Finished C conversion! Hoorah!

Note: Autoconf files must be cleaned up and regenerated to ensure
proper compilation.
This commit is contained in:
Julie Marchant 2019-05-23 11:02:48 -04:00
parent ed0cc2ec97
commit 908a6059ac
30 changed files with 60 additions and 36 deletions

View File

@ -9,12 +9,11 @@
AC_PREREQ([2.69]) AC_PREREQ([2.69])
AC_INIT([Project: Starfighter], [1.8-dev], [onpon4@riseup.net], [starfighter]) AC_INIT([Project: Starfighter], [1.8-dev], [onpon4@riseup.net], [starfighter])
AM_INIT_AUTOMAKE([foreign -Wall -Werror]) AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AC_CONFIG_SRCDIR([src/Starfighter.cpp]) AC_CONFIG_SRCDIR([src/Starfighter.c])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
# Checks for programs. # Checks for programs.
AC_PROG_CXX
AC_PROG_CC AC_PROG_CC
AC_PROG_INSTALL AC_PROG_INSTALL

View File

@ -6,60 +6,61 @@
bin_PROGRAMS = starfighter bin_PROGRAMS = starfighter
starfighter_CPPFLAGS = $(STARFIGHTER_CFLAGS) -DDATADIR=\"$(pkgdatadir)\" -Wall starfighter_CPPFLAGS = $(STARFIGHTER_CFLAGS) -DDATADIR=\"$(pkgdatadir)\" -Wall
starfighter_CXXFLAGS = $(SDL_CFLAGS) starfighter_CFLAGS = $(SDL_CFLAGS) -lm
starfighter_LDADD = $(SDL_LIBS) starfighter_LDADD = $(SDL_LIBS)
starfighter_SOURCES = \ starfighter_SOURCES = \
Starfighter.cpp \ Starfighter.c \
alien.cpp \ alien.c \
alien.h \ alien.h \
audio.cpp \ audio.c \
audio.h \ audio.h \
bullet.cpp \ bullet.c \
bullet.h \ bullet.h \
cargo.cpp \ cargo.c \
cargo.h \ cargo.h \
collectable.cpp \ collectable.c \
collectable.h \ collectable.h \
colors.cpp \ colors.c \
colors.h \ colors.h \
cutscene.cpp \ cutscene.c \
cutscene.h \ cutscene.h \
defs.c \
defs.h \ defs.h \
engine.cpp \ engine.c \
engine.h \ engine.h \
event.cpp \ event.c \
event.h \ event.h \
explosion.cpp \ explosion.c \
explosion.h \ explosion.h \
game.cpp \ game.c \
game.h \ game.h \
gfx.cpp \ gfx.c \
gfx.h \ gfx.h \
info.cpp \ info.c \
info.h \ info.h \
intermission.cpp \ intermission.c \
intermission.h \ intermission.h \
mission.cpp \ mission.c \
mission.h \ mission.h \
player.cpp \ player.c \
player.h \ player.h \
radio.cpp \ radio.c \
radio.h \ radio.h \
renderer.cpp \ renderer.c \
renderer.h \ renderer.h \
save.cpp \ save.c \
save.h \ save.h \
screen.cpp \ screen.c \
screen.h \ screen.h \
ship.cpp \ ship.c \
ship.h \ ship.h \
shop.cpp \ shop.c \
shop.h \ shop.h \
structs.h \ structs.h \
title.cpp \ title.c \
title.h \ title.h \
weapons.cpp \ weapons.c \
weapons.h \ weapons.h \
window.cpp \ window.c \
window.h window.h

26
src/defs.c Normal file
View File

@ -0,0 +1,26 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012 Guus Sliepen
Copyright (C) 2012, 2015-2019 Julie Marchant <onpon4@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 3
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const char * const systemNames[] = {"Spirit", "Eyananth", "Mordor", "Sol"};
const char * const systemBackground[] = {
"gfx/spirit.jpg", "gfx/eyananth.jpg", "gfx/mordor.jpg", "gfx/sol.jpg"
};
const int rate2reload[6] = {15, 15, 13, 11, 9, 7};

View File

@ -758,12 +758,10 @@ enum {
DIFFICULTY_MAX DIFFICULTY_MAX
}; };
const char * const systemNames[] = {"Spirit", "Eyananth", "Mordor", "Sol"}; extern const char * const systemNames[];
const char * const systemBackground[] = { extern const char * const systemBackground[];
"gfx/spirit.jpg", "gfx/eyananth.jpg", "gfx/mordor.jpg", "gfx/sol.jpg"
};
const int rate2reload[6] = {15, 15, 13, 11, 9, 7}; extern const int rate2reload[6];
#endif #endif

View File

@ -639,8 +639,8 @@ static int intermission_showSystem(float pos, int selectable)
gfx_drawCircle(screen->w / 2, h / 2, i, screen, darkGrey); gfx_drawCircle(screen->w / 2, h / 2, i, screen, darkGrey);
r.x = int(screen->w / 2 + (sinf(pos) * i)); r.x = (int)(screen->w / 2 + (sinf(pos) * i));
r.y = int(h / 2 + (cosf(pos) * i)); r.y = (int)(h / 2 + (cosf(pos) * i));
r.w = h / 50; r.w = h / 50;
r.h = h / 50; r.h = h / 50;