70 Commits

Author SHA1 Message Date
Joni Vähämäki
360c6ee95f EMI: Implemented SetActorLighting. 2014-06-16 15:42:25 +03:00
Joel Teichroeb
0f3da43694 GRIM: Change NULL to nullptr. 2014-05-30 17:43:08 -07:00
Joni Vähämäki
765ecf7870 EMI: Implemented PlayChore and PauseChore. 2014-05-31 03:05:32 +03:00
Joni Vähämäki
b14b9856d6 EMI: Fixed implementation of AdvanceChore. 2014-05-31 03:05:30 +03:00
Joni Vähämäki
a180b3b562 EMI: Chore fading fixes.
Fading out chores remain in playing state until they have completely faded out. Also using StopChore on a fading out chore will actually stop the chore, unlike in Grim where the chore will keep fading out.
2014-05-31 03:05:17 +03:00
Joni Vähämäki
c0c80e0624 EMI: Fixed talk chore index 0 being ignored by SetActorTalkChore. 2014-05-31 02:51:53 +03:00
Joni Vähämäki
f151ce8e2d EMI: Fade chores if PlayChore/StopChore specifies a fade time. 2014-05-31 02:51:45 +03:00
Joseph Jezak josejx@gentoo.org
d98282e6cc EMI: Add a stopWalking() call to ActorStopMoving. Fixes #880. 2014-05-25 21:00:42 -04:00
Joseph Jezak josejx@gentoo.org
ed44e64369 EMI: Allow actors to be hidden by a call to set_wear_chore(nil). 2014-04-06 17:50:31 -04:00
Pawel Kolodziejski
8759900b6a ALL: synced with ScummVM 2014-04-05 18:18:42 +02:00
Joni Vähämäki
e7f895e248 EMI: Allow StopChore without fade time parameter. 2014-03-26 18:52:02 +02: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
446f56eb67 GRIM/EMI: Fix compile warnings 2014-02-15 18:40:19 +01: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
d5a1b77852 EMI: Fix costume unloading
- use the costumeName instead of a pointer to the costume object to
  check, whether the current costume matches the requested one
- this fixes an uninitialized pointer read
2014-01-11 17:30:25 +01:00
Christian Krause
967d0b0589 EMI: Minor refactoring for setting chores and costumes
Refactor some repeated code blocks into a single function.
2014-01-08 23:19:46 +01: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
f856f2341e EMI: Don't load a costume if a "nil" chore is set
Don't call findCostume for "nil" chores to avoid loading the costume
indirectly via findCostume even if it is not needed.
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
Christian Krause
4b0129e6de EMI: invalidate sortorder after detaching actors
- the order of the active actors is based on the effective sort order
  which is based on the sortorder of actors itself but also on the
  attached actors
- invalidate the sortorder also when detaching actors
- this fixes two glitches in the final end scene (guybrush is still
  displayed after falling from the cliff and monkey robot is drawn in
  the foreground)
2013-12-29 13:33:00 +01:00
Christian Krause
469d1297e6 EMI: Fix costume handling
If a costume is not found in the existing costume stack of an actor,
try to load it via actor->pushCostume().
2013-12-12 01:10:12 +01:00
Ingo van Lil
552b813f0d EMI: Rename PoolChore to EMIChore, move to emi/costume 2013-12-07 14:36:31 +01:00
Joel Teichroeb
11f5760ba4 Merge pull request #772 from inguin/emi-fixes
EMI: Fix handling of actor turn chores
2013-11-30 15:38:16 -08:00
Ingo van Lil
8a9a24c527 EMI: Allow resetting actor turn chores
EMI scripts use nil in SetActorTurnChores() to reset the turn chores,
e.g. when Guybrush picks up the hot coal in wed.lua.
2013-12-01 00:36:36 +01:00
Dries Harnie
3f9f34cd3f Merge pull request #770 from somaen/fixPS2intro
EMI: Fix the intro at cs_dock getting stuck in the PS2-version.
2013-11-30 08:46:09 -08:00
Joel Teichroeb
58b0bed9ad EMI: Make attached objects use their parents sort order 2013-11-29 16:05:08 -08:00
Einar Johan Trøan Sømåen
52cdd432b0 EMI: Fix the intro at cs_dock getting stuck in the PS2-version.
IsActorChoring takes different parameters in EMI than it does in Grim,
the original code was prudent enough about checking it’s parameters that
it actually ran fine, however the problem was that the argument that
said whether we should ignore looping chores was moved. This lets the
intro play the cut scene on the docks.
2013-11-29 22:16:59 +01:00
Christian Krause
56605c02aa EMI: Fix turn_rate of voodoo chair
The turn rate for the chair of the voodoo lady is set to 1 in the lua
code which makes the turn animation very slow (> 30s).

