Commit Graph
451 Commits
Author SHA1 Message Date
Joni Vähämäki 7438b7a2cb EMI: Do not print a warning if Actor::getBboxInfo is called for an actor that doesn't have a model. 2014-07-20 22:11:38 +03:00
Joni Vähämäki 4a1df6bfa2 EMI: Enable shadow sprites. 2014-07-20 21:46:21 +03:00
Joni Vähämäki 535f025fd8 EMI: Calculate actor bounding box correctly.
This is necessary for Actor::shouldDrawShadow to behave correctly, but
could also affect collision detection.
2014-07-20 21:46:20 +03:00
Joni Vähämäki 1081471119 EMI: Implement projection shadows. 2014-07-20 21:46:14 +03:00
Joni Vähämäki 930a589569 EMI: Free materials as soon as they are no longer in use by any costumes. 2014-07-19 22:11:24 +03:00
Joseph Jezak fcaabfa14d EMI: Fix inventory item rotation by correcting the Euler Order. 2014-07-08 23:09:17 -04:00
Joel Teichroeb 63199bb0f6 GRIM: Set shadow userdata to nullptr when done with it. 2014-07-07 13:04:27 -07:00
Joni Vähämäki 39fa931012 EMI: Continuously update the look at vector when looking at an actor. 2014-07-05 14:14:53 +03:00
Joni Vähämäki 0ed645c4b1 EMI: Fixed Actor::getWorldPosition calculating the world transform incorrectly for attached actors. 2014-07-02 22:43:59 +03:00
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
Joseph Jezak d2d23738a5 MATH: Replace Euler Angle Implementation in Quaternions with Rotation3D based method. 2014-07-01 16:18:12 -04:00
Joel Teichroeb 0e69cc11a7 Merge pull request #938 from Akz-/emi-sprite-fixes
EMI: Sprite fixes
2014-06-25 17:30:36 -07: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
Joseph Jezak 55f77fb92f EMI/GRIM/MYST3: Replace some Quaternions with Rotation3D. 2014-06-23 09:24:26 -04:00
Joseph Jezak 76d36f676b MATH: Add a selectable Euler Order to Rotation3D. 2014-06-23 09:04:25 -04: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
Joel Teichroeb 21115e35da Merge pull request #930 from Akz-/grim-shadows-fix
GRIM: Shadow fixes
2014-06-20 08:38:23 -07:00
Christian Krause 1fb3b5df4b GRIM/EMI: fix compiler warning
- remove unused variable
2014-06-19 23:57:14 +02:00
Joel Teichroeb 6ad4b70d84 Merge pull request #926 from Akz-/pathfind-fix
GRIM/EMI: Pathfinding fixes
2014-06-16 10:54:01 -07:00
Joni Vähämäki 360c6ee95f EMI: Implemented SetActorLighting. 2014-06-16 15:42:25 +03:00
Joni Vähämäki b5cdd1240f EMI: Only draw models for actors inside the view frustum.
This adds math classes for doing frustum culling in software. These could be used for optimizing performance in many other places as well. For example, if an actor is outside the view frustum, it may not be necessary to do expensive keyframe animation and vertex skinning calculations for that actor.
2014-06-16 15:42:18 +03:00
Joni Vähämäki 8f9f541f17 EMI: Implemented dynamic lighting for models.
Lighting is done by calculating vertex colors in software, since the attenuation model used in EMI cannot be simulated with OpenGL fixed function lighting. The original game does the lighting this way as well. Ideally for the modern shader-based renderer a shader would be used for this instead.
2014-06-16 15:41:06 +03:00
Joni Vähämäki c3bcfbb87b GRIM: Test model center position instead of origin in shouldDrawShadow. Fixes #741 2014-06-16 15:24:46 +03:00
Joni Vähämäki cd47ccb50c GRIM: Use exact string search when searching for shadow sectors.
Fixes shadows in set st.
2014-06-16 15:24:45 +03:00
Joni Vähämäki f3af129711 GRIM/EMI: The walk destination may reside in multiple sectors, so don't choose a single end sector.
This fixes Elaine walking through Guybrush at the end of the first cutscene in the set gme.
2014-06-15 13:32:16 +03:00
Joni Vähämäki fa6ffcb46e GRIM/EMI: Always walk towards the target position in a straight line if possible. 2014-06-15 13:32:16 +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 ec026ecba4 GRIM: Remove usless setColormap line
The code in pushCostume and the behavior for setColormap(NULL) has been
unchanged since 0.1.0, so there are probably no unintended consiquences
and the functionality should not change without this line.
2014-06-02 18:56:33 -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
Joel Teichroeb 0f3da43694 GRIM: Change NULL to nullptr. 2014-05-30 17:43:08 -07: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 e6bc1430ca EMI: Never fade rest chores. 2014-05-31 03:05:29 +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 ab1631e6ef EMI: Fade talk chores. 2014-05-31 02:51:46 +03:00
Joni Vähämäki 4ece29c91e EMI: Never stop the rest chore. 2014-05-31 02:51:44 +03:00
Joseph Jezak josejx@gentoo.org 6951b5c0ee EMI: Remove setYaw. 2014-05-19 15:40:24 -07:00
Joel Teichroeb 1aa417fac6 Merge pull request #857 from JoseJX/FixActorAttach
EMI: Swap actors to remove the sign when calculating the position.
2014-04-05 12:51:12 -07:00
Pawel Kolodziejski 8759900b6a ALL: synced with ScummVM 2014-04-05 18:18:42 +02:00
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