From 86ed4678e263b8894632afb1114478dcace32a46 Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 2 Apr 2016 16:38:26 +0100 Subject: [PATCH] Misc clean up. --- src/battle/debris.h | 1 - src/battle/entities.h | 2 -- src/game/title.c | 12 ++++++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/battle/debris.h b/src/battle/debris.h index c723129..ff84fe1 100644 --- a/src/battle/debris.h +++ b/src/battle/debris.h @@ -27,7 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern float mod(float n, float x); extern void blitRotated(SDL_Texture *texture, int x, int y, float angle); -extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2); extern SDL_Texture *getTexture(char *filename); extern void addDebrisFire(int x, int y); extern void *resize(void *array, int oldSize, int newSize); diff --git a/src/battle/entities.h b/src/battle/entities.h index 740df75..55f2b99 100644 --- a/src/battle/entities.h +++ b/src/battle/entities.h @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern void blitRotated(SDL_Texture *texture, int x, int y, float angle); extern void doFighter(void); extern void doCapitalShip(void); -extern Entity **getAllEntsWithin(int x, int y, int w, int h, Entity *ignore); extern void doRope(Entity *e); extern void drawRope(Entity *e); extern void cutRope(Entity *e); @@ -36,7 +35,6 @@ extern void drawShieldHitEffect(Entity *e); extern void removeFromQuadtree(Entity *e, Quadtree *root); extern void addToQuadtree(Entity *e, Quadtree *root); extern void updateCapitalShipComponentProperties(Entity *parent, long flags); -extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2); extern void *resize(void *array, int oldSize, int newSize); extern int isOnBattleScreen(int x, int y, int w, int h); diff --git a/src/game/title.c b/src/game/title.c index ec7c434..c9ebb99 100644 --- a/src/game/title.c +++ b/src/game/title.c @@ -101,7 +101,7 @@ static void initFighters(void) for (i = 0 ; i < NUM_FIGHTERS ; i++) { - fighters[i].x = rand() % (SCREEN_WIDTH - 64); + fighters[i].x = rand() % (SCREEN_WIDTH - 32); fighters[i].y = SCREEN_HEIGHT + (rand() % SCREEN_HEIGHT); fighters[i].texture = getTexture(fighterTextures[rand() % numTextures]); fighters[i].dy = -(1 + rand() % 3); @@ -133,7 +133,9 @@ static void logic(void) static void doFighters(void) { - int i; + int i, numTextures; + + numTextures = sizeof(fighterTextures) / sizeof(char*); for (i = 0 ; i < NUM_FIGHTERS ; i++) { @@ -145,8 +147,10 @@ static void doFighters(void) if (fighters[i].y <= -64) { - fighters[i].x = rand() % (SCREEN_WIDTH - 64); + fighters[i].x = rand() % (SCREEN_WIDTH - 32); fighters[i].y = SCREEN_HEIGHT + (rand() % SCREEN_HEIGHT); + fighters[i].texture = getTexture(fighterTextures[rand() % numTextures]); + fighters[i].dy = -(1 + rand() % 3); } } } @@ -251,5 +255,5 @@ static void returnFromOptions(void) static void quit(void) { - exit(1); + exit(0); }