Move isOnScreen() to explosions.cpp.

It is only used there, and can then be turned into a static function.
This commit is contained in:
Guus Sliepen 2011-08-27 00:29:01 +02:00
parent d7d6dc37bc
commit 5629a2ad73
3 changed files with 5 additions and 9 deletions

View File

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

View File

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

View File

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