505 Commits

Author SHA1 Message Date
Laurent Merckx
741cd5ddc7 GRIM: use GL_UNSIGNED_SHORT for glDrawElements instead of GL_UNSIGNED_INT (not supported for GLES <= 2) 2020-11-12 05:58:36 +01:00
Eugene Sandulenko
a312ddce78 GRIM: Fix typo in error message 2020-10-12 13:13:34 +02:00
Pawel Kolodziejski
490bedb584 ALL: Fixed some compiler warnings while using c++11 2020-09-25 18:51:18 +02:00
Pawel Kolodziejski
d5304e2568 ALL: Synced with ScummVM - rev: 33a47d23b85694015fe2aa340219d2b60db873f3 2020-09-03 02:21:14 +02:00
Dries Harnie
f393929c6f EMI: Always enable subtitles for the demo
Fixes #1161.
Tested on the German and Spanish demo.
2020-05-17 13:49:54 +02:00
Mathias Parnaudeau
a8e8b71550 EMI: Check _musicTable is null before it is used
After having installed EMI data and started the game, if we are in the situation
where it is asked to rename resource file FullMonkeyMap.imt from both CDs
into FullMonkeyMap1.imt and FullMonkeyMap2.imt, the game tries to start but
leads to an immediate segmentation fault.

In EMISound::setMusicState, _musicTable is checked againt nullptr but ... after
it is used. This check is moved up.
2020-02-21 07:11:56 +01:00
Dries Harnie
74a8f2d09c EMI: Support merged FullMonkeyMap.int as well 2019-05-13 20:55:21 +02:00
Bastien Bouclet
23339184ce GRIM: Clean up float data loading 2018-04-14 11:49:35 +02:00
Bastien Bouclet
6708f19a50 GRIM: Fix invalid ADGF_DEMO flag usage 2017-07-26 20:12:35 +02:00
Vincent Pelletier
2490cb986f EMI: Reuse existing variable 2017-05-15 10:31:25 +00:00
Vincent Pelletier
84f83fe6ea ALL: Rename get_float to READ_LE_FLOAT
For consistency with other functions/macros from common/endian.h .
2017-05-12 13:57:16 +00:00
Vincent Pelletier
66d24776ec EMI: Directly use converted buffer
Data is already converted to the correct format by copyBuffer, so write
it directly to save file.
This fixes save game screenshots taken with TinyGL renderer: Bitmap
constructor calls graphic driver's createBitmap method, and TinyGL's
converts the buffer to its own buffer pixel format - undoing the conversion
storeSaveGameImage did just before.
2017-04-26 13:11:00 +00:00
Bastien Bouclet
14b5763408 GRIM: Fix memory leaks related to EMI models 2016-07-12 06:16:36 +02:00
Bastien Bouclet
f31ef249ba GRIM: Only request actual save slots in listSaves and lua. 2016-01-31 07:02:02 +01:00
Pawel Kolodziejski
5c7fd27706 ALL: sync with ScummVM 2015-09-06 16:08:49 +02:00
Pawel Kolodziejski
11b457122b ALL: synced with ScummVM 2015-08-16 08:49:02 +02:00
Christian Krause
c4282b96dd Merge pull request #1194 from chkr-private/emi-chore-fixes
EMI: Keep time of chores and animations in sync
2015-05-19 22:28:03 +02:00
Christian Krause
bbc0e53837 Merge pull request #1189 from chkr-private/animation-fixes
EMI: Start animation when "Loop" key is set
2015-05-19 21:48:22 +02:00
Christian Krause
b186c21f85 EMI: Fix wrap around of Layers/Frames
This patch makes sure, that Layer::_frame is smaller than numLayers
of the bitmap in order to prevent out-of-bounds access to
BitmapData::_layers.
2015-05-16 10:39:08 +02:00
Christian Krause
d8ef15acc2 EMI: Keep time of chores and animations in sync
Both the animation components/tracks and the chores itself keep track of
the current time independently:

animation component:
- AnimationStateEmi::_time
- initialized with 0
- after the first update() call, _time is advanced by the frametime

