X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameInitDispose.cpp;h=10ead719f16a8c7de63f44f8eb3277d3ee0606c4;hb=8a1a91c0a10a37799dc95d423f9db8dc5ff7b965;hp=f87d6eef92349de6e5c7fadf3c98e55f6a86a7f6;hpb=bbf8873b80baf3cb468ac12b3f62b0938320fef1;p=lugaru.git diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index f87d6ee..10ead71 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -101,8 +101,6 @@ void LOG(const std::string &fmt, ...) void Game::Dispose() { - int i,j; - LOGFUNC; if(endgame==2){ @@ -122,7 +120,7 @@ void Game::Dispose() // later in the shutdown process. --ryan. #if !PLATFORM_LINUX - for (i=0; i < sounds_count; ++i) + for (int i=0; i < sounds_count; ++i) { OPENAL_Sample_Free(samp[i]); } @@ -366,7 +364,7 @@ GLvoid Game::ReSizeGLScene(float fov, float pnear) void Game::LoadingScreen() { - static float loadprogress,minprogress,maxprogress; + static float loadprogress; static AbsoluteTime time = {0,0}; static AbsoluteTime frametime = {0,0}; AbsoluteTime currTime = UpTime (); @@ -383,7 +381,6 @@ void Game::LoadingScreen() if(multiplier>.05){ frametime = currTime; // reset for next time interval - float size=1; glLoadIdentity(); //Clear to black glClearColor(0,0,0,1); @@ -538,15 +535,6 @@ void Game::LoadingScreen() glDepthMask(1); //Text - /* - glEnable(GL_TEXTURE_2D); - static char string[256]=""; - sprintf (string, "LOADING... %d%",(int)loadprogress); - glColor4f(1,1,1,.2); - text.glPrint(280-280*loadprogress/100/2/4,125-125*loadprogress/100/2/4,string,1,1+loadprogress/100,640,480); - glColor4f(1.2-loadprogress/100,1.2-loadprogress/100,1.2-loadprogress/100,1); - text.glPrint(280,125,string,1,1,640,480); - */ if(flashamount>0){ if(flashamount>1)flashamount=1; @@ -591,9 +579,8 @@ void Game::LoadingScreen() void Game::FadeLoadingScreen(float howmuch) { - static float loadprogress,minprogress,maxprogress; + static float loadprogress; - float size=1; glLoadIdentity(); //Clear to black glClearColor(0,0,0,1); @@ -647,15 +634,6 @@ void Game::FadeLoadingScreen(float howmuch) glDisable(GL_BLEND); glDepthMask(1); //Text - /* - glEnable(GL_TEXTURE_2D); - static char string[256]=""; - sprintf (string, "LOADING... %d%",(int)loadprogress); - glColor4f(1,1,1,.2); - text.glPrint(280-280*loadprogress/100/2/4,125-125*loadprogress/100/2/4,string,1,1+loadprogress/100,640,480); - glColor4f(1.2-loadprogress/100,1.2-loadprogress/100,1.2-loadprogress/100,1); - text.glPrint(280,125,string,1,1,640,480); - */ swap_gl_buffers(); } @@ -686,8 +664,6 @@ void Game::InitGame() autocam=0; - int i,j; - numchallengelevels=14; accountactive=Account::loadFile(":Data:Users"); @@ -839,7 +815,7 @@ void Game::InitGame() loadAllSounds(); if(musictoggle) - emit_stream_np(stream_music3); + emit_stream_np(stream_menutheme); LoadTexture(":Data:Textures:Cursor.png",&cursortexture,0,1); @@ -853,14 +829,11 @@ void Game::InitGame() LoadTexture(":Data:Textures:Newgame.png",&Mainmenuitems[1],0,0); LoadTexture(":Data:Textures:Options.png",&Mainmenuitems[2],0,0); LoadTexture(":Data:Textures:Quit.png",&Mainmenuitems[3],0,0); - LoadTexture(":Data:Textures:World.png",&Mainmenuitems[7],0,0); LoadTexture(":Data:Textures:Eyelid.png",&Mainmenuitems[4],0,1); //LoadTexture(":Data:Textures:Eye.jpg",&Mainmenuitems[5],0,1); + //~ LoadTexture(":Data:Textures:World.png",&Mainmenuitems[7],0,0); // LoadCampaign will take care of that texdetail=temptexdetail; - loaddistrib=0; - anim=0; - FadeLoadingScreen(95); @@ -897,7 +870,7 @@ void Game::LoadStuff() { static float temptexdetail; static float viewdistdetail; - static int i,j,texsize; + static int i,j; float megascale =1; LOGFUNC; @@ -970,42 +943,42 @@ void Game::LoadStuff() LOG("Loading weapon data..."); - LoadTexture(":Data:Textures:knife.png",&weapons.knifetextureptr,0,1); - LoadTexture(":Data:Textures:bloodknife.png",&weapons.bloodknifetextureptr,0,1); - LoadTexture(":Data:Textures:lightbloodknife.png",&weapons.lightbloodknifetextureptr,0,1); - LoadTexture(":Data:Textures:sword.jpg",&weapons.swordtextureptr,1,0); - LoadTexture(":Data:Textures:Swordblood.jpg",&weapons.bloodswordtextureptr,1,0); - LoadTexture(":Data:Textures:Swordbloodlight.jpg",&weapons.lightbloodswordtextureptr,1,0); - LoadTexture(":Data:Textures:Staff.jpg",&weapons.stafftextureptr,1,0); - - weapons.throwingknifemodel.load((char *)":Data:Models:throwingknife.solid",1); - weapons.throwingknifemodel.Scale(.001,.001,.001); - //weapons.throwingknifemodel.Rotate(0,0,-90); - weapons.throwingknifemodel.Rotate(90,0,0); - weapons.throwingknifemodel.Rotate(0,90,0); - weapons.throwingknifemodel.flat=0; - weapons.throwingknifemodel.CalculateNormals(1); - //weapons.throwingknifemodel.ScaleNormals(-1,-1,-1); - - weapons.swordmodel.load((char *)":Data:Models:sword.solid",1); - weapons.swordmodel.Scale(.001,.001,.001); - //weapons.swordmodel.Rotate(0,0,-90); - weapons.swordmodel.Rotate(90,0,0); - weapons.swordmodel.Rotate(0,90,0); - weapons.swordmodel.Rotate(0,0,90); - weapons.swordmodel.flat=1; - weapons.swordmodel.CalculateNormals(1); - //weapons.swordmodel.ScaleNormals(-1,-1,-1); - - weapons.staffmodel.load((char *)":Data:Models:staff.solid",1); - weapons.staffmodel.Scale(.005,.005,.005); - //weapons.staffmodel.Rotate(0,0,-90); - weapons.staffmodel.Rotate(90,0,0); - weapons.staffmodel.Rotate(0,90,0); - weapons.staffmodel.Rotate(0,0,90); - weapons.staffmodel.flat=1; - weapons.staffmodel.CalculateNormals(1); - //weapons.staffmodel.ScaleNormals(-1,-1,-1); + LoadTexture(":Data:Textures:knife.png",&Weapon::knifetextureptr,0,1); + LoadTexture(":Data:Textures:bloodknife.png",&Weapon::bloodknifetextureptr,0,1); + LoadTexture(":Data:Textures:lightbloodknife.png",&Weapon::lightbloodknifetextureptr,0,1); + LoadTexture(":Data:Textures:sword.jpg",&Weapon::swordtextureptr,1,0); + LoadTexture(":Data:Textures:Swordblood.jpg",&Weapon::bloodswordtextureptr,1,0); + LoadTexture(":Data:Textures:Swordbloodlight.jpg",&Weapon::lightbloodswordtextureptr,1,0); + LoadTexture(":Data:Textures:Staff.jpg",&Weapon::stafftextureptr,1,0); + + Weapon::throwingknifemodel.load((char *)":Data:Models:throwingknife.solid",1); + Weapon::throwingknifemodel.Scale(.001,.001,.001); + //Weapon::throwingknifemodel.Rotate(0,0,-90); + Weapon::throwingknifemodel.Rotate(90,0,0); + Weapon::throwingknifemodel.Rotate(0,90,0); + Weapon::throwingknifemodel.flat=0; + Weapon::throwingknifemodel.CalculateNormals(1); + //Weapon::throwingknifemodel.ScaleNormals(-1,-1,-1); + + Weapon::swordmodel.load((char *)":Data:Models:sword.solid",1); + Weapon::swordmodel.Scale(.001,.001,.001); + //Weapon::swordmodel.Rotate(0,0,-90); + Weapon::swordmodel.Rotate(90,0,0); + Weapon::swordmodel.Rotate(0,90,0); + Weapon::swordmodel.Rotate(0,0,90); + Weapon::swordmodel.flat=1; + Weapon::swordmodel.CalculateNormals(1); + //Weapon::swordmodel.ScaleNormals(-1,-1,-1); + + Weapon::staffmodel.load((char *)":Data:Models:staff.solid",1); + Weapon::staffmodel.Scale(.005,.005,.005); + //Weapon::staffmodel.Rotate(0,0,-90); + Weapon::staffmodel.Rotate(90,0,0); + Weapon::staffmodel.Rotate(0,90,0); + Weapon::staffmodel.Rotate(0,0,90); + Weapon::staffmodel.flat=1; + Weapon::staffmodel.CalculateNormals(1); + //Weapon::staffmodel.ScaleNormals(-1,-1,-1); //temptexdetail=texdetail; //if(texdetail>4)texdetail=4; @@ -1192,13 +1165,7 @@ void Game::LoadStuff() animation[swordsneakattackedanim].position[i][j]+=moveamount; } } - /* - for(i=0;i