diff --git a/.gitignore b/.gitignore index 34fd20c..556537f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ Win32/Unuk/Unuk/Release Win32/Unuk/Unuk/*.user Win32/Unuk/Unuk.ncb Win32/Unuk/Unuk.suo +Bin/*.dll *.o *.exe *log diff --git a/src/Unuk/Game.cpp b/src/Unuk/Game.cpp index affa204..fade9e9 100644 --- a/src/Unuk/Game.cpp +++ b/src/Unuk/Game.cpp @@ -54,15 +54,26 @@ gameNavVal_t Game::Run(const string savegameIDArg) { _gameRunning = true; while(_gameRunning) { + bool stillRunning = true; + updateTimer.Start(); while((int)SDL_GetTicks() > nextGameTick) { HandleInput(); - UpdateGame(); + if (!_gameRunning) { + stillRunning = false; + break; + } + + UpdateGame(); nextGameTick += SKIP_TICKS; } updateTimer.Pause(); + if (!stillRunning) { + break; + } + renderTimer.Start(); Render(); renderTimer.Pause(); diff --git a/src/libUnuk/Text.cpp b/src/libUnuk/Text.cpp index 47b1556..fad9cd6 100644 --- a/src/libUnuk/Text.cpp +++ b/src/libUnuk/Text.cpp @@ -11,8 +11,10 @@ Text::Text(void) { } Text::~Text(void) { - assert(_text != NULL); - SDL_FreeSurface(_text); + if (_text) { + SDL_FreeSurface(_text); + _text = NULL; + } } void Text::LoadFonts(void) {