chores:
- Costume::_currTime
- initialized with -1
- during the first update() call, _currTime is set first to 0
- during the next update() call, _currTime is advanced by the frametime

EMICostume::update() updates first the chore and then all components
with the same frame time. This has the effect, that the internal time
base of the chore and the animation has always an initial offset (the
value of the frametime of the first update() call).

For some costumes, the chore will pause the animation by setting the
according key for that animation at the end of the animation. However,
since the animation component has a different time base, it has already
reached that point and may have already disabled itself entirely
(instead of just being paused by the chore).

This bug fix let the animation set _time to 0 in the first update() call, too.
Any consecutive update() call will advance the time by the frametime.
This will keep the two time bases of the chore and the animation component
in sync.
2015-05-15 21:26:01 +02:00
Dries Harnie
fb3bd8139a JANITORIAL: Fix Coverity warnings
Fixes coverity warnings 1267220, 1256936, 1229470, 1224097, 1219766,
1054364, 1009896.
2015-05-12 08:49:19 +02:00
Christian Krause
be771ab454 EMI: Correct draw order of textobjects
Instead of just ordering the textobjects by their layer, use their
creation time (indirectly provided by the pool ID which is continuously
counting up).

This ensures that if there are multiple textobjects with the same text
ID and the same layer, that the latest is drawn last and overwrites the
previous ones.

That's necessary since the LUA code will create multiple instances of
the same textobject for the color fading effect in the credits.
2015-05-09 16:32:26 +02:00
Christian Krause
2fece8b8d7 EMI: Enable drawing of dynamic Layer objects
This patch enables drawing of Layer objects which are
dynamically created by LUA code.

All three sorted lists (background images, layers and actors) are
merged based on their sort-order.
2015-05-05 23:31:20 +02:00
Christian Krause
06df5f599f EMI: Layer::getSortOrder can be called in const context 2015-05-05 23:27:23 +02:00
Christian Krause
09bb2d7b0d EMI: Fix sanity check in Lua_V2::SetLayerSortOrder
Correct typo in sanity check and add an error message for
wrong parameters.
2015-05-05 23:22:42 +02:00
Christian Krause
409a6f7b95 EMI: Start animation when "Loop" key is set
This fixes the problem if the costume uses only key 3 ("Loop") but not
key 1 ("Play") for an animation. This happens e.g. for Pegnose's "run" chore.
2015-05-03 03:31:08 +02:00
Christian Krause
a8460f4f3f EMI: Check bit in mesh face flags to disable lighting
Use bit 0x20 in the mesh face flags to disable ligthing. This
fixes the problem that once a previous screen is used as
texture (e.g. in the intro or for the transition effects
in set kab when walking eastwards or westwards), it is shown
too dark due to the applied static lighting for overworld
actors.
2015-02-24 22:49:48 +01:00
Christian Krause
6d226501b5 EMI: Implement mesh-specific alpha values
- if Lua_V2::SetActorGlobalAlpha() is called with a mesh name,
  set a mesh-specific alpha value / mode
- use this alpha value in drawEMIModelFace()
- fixes the problem that the whole actor vanishes in some scenes
  (e.g. when entering or leaving the porch of the of LUA bar)
2015-02-17 01:57:07 +01:00
David Cardwell
9b1bbd61dc EMI: Change the file-extension of PS2 saves
Prevent conflicts with incompatible save files by changing the
file-extension of PS2 saves to “*.ps2”.
2015-02-14 14:18:09 -05:00
David Cardwell
3952fda0e3 EMI: Append filename to PS2 saves
Append “.gsv” to filenames so that ResidualVM’s load screen will show
them.  However, the description text is internal names such as
“/txtsavwed/“.
2015-02-14 14:18:09 -05:00
David Cardwell
c2d0941890 EMI: Allow saving in-game on the PS2 version
Change the memory card id and the reported free space so that the game
is able to save.
2015-02-14 14:18:09 -05:00
Christian Krause
ad2ce4a87e EMI: Fix memleaks caused by specialtyTextures
- delete screenshot after texture is created
- free _data[] entries in BitmapData::freeData()
- destroy _specialtyTextures[] entries in
  graphic driver's destructors
