This code section was converted from the original source, where the
sections are directly drawn to the screen instead of buffered.
If a section > 128 is set as parameter, the function takes the
dimensions of section - 128 and draws this region of section 0 to the
screen, thus restoring it.
It would not make sense loading part of section 0 in seperate Surfaces
especially since kMaxSection is smaller than 128 the else branch is
never entered so removing it doesn't change the programs behavior.
Of course the short description does not adequately describe the changes
made with this commit and I assume this won't be the last big
restructuring unfortunately.
Focus of this commit was to implement/fix the code so the main user
interface can be rendered. Bugs in the core routines for rendering
Messages and Images were fixed as well.
The resolution will change dynamically depending what image is about to
be rendered. As there are no other GUI elements shown that depend on the
screen resolution when the artciles are rendered, there shouldn't be any
problems.
This is the game logic for the first act of the game.
It will see restructuring to remove gotos/jumps and hardcoded
differences in game behavior depending on settings (e.g. sound on/off).
Room specific logic needs access to functions that currently are
unavailable to them. Once no further extension or rearchitecture is
rather unlikely, thoughts on encapsulation can be given but for now all
members will be made public.
An instance of GameManager acts as an interface between the game logic
and engine. It provides game specific functions like isHelmetOff() to
check if the player wears his helmet.
This commit also adds engine extensions like saveScreen() and
restoreScreen() that makes use of the ScreenBufferStack class for
temporarily saving and restoring sections of the screen.
Most of the structure and code is bound to change but gives something to
improve on.
Messages will be 'removable' by over-rendering the message by invoking
removeMessage() with what was previously overdrawn.
_messageDisplayed might need to be reworked to an int, depending if
there are multiple messages rendered simultaneously.