From 1e6676c35ce4990981e8cda389ba39108437d66d Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Wed, 20 Jan 2016 08:42:46 -0500 Subject: WIP save/load --- src/ui.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/ui.cpp') diff --git a/src/ui.cpp b/src/ui.cpp index eecd7ef..2896102 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -67,6 +67,8 @@ unsigned int fadeIntensity = 0; bool inBattle = false; Mix_Chunk *battleStart; +Mix_Chunk *sanic; + namespace ui { /* @@ -119,9 +121,20 @@ namespace ui { DEBUG_printf("Initialized FreeType2.\n",NULL); #endif // DEBUG dialogClick = Mix_LoadWAV("assets/click.wav"); + battleStart = Mix_LoadWAV("assets/sounds/frig.wav"); + sanic = Mix_LoadWAV("assets/sounds/sanic.wav"); Mix_Volume(1,50); } + void destroyFonts(void){ + FT_Done_Face(ftf); + FT_Done_FreeType(ftl); + + Mix_FreeChunk(dialogClick); + Mix_FreeChunk(battleStart); + Mix_FreeChunk(sanic); + } + /* * Sets a new font family to use (*.ttf). */ @@ -740,8 +753,6 @@ DONE: break; case SDLK_LSHIFT: if(debug){ - Mix_Chunk *sanic; - sanic = Mix_LoadWAV("assets/sounds/sanic.wav"); Mix_PlayChannel(1,sanic,-1); player->speed = 4.0f; }else @@ -884,7 +895,6 @@ DONE: fadeEnable ^= true; fadeWhite = true; fadeFast = true; - battleStart = Mix_LoadWAV("assets/sounds/frig.wav"); Mix_PlayChannel(1,battleStart,0); } } -- cgit v1.2.3