Commit Graph
146 Commits
Author SHA1 Message Date
Thierry Crozat af226daf81 SUPERNOVA: Fix incorrect delay for message display
The delay was not set, meaning the messages were immediately
removed in some cutscenes.
2018-01-23 02:15:38 +00:00
Thierry Crozat 8a8a0b9d38 SUPERNOVA: Implement event callback mechanism and Supernova event 2018-01-23 02:15:38 +00:00
Thierry Crozat 54201327f7 SUPERNOVA: Fix image rendering when removing image
This is mostly used in talk animations and result in bad artefacts.
The issue was a regression introduced in commit e0f6da0.
2018-01-23 02:15:38 +00:00
Thierry Crozat 3f2c0673e4 SUPERNOVA: Do not run animations while a text box is displayed
That is also what the original is doing, and this avoid having
graphical glitches.
2018-01-23 02:15:38 +00:00
Thierry Crozat 8f7dcbe4ac SUPERNOVA: Fix crash when displaying strings larger than the screen 2018-01-23 02:15:37 +00:00
Thierry Crozat 841e7182f2 SUPERNOVA: Reduce memory usage to store sections and simplify code
Each section was store dusing the full image size. Now it only uses the
section size, which should reduce considerably the amout of memory used
for each image.

Also when a section has one or more next section, they were all drawn on
the surface for this section, but then they were drawn again on their own
surface. And while this should not cause any issue, this was really
unnecessary (and prevented optimizing the surface size for each section).
So now this is no longer the case and the surface for a section only
contains this section.
2018-01-23 02:15:37 +00:00
Thierry Crozat 73278c3f9f SUPERNOVA: Replace a class variable used in a single function by a local variable 2018-01-23 02:15:37 +00:00
Thierry Crozat 7bf803f6e6 SUPERNOVA: Cleanup dialog code
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.
2018-01-23 02:15:37 +00:00
Thierry Crozat 15b4e7a298 SUPERNOVA: Fix delay when loading a savedgame while a message is displayed
This required the user to click a mouse button to close the message and
get to the mew state. Now the message is automatically closed before
loading the new state.
2018-01-23 02:15:36 +00:00
Thierry Crozat 52952c48a7 SUPERNOVA: Fix displaying image missing last row and last column
This also fixes a crash for single row image sections
2018-01-23 02:15:35 +00:00
Strangerke f0d139d519 SUPERNOVA: Fix some warnings 2018-01-23 02:15:34 +00:00
Thierry Crozat 69d7b91965 SUPERNOVA: Improve interactivity of title screen and intro cutscene
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.
2018-01-23 02:15:33 +00:00
Thierry Crozat 7722fe99cd SUPERNOVA: Move object name and description strings to engine data file 2018-01-23 02:15:33 +00:00
Thierry Crozat 184b3a1662 SUPERNOVA: Load strings from the supernova.dat file 2018-01-23 02:15:33 +00:00
Thierry Crozat 65d30cf720 SUPERNOVA: Plug memory leak in MOD music streams 2018-01-23 02:15:32 +00:00
Thierry Crozat d1bdfd2bde SUPERNOVA: Clean indentations 2018-01-23 02:15:32 +00:00
D G Turner ea955675db SUPERNOVA: Fix GCC Warning for Malformed Narrowing Conversions in C++11. 2018-01-23 02:15:32 +00:00
Thierry Crozat 86795f0fa2 SUPERNOVA: Fix clicks at start and end of audio samples
The sound samples start with a 6 bytes header (including the size of
the sample coded on a little endian 16 bits uint on bytes 2 and 3)
and end with 4 bytes set to null. Those were passed to the raw stream,
which resulted in the audible clicks.

Note that we could use the information from the header to load the
sound samples instead of keeping around an array of offset and size.
2018-01-23 02:15:32 +00:00
Thierry Crozat 696fcb6bb9 SUPERNOVA: Add saving/loading of playtime 2018-01-23 02:15:32 +00:00
Thierry Crozat 1cdede12ac SUPERNOVA: Properly handle loading saved game from launcher 2018-01-23 02:15:32 +00:00
Thierry Crozat ed7fa6f7d7 SUPERNOVA: Improve save state handling
The saved game files now start with a header and version which allows
to do some sanity check and will allow to change the format in the
future if needed.

