aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game.c9
-rw-r--r--src/game.h1
-rw-r--r--src/main.c3
3 files changed, 11 insertions, 2 deletions
diff --git a/src/game.c b/src/game.c
index bf301c4..a68144e 100644
--- a/src/game.c
+++ b/src/game.c
@@ -291,6 +291,15 @@ Game *game_new(int width, int height, int disable_vbos, int disable_fbos, int di
}
+void game_shutdown(Game *game) {
+
+ render_shutdown(game->render);
+ audio_shutdown(game->audio);
+
+ free(game);
+
+}
+
/* Check if the player needs to be moved to another room */
void game_check_handoff(Game *game) {
diff --git a/src/game.h b/src/game.h
index 1b5d956..5cb27b9 100644
--- a/src/game.h
+++ b/src/game.h
@@ -22,6 +22,7 @@
extern void game_check_handoff(Game *game);
extern Game *game_new(int width, int height, int disable_vbos, int disable_fbos, int disable_shaders);
+extern void game_shutdown(Game *game);
extern Room *game_find_room(Game *game, int rx, int ry, int rz);
extern void game_pause(Game *game);
diff --git a/src/main.c b/src/main.c
index 3b644dc..c17a42e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -237,8 +237,7 @@ int main(int argc, char *argv[]) {
}
- render_shutdown(game->render);
- SDL_CloseAudio();
+ game_shutdown(game);
SDL_Quit();
//printf("\n");