4101 Commits

Author SHA1 Message Date
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
Bastien Bouclet
7c60a59c81 GRIM: Account for the alignment when seeking smush movies 2017-05-08 10:54:04 +02:00
Bastien Bouclet
1beae260c8 STARK: Fix incorrect include style 2017-05-08 07:39:33 +02:00
Vincent Pelletier
e7073dc037 ALL: Add an option to control dirty rectangless TinyGL optimisation
Exposed to command line via --[no-]dirtyrects.
As dirty rectangles make the workload vary a lot between frames, it makes
performance regressions harder to spot. Disabling it produces lower, but
much more regular FPS counts.
2017-05-03 16:52:36 +00:00
Vincent Pelletier
707a48c8c5 GRIM: Remove redundant ConfMan.registerDefault calls
These are already declared in base/commandLine.cpp .
2017-05-03 16:52:36 +00:00
Vincent Pelletier
eb192cda0d ALL: Document GRIM's engine-speed command line argument
Also, move it in the ENABLE_GRIM section.
2017-05-03 16:52:36 +00:00
Vincent Pelletier
1ca4e22223 GRIM: Use drawBitmap in GfxTinyGL::copyStoredToDisplay
Removes image down-sampling to texture resolution - much nicer !
2017-05-02 12:49:04 +00:00
Vincent Pelletier
0de4acbd48 GRIM: Do not draw when flipping is forbidden.
Fixes
"Allocator out of memory: couldn't allocate more memory from linear allocator."
error with TinyGL in GRIM in several places:
- at the beginning of Year 2, after Meche boards the boat (does not happen
  when skipping cutscene)
- when loading set bi
And likely in other places.
The issue is that TinyGL queues draw calls in a fixed-size structure
(linear allocator used to quickly queue vertices), and it emits this error
when running out of space. This queue is not flushed for as long as
_flipEnable is false, and this value is controlled by game scripts.
The longer flipping is forbidden, and the more complex the scene is (more
vertices, like in bi), the more likely it is to run out of space and cause
residualvm to error out.

In set bi, missing one flip is enough to exceed buffer space.
In set lm (the one after meche boarding the boat), it takes 5 missed flips
to exceed buffer space (simpler scene), but it still happens in a split
second.

My initial thought was to empty the queue without drawing, but there is no
way to do this with OpenGL and I prefer to avoid TinyGL-only shortcuts.

It seems likely OpenGL to have larger draw operation buffers (maybe
dynamically extended ?), and/or to forcibly stall caller and execute draw
operations when running out of space. In any case, this would add
complexity to residualvm and use more CPU and GPU time for no purpose.
So instead just skip drawing until flipping is allowed again.
2017-05-02 09:53:46 +00: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
Vincent Pelletier
d92e9581b4 GRIM: Use default clear depth
For consistency with OpenGL.
2017-05-01 03:19:45 +00:00
Vincent Pelletier
ee66143a90 GRIM: Disable lighting in GfxTinyGL::drawEMIModelFace
As is done for OpenGL. It allows TinyGL to take shortcuts in coordinates
transformations of all vertices.
Also, reduce trivial diffs with gfx_opengl.cpp .
2017-05-01 03:19:45 +00:00
Vincent Pelletier
1c2e6f554a GRIM: Simplify Lua_V1::EngineDisplay 2017-05-01 02:37:31 +00:00
Vincent Pelletier
55d1e6b489 GRIM: Make Sprite::loadBinary bitfield debug more readable
Also, second bitfield was reported with value from first.
2017-04-29 16:43:33 +00:00
Vincent Pelletier
a0886193f0 GRIM: Do not convert type-1 bitmap data on submission
Instead, generate color key in a consistent pixel format.
2017-04-29 15:17:37 +00:00
Vincent Pelletier
090dc58a83 GRIM: Drop outdated comment
This came from code in TinyGL which was removed during the 32bits works,
but I forgot to remove this comment.
2017-04-29 14:40:14 +00:00
Vincent Pelletier
8fc17a49e2 GRIM: {T,}GL_LINES does not need to be interrupted between each line 2017-04-28 21:55:36 +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
Vincent Pelletier
a8612e130f GRIM TINYGL: Do not force conversion to RGBA8888
createScreenshotBitmap internally converts to RGB565 anyway.
2017-04-26 13:11:00 +00:00
Vincent Pelletier
b8ae5c5bcf GRIM: Use already-stored display for save screenshot
Instead of storing display again and using it.
2017-04-26 13:11:00 +00:00
Vincent Pelletier
f8ef0b2261 GRIM: Draw to buffer before storing display
Fixes save game screenshots with TinyGL: without this, the screenshot
content is the menu at the time user confirmed the save, and not the
original scene.
This is consistent with OpenGL behaviour, where framebuffer-reading
operations implicitly call glFlush.
2017-04-25 11:31:49 +00:00
Vincent Pelletier
a3a6218060 GRIM: Avoid writing to buffer directly. 2017-04-23 01:44:51 +00:00
Bastien Bouclet
f11e25f129 MYST3: Don't crash when myst3.dat is not found
Fixes #1333.
2017-04-20 17:38:56 +02:00
Bastien Bouclet
192b85af32 MYST3: Use a full 3D intersection test for hotspots
Cube hotspots are now fully accurate when compared to the original engine.
Fixes #1329.
2017-04-17 08:52:36 +02:00
Bastien Bouclet
c421e8305c MYST3: Add a script patch for the water effects in room LEOF
Fixes #1330.
2017-04-15 06:56:42 +02:00
Bastien Bouclet
2632f11c8a MYST3: Minor cleanup 2017-04-14 06:20:52 +02:00
Bastien Bouclet
62fb8d2875 MYST3: Fix incorrect logic in the ifOneVarSetInRange opcode
The test was never true due to in incorrect precondition check

