[FIX] Fixed exception when quitting.
This commit is contained in:
parent
0e11ecba87
commit
73210e0451
1
.gitignore
vendored
1
.gitignore
vendored
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user