Commit Graph

90 Commits

Author SHA1 Message Date
Vladimir Serbinenko
829eab2f72 GRIM: Split TTF fonts from bitmap fonts and add a drawing interface
This cleans up the code and allows adding double-byte charsets easier
2023-03-05 22:39:27 +01:00
Paweł Kołodziejski
20cb0ae228
ALL: Cleanup ResidualVM -> ScummVM 2021-12-26 21:19:38 +01:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Bastien Bouclet
e105e6340e GRIM: Use 64bit integers for the save/restore code
To remove usage of the now removed SCUMM_64BITS definition
2017-12-06 21:41:23 +01:00
Vincent Pelletier
bad3de8a12 GRIM: Drop off-screen buffers
These were present to implement actor freezing in software rendering mode
in the way original engine was intended for performance reason.
In residualvm, software rendering will generalise the principle through
dirty-rectangles management, so off-screen buffers should not be needed.

Also, properly implementing them requires invasive changes (move previous
draw call list from global OpenGL context to individual off-screen buffers,
along with associated linear vertex allocator, adding a new draw call to
track requested buffer changes until final on-screen frame buffer
presentation).
So instead of such added complexity, lie to lua API about actor not being
in set but keep it in so it is part of normal redraw sequence.

Fixes disappearing actors in cn, bi.
Likely also fixes at, ly, sh, mn, dd which uses free/thaw lua API, but
which I did not check.
2017-05-02 09:51:47 +00:00
Christian Krause
5df7e5991d EMI: Fix semantic of IsActorTurning() LUA call
TurnActorTo is mapped to Actor::singleTurnTo() which only
turns the actor (according to its turn rate) by a small amount.

If the turn could not be completed, TurnActorTo returns false.

In EMI, all LUA calls to TurnActorTo are repeated until the
actor does eventually look into the correct direction.

However, for parallel running LUA threads, calls to IsActorTurning
would return false during such a "LUA-controlled" turn.

In the scene with the dart players, the LUA code for the dialog
waits for the dart player to stop moving (and turning) by repeatedly
calling IsActorTurning. Since that function returns false
even if the players are still turning towards the dart board, the
dialog code starts and spawns a parallel LUA thread to use
TurnActorTo to make the dart players looking at Guybrush.

This means, that eventually for each dart player, two LUA
threads with contradicting TurnActorTo directions will run forever
since in none of the threads the final direction is ever reached.

To fix that, a new actor state variable, _singleTurning, is introduced.
It is set to true if an Actor::singleTurnTo() call indicates that
the turn is not complete. It is set to false once the turning has
fininshed.

Since all TurnActorTo calls in EMI are repeated until the function returns
false, it is safe to use that variable to indicate that a "LUA-controlled"
turning is in progress.