Also the MetaEngine can now be queried for the meta infos of a save
state.
2018-01-23 02:15:31 +00:00
Joseph-Eugene Winzer 02290c32b6 SUPERNOVA: Allows saving by default
When saving is not apropriate, for example during cutscenes, explicitly
disable it.
2018-01-23 02:15:30 +00:00
Joseph-Eugene Winzer 749fa6336e SUPERNOVA: Fixes save/load dialog 2018-01-23 02:14:56 +00:00
Joseph-Eugene Winzer a334a4730d SUPERNOVA: Fixes returned constant on load fail 2018-01-23 02:01:00 +00:00
Joseph-Eugene Winzer ea60d1513e SUPERNOVA: Raises save game limit to 99 2018-01-23 02:01:00 +00:00
Joseph-Eugene Winzer 6e33819217 SUPERNOVA: Changes increment size for fade in/out 2018-01-23 02:01:00 +00:00
Joseph-Eugene Winzer b3e23fef13 SUPERNOVA: Fixes mouse events during intro 2018-01-23 02:00:59 +00:00
Joseph-Eugene Winzer 7b4e9a5424 SUPERNOVA: Adds text speed variable 2018-01-23 02:00:59 +00:00
Joseph-Eugene Winzer de539134f9 SUPERNOVA: Removes comments 2018-01-23 02:00:59 +00:00
Joseph-Eugene Winzer 3f68cda2d7 SUPERNOVA: Implements de-/serialization
WIP. It is currently broken.
2018-01-23 01:53:31 +00:00
Joseph-Eugene Winzer ef14dfb7c3 SUPERNOVA: Adds engine pause 2018-01-23 01:53:28 +00:00
Joseph-Eugene Winzer edef2792da SUPERNOVA: Adds RoomID to Rooms
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.
2018-01-23 01:52:59 +00:00
Joseph-Eugene Winzer bc43ff820e SUPERNOVA: Ignores mouse clicks while sound is playing 2018-01-23 01:52:59 +00:00
Joseph-Eugene Winzer 18abc4702a SUPERNOVA: Implements Return To Launcher 2018-01-23 01:52:50 +00:00
Joseph-Eugene Winzer 1e36c74e6b SUPERNOVA: Updates TODOs 2018-01-23 01:42:32 +00:00
Joseph-Eugene Winzer b0b682ad09 SUPERNOVA: Removes getDOSTicks() 2018-01-23 01:42:32 +00:00
Joseph-Eugene Winzer eabcca3e89 SUPERNOVA: Adds Alt-X as exit shortcut 2018-01-23 01:33:24 +00:00
Joseph-Eugene Winzer 5845cd7bd2 SUPERNOVA: Fixes rerendering of the room
One sprite can consist of many sections that are concatenated in a
linked list.
2018-01-23 01:33:24 +00:00
Joseph-Eugene Winzer bfa96d6f50 SUPERNOVA: Adds Audio info for rocks 2018-01-23 01:33:12 +00:00
Joseph-Eugene Winzer 172377f093 SUPERNOVA: cleanup 2018-01-23 01:01:18 +00:00
Joseph-Eugene Winzer 30e138dcfa SUPERNOVA: Adds indicator for key presses 2018-01-23 00:29:35 +00:00
Joseph-Eugene Winzer 0fdb3d8d10 SUPERNOVA: Extends text rendering
textWidth() and renderText() are overloaded for handling single uint16
characters (useful when rendering key strokes directly)
2018-01-23 00:29:35 +00:00
Joseph-Eugene Winzer afb873c032 SUPERNOVA: Adjusts game loop delay 2018-01-23 00:29:34 +00:00
Joseph-Eugene Winzer 0462bd0184 SUPERNOVA: Implements animation
The original game's time was stored in 55ms ticks but we just run on
milliseconds. setAnimationTimer() sets the ticks the currrent room's
animation() function will not be called.
2018-01-23 00:29:34 +00:00
Joseph-Eugene Winzer 30c5c85243 SUPERNOVA: Refactors event loop 2018-01-23 00:00:12 +00:00
Joseph-Eugene Winzer 36263aaa0b SUPERNOVA: Fixes font rendering 2018-01-23 00:00:11 +00:00
Joseph-Eugene Winzer e0aa700dac SUPERNOVA: Renames charcterWidth() to textWidth() 2018-01-23 00:00:11 +00:00
Joseph-Eugene Winzer 40c609c40b SUPERNOVA: Adds debugging code for rendering available sections 2018-01-23 00:00:11 +00:00
Joseph-Eugene Winzer c903ede023 SUPERNOVA: Fixes renderRoom() by limiting the section range 2018-01-22 23:54:42 +00:00
Joseph-Eugene Winzer b959453b39 SUPERNOVA: removeMessage() now restores the screen on destruction 2018-01-22 23:54:42 +00:00