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.
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.
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.
- 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
- all actors of the Overworld should cover any non-Overworld drawings
- Overworld actors need to use the depth buffer so that e.g. the
pause screen is drawn above the inventory
- this fixes issue #927 (inventory is drawn above background of pause
or menu screen)
Both EMI and Grim call RenderModeUser when entering the menus or dialogs,
but EMI does not use special "blast" commands to display text or images,
so we cannot suspend regular screen updates. The current implementation
does not switch engine modes in RenderModeUser, which has the drawback
that the frame time is not stopped during pause or menu.
With this patch, EMI handles draw mode like normal mode with frozen frame
time.
The text stack in EMI must be saved and restored in save games because
the game will call PopText after returning from the menu. Instead of
managing separate lists for each text stack level this patch adds a
_stackLevel field that is incremented for PushText and decremented for
PopText. Only text objects from the stack top (level 0) are rendered.
The highlighted menu entry is sometimes not correctly colored.
There are multiple textObjects per string (one for each color) and
residualvm draws them in an unspecified order.
To ensure that the correct textObject is drawn on top, each
object gets a layer attribute assigned by the lua code.
The patch adds the layer attribute to the runtime engine and orders the
textObjects by layer before drawing them.
The floor in the Hall of Justice is hidden by a solid gray actor named
"trap plane". This actor is originally positioned far in the background
but moved to the foreground because we can't find a sort plane in the
sector.
This patch stores returns an actor to the original sort order set by
the game script when entering a sector that has no sort information.