In GRIM, that's not the case and so isTurning() is only changed for EMI.
2014-11-30 21:24:04 +01:00
Christian Krause
e2eee80716 EMI: Implement Lua_V2::SetActorLocalAlpha
- sets the alpha mode and the alpha value for single vertices
2014-09-08 09:00:21 +02:00
Joni Vähämäki
1bf63977a6 EMI: Remove special treatment of wear chores which is no longer necessary. 2014-08-20 01:37:19 +03:00
Joni Vähämäki
896fd7cb42 EMI: Recalculate volume and balance for positioned sounds when the setup changes. Fixes #996 2014-08-14 17:50:58 +03:00
Joni Vähämäki
de049e0eaf EMI: If a sort order is specified for an actor that is attached to another, use the specified sort order instead of the parent's one. 2014-08-12 17:46:36 +03:00
Joni Vähämäki
0715853387 EMI: Save and restore sound tracks. 2014-08-06 19:43:08 +03:00
Joni Vähämäki
a7a79aeb4e EMI: Save and restore light falloff ranges. Fixes #997 2014-08-05 00:44:04 +03:00
Joni Vähämäki
8b754b0de5 EMI: Save and restore SetShadow data. 2014-08-02 20:43:02 +03:00
Dries Harnie
1c1b5dde73 EMI: Bump SaveGame MINOR_VERSION to 18
As noted in #977 and #956.
2014-07-31 13:08:41 +02: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
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
Joel Teichroeb
b5070bb790 GRIM: Remove _matrix from Component
Mesh is the only component that actually usees _matrix, and it
has it's own local _matrix variable. This remove the confusion over
which _matrix variable is actually used and removes saving _matrix
for all the components that don't use it.
2014-06-25 17:39:10 -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
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
3316420448 EMI: Save and restore chore instance IDs.
Previously chore instance IDs stored as Lua userdata became invalid after
loading a save, because the chores were recreated with different IDs. This
caused certain opcodes like StopChore to fail.
2014-06-15 03:17:13 +03:00
Joni Vähämäki
e7b57bdff2 EMI: Save and restore animation states. Fixes #902 2014-06-05 08:12:49 -07:00
Joel Teichroeb
0f3da43694 GRIM: Change NULL to nullptr. 2014-05-30 17:43:08 -07:00
Pawel Kolodziejski
8759900b6a ALL: synced with ScummVM 2014-04-05 18:18:42 +02:00
Joel Teichroeb
0511571850 GRIM: Do not leak if realloc fails 2013-12-07 08:02:14 -08:00
Giulio Camuffo
be9b11570e GRIM: Make the savegames compatible with 1.1 again. Bump to 22.9
New Lua's internal functions (int_funcs array in lbuiltin.cpp) must
be added to the bottom, and the savegame's minor version must
be increased.
2013-10-30 15:28:36 +01:00
Joel Teichroeb
c0cb2f1f9c GRIM: Use a consitent style for constructor initializers 2013-10-26 13:57:55 -07:00
Joel Teichroeb
c7ce8358e9 GRIM: Remove getBufferPos from Savegame as it is never used 2013-10-26 08:30:39 -07:00
Joel Teichroeb
e0997fabab GRIM: Initialize all members of SaveGame 2013-10-24 18:59:48 -07:00
Joel Teichroeb
be41e30c00 GRIM: Make lights use an enum instead of checking against a string to get the type 2013-07-10 16:17:28 -07:00
Joel Teichroeb
08d749e730 GRIM: Remove including savefile.h from savegame.h 2013-07-09 22:54:45 -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
3faeb22088 GRIM: Save and restore some forgotten Actor's turn related fields. Bump to 22.7 2013-01-17 21:32:09 +01:00
Giulio Camuffo
e93e33fb80 GRIM: Save and restore the movie subtitle. Bump save version to 22.6. 2013-01-16 14:49:37 +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
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
Joel Teichroeb
478d9c2505 EMI: Save LState sleepFor and bump savegame to 22.3 2012-12-22 11:04:15 -08:00
Paweł Kołodziejski
175620b62a ALL: change license headers from LGPL to GPL, and few updates 2012-12-19 23:15:43 +01:00
Giulio Camuffo
09ffb69725 GRIM: Look at the minor version too when checking if a savegame is compatible. 2012-12-14 23:04:20 +01:00
Giulio Camuffo
c8b2c1709e GRIM: Save and restore head orientation. Bump save version to 22.2. 2012-12-14 22:55:48 +01:00
Giulio Camuffo
f79577c410 GRIM: Fix save/load of Lua's userdata objects. Bump savegame version to 22.1. 2012-12-14 18:11:12 +01:00
Giulio Camuffo
3c515489d3 GRIM: Add minor versioning of savegames, allowing compatible save versions.
Bump savegame version to 22.0.
2012-03-11 16:40:35 +01:00
Giulio Camuffo
9771492e6c GRIM: Push savegame version to 21. 2012-01-28 10:03:27 +01:00
Joel Teichroeb
a9c664379e GRIM: Make saving and restoring use more appropriate types and rename functions to be more logical 2012-01-28 10:03:27 +01:00
Joel Teichroeb
1eb4bdfe5c GRIM: Better handle invalid savegames. 2012-01-19 14:02:16 -08:00
Paweł Kołodziejski
e350c7f777 renames 2012-01-06 23:29:45 +01:00
Giulio Camuffo
3adbfc2898 GRIM: Be a bit more verbose. 2011-12-16 15:21:35 +01:00
Joel Teichroeb
5b1a5b2e48 GRIM: Fix a leak when loading savegames 2011-12-11 14:43:43 -08:00
Giulio Camuffo
841c2253f6 GRIM: Bump savegame version to 20. 2011-10-02 19:16:43 +02:00
Giulio Camuffo
0083c8619c MATH: Move the math classes to their own math/ dir and Math namespace. 2011-09-14 23:05:52 +02:00