Fixes #1328.
2017-04-10 19:13:44 +02:00
Bastien Bouclet
1d4c9b7d36 MYST3: Add missing peg sound effect in the pinball puzzle
Fixes #1328.
2017-04-10 19:11:00 +02:00
Bastien Bouclet
ce9637dee2 Merge pull request #1326 from firesock/stark-opfade
STARK: Implement opFadeScene
2017-04-08 17:17:16 +02:00
Awad Mackie
54cdb8053a STARK: Implement opFadeScene 2017-04-08 14:30:13 +01:00
Bastien Bouclet
c7e75552ef STARK: Implement the fast forward mode
Used to skip animations. Does not behave exactly as the original due to
frame timing being incorrect in ResidualVM.

Fixes #1324.
2017-03-25 18:31:12 +01:00
Bastien Bouclet
76b7bdc2fc STARK: Implement opSoundChange, sound volume and pan fading 2017-03-21 21:22:51 +01:00
Bastien Bouclet
5d27096e53 STARK: Fix the last frame of Smacker animations not being displayed
As a side effect, fix a lot of graphic glitches where script execution
would resume too late, resulting in inconsistent graphics being drawn for one
frame.
2017-03-19 10:06:52 +01:00
Bastien Bouclet
6d6822666e STARK: Don't crash when decompiling a script referencing an unloaded location 2017-03-19 09:16:26 +01:00
Bastien Bouclet
ca32ebef74 STARK: Further simplify actor models in-memory representation 2017-03-19 08:30:25 +01:00
Bastien Bouclet
6ef37506d6 MYST3: Fix the md5 for the Spanish v1.2 version 2017-02-17 05:27:03 +01:00
Bastien Bouclet
5770534c74 MYST3: Add detection for v1.2 German and Italian
Thanks to goodoldgeorge. See #1323.
2017-02-16 13:18:37 +01:00
Bastien Bouclet
4591d0c2c4 MYST3: Add detection for v1.2 German and Italian
Thanks to andrews05. Fixes #1323.
2017-02-15 20:14:04 +01:00
Bastien Bouclet
61edb671cb STARK: Load actor model into a format that's easier to render
As a result less OpenGL bindings need to be changed when rendering.
2017-01-29 10:44:09 +01:00
Bastien Bouclet
c58b58685f STARK: Plug a memory leak 2017-01-29 10:41:34 +01:00
Bastien Bouclet
bc84594bec STARK: Fix misformatted include 2017-01-02 19:50:32 +01:00
Bastien Bouclet
74704d522a STARK: Implement lipsync 2017-01-02 19:48:24 +01:00
Bastien Bouclet
026e96cbf2 Merge pull request #1316 from bgK/vsync
Allow to control V-Sync
2016-12-04 09:18:52 +01:00
Bastien Bouclet
37e9b87e65 MYST3: Make sure movies are paused at most once when they complete
Otherwise, they would need to be unpaused the same number of time
when they resume.

Fix #1319.
2016-11-24 07:16:52 +01:00
Bastien Bouclet
df623b0e99 MYST3: Make database node ranges inclusive
Fixes #1318
2016-11-23 07:19:08 +01:00
Bastien Bouclet
0ef47eb5a3 MYST3: Create missing shared nodes in the hotspot pass
Fixes #1317.
2016-11-21 08:36:04 +01:00
Bastien Bouclet
f332f90e3a MYST3: Disable the frame limiter when V-Sync is enabled 2016-11-20 13:14:03 +01:00
Awad Mackie
c4a37c2d31 STARK: Add support for opRumble 2016-11-19 15:20:51 +01:00
Pawel Kolodziejski
19bcd1f3bc ALL: Sync with ScummVM 2016-11-12 12:59:06 +01:00
Bastien Bouclet
e72761a05e STARK: Play an anim script when no specific animation handling is provided 2016-11-12 09:18:58 +01:00
Bastien Bouclet
094099d0f1 STARK: Implement playing stock sounds from anim scripts 2016-11-12 09:17:02 +01:00