Commit Graph

134 Commits

Author SHA1 Message Date
Joni Vähämäki
23a99a9f2b EMI: Implement head limits. 2014-07-02 22:43:58 +03:00
Joni Vähämäki
3adbd1fdcf EMI: Implement head tracking. 2014-07-02 22:43:50 +03:00
Joni Vähämäki
5c20f0f4a7 EMI: Share Materials between Costumes.
Sometimes a texi component may refer to a material that was initialized by some other costume than the owner costume of the texi component. For example, the candles in gmi have a costume "fx/aura1.cos" that controls the animation of a material originally initialized by a sprite component of "fx/candle.cos".
2014-06-23 22:36:04 +03:00
Joni Vähämäki
947ddefbc8 GRIM/EMI: Move implementation of setFollowBoxes from header to source file. 2014-06-23 22:34:49 +03:00
Joni Vähämäki
72a7f7c1b0 EMI: GetActorPuckVector should return nil for actors that have never followed walkboxes.
In Lua, The wear chore of dumbshadow.cos is only started if GetActorPuckVector returns a non-nil value. In the original game GetActorPuckVector seems to always return nil until a call is made to SetActorFollowBoxes.

This fixes the candles not appearing in the set gmi. The original Lua code only starts the candle animation if the candle actor is not playing any chores. Previously the wear chore of dumbshadow.cos was playing, so the animation was never started.
2014-06-22 14:19:52 +03:00
Joni Vähämäki
360c6ee95f EMI: Implemented SetActorLighting. 2014-06-16 15:42:25 +03:00
Joel Teichroeb
08f6e8195d Merge pull request #891 from Akz-/grim-lookat-fix
GRIM: If ActorLookAt is called with an actor as the target, look towards...
2014-06-11 16:59:41 -07:00
Joel Teichroeb
4aa61146c6 GRIM: Convert a few more NULLs 2014-06-02 16:59:09 -07:00
Joni Vähämäki
de3c68d89c GRIM: If ActorLookAt is called with an actor as the target, look towards the actor's head instead of their origin. Fixes #887 2014-05-31 15:59:55 +03:00
Joni Vähämäki
3e322b67ba Revert "EMI: Fix missing hold chores"
This reverts commit 863b33e803.

Conflicts:
	engines/grim/actor.cpp
	engines/grim/actor.h
	engines/grim/costume.cpp
	engines/grim/costume.h
	engines/grim/costume/chore.h
	engines/grim/emi/costumeemi.cpp
	engines/grim/emi/costumeemi.h
2014-05-31 03:05:30 +03:00
Joni Vähämäki
ab1631e6ef EMI: Fade talk chores. 2014-05-31 02:51:46 +03:00
Joseph Jezak josejx@gentoo.org
6951b5c0ee EMI: Remove setYaw. 2014-05-19 15:40:24 -07:00
Pawel Kolodziejski
8759900b6a ALL: synced with ScummVM 2014-04-05 18:18:42 +02:00
Joel Teichroeb
f763dd05ea GRIM: Rename Actor::Chore to Actor::ActionChore 2014-02-21 16:02:25 -08:00
Christian Krause
b35bdd2ddf EMI: Don't stop looping chores in StopAllChores
Some chores need to stay active even after a call to
StopAllChores(). E.g. the hold chores should stay active
even after changing the set (which calls StopAllChores()).

It looks like that the previously unknown boolean paramter
of StopAllChores() controls that behavior. If set to TRUE,
stop only the non-looping chores.

This patch fixes:
- hold chore was lost when switching sets
- blue painting did not show the ultimate insult when opening
the inventory
2014-02-21 20:13:11 +01:00
Christian Krause
863b33e803 EMI: Fix missing hold chores
The hold chore was always lost after e.g. turning left or right.
Although that chore was still in _playingChores, it was not shown.