2014-12-31 15:47:36 +01:00
Christian Krause
455f58a309 EMI: Minor cleanup of access modifier
- make EMIChore::fade() private (no need for public access, method is
  already protected in base class)
2014-12-31 15:47:02 +01:00
Christian Krause
5b5b8e5281 EMI: Use correct type for comparison 2014-12-31 15:46:37 +01:00
Joel Teichroeb
c936e29bac Merge pull request #1119 from chkr-private/emi-sound-fixes
Various EMI sound fixes
2014-11-25 12:58:22 -08:00
Christian Krause
ce3d8bd81d EMI: Use static lights for overworld actors
Overworld actors, e.g. the load/save menu or the inventory wheel
should not use the lights of the current scene for lighting.

This fixes the bug that the screenshots of the load menu
were dimmed to various levels depending on the current scene.
2014-11-22 16:58:43 +01:00
Christian Krause
404ae70687 EMI: Avoid +/-inf values for volumes
Ensure that all math operations are done with floating point
arithmetic to avoid a floating point division by zero for small
values of _volume. In this case, the term in parenthesis would
be evaluated first via integer arithmetic and may produce easily 0.
2014-11-21 19:36:44 +01:00
Christian Krause
50f958e5c9 EMI: Make Lua_V2::PlayLoadedSound more robust
Don't abort() when EMI's LUA code calls PlayLoadedSound
with nil parameter.
2014-11-21 19:36:41 +01:00
Christian Krause
e8190af548 EMI: Set movie volume to SFX volume setting
- movies are played as kPlainSoundType
- set the kPlainSoundType volume to the same value as
  the kSFXSoundType volume
2014-10-27 01:11:42 +01:00
Christian Krause
36b037c81d EMI: Refactor conversion of sound volume values
- LUA code uses a range of 0 .. 100
- the LUA group volumes are in the range 25 .. 100, otherwise the sound
  group is muted
- residualvm engine uses a range of 0 .. Audio::Mixer::kMaxChannelVolume
- do most of the conversion in lua_v2_sound.cpp
- most parts of the engine will solely use the engine internal range
- only when reading/writing the registry residualvm continues to use
  a special conversion for compatibility with the volume settings
  of the residualvm engine settings
- proper handling of volumes close to 0.0f in SoundTrack::updatePosition()
2014-10-27 01:10:29 +01:00
Dries Harnie
26a37c1410 EMI: Reroute AttachActor/DetachActor to debug channel 2014-10-11 12:48:07 +02:00
Paweł Kołodziejski
60a67b28f8 Merge pull request #965 from chkr-private/screen-dim-fixes
Use half-transparent plane to implement dimScreen in EMI
2014-09-16 06:21:50 +02:00
Christian Krause
56e13b52ca EMI: Use half-transparent plane to implement dimScreen (OpenGL)
- instead of re-calculating the color values when dimming the screen,
  better draw a half-transparent plane after drawing all non-overworld
  characters
- fixes the issue that overworld actors were dimmed and that the
  pause screen is transparent when the inventory is open
2014-09-13 10:43:33 +02:00
Joseph Jezak
99fa91053c MATH: Rename XYZ Rotation Functions to Euler to better describe the function. 2014-09-11 13:38:28 -04:00
Joel Teichroeb
6c01a3ca74 Merge pull request #1077 from JoseJX/StopTurning
EMI: Add stop turning to actor methods.
2014-09-09 09:01:33 -07:00
Joel Teichroeb
6227388dce EMI: Fix casting issue with MSVC 2014-09-08 18:30:22 -07: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
Joseph Jezak
aa1977618a EMI: Add stop turning to actor methods. 2014-08-26 13:36:07 -04:00
Joseph Jezak
68bf45f373 EMI: Additional conversions from interest/roll to _rot. 2014-08-19 21:15:18 -04:00
Joel Teichroeb
6a852161c7 Merge pull request #999 from JoseJX/Camera
EMI: Keep camera as a rotation matrix and add Lua functions for changing it.
2014-08-19 17:21:43 -07:00