Commit Graph

9 Commits

Author SHA1 Message Date
Guus Sliepen d7d6dc37bc Flatten Graphics object.
All functions and variables are now defined in graphics.cpp.
Before, the functions would be compiled again and again for every source
file, now it is compiled only once, halving the size of the stripped
starfighter binary.
2011-08-26 23:53:46 +02:00
Guus Sliepen 878e559b6a Flatten objects which only contain static functions.
There is no reason to have objects which contain only static functions
and no variables. These functions have been moved to the global
namespace and are now defined in .cpp files. The math functions are very
small and have been put in math.h and made static inline.
2011-08-26 23:27:16 +02:00
Guus Sliepen 931d110692 Fix "random" behaviour of sound, music and fullscreen options.
The state of these options was not only stored in the global config
file, but also in each saved game. When loading a game or clicking on
"continue game" from the title screen, the state of these options would
also be loaded from the save game file. If this changed the state of
sound and music, this would only take effect when starting a mission or
going back to the title screen. If it changed the state of the
fullscreen option, it would never toggle the state, but would
desynchronise the actual state of the window and the fullscreen option.

This is now fixed by moving these options from the currentGame variable
to the engine variable, where they are not in danger of being
overwritten.
2011-08-26 22:48:52 +02:00
Guus Sliepen 6ea4744832 Bring sanity to the header files.
Most .h files were not used to declare the externally visible variables
and functions of the .cpp files, but only to #include things and declare
things that were needed by that .cpp file itself. This resulted in a lot
of duplication.

Now the .h files only declare what is externally visible from the
corresponding .cpp files. Starfighter.h includes all the other .h files,
and all .cpp files only #include "Starfighter.h". Functions and
variables that were not used outside the .cpp file that contained them
were marked static. Variables defined in .h files were moved to the
appropriate .cpp files.
2011-08-26 21:29:04 +02:00
Guus Sliepen 277d34dabd Turn signed chars into bools where appropriate. 2011-08-26 16:14:58 +02:00
Guus Sliepen f46bbcef69 Remove more busyloops. 2011-08-24 20:10:21 +02:00
Guus Sliepen bb9ba4da28 Remove unused FPS display code. 2011-08-24 20:04:15 +02:00
Guus Sliepen fc9dac5195 Strict 60 Hz update rate without busyloops. 2011-08-24 20:02:35 +02:00
Guus Sliepen 09b007411c Import of version 1.1 minus music, sound and graphics. 2011-08-24 14:14:44 +02:00