3176 Commits

Author SHA1 Message Date
Einar Johan Trøan Sømåen
dd9c461883 Merge pull request from chkr-private/timing-fixes
GRIM/EMI: Limit frequency of luaUpdate()
2015-01-11 18:53:52 +01:00
Christian Krause
6b7010598f EMI: Fix caching of local.m4b
- currently, the cache of local.m4b will cause that all contained files
  have the highest priority
- any file from a different archive which should have a higher priority
  (e.g. patch.m4b) is completley ignored
- this patch removes the additional cache of local.m4b so that the
  priority handling of SearchMan works
- additionally the concrete Lab object for local.m4b will now keep
  the file open
2015-01-10 16:54:47 +01:00
Christian Krause
316b2595e3 EMI: Avoid calling luaUpdate in poll event loop
- this avoids the issue that _frameTime is set to 0 if a consecutive
  luaUpdate() happens in the same millisecond and so getPerSecond()
  would return 0 for any given rate
- this fixes the issue that Guybrush would walk erratically
  when residualvm is built with optimization
2015-01-01 20:50:59 +01:00
Christian Krause
243519b276 EMI: Delete _localArchive in destructor
- fixes a memleak
2014-12-31 15:47:36 +01:00
Christian Krause
ff74216678 LUA: Fix copy'n'paste error 2014-12-31 15:47:36 +01:00
Christian Krause
8ba97cb063 LUA: Fix memleak of lua file descriptors
- don't delete the common LuaFile objects (like g_fin, g_stdout, ...)
  separately
- don't delete the LuaFile objects in closefile()
- delete all LuaFile objects in g_files at once in lua_iolibclose()
- for some objects LuaFile::close() is called twice (once by closefile()
  and a second time by lua_iolibclose()) but this is uncritically due to
  the way LuaFile::close() is implemented
2014-12-31 15:47:36 +01:00
Christian Krause
4425493124 GRAPHICS: Cleanup
- no need to dereference g_driver since createSpecialtyTexture()
  is already called in the correct object's context
2014-12-31 15:47:36 +01: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
026166ecf6 GRIM: Make malloc/free calls symmetric
- MemoryReadStream's data is destroyed in its desctructor
  via free so that original memory allocation needs to use malloc
  instead of new
