Commit Graph

21 Commits

Author SHA1 Message Date
onpon4 b66bb4bf98 Replaced the struct dump "save format" with a proper save format.
This format is actually portable, and there isn't a risk of it just
breaking any time the format is changed, since the version number
can be read independently of everything else.
2016-01-09 19:58:07 -05:00
onpon4 ac844d8d54 Removed the "planets" data files.
This is the last of the data files I wanted to remove.

This commit also includes some dialog changes.

I copied some of this code into a comment elsewhere, because I want
to use it as a reference when creating a new save format.
2016-01-08 21:33:40 -05:00
onpon4 409a2efe07 Updated copyright notices.
Apparently they've all been modified this year now. The earliest
modification date is alien.h, at January 2.
2016-01-07 21:32:40 -05:00
onpon4 822ff849e4 Removed the very last of the image-related magic numbers (in source code).
The only magic numbers left now are related to positioning, image
sizing, and the remaining "data" files (the "planets" and "brief" ones).
At least, I'm pretty sure that's the case.
2016-01-06 20:35:37 -05:00
onpon4 4be080225b Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.

The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.

The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.

There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-05 22:12:29 -05:00
onpon4 26add18109 Repositioned the Starfighter logo and the menu.
This places the logo at 1/3 of the way down the screen, rather than
half of the way down, and the menu ends up about in the middle of
the screen now. This doesn't really matter as it is, but it should
help some with lower resolutions.
2016-01-03 18:19:20 -05:00
onpon4 ce94477b70 More cleanup. 2016-01-02 16:59:48 -05:00
onpon4 651a7f55fb Did some more cleanup, removing more "shape" magic numbers. 2015-12-31 10:47:27 -05:00
onpon4 67d464433d Removed the second "drawString" function.
It wasn't very useful. All it did was offer the option to center
text and take away the option to wrap text. I've moved the text
centering option to gfx_renderString and replaced all uses of this
function with that function.
2015-11-06 10:12:57 -05:00
onpon4 0f10c6d5c7 Converted the three "collision" functions to four differently-named ones.
The fourth is simply a duplicate of ship_collision for bullets. A
bit redundant, but I figure it's clearer of a definition. Besides,
this opens up the door to possibly making bullets a different struct
type in the future, if that turns out to be desirable.
2015-09-25 16:28:09 -04:00
onpon4 f306825636 Removed the "nomove" and "nofire" cheats.
I honestly don't understand why these cheats were here. Preventing
enemies from moving breaks some missions and doesn't do anything
useful, and preventing enemies from firing is basically no better
than the invincibility cheat (and might even be worse, if it applies
to Sid; I didn't check).
2015-05-20 19:41:43 -04:00
onpon4 0e1cd4b86f Changed timeTaken from int to long int.
This guarantees that it will be able to store at least about 68 years.
2015-03-31 15:23:17 -04:00
onpon4 1567595def Changed all the various unnecessarily specifically defined types to "int".
Most of these were defining various integers as char types, probably
in the naive belief that this is necessarily good because it uses less
RAM. There were also several unnecessary unsigned ints, though.
These have all been changed to just "int", so the compiler can decide
exactly what type to use.
2015-03-24 18:51:12 -04:00
onpon4 1f2ef8ac50 Dedicated autosave slot + much improved menu code.
I found it kind of odd to be able to manually save to the autosave
slot, *and* have no reliable way to even know what the autosave
slot is. I noticed that it's an actual problem when my brothers
played Starfighter; one of them used an autosave slot, and the
other unwittingly ended up erasing the first one's save because of
this. To fix this, I have replaced the behavior of allowing the
player to define a slot as autosave, with a dedicated autosave
slot.

While I was there, I had no choice but to vastly improve on this
game's *atrocious* menu system. Granted, I didn't do much more
than replace the magic numbers with enums, but it makes the code
much more clear and more easy to edit.
2015-03-02 23:32:48 -05:00
onpon4 9959c47f98 Updated copyright notices on all files based on git-blame. 2015-03-01 15:37:32 -05:00
onpon4 26a82a6385 Some code cleanup.
Fixed some cases where I put spaces instead of tabs earlier, and
changed all cases of "weapons[0]" with "weapons[W_PLAYER_WEAPON]".
2015-02-28 08:15:53 -05:00
onpon4 01b5b73dba Fixed defaulting to "easy" difficulty. 2015-02-27 19:52:55 -05:00
onpon4 182ea70ba1 Removed gameplay option, have different max shield based on difficulty 2015-02-26 20:52:20 -05:00
onpon4 f385c9448e Upgraded to GPLv3. 2015-02-26 11:20:36 -05:00
Guus Sliepen 593ea01386 Initial conversion to SDL2. 2013-09-30 16:52:43 +02:00
Guus Sliepen bd4a449e10 Rename code/ to src/. 2013-07-11 14:24:37 +02:00