Commit Graph
137148 Commits
Author SHA1 Message Date
Vincent Pelletier 77a4672530 TINYGL: Enable dirty rectangle by default. 2017-05-02 09:57:09 +00:00
Vincent Pelletier d797461fa9 TINYGL: Clip dirty rectangle to render rectangle.
As all dirty rectangles are inflated by 1 pixel to the right and one to the
bottom, they may exceed render rectangle. So clip them again. There should
be very few rectangles at this point, so this should be cheap.
2017-05-02 09:57:09 +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 290d6a3b6d TINYGL: Initialise a1 in fillTriangleFlat code path
fillTriangleFlat has kDrawLogic == DRAW_FLAT and interpRGB == false,
causing this variable to be used uninitialised.
Found by removing default values on all locals.
2017-05-02 09:42:06 +00:00
Colin Snover bb40889a60 Revert "SCI32: Add debugging calls to GfxCursor32"
This reverts commit c02f2674ad.

Two minutes after committing this, the author of the ticket
resolved the problem, which was caused by missing VMDs.
2017-05-01 21:16:20 -05:00
Colin Snover c02f2674ad SCI32: Add debugging calls to GfxCursor32
Refs Trac#9740.
2017-05-01 20:44:25 -05:00
Bastien Bouclet ecd758d886 PS3: Don't try to copy a non-existing file 2017-05-01 20:50:39 +02:00
Colin Snover b208c82494 SCI32: Add support for Shivers interactive demo
Closes Trac#9745.
2017-05-01 12:31:21 -05:00
Colin Snover 6da5a175cb SCI32: Add detection for KQ7 German 1.65c
Closes Trac#9738.
2017-05-01 12:30:57 -05:00
Bastien Bouclet 174827fb0e SDL: Use a native SDL function to draw the screen on the overlay surface 2017-05-01 15:40:23 +02:00
Bastien Bouclet a28a2cad94 SDL: Use a SDL function to draw the overlay on the screen surface 2017-05-01 15:13:29 +02:00
Vincent Pelletier 7988c696d9 TINYGL: Drop unused Framebuffer pixelbits property 2017-05-01 08:34:53 +00:00
Vincent Pelletier eeedf4de06 TINYGL: Deduplicate PixelFormat retrieval in zblit
For some reason, loadData hardcodes a pixel format.
At least avoid duplicating it in Line constructor.
Likewise, avoid duplicating access to framebuffer's pixel format when
constructing a Line from another.
Also, avoid over-allocating Line, as its size argument is counted in pixel,
not in bytes.
2017-05-01 08:34:53 +00:00
Vincent Pelletier 4bcc95f217 TINYGL: Fix ARGBST scaling.
I based ARGB scaling on ST scaling without giving it enough thought.
It accidentally uncovered an older bug in glopClear, which made me recheck
these formulas.
ST scaling maps [0.0, 1.0] to [0x01.0000, 0xff.0000], meaning the first and
last texture rows and columns are never shown.
Treating s and t as proportions of ST_MAX fixes this by mapping to
[0x00.0000, 0xff.fffc] (last two fractional bits being off-precision, as
there are only 14 bits), covering the whole available range.
2017-05-01 08:34:25 +00:00
Vincent Pelletier 8c1954359e TINYGL: Fix glopClear
ClearBufferDrawCall expects 0..255 color values, not the internal 16-bits
fixed-point format.
Also, fix a typo in glopClear on Z scaling.
2017-05-01 08:32:25 +00:00
Vincent Pelletier 92a54a5969 fixup! TINYGL: Fix line color
These shifts are now handled in zline (only user of this macri),
consistently with ztriangle.
I have removed this macro from my working copy, but I missed the breakage
while resolving the conflict.
2017-05-01 04:45:11 +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
Thierry Crozat dba9ef4fa4 I18N: Regenerate translations data file 2017-05-01 05:05:08 +02:00
Vincent Pelletier 1c2e6f554a GRIM: Simplify Lua_V1::EngineDisplay 2017-05-01 02:37:31 +00:00
Vincent Pelletier 39656ce5c5 TINYGL: Store colors with 8-bits integer part
Before this change vertex data (post-shading) was limited to 6 (green) or
5 (all others) bits of precision.
Interpolation happened with 8-bits precision, so the visual effect is
minor: about 4 off at vertices.
2017-05-01 02:22:17 +00:00
Vincent Pelletier 054a2bd920 TINYGL: Fix line color
As in ztriangle, vertex color must be shifted from internal 16-bits
fixed-point format to 8-bits colors.
To do so, define values similar to the ones describing for ST fixed-point
format.
Also, use these in tglClear instead of hard-coded multiplicands, as is
done in tglColor4f and gl_transform_to_viewport.
Also, make tglClear take into account requested clear depth.
2017-05-01 02:21:40 +00:00
Vincent Pelletier 1d3d581870 TINYGL: Use same default clear depth as OpenGL 2017-05-01 02:19:42 +00:00
Colin Snover 00168003fe SCI: Clean up ugly syncBaseObject call 2017-04-30 13:44:34 -05:00
Colin Snover 94dc6ae052 SCI: Hold script data as mutable internally
Script buffer data is modified after a script is loaded by
savegame operations, and, in SCI16, by string operations. Casting
away const to allow these mutations to happen is not a very good
design, so this patch just changes the privately held reference
to data to be mutable. (Public accessors still return immutable
data.)
2017-04-30 12:47:32 -05:00
Martin Kiewitz 0560a1d041 SCI32: add detection for GK2 German 2017-04-30 18:46:44 +02:00
Tobia Tesan 23b6dbbede DIRECTOR: clean up renderText: separate reading & actual rendering 2017-04-30 09:48:08 +02:00
Tobia Tesan 03831698ac DIRECTOR: remove redundant/ineffective assignments to width 2017-04-30 09:48:08 +02:00
Tobia Tesan 132785ccb0 DIRECTOR: clean up renderText: move warning block down
This changes slightly the semantics of the method; however, I assume we
want to print (or not) the warning based on the width/height values that
will in fact be used *in* the method.
2017-04-30 09:48:08 +02:00
Tobia Tesan b6eb8a1a66 DIRECTOR: consolidate font, width instructions in renderText 2017-04-30 09:48:08 +02:00
Tobia Tesan ed2f09b13f GRAPHICS: Delete MacFont in MacText 2017-04-30 09:48:08 +02:00
Tobia Tesan af664fe757 GRAPHICS: Use MacFont in lieu of Graphics::Font in MacText 2017-04-30 09:48:08 +02:00
Tarek Soliman d602850b0c TESTBED: Fix building with --disable-cloud (#938)
The linker fails when building with --disable-cloud and not
passing --disable-libcurl
2017-04-30 09:42:48 +02:00
Thierry Crozat 9a8aea0585 CLOUD: Fix compilation with old curl vesions 2017-04-29 22:10:16 +01:00
Arius a4e5041117 I18N: Update translation (Greek)
Currently translated at 99.4% (942 of 947 strings)
2017-04-29 21:36:15 +02:00
Colin Snover 5dd9618842 SCI32: Remove unnecessary GfxFrameout::_frameNowVisible
This flag was used in SSCI to read from VRAM instead of from the
back buffer when a mouse interrupt was received in the middle of
a back buffer update. Since ScummVM controls when mouse events
are received via polling, it is not possible to receive a mouse
event in the middle of back buffer updates, so this code is
unnecessary for the engine to work properly.

This also fixes Valgrind warnings about use of uninitialized
memory at the start of the game, caused by not filling the cursor
memory buffers because `_frameNowVisible` was false until the first
frame was rendered.
2017-04-29 14:31:01 -05:00
Colin Snover 75c6b1fd3b SCI32: Promote GK2 and Torin demos to AGDF_TESTING 2017-04-29 14:30:09 -05:00
Colin Snover 53fb26550d VIDEO: Unexpose audio sync API in AdvancedVMDDecoder
This change was inadvertently added in commit
44dd029cb1 but is not actually used.
2017-04-29 14:30:09 -05: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 df62c19a88 TINYGL: const-ify all vector API parameters 2017-04-29 14:04:13 +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 5f993ac66f TINYGL: TGL_LINE_STRIP and TGL_LINE_LOOP are one line appart 2017-04-28 21:54:11 +00:00
Eugene Sandulenko a62e174064 I18N: Update translation (Greek)
Currently translated at 99.3% (941 of 947 strings)
2017-04-28 13:12:11 +02:00
Arius 7f97d1c8e6 I18N: Update translation (Greek)
Currently translated at 99.3% (941 of 947 strings)
2017-04-28 13:11:58 +02: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