diff --git a/src/alien.cpp b/src/alien.cpp index 0c7d420..20720ab 100644 --- a/src/alien.cpp +++ b/src/alien.cpp @@ -17,8 +17,28 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "Starfighter.h" +#include + +#include "SDL.h" + +#include "defs.h" +#include "structs.h" + +#include "alien.h" +#include "audio.h" +#include "bullet.h" +#include "cargo.h" +#include "collectable.h" +#include "engine.h" +#include "game.h" +#include "gfx.h" +#include "info.h" +#include "mission.h" +#include "player.h" #include "radio.h" +#include "screen.h" +#include "ship.h" +#include "weapons.h" Object alien_defs[CD_MAX]; Object aliens[ALIEN_MAX]; diff --git a/src/audio.cpp b/src/audio.cpp index 13ce057..60de365 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -17,7 +17,17 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "Starfighter.h" +#include + +#include "SDL.h" +#include "SDL_mixer.h" + +#include "defs.h" +#include "structs.h" + +#include "game.h" +#include "engine.h" +#include "screen.h" static Mix_Chunk *sound[SFX_MAX]; static Mix_Music *music = NULL; diff --git a/src/bullet.cpp b/src/bullet.cpp index 27039e3..7e7a8ea 100644 --- a/src/bullet.cpp +++ b/src/bullet.cpp @@ -17,7 +17,18 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "Starfighter.h" +#include + +#include "SDL.h" + +#include "defs.h" +#include "structs.h" + +#include "alien.h" +#include "engine.h" +#include "game.h" +#include "gfx.h" +#include "player.h" void bullet_add(Object *theWeapon, Object *attacker, int y, int dy) { diff --git a/src/cutscene.cpp b/src/cutscene.cpp index 0e13e4e..223f26f 100644 --- a/src/cutscene.cpp +++ b/src/cutscene.cpp @@ -373,13 +373,13 @@ void cutscene_init(int scene) SDL_Surface *face; - flushInput(); + player_flushInput(); while (1) { renderer_update(); screen_unBuffer(); - getPlayerInput(); + player_getInput(); game_doStars(); game_doExplosions(); diff --git a/src/engine.cpp b/src/engine.cpp index e1018b5..bccb1b4 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -125,7 +125,7 @@ void engine_showError(int errorId, const char *name) while (!engine.keyState[KEY_ALTFIRE]) { - getPlayerInput(); + player_getInput(); game_delayFrame(); } diff --git a/src/game.cpp b/src/game.cpp index e639ff3..970335f 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -2038,7 +2038,7 @@ pressed, the game automatically ends and goes back to the title screen */ static int game_checkPauseRequest() { - getPlayerInput(); + player_getInput(); if (engine.keyState[KEY_ESCAPE]) { @@ -2094,12 +2094,12 @@ static void game_showGameOver() renderer_update(); - flushInput(); + player_flushInput(); engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0; while (1) { - getPlayerInput(); + player_getInput(); if (engine.keyState[KEY_FIRE] || engine.keyState[KEY_ALTFIRE]) break; @@ -2127,7 +2127,7 @@ int game_mainLoop() mission_showStartScreen(); cargo_init(); - initPlayer(); + player_init(); aliens_init(); // specific for Phoebe being captured! @@ -2294,7 +2294,7 @@ int game_mainLoop() engine.keyState[KEY_FIRE] = 0; engine.keyState[KEY_ALTFIRE] = 0; - flushInput(); + player_flushInput(); while (engine.done != 1) { @@ -2320,7 +2320,7 @@ int game_mainLoop() { if ((!mission_checkFailed()) && (game.area != MISN_VENUS)) { - leaveSector(); + player_leaveSector(); if ((engine.done == 2) && (game.area != MISN_DORIM) && (game.area != MISN_SIVEDI)) @@ -2369,7 +2369,7 @@ int game_mainLoop() } else { - getPlayerInput(); + player_getInput(); } } else @@ -2384,7 +2384,7 @@ int game_mainLoop() } else { - getPlayerInput(); + player_getInput(); } screen_unBuffer(); @@ -2509,7 +2509,7 @@ int game_mainLoop() rtn = 0; } - exitPlayer(); + player_exit(); return rtn; } diff --git a/src/intermission.cpp b/src/intermission.cpp index 87451cb..8e7042f 100644 --- a/src/intermission.cpp +++ b/src/intermission.cpp @@ -199,7 +199,7 @@ Drives the cursor. Is used by some other screens too */ static void intermission_doCursor() { - getPlayerInput(); + player_getInput(); LIMIT(engine.cursor_x, 10, screen->w - 10 - gfx_sprites[SP_CURSOR]->w); LIMIT(engine.cursor_y, 10, screen->h - 10 - gfx_sprites[SP_CURSOR]->h); @@ -1346,7 +1346,7 @@ int intermission() engine.ssy = 0; intermission_setStatusLines(); - initShop(); + shop_init(); intermission_setPlanets(); SDL_Surface *statsSurface = gfx_createAlphaRect(600, 330, 0x00, 0x00, 0x99); @@ -1428,7 +1428,7 @@ int intermission() else player.shield = player.maxShield; - flushInput(); + player_flushInput(); engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0; engine.done = 0; @@ -1548,7 +1548,7 @@ int intermission() break; case 4: - showShop(); + shop_show(); break; case 5: diff --git a/src/mission.cpp b/src/mission.cpp index 9383ba6..89f591d 100644 --- a/src/mission.cpp +++ b/src/mission.cpp @@ -1092,7 +1092,7 @@ void mission_showStartScreen() renderer_update(); - flushInput(); + player_flushInput(); engine.done = 0; engine.keyState[KEY_FIRE] = 0; engine.keyState[KEY_ALTFIRE] = 0; @@ -1101,7 +1101,7 @@ void mission_showStartScreen() while (1) { game_delayFrame(); - getPlayerInput(); + player_getInput(); if ((engine.keyState[KEY_FIRE]) || (engine.keyState[KEY_ALTFIRE]) || (engine.keyState[KEY_ESCAPE])) break; @@ -1200,14 +1200,14 @@ void mission_showFinishedScreen() renderer_update(); - flushInput(); + player_flushInput(); engine.done = 0; engine.keyState[KEY_FIRE] = 0; while (1) { game_delayFrame(); - getPlayerInput(); + player_getInput(); if ((engine.keyState[KEY_FIRE])) break; } diff --git a/src/player.cpp b/src/player.cpp index 8ab5920..aa188c4 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -25,7 +25,7 @@ int player_chargerFired = 0; /* Initialises the player for a new game. */ -void initPlayer() +void player_init() { player.active = 1; player.x = screen->w / 2; @@ -93,7 +93,7 @@ void player_checkShockDamage(float x, float y) } } -void exitPlayer() +void player_exit() { player_chargerFired = 0; @@ -101,7 +101,7 @@ void exitPlayer() player.ammo[1] = 0; } -void flushInput() +void player_flushInput() { for (int i = 0; i < KEY_LAST; i++) engine.keyState[i] = 0; @@ -166,7 +166,7 @@ static enum keys mapkey(uint32_t code) { } } -void getPlayerInput() +void player_getInput() { while (SDL_PollEvent(&engine.event)) { @@ -292,7 +292,7 @@ void getPlayerInput() } -void leaveSector() +void player_leaveSector() { engine.keyState[KEY_UP] = 0; engine.keyState[KEY_DOWN] = 0; diff --git a/src/player.h b/src/player.h index 288967a..47777aa 100644 --- a/src/player.h +++ b/src/player.h @@ -23,12 +23,12 @@ along with this program. If not, see . extern Object player; extern int player_chargerFired; -extern void initPlayer(); +void player_init(); void player_setTarget(int index); void player_checkShockDamage(float x, float y); -extern void exitPlayer(); -extern void flushInput(); -extern void getPlayerInput(); -extern void leaveSector(); +void player_exit(); +void player_flushInput(); +void player_getInput(); +void player_leaveSector(); #endif diff --git a/src/shop.cpp b/src/shop.cpp index 1ff93ae..492b045 100644 --- a/src/shop.cpp +++ b/src/shop.cpp @@ -311,7 +311,7 @@ static void drawShop() } } -void initShop() +void shop_init() { /* ----------- Temporary Items ----------- */ @@ -1010,7 +1010,7 @@ static void sell(int i) save(0); } -void showShop() +void shop_show() { int icons = SHOP_MAX; diff --git a/src/shop.h b/src/shop.h index ab2d2e1..66dfcf9 100644 --- a/src/shop.h +++ b/src/shop.h @@ -20,7 +20,7 @@ along with this program. If not, see . #ifndef SHOP_H #define SHOP_H -extern void initShop(); -extern void showShop(); +void shop_init(); +void shop_show(); #endif diff --git a/src/title.cpp b/src/title.cpp index e5f00dc..32b5937 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -306,7 +306,7 @@ int title_show() screen_drawBackground(); engine.done = 0; - flushInput(); + player_flushInput(); engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0; audio_playMusic("music/walking_among_androids.ogg", 1); @@ -419,7 +419,7 @@ int title_show() } } - getPlayerInput(); + player_getInput(); if ((engine.keyState[KEY_FIRE] || engine.keyState[KEY_ALTFIRE])) { @@ -654,14 +654,14 @@ void title_showCredits() engine.keyState[KEY_ESCAPE] = 0; engine.keyState[KEY_FIRE] = 0; engine.keyState[KEY_ALTFIRE] = 0; - flushInput(); + player_flushInput(); while (1) { renderer_update(); screen_unBuffer(); - getPlayerInput(); + player_getInput(); if (engine.keyState[KEY_ESCAPE] || engine.keyState[KEY_FIRE] || engine.keyState[KEY_ALTFIRE]) break;