Commit Graph
461 Commits
Author SHA1 Message Date
Joseph Jezak josejx@gentoo.org 3ed29bf92c EMI: Swap actors to remove the sign when calculating the position. 2014-04-05 00:36:57 -04:00
Joseph Jezak josejx@gentoo.org 3feeeb124e EMI: Fix the attached actor's position coordinates. 2014-04-03 06:41:21 -04: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 f12647cdca EMI: Fix position of attached actor
When attaching an actor to another one, set its local position
so that its final position (position of the parent actor + the
local position) remains the same as the final position before
it was attached.
2014-02-05 21:35:08 +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
Christian Krause 95bceeb216 EMI: Handling of invalid bone names
Two animations (guy_puton_cap, guy_holdstickystuff) contain bone names
which which don't match any joints. To avoid that the holding actor is
drawn with a wrong orientation, ingore the unknown bone names when
running the animations.

Skeleton::getJointNamed() will now return null for unknown names.
The original behaviour for Actor::getWorldPos and
Actor::getRotationQuat is kept.

This patch fixes the problem, that Guybrush is "lying down" once he
holds the bottle of glue.
2014-02-02 14:26:12 +01:00
Ingo van Lil 549225964a EMI: Use parent sort order for attached actors
When drawing attached actors the engine uses the parent's sort order
plus one. This offset can move the attached actor behind a background
plane, for instance the chess board in the Lucre docks or Guybrush when
riding the manatee.
2014-02-02 00:51:47 +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
Einar Johan Trøan Sømåen c66b1b4c27 Merge pull request #794 from inguin/emi-walkto
GRIM/EMI: Ignore Actor:walkTo() if destination is unreachable
2013-12-29 08:26:43 -08:00
Ingo van Lil 82b3aa7a81 EMI: Ignore Actor:walkTo() if destination is unreachable
The path to the Curch of LeChuck has bogus coordinates as out point, so
the game will walk Guybrush to an invalid position when entering that
set. This patch will detect when no path can be found to the destination
position and ignore the walkTo() request in that case.

The behavior for Grim is unchanged in order to avoid the risk of breaking
the game. If the warning is never triggered the distinction can be removed.
2013-12-28 16:18:53 +01:00
Ingo van Lil c5a20438ce EMI: Fix rotation of overworld actors 2013-12-22 22:49:50 +01:00
Ingo van Lil a153d6d0e6 EMI: Save/restore Actor::_lastWearChore 2013-12-10 01:21:00 +01:00
Ingo van Lil 38342e423e EMI: Correct sign error when walking on slopes
Due to a sign error in Actor::walkForward() it is frequently difficult or
impossible to walk on sloped sectors (stairs or ramps), e.g. in Meathook's
place or in front of Pegnose's house.
2013-12-08 20:13:53 +01:00
Joel Teichroeb ff45f66410 Merge pull request #774 from chkr-private/swamp-fixes
EMI: make time paradox solvable
2013-12-06 16:56:12 -08:00
Dries Harnie b1a910c800 GRIM/EMI: Refactor GfxBase::startActorDraw 2013-12-04 14:31:06 +01:00
Christian Krause 4eaa840613 EMI: fix attached actor handling in swamp
Time paradox is now playable.

- local _pos and _yaw values seem to be relative
to the actor where the current actor is attached to

- to accomodate this, Lua_V1::GetVisibleThings,
Actor::getYawTo and Actor::getSimplePuckVector should use
world coordinates
2013-12-02 22:30:51 +01:00
Ingo van Lil 0f95b574b6 EMI: Restart turn chore when changed mid-turn
When the turn chores are changed while an actor is turning the current
chores will be stopped but the new ones won't be started until the turn
direction changes. This can be seen when hitting the run key while
Guybrush is turning.
2013-12-01 00:36:42 +01:00
Ingo van Lil 14e268d7cd EMI: Select the correct turn chore
In EMI's coordinate system, other than in Grim, actors turn right when
the yaw angle is increasing. Select the correct turn chore for the turn
direction.
2013-11-30 10:19:37 +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 5c4fe71ed2 EMI: Use uint32 to store actor alpha mode
Storing the actor's alpha mode in a byte does not work when the value is
negative (AlphaOff == -1).
2013-11-26 20:37:31 +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
Dries Harnie 1927693d4c EMI: Keep actor position after detaching 2013-11-25 19:11:08 +01:00
Ingo van Lil 821cb283fe EMI: Fix crash when talking to Voodoo lady
When asking the Voodoo lady why the island is so empty the engine
quits because the script calls Actor:say_line() with an empty
message.
2013-11-24 15:24:04 +01:00
Joel Teichroeb df6aaee2ef GRIM: Do not shadow setName 2013-10-25 07:53:33 -07:00
Joel Teichroeb 92c48e6637 GRIM: const more paramiters 2013-10-25 07:48:27 -07:00
Joel Teichroeb bd70520832 GRIM: Fix typo (speach -> speech) 2013-10-25 06:41:29 -07:00
Joel Teichroeb c186bc9b80 GRIM: Reduce calls to getNormal 2013-10-24 19:16:06 -07:00
Joel Teichroeb b76ba199b5 GRIM: Reduce calls to getCurrSet 2013-10-24 19:14:22 -07:00
Joel Teichroeb aab084c989 GRIM: Make Actor only use one constructor and initialize all members 2013-10-24 18:59:50 -07:00
Joel Teichroeb b573f35e43 GRIM: Remove unneeded TextObject constructor 2013-10-24 17:52:28 -07:00
Dries Harnie 875cfe12a2 EMI: Restore wear chore upon entering a new set 2013-08-19 21:10:42 +02:00
Dries Harnie 799652e442 EMI: Rotate overworld actors in the right direction 2013-08-07 20:23:07 +02:00
Dries Harnie 92f5deadc5 EMI: Allow sprites to rotate
The clock in mot.set depends on rotating sprites.
2013-08-07 20:05:48 +02:00
Dries Harnie cfd580bbfa EMI: Draw attached actors w/ joint-relative rotation 2013-08-04 15:15:41 +02:00
Dries Harnie b3e406d6f0 EMI: Return an absolute angle from calculateOrientation 2013-07-30 20:02:43 +02:00
Dries Harnie c2f4288680 EMI: Use GetWorldPos recursively 2013-07-30 19:59:00 +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
Joel Teichroeb 041537a604 EMI: Draw all the Costumes in an Actor's stack 2013-07-10 14:05:14 -07:00
Joel Teichroeb 7399fc6798 EMI: Implement setting actor sort order based on sector sort planes 2013-07-10 09:13:21 -07:00
Einar Johan Trøan Sømåen 52ce315300 GRIM: Replace , with ; 2013-07-09 21:14:11 +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
Joel Teichroeb 3253b9ba76 GRIM: Remove some redundant code 2013-07-07 21:00:08 -07:00