Commit Graph

11 Commits

Author SHA1 Message Date
Guus Sliepen da50d090f5 Fix whitespace issues. 2012-03-11 15:21:38 +01:00
Guus Sliepen f5eaa991cf Remove arrays with strings from defs.h.
These are now put in the .cpp files where they are used.
2012-03-11 15:19:25 +01:00
Guus Sliepen a45df516df Remove useless string initialisation code.
In many places strings were initialised with strcpy(string, "") right
before the string was overwritten by another function. In the few cases
where this really might have been useful, just use a static initialiser.
2012-03-11 15:16:19 +01:00
Guus Sliepen a1b3da48c1 Fix crash happening on 8 and 16 bit color displays.
Commit f51dbd0669 changed the way of generating
images of ships taking damage, and assumed that the SDL_Surfaces containing the
images were always 24 or 32 bpp. However, SDL will already have converted them
to the display format, so we need to properly handle 8 and 16 bpp as well.
2012-03-09 16:08:31 +01:00
Guus Sliepen f51dbd0669 Use a better way to create images of ships taking damage.
The old technique was to overlay a semi-transparent red rectangle over an
existing ship image, and then make 50% red pixels transparent. For some reason,
the transparency is not working correctly. Instead, don't overlay anything,
but set the red component of all non-black pixels to the maximum value.
2012-02-28 13:35:39 +01:00
Guus Sliepen 12d4fcaeab Don't use .wav anymore, use .ogg for all sound effects. 2011-08-28 13:32:34 +02:00
Guus Sliepen d6c17d176f Don't use .bmp and .gif anymore, use .png for all lossless graphics. 2011-08-27 16:18:29 +02:00
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 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 0910cd3db6 Add const to all char * function parameters. 2011-08-24 14:42:59 +02:00
Guus Sliepen 09b007411c Import of version 1.1 minus music, sound and graphics. 2011-08-24 14:14:44 +02:00