[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/*.user
|
||||||
Win32/Unuk/Unuk.ncb
|
Win32/Unuk/Unuk.ncb
|
||||||
Win32/Unuk/Unuk.suo
|
Win32/Unuk/Unuk.suo
|
||||||
|
Bin/*.dll
|
||||||
*.o
|
*.o
|
||||||
*.exe
|
*.exe
|
||||||
*log
|
*log
|
||||||
|
@ -54,15 +54,26 @@ gameNavVal_t Game::Run(const string savegameIDArg) {
|
|||||||
|
|
||||||
_gameRunning = true;
|
_gameRunning = true;
|
||||||
while(_gameRunning) {
|
while(_gameRunning) {
|
||||||
|
bool stillRunning = true;
|
||||||
|
|
||||||
updateTimer.Start();
|
updateTimer.Start();
|
||||||
while((int)SDL_GetTicks() > nextGameTick) {
|
while((int)SDL_GetTicks() > nextGameTick) {
|
||||||
HandleInput();
|
HandleInput();
|
||||||
|
if (!_gameRunning) {
|
||||||
|
stillRunning = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
UpdateGame();
|
UpdateGame();
|
||||||
|
|
||||||
nextGameTick += SKIP_TICKS;
|
nextGameTick += SKIP_TICKS;
|
||||||
}
|
}
|
||||||
updateTimer.Pause();
|
updateTimer.Pause();
|
||||||
|
|
||||||
|
if (!stillRunning) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
renderTimer.Start();
|
renderTimer.Start();
|
||||||
Render();
|
Render();
|
||||||
renderTimer.Pause();
|
renderTimer.Pause();
|
||||||
|
@ -11,8 +11,10 @@ Text::Text(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Text::~Text(void) {
|
Text::~Text(void) {
|
||||||
assert(_text != NULL);
|
if (_text) {
|
||||||
SDL_FreeSurface(_text);
|
SDL_FreeSurface(_text);
|
||||||
|
_text = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Text::LoadFonts(void) {
|
void Text::LoadFonts(void) {
|
||||||
|
Loading…
Reference in New Issue
Block a user