There were several issues fixed by this commit. The main ones are:
- It was in many places only drawing the first section even for
images that have multiple sections.
- It was in some places using the wrong image.
The first issue has been fixed by removing the GameManager::drawImage
function, and moving its logic to SupernovaEngine::renderImage which
was initially only drawing one section, but was nevertheless called
directly from many place.
The second image required more changes to the rendering code to allow
setting the current image file when it is different from the room file.
This fixes some memory issues and random crashes in places where it was
for example trying to use the image -1. This also fixes the rendering
of the flying cutscene.
The incorrect implementation meant than for example when leaving
the cave the room could stay black.
Note that the implementation is still approximative for the HOLD
and LANDINGMODULE rooms.
It was storing the result of bitwise operation on the ObjectType
enum values in a ObjectType variable. But that was incorrect as
the result was not a value from the enum.
Also removing a property was actually adding the property if it
was not present in the value initially.
The main change consists in using a separate byte array for the sentence
removal flags, move some functions from the GameManager to the Room class,
and add a few additional functions to manipulate this new array. This
allows to clarify some code related to dialogs.
This change also allows to switch the _shown array back to a bool array.
OSystem::setShakePos(int) can only take positive offset (as documented).
Passing a negative offset caused memory issues in the drawing code and
some random crashes.
We can now press the mouse button to leave the title screen instead
of having to press a key. Since the mouse cursor was visible, not
being able to press the mouse button was strange. Especially as it
was possible to use the mouse button earlier in the title screen.
Also we can now use the mouse button or any key other than escape
during the cutscene to move to the next sentence. And the code is
more reactive to pressing the Escape key (we don't need to wait
for the current annimation to finish) to exit the cutscene.
wait2() is used for updating events all over the code with a parameter
of 1, so to be sure there's at least one update it is wrapped in a
do-while now.