Since the rate value of 1 is not used otherwise in EMI, adjust the
turnrate in this case.
2013-11-26 21:04:55 +01:00
Dries Harnie
875cfe12a2 EMI: Restore wear chore upon entering a new set 2013-08-19 21:10:42 +02:00
Dries Harnie
649bc89d59 EMI: Remove old GetActorPos call from GetActorWorldPos 2013-08-04 14:27:30 +02:00
Dries Harnie
a5038cd57f EMI: Remember last wear chore, restore it upon entering overworld 2013-07-29 22:02:03 +02:00
Joel Teichroeb
7e87286cb8 EMI: Sort actors seperatly from invalidating the active actors list 2013-07-14 10:16:27 -07:00
Einar Johan Trøan Sømåen
ec697300b3 EMI: Stub more Lua_V2-functions, and read most parameters.
CompleteChore
GetSoundVolume
SetSoundVolume
UpdateSoundPosition
ImStateHasLooped
GetCameraPitch
PitchCamera
RollCamera
YawCamera
NukeAllScriptLocks
FRUTEY_Begin
FRUTEY_End
2013-07-12 17:34:37 +02: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
Dries Harnie
25ceb7ac50 EMI: Implement Lua_V2::AdvanceChore 2013-07-06 13:04:03 +02:00
Dries Harnie
59d192bcc3 EMI: Stub for EnableActorPuck 2013-05-22 20:58:48 +02:00
Dries Harnie
3de75fe71e EMI: UnloadActor: Free actor after removing it
Fixes Coverity issue #1009869
2013-05-21 23:30:59 +02:00
Giulio Camuffo
2ee2d0e937 EMI: Fix PlayActorChore() regression. 2013-01-13 12:01:36 +01:00
Giulio Camuffo
273522a600 GRIM: If setting a walk chore with no costume use the old chore costume. Fix #28 2012-12-28 20:40:02 +01: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
f1dc8ba3b0 EMI: Stub PlayChore and PauseChore 2012-11-13 21:44:24 +01:00
Dries Harnie
66f7a4e1f7 EMI: Stub LockChoreSet and UnlockChoreSet 2012-11-13 21:44:24 +01:00
Dries Harnie
494839062f EMI: Implement Lua_V2::ActorActivateShadow 2012-09-01 17:23:55 +02:00
Joel Teichroeb
1bfbc0c64b EMI: Stub some functions that are needed in the scumm bar 2012-08-19 12:16:28 -07:00
Dries Harnie
1551775b63 EMI: Fix VisibleActors crash with free'd actor 2012-08-12 12:19:45 +02:00
Dries Harnie
5b70612477 EMI: Update depth buffer for invisible objects 2012-07-12 23:16:46 +02:00
Dries Harnie
13023e89e1 EMI: Implement Actor::{Get,Set}SortOrder 2012-07-12 23:16:45 +02:00
Dries Harnie
381ae8e95c EMI: Implement missing SetChoreLooping opcode 2012-07-12 23:15:11 +02:00
Dries Harnie
b9fc80b5ee EMI: Support looping chores 2012-07-12 19:58:55 +02:00
Joel Teichroeb
a96ba9590e EMI: Invalidate the active actors list when unloading actors 2012-05-06 10:00:48 -07:00