Although SupernovaEngine forwards render calls to screen, it also
exposed members publicly like _brightness. Therefore, a few changes were
necessary in rooms and state.
Because of confusion when indentation level is raised and thus tabs or
spaces should be used when aligning code, this commit switches to tabs
to avoid any further confusion.
Most of the time _objectState[MAX_OBJECT - 1] was used for
showing/hiding the GUI, here it was to indicate if the player
is currently hidden behind a pillar though.
genericInteraction() has a special case when you take off your helmet
in the restaurant, it strips you completely.
Once you leave it's supposed to put on your suit, helmet and supply
but instead if flagged generic objects as worn.
If the player did pik up the discman earlier in the game,
it should be kept.
Also the inventory scroll needs to be reset after removing
almost all the objects as otherwise we may see what seems
to be an empty inventory with no arrow (although we can
still scroll when clicking on the space where the up arrow
should be).
There were several issues with the brighness due to the different
implementation between the original and the code in scummvm. The
code has now been modified to be much closer to the original, which
fixed those issues and allowed to remove workarounds that had been
added in various places to deal with those issues (but those
workarounds had their own issues such as fade in happening too
soon before switching to the new room).
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.