Slightly better cleanup and un-screwing of display buffers

This commit is contained in:
stevenhowes
2021-04-03 22:36:51 +01:00
parent 151a4d859c
commit 4f861753ce
2 changed files with 15 additions and 0 deletions
Binary file not shown.
+15
View File
@@ -29,6 +29,7 @@ extern int screen;
extern int game1_tick();
extern void game1_setup();
extern void screen_nobuffer();
int game_hitbox_collide(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2)
{
@@ -41,10 +42,24 @@ int game_hitbox_collide(int x1, int y1, int w1, int h1, int x2, int y2, int w2,
return 0;
}
void exitfunc () {
screen_flipbuffer();
screen_clear();
screen_flipbuffer();
screen_clear();
screen_nobuffer();
free(buffer);
free(fontbuffer);
free(tilebuffer);
}
int main(int argc, char *argv[])
{
int lastoutcome = 1;
int outcome = 0;
atexit(exitfunc);
sound_on();
// Set initial display mode