The patch uses the following order for drawing the chores:
- wear chores
- rest chores
- walk/turn chores
- other chores (in order of the playChore calls)
2014-02-21 20:13:05 +01:00
Christian Krause
58d7bf116c EMI/GRIM: Fix rotation of attached actors
Use matrix multiplications to fix the rotation for attached actors:
- calculate the final transformation matrix recursively for attached
  actors (instead of using getWorldPos and getWorldRot)
- use a different order for building the quaternions out of the Euler
  angles
- changed handling of camera position (just apply the rotation of the
  camera, the (inverted) position of the camera and the position of the
  actor
- no functional changes for GRIM
- no changes for drawing in overworld

Code simplification for GRIM:
- no need to use _currentPos in calculations for GRIM since it is
always (0, 0, 0)

This fixes:
- the rotation of any items Guybrush is holding in his hands
- the handling of the pole when using the raft in the swamps
- getting the bananas with the banana picker
2014-02-05 21:35:02 +01:00
Dries Harnie
f618b90d31 GRAPHICS: Stencil for grim shadows [OpenGLS] 2014-01-23 20:03:21 +01:00
Joel Teichroeb
7cf3f2f99c GRIM: Add a constructor for Shadow
This lets us get rid of the loop in Actor and lets us ensure
that Shadow is initizlied even if constructed elsewhere.
2014-01-23 10:22:44 -08:00
Christian Krause
71a44ba28a Merge pull request #797 from chkr-private/collision-fixes
Collision fixes
2014-01-14 14:48:52 -08:00
Christian Krause
5a65ffd470 EMI: Unload the active costume once a different is set
- the costumes are handled on a stack per Actor
- the last costume is considered the current one
- currently, the costumes are never removed from from the stack
- this causes an issue when Guybrush is using its original
  costume first, later the monkey robot costume for the final Monkey Kombat
  and then again the standard costume (the robot costume will remain the last
  on the stack and cosidered the current one - this causes a problem
  when attaching the head actor since the robot has different joints
  than guybrush with the standard costume)
- if a new wear chore is set and it uses a different costume than the
  current one and neither of them is the shadow costume remove the old
  costume before setting the new one
- additionally, this patch makes sure, that all active chores of all
  costumes on the stack of an actor are stopped
2014-01-08 23:19:46 +01:00
Christian Krause
ce9239412d EMI/GRIM: Implement collision handling for EMI
- for solving the Monkey Kombat puzzle it is necessary that a kombat is
  triggered when Guybrush runs into one of the monkeys on the map
- implement SetActorCollisionMode and SetActorCollisionScale
- add EMI-specific calculations for retrieving the sphere data for the
  actors (and some minor refactoring for better readability)

The following changes may alter the behaviour in GRIM, too:
- in Actor::collisionHandlerCallback(), call the collision handler for
  both affected objects (that is necessary since only one actor may have
  a collision handler associated in lua but it may happen that the
  character with the handler is standing still and the other one is run
  into him)
- Actor::handleCollisionTo() did only update a given position to ensure
  that there is no collision - so it is necessary to actually check for
  collisions and execute the lua callback if necessary (via
  Actor::handleCollisionWith())
2014-01-07 03:21:52 +01:00
Joel Teichroeb
e570cd5d32 GRIM: A Chore is only valid of _costime isn't null 2013-12-06 15:16:07 -08:00
Dries Harnie
b1a910c800 GRIM/EMI: Refactor GfxBase::startActorDraw 2013-12-04 14:31:06 +01:00
Dries Harnie
fa9a866e54 EMI: Add some accessors to Actor 2013-12-04 13:19:45 +01:00
Joel Teichroeb
58b0bed9ad EMI: Make attached objects use their parents sort order 2013-11-29 16:05:08 -08:00
Ingo van Lil
33005ce43d EMI: Fix actor orientation
EMI uses a different coordinate system than Grim, so we have to switch
dimensions in various places to share common code for walking and turning
actors. This patch fixes several yaw angle sign errors causing actors to
look into wrong directions.
2013-11-27 23:28:54 +01:00
Ingo van Lil
4509e4ff34 EMI: Return to original sort order when no sort plane is available
The floor in the Hall of Justice is hidden by a solid gray actor named
"trap plane". This actor is originally positioned far in the background
but moved to the foreground because we can't find a sort plane in the
sector.

This patch stores returns an actor to the original sort order set by
the game script when entering a sector that has no sort information.
2013-11-25 21:16:45 +01:00
Joel Teichroeb
92c48e6637 GRIM: const more paramiters 2013-10-25 07:48:27 -07:00
Joel Teichroeb
aab084c989 GRIM: Make Actor only use one constructor and initialize all members 2013-10-24 18:59:50 -07:00
Dries Harnie
a5038cd57f EMI: Remember last wear chore, restore it upon entering overworld 2013-07-29 22:02:03 +02:00
Joel Teichroeb
041537a604 EMI: Draw all the Costumes in an Actor's stack 2013-07-10 14:05:14 -07:00
Einar Johan Trøan Sømåen
fe3883cecd GRIM: Reformat code to be closer to convention. 2013-07-09 21:12:55 +02:00
Giulio Camuffo
941813522b GRIM: Fix background talking behaviour with Toto and Naranja in set si. 2013-01-24 16:16:54 +01:00
Giulio Camuffo
5268dbb473 GRIM: Cleanup PointActorAt(). 2013-01-16 12:22:09 +01:00
Giulio Camuffo
36297d3dc9 GRIM: Make TurnActorTo() more compliant to the original 2013-01-16 12:02:52 +01:00
Giulio Camuffo
bb3b706ad5 GRIM: Rename Actor::_constrain to Actor::_followBoxes. 2013-01-15 14:54:15 +01:00
Giulio Camuffo
bcb77eeddc GRIM: Save and restore GrimEngine::_movieSetup. Bump save version to 22.5. 2013-01-13 17:09:29 +01:00
Giulio Camuffo
eb5c89a880 GRIM: Use the right turn rate, and increase it only when necessary. 2013-01-13 11:27:56 +01:00
Giulio Camuffo
3b9a59dc93 GRIM: Make an actor orient its pitch and roll too if requested. Fix #368 2013-01-13 10:54:36 +01:00
Giulio Camuffo
80109ca3fe GRIM: Fix ActorToClean behaviour. Bump save version to 22.4. Fix #701.
The clean buffer code needs two layers. Every actor needs its buffer,
but we also need a global one. The actors' buffers blit to the global buffer
which then gets blitted to screen.
2013-01-11 12:44:30 +01:00
Joni Vähämäki
df7f6907c5 GRIM: Use the left turn chore when turning left and the right turn chore when turning right. 2013-01-02 19:00:30 +02:00
Paweł Kołodziejski
175620b62a ALL: change license headers from LGPL to GPL, and few updates 2012-12-19 23:15:43 +01:00
Dries Harnie
acc2472c31 EMI: Use an actor ID for Actor::_attachedActor 2012-11-14 00:08:06 +01:00
Dries Harnie
6334cc0290 EMI: Gfx::startActorDraw() accepts a quaternion 2012-11-13 21:51:11 +01:00
Dries Harnie
494839062f EMI: Implement Lua_V2::ActorActivateShadow 2012-09-01 17:23:55 +02:00
Dries Harnie
13023e89e1 EMI: Implement Actor::{Get,Set}SortOrder 2012-07-12 23:16:45 +02:00
Joel Teichroeb
14f880d470 GRIM: Remove unneeded friends 2012-05-05 11:37:13 -07:00
Dries Harnie
eb9d22d359 EMI: minor style fixes 2012-04-15 13:51:13 +02:00
Dries Harnie
c27894e85e EMI: implement SetActorGlobalAlpha 2012-04-13 20:02:03 +02:00