aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-06-22 09:16:36 +0000
committertaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-06-22 09:16:36 +0000
commit726c1ae80037ad566c0548b60c779c8ee8dfad16 (patch)
treed20eeeab74319ab9c744c5b973be7f3141c0ed0e /src
parent64da6785055883485f3a5387f5ab88939df21c1f (diff)
Add game_shutdown()
git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@106 84d2e878-0bd5-11dd-ad15-13eda11d74c5
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");