Misc clean up.

This commit is contained in:
Steve 2016-04-02 16:38:26 +01:00
parent c44d605b13
commit 86ed4678e2
3 changed files with 8 additions and 7 deletions

View File

@ -27,7 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern float mod(float n, float x); extern float mod(float n, float x);
extern void blitRotated(SDL_Texture *texture, int x, int y, float angle); 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 SDL_Texture *getTexture(char *filename);
extern void addDebrisFire(int x, int y); extern void addDebrisFire(int x, int y);
extern void *resize(void *array, int oldSize, int newSize); extern void *resize(void *array, int oldSize, int newSize);

View File

@ -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 blitRotated(SDL_Texture *texture, int x, int y, float angle);
extern void doFighter(void); extern void doFighter(void);
extern void doCapitalShip(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 doRope(Entity *e);
extern void drawRope(Entity *e); extern void drawRope(Entity *e);
extern void cutRope(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 removeFromQuadtree(Entity *e, Quadtree *root);
extern void addToQuadtree(Entity *e, Quadtree *root); extern void addToQuadtree(Entity *e, Quadtree *root);
extern void updateCapitalShipComponentProperties(Entity *parent, long flags); 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 void *resize(void *array, int oldSize, int newSize);
extern int isOnBattleScreen(int x, int y, int w, int h); extern int isOnBattleScreen(int x, int y, int w, int h);

View File

@ -101,7 +101,7 @@ static void initFighters(void)
for (i = 0 ; i < NUM_FIGHTERS ; i++) 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].y = SCREEN_HEIGHT + (rand() % SCREEN_HEIGHT);
fighters[i].texture = getTexture(fighterTextures[rand() % numTextures]); fighters[i].texture = getTexture(fighterTextures[rand() % numTextures]);
fighters[i].dy = -(1 + rand() % 3); fighters[i].dy = -(1 + rand() % 3);
@ -133,7 +133,9 @@ static void logic(void)
static void doFighters(void) static void doFighters(void)
{ {
int i; int i, numTextures;
numTextures = sizeof(fighterTextures) / sizeof(char*);
for (i = 0 ; i < NUM_FIGHTERS ; i++) for (i = 0 ; i < NUM_FIGHTERS ; i++)
{ {
@ -145,8 +147,10 @@ static void doFighters(void)
if (fighters[i].y <= -64) 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].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) static void quit(void)
{ {
exit(1); exit(0);
} }