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.
GameManager::airless() determined if the space suit could be taken off
by comparing the current room pointer to the allocated room objects.
This led to indeterministic behavior as sometimes airless() would
falsely return true as the dynamic allocation of the Room objects cannot
be expected to be in a certain order.
Implementing the corresponing RoomID to a Room objects solves this
problem.
roomBrightness() saw the greatest change by ripping out dimColors().
I compared the result with the original game and I cannot see any
difference by just reducing the palette brightness to 60%.
Before edit() cleared the input on screen by overdrawing it from x to
the right side of the screen. This works fine for terminals but for
example setting the watches alarm time it does not.
The text font is 5x8 so overdrawing the max input length + 1 * 5 is
sufficient to clear the screen from our input and the cursor. Also if
the value ends up being too big it is clamped to the right side
of the screen.
According to the naming convention class member variables need to be
prefixed with an underscore.
Unfortunately, I already started converting time constants when making
this change so ticksToMsec() and constant changes are sprinkled over
this commit.
Instead of manipulating C-Strings edit() now takes a Common::String as a
parameter and the terminal input gets redrawn after every keystroke what
simplifies the function greatly.
During the gameplay room state is overwritten and needs to be restored
on restart/load. Currently the original room state is not preserved and
thus needs to be destroyed and reinitialized to obtain the original
state.
GetKeyInput/MouseInput/Input() block until the expected input happens.
GetKeyInput() takes a parameter that checks if the key input is a
'printable' character, backspace, delete, return or escape.
Also, the key state is now stored instead of just the ascii value of the
pressed key.