More cleanup.

This commit is contained in:
onpon4 2016-11-25 18:21:31 -05:00
parent 60ed5cbd65
commit d336bb2c83
49 changed files with 156 additions and 11 deletions

View File

@ -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

View File

@ -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"

View File

@ -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];

View File

@ -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();

View File

@ -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);

View File

@ -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];

View File

@ -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();

View File

@ -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.
*/

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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))

View File

@ -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()

View File

@ -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];

View File

@ -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;

View File

@ -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.

View File

@ -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);

View File

@ -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;

View File

@ -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();

View File

@ -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];

View File

@ -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];

View File

@ -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++)

View File

@ -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);

View File

@ -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];

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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];
/*

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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();

View File

@ -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);

View File

@ -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();

View File

@ -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];
/*

View File

@ -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();

View File

@ -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;

View File

@ -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