2014-12-31 15:47:33 +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
Pawel Kolodziejski
ae24374482 Revert "GRIM: Fix deleting material when it is still needed"
This reverts commit 8767a41294a24bc24b50adda12b19cadbdfc0515.
2014-12-31 12:09:22 +01:00
Joel Teichroeb
8767a41294 GRIM: Fix deleting material when it is still needed 2014-12-29 21:51:27 -08:00
Pawel Kolodziejski
4f19ee6a2c GRIM: restored previous position shifting, but only partially for one font 2014-12-29 12:00:09 +01:00
Pawel Kolodziejski
a37e7bc204 GRIM: fixed TinyGL draw sprites 2014-12-28 17:11:13 +01:00
Pawel Kolodziejski
2a6f23839f GRIM: turn on back Depth Write after draw shadow planes 2014-12-28 16:51:06 +01:00
Pawel Kolodziejski
4166e1f4f5 GRIM: fixed compilation on AmigaOS4 2014-12-28 08:54:59 +01:00
Pawel Kolodziejski
91725ce54f GRIM: improve drawing X on Don's computer in OpenGL driver 2014-12-28 08:49:15 +01:00
Pawel Kolodziejski
7a252183dc GRIM: fixed issue 2014-12-28 00:04:24 +01:00
Pawel Kolodziejski
6afed33017 GRIM: fixed issue (revert old behavior) 2014-12-27 21:51:01 +01:00
Pawel Kolodziejski
dd02af967e GRIM: Fixed crash/invalid reads in Blocky16 2014-12-27 14:31:53 +01:00
Joni Vähämäki
e287fb4c8e GRIM: Initialize rotation quaternion also when loading text format model. 2014-12-27 00:30:09 +02:00
Joni Vähämäki
ae64297e3a GRIM: Initialize animated pose to bind pose, so the model bounding box is calculated correctly. Fixes
Also removed the yaw, pitch and roll fields from ModelNode as they are no longer needed after the rotation is converted to a quaternion.
2014-12-27 00:28:39 +02:00
Joel Teichroeb
943ee12926 GRIM: Add sector null check. Fixes 2014-12-26 08:42:45 -08:00
Pawel Kolodziejski
c2a9a394c3 MYST3, TINYGL: fixed endian issue 2014-12-23 20:40:59 +01:00
Bastien Bouclet
7a3e61a9b7 MYST3: Fix the endian-safety of the OpenGL texture loading 2014-12-22 20:20:00 +01:00
Pawel Kolodziejski
2f7ab83118 EMI: prevent use cache when result is false 2014-12-21 16:46:52 +01:00
Bastien Bouclet
b7e8ef5dc4 MYST3: Turn some warnings into debugs 2014-12-21 16:26:34 +01:00
Pawel Kolodziejski
73c9fda2e5 ALL: full sync with ScummVM 2014-12-04 21:16:12 +01:00
Bastien Bouclet
aabc7bc34f MYST3: Allow disabling aspect ratio correction 2014-12-04 19:38:04 +01:00
Bastien Bouclet
ee50a268d4 MYST3: Enable arbitrary resolution support 2014-12-04 19:31:18 +01:00
Dries Harnie
56cab59b6b Merge pull request from Botje/aspect-ratio-rebased
GRAPHICS: Fullscreen rendering and correct aspect ratio at native resolutions
2014-12-04 15:37:52 +01:00
Einar Johan Trøan Sømåen
f756848928 Merge pull request from somaen/emiMac
EMI: A first set of patches to improve Mac-support (German only)
2014-12-03 13:17:45 +01:00
Einar Johan Trøan Sømåen
2412047c14 GRIM/EMI: Handle 32bpp BGR in gfxOpenGL::prepareMovieFrame
This fixes the display of the Aspyr Logo in OpenGL.
2014-12-02 17:38:31 +01:00
Einar Johan Trøan Sømåen
223c81b144 EMI: Add code for one-shot playing the Aspyr logo on EMI Mac
This needs to be separate from the other videos, since the logo
is encoded as QuickTime. This solution replicates logic from
mainLoop to avoid adding any further special cases in engine code.
2014-12-02 17:01:39 +01:00
Christian Krause
8011a6a1e3 Merge pull request from chkr-private/dart-player-fixes
EMI: Fix stuck dart players
2014-11-30 21:48:25 +01: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
Joel Teichroeb
2c44b2bbdc GRIM: Use floating point division 2014-11-29 16:01:40 -08:00
Joel Teichroeb
10f265da58 MYST3: Fix two type conversion warnings 2014-11-27 17:10:37 -08:00
Joel Teichroeb
c936e29bac Merge pull request from chkr-private/emi-sound-fixes
Various EMI sound fixes
2014-11-25 12:58:22 -08:00
Dries Harnie
3641402ac7 Merge pull request from chkr-private/lighting-fixes
EMI: Fix lighting to overworld actors
2014-11-25 11:02:58 +01:00
Dries Harnie
ae4f9e20d4 EMI: Properly set viewMatrix as well [OpenGLS] 2014-11-24 14:07:30 +01:00
Dries Harnie
c0ec475288 EMI: Support overworld actors [OpenGLS] 2014-11-23 23:15:10 +01:00
Dries Harnie
e06056e7be EMI: Factor out makeFrustumMatrix 2014-11-23 23:14:59 +01: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
Joel Teichroeb
f832487ce4 GRIM: Only check collision on setPos in EMI
Fixes 
2014-11-07 20:40:15 -08:00
Joel Teichroeb
c1f79333f7 Merge pull request from chkr-private/walk-fixes
GRIM/EMI: Handle special case in Actor::walkForward()
2014-11-05 18:39:31 -08:00
Christian Krause
1c43404192 GRAPHICS: Reset GL's current color in drawDimPlane()
Per convention, in residualvm the default GL current color
should be (1.0f, 1.0f, 1.0f). If a function changes the color,
it is required to reset it before returning.

This fixes the issue that some videos were not correctly displayed
until the next glColor call (e.g. when drawing the sub-titles) was
issued.
2014-11-05 20:59:56 +01:00