X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;ds=sidebyside;f=Source%2FGameInitDispose.cpp;h=2922eaf29e312c4b989eb3580d522f1790cb4397;hb=8b8230c564e1f0063b381e77bf6222af9f2e678d;hp=37593a1ab524adfe2eae7ac6ec6ef4bafdf4df37;hpb=cd451341c5ee01374268559885871ca9d454cbd0;p=lugaru.git diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 37593a1..2922eaf 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -105,15 +105,15 @@ void Dispose() void Game::newGame() { text = new Text(); + textmono = new Text(); skybox = new SkyBox(); } void Game::deleteGame() { - if (skybox) - delete skybox; - if (text) - delete text; + delete skybox; + delete text; + delete textmono; glDeleteTextures(1, &screentexture); glDeleteTextures(1, &screentexture2); @@ -538,6 +538,8 @@ void Game::InitGame() texdetail = 1; text->LoadFontTexture("Textures/Font.png"); text->BuildFont(); + textmono->LoadFontTexture("Textures/FontMono.png"); + textmono->BuildFont(); texdetail = temptexdetail; FadeLoadingScreen(10); @@ -588,7 +590,7 @@ void Game::InitGame() mainmenu = 1; stillloading = 0; - firstload = 0; + firstLoadDone = false; newdetail = detail; newscreenwidth = screenwidth; @@ -618,10 +620,11 @@ void Game::LoadScreenTexture() } //TODO: move LoadStuff() closer to GameTick.cpp to get rid of various vars shared in Game.hpp +/* Loads models and textures which only needs to be loaded once */ void Game::LoadStuff() { - static float temptexdetail; - static float viewdistdetail; + float temptexdetail; + float viewdistdetail; float megascale = 1; LOGFUNC; @@ -638,6 +641,8 @@ void Game::LoadStuff() texdetail = 1; text->LoadFontTexture("Textures/Font.png"); text->BuildFont(); + textmono->LoadFontTexture("Textures/FontMono.png"); + textmono->BuildFont(); texdetail = temptexdetail; viewdistdetail = 2; @@ -773,8 +778,6 @@ void Game::LoadStuff() gameon = 1; mainmenu = 0; - firstload = 0; - //Fix knife stab, too lazy to do it manually XYZ moveamount; moveamount = 0; @@ -846,5 +849,6 @@ void Game::LoadStuff() changedelay = 1; visibleloading = false; + firstLoadDone = true; }