More cleanup.
This commit is contained in:
parent
60ed5cbd65
commit
d336bb2c83
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "CoreFoundation/CoreFoundation.h"
|
||||
#endif
|
||||
|
|
|
@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -32,9 +31,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "SDL_image.h"
|
||||
#include "SDL_mixer.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
#include "alien.h"
|
||||
#include "audio.h"
|
||||
#include "bullet.h"
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef ALIEN_H
|
||||
#define ALIEN_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
extern Object alien_defs[CD_MAX];
|
||||
extern Object aliens[ALIEN_MAX];
|
||||
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef AUDIO_H
|
||||
#define AUDIO_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
void audio_loadSounds();
|
||||
void audio_playSound(int sid, float x, float y);
|
||||
void audio_haltMusic();
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef BULLETS_H
|
||||
#define BULLETS_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
void bullet_add(Object *theWeapon, Object *attacker, int y, int dy);
|
||||
Object *bullet_getTarget(Object *bullet);
|
||||
int bullet_collision(Object *bullet, Object *ship);
|
||||
|
|
|
@ -18,6 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
#include "radio.h"
|
||||
|
||||
Object cargo[MAX_CARGO];
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef _CARGO_H_
|
||||
#define _CARGO_H_
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
extern Object cargo[MAX_CARGO];
|
||||
|
||||
void cargo_init();
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
/*
|
||||
Create a new collectable item based on supplied arguments.
|
||||
*/
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef COLLECTABLE_H
|
||||
#define COLLECTABLE_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
void collectable_add(float x, float y, int type, int value, int life);
|
||||
int collectable_collision(Collectable *collectable, Object *ship);
|
||||
void collectable_explode(Collectable *collectable);
|
||||
|
|
|
@ -21,6 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
Uint32 red;
|
||||
Uint32 darkRed;
|
||||
Uint32 yellow;
|
||||
|
|
|
@ -20,6 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef COLORS_H
|
||||
#define COLORS_H
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
extern Uint32 red;
|
||||
extern Uint32 darkRed;
|
||||
extern Uint32 yellow;
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
typedef struct Message_ {
|
||||
|
||||
int face;
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef CUTSCENE_H
|
||||
#define CUTSCENE_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
void cutscene_init(int scene);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,8 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef DEFS_H
|
||||
#define DEFS_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
// Macros
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
|
|
@ -19,11 +19,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
Engine engine;
|
||||
|
||||
void engine_init()
|
||||
|
|
|
@ -18,6 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
#include "radio.h"
|
||||
|
||||
static Event events[MAX_EVENTS];
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef EVENT_H
|
||||
#define EVENT_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
typedef struct Event_ {
|
||||
|
||||
int time;
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
/*
|
||||
Create a new explosion based on supplied parameters.
|
||||
The "type" will actually be used as an explosion frame check.
|
||||
|
|
|
@ -17,8 +17,11 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef EXPLOSIONS_H
|
||||
#define EXPLOSIONS_H
|
||||
#ifndef EXPLOSION_H
|
||||
#define EXPLOSION_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
void explosion_add(float x, float y, int type);
|
||||
void explosion_addEngine(Object *craft);
|
||||
|
|
|
@ -18,6 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
#include "radio.h"
|
||||
|
||||
Game game;
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef GAME_H
|
||||
#define GAME_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
extern Game game;
|
||||
|
||||
void game_init();
|
||||
|
|
|
@ -21,6 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
SDL_Surface *gfx_background;
|
||||
SDL_Surface *gfx_sprites[SP_MAX];
|
||||
SDL_Surface *gfx_faceSprites[FS_MAX];
|
||||
|
|
|
@ -20,7 +20,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef GFX_H
|
||||
#define GFX_H
|
||||
|
||||
#include "Starfighter.h"
|
||||
#include "SDL.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
extern SDL_Surface *gfx_background;
|
||||
extern SDL_Surface *gfx_sprites[SP_MAX];
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
void info_clearLines()
|
||||
{
|
||||
for (int i = 0 ; i < MAX_INFOLINES ; i++)
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef INFO_H
|
||||
#define INFO_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
void info_clearLines();
|
||||
void info_copyLine(int a, int b);
|
||||
void info_setLine(const char *in, int color);
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
// XXX: Magic number
|
||||
Planet intermission_planets[10];
|
||||
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef INTERMISSION_H
|
||||
#define INTERMISSION_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
extern Planet intermission_planets[10];
|
||||
|
||||
void intermission_initPlanets(int system);
|
||||
|
|
|
@ -18,6 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
#include "radio.h"
|
||||
|
||||
Mission mission;
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef MISSION_H
|
||||
#define MISSION_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
extern Mission mission;
|
||||
|
||||
void mission_set(int mission);
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
Object player;
|
||||
int player_chargerFired = 0;
|
||||
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef PLAYER_H
|
||||
#define PLAYER_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
extern Object player;
|
||||
extern int player_chargerFired;
|
||||
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
/*
|
||||
Sets a radio message that appears at the top of the screen. Used for
|
||||
script events, etc. We send a message priority too, since we don't want
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef RADIO_H
|
||||
#define RADIO_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
void radio_setMessage(int face, const char *in, int priority);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "SDL.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
#include "screen.h"
|
||||
|
||||
SDL_Renderer *renderer;
|
||||
|
|
|
@ -20,6 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef RENDERER_H
|
||||
#define RENDERER_H
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
extern SDL_Renderer *renderer;
|
||||
extern SDL_Texture *renderer_texture;
|
||||
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
static char saveSlot[10][25];
|
||||
|
||||
/*
|
||||
|
|
|
@ -20,6 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef SAVE_H
|
||||
#define SAVE_H
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
int save_initSlots();
|
||||
int save_load(int slot);
|
||||
void save(int slot);
|
||||
|
|
|
@ -21,9 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "SDL.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
#include "engine.h"
|
||||
#include "gfx.h"
|
||||
#include "structs.h"
|
||||
|
||||
SDL_Surface *screen;
|
||||
bRect *screen_bufferHead;
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef SCREEN_H
|
||||
#define SCREEN_H
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
extern SDL_Surface *screen;
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
int ship_collision(Object *ship, Object *otherShip)
|
||||
{
|
||||
float x0 = ship->x;
|
||||
|
|
|
@ -18,6 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef SHIP_H
|
||||
#define SHIP_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
int ship_collision(Object *ship, Object *otherShip);
|
||||
void ship_fireBullet(Object *ship, int weaponType);
|
||||
void ship_fireRay(Object *ship);
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
static ShopItem shopItems[SHOP_MAX];
|
||||
static int shopSelectedItem;
|
||||
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef SHOP_H
|
||||
#define SHOP_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
void shop_init();
|
||||
void shop_show();
|
||||
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
static int showGameMenu(int continueSaveSlot)
|
||||
{
|
||||
screen_blitText(TS_START_NEW_GAME);
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef TITLE_H
|
||||
#define TITLE_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
int title_show();
|
||||
void title_showCredits();
|
||||
|
||||
|
|
|
@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "Starfighter.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
Object weapons[W_MAX];
|
||||
|
||||
/*
|
||||
|
|
|
@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef WEAPONS_H
|
||||
#define WEAPONS_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
extern Object weapons[W_MAX];
|
||||
|
||||
void weapons_init();
|
||||
|
|
|
@ -20,4 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "SDL.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
SDL_Window *window;
|
||||
|
|
|
@ -20,6 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef WINDOW_H
|
||||
#define WINDOW_H
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
extern SDL_Window *window;
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue