Move isOnScreen() to explosions.cpp.
It is only used there, and can then be turned into a static function.
This commit is contained in:
parent
d7d6dc37bc
commit
5629a2ad73
|
@ -58,6 +58,11 @@ void addEngine(object *craft)
|
|||
addExplosion(x, y, E_TINY_EXPLOSION);
|
||||
}
|
||||
|
||||
static bool isOnScreen(int x, int y, int w, int h)
|
||||
{
|
||||
return (x + w > 0) && (x < 800) && (y + h > 0) && (y < 600);
|
||||
}
|
||||
|
||||
/*
|
||||
Loops through active explosions and decrements their think time.
|
||||
If their thinktime is divisable by 5, then the frame is changed to
|
||||
|
|
|
@ -737,11 +737,3 @@ void doStarfield()
|
|||
SDL_UnlockSurface(screen);
|
||||
}
|
||||
}
|
||||
|
||||
int isOnScreen(int x, int y, int w, int h)
|
||||
{
|
||||
if ((x + w > 0) && (x < 800) && (y + h > 0) && (y < 600))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -79,4 +79,3 @@ extern void freeGraphics();
|
|||
|
||||
extern SDL_Surface *loadImage(const char *filename);
|
||||
extern void doStarfield();
|
||||
extern int isOnScreen(int x, int y, int w, int h);
|
||||
|
|
Loading…
Reference in New Issue