From 2f6f7fe7b9562156a966b6cfd62afb2dc69734f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20BERNIGAUD?= Date: Mon, 16 May 2011 17:42:40 +0200 Subject: [PATCH] renaming some maps to be coherent. --- Data/Campaigns/main.txt | 2 +- Data/Maps/{start1 => Start1} | Bin Data/Maps/{start10 => Start10} | Bin Data/Maps/{start11 => Start11} | Bin Data/Maps/{start12 => Start12} | Bin Data/Maps/{start13 => Start13} | Bin Data/Maps/{start14 => Start14} | Bin Data/Maps/{start15 => Start15} | Bin Data/Maps/{start16 => Start16} | Bin Data/Maps/{start17 => Start17} | Bin Data/Maps/{start18 => Start18} | Bin Data/Maps/{start19 => Start19} | Bin Data/Maps/{start2 => Start2} | Bin Data/Maps/{start20 => Start20} | Bin Data/Maps/{start21 => Start21} | Bin Data/Maps/{start22 => Start22} | Bin Data/Maps/{start23 => Start23} | Bin Data/Maps/{start3 => Start3} | Bin Data/Maps/{start4 => Start4} | Bin Data/Maps/{start5 => Start5} | Bin Data/Maps/{start6 => Start6} | Bin Data/Maps/{start7 => Start7} | Bin Data/Maps/{start8 => Start8} | Bin Data/Maps/{start9 => Start9} | Bin Source/GameDraw.cpp | 61 +--- Source/GameTick.cpp | 18 +- Source/Terrain.cpp | 67 ++-- Source/Weapons.cpp | 640 ++++++++++++++++++--------------- 28 files changed, 411 insertions(+), 377 deletions(-) rename Data/Maps/{start1 => Start1} (100%) rename Data/Maps/{start10 => Start10} (100%) rename Data/Maps/{start11 => Start11} (100%) rename Data/Maps/{start12 => Start12} (100%) rename Data/Maps/{start13 => Start13} (100%) rename Data/Maps/{start14 => Start14} (100%) rename Data/Maps/{start15 => Start15} (100%) rename Data/Maps/{start16 => Start16} (100%) rename Data/Maps/{start17 => Start17} (100%) rename Data/Maps/{start18 => Start18} (100%) rename Data/Maps/{start19 => Start19} (100%) rename Data/Maps/{start2 => Start2} (100%) rename Data/Maps/{start20 => Start20} (100%) rename Data/Maps/{start21 => Start21} (100%) rename Data/Maps/{start22 => Start22} (100%) rename Data/Maps/{start23 => Start23} (100%) rename Data/Maps/{start3 => Start3} (100%) rename Data/Maps/{start4 => Start4} (100%) rename Data/Maps/{start5 => Start5} (100%) rename Data/Maps/{start6 => Start6} (100%) rename Data/Maps/{start7 => Start7} (100%) rename Data/Maps/{start8 => Start8} (100%) rename Data/Maps/{start9 => Start9} (100%) diff --git a/Data/Campaigns/main.txt b/Data/Campaigns/main.txt index 9ea6a54..9b576b7 100644 --- a/Data/Campaigns/main.txt +++ b/Data/Campaigns/main.txt @@ -1 +1 @@ -Campaign Levels: 27 Level 1: Name: Start1 Description: Village_-_start_campaign_mode! ChooseNext: 2 NumNext: 1 NextLevel: 2 LocationX: 264 LocationY: 310 Level 2: Name: Start2 Description: Stranger ChooseNext: 0 NumNext: 1 NextLevel: 3 LocationX: 264 LocationY: 310 Level 3: Name: Start3 Description: Village ChooseNext: 1 NumNext: 1 NextLevel: 4 LocationX: 264 LocationY: 310 Level 4: Name: Start4 Description: Wanderer ChooseNext: 1 NumNext: 1 NextLevel: 5 LocationX: 274 LocationY: 310 Level 5: Name: Start5 Description: Village ChooseNext: 1 NumNext: 1 NextLevel: 6 LocationX: 264 LocationY: 310 Level 6: Name: Start6 Description: Clearing ChooseNext: 1 NumNext: 1 NextLevel: 7 LocationX: 260 LocationY: 295 Level 7: Name: Start7 Description: Raider_Patrol ChooseNext: 1 NumNext: 1 NextLevel: 8 LocationX: 250 LocationY: 278 Level 8: Name: raidercamp Description: Raider_Camp ChooseNext: 1 NumNext: 1 NextLevel: 9 LocationX: 240 LocationY: 270 Level 8: Name: Start8 Description: Raider_Sentries ChooseNext: 1 NumNext: 1 NextLevel: 10 LocationX: 255 LocationY: 265 Level 9: Name: Start9 Description: Raider_Base ChooseNext: 0 NumNext: 1 NextLevel: 11 LocationX: 265 LocationY: 273 Level 10: Name: Start10 Description: Raider_Base ChooseNext: 1 NumNext: 1 NextLevel: 12 LocationX: 265 LocationY: 273 Level 11: Name: Start11 Description: Old_Raider_Base ChooseNext: 1 NumNext: 1 NextLevel: 13 LocationX: 286 LocationY: 276 Level 12: Name: Start12 Description: Village ChooseNext: 1 NumNext: 1 NextLevel: 14 LocationX: 264 LocationY: 310 Level 13: Name: Start13 Description: Rocky_Hall ChooseNext: 1 NumNext: 1 NextLevel: 15 LocationX: 284 LocationY: 312 Level 14: Name: Start14 Description: Heading_North ChooseNext: 1 NumNext: 1 NextLevel: 16 LocationX: 332 LocationY: 272 Level 15: Name: Start15 Description: Heading_North ChooseNext: 1 NumNext: 1 NextLevel: 17 LocationX: 345 LocationY: 246 Level 16: Name: Start16 Description: Jack's_camp ChooseNext: 0 NumNext: 1 NextLevel: 18 LocationX: 324 LocationY: 224 Level 17: Name: Start17 Description: Jack's_camp ChooseNext: 1 NumNext: 1 NextLevel: 19 LocationX: 324 LocationY: 224 Level 18: Name: Start18 Description: Rocky_Hall ChooseNext: 0 NumNext: 1 NextLevel: 20 LocationX: 284 LocationY: 312 Level 19: Name: Start19 Description: Rocky_Hall ChooseNext: 1 NumNext: 1 NextLevel: 21 LocationX: 284 LocationY: 312 Level 20: Name: Start20 Description: To_Alpha_Wolf ChooseNext: 1 NumNext: 1 NextLevel: 22 LocationX: 360 LocationY: 269 Level 21: Name: Start21 Description: To_Alpha_Wolf ChooseNext: 1 NumNext: 1 NextLevel: 23 LocationX: 343 LocationY: 219 Level 22: Name: Start22 Description: Wolf_Den ChooseNext: 0 NumNext: 1 NextLevel: 24 LocationX: 327 LocationY: 179 Level 23: Name: Start23 Description: Alpha_Wolf ChooseNext: 1 NumNext: 1 NextLevel: 25 LocationX: 314 LocationY: 179 Level 24: Name: Start24 Description: Rocky_Hall ChooseNext: 0 NumNext: 1 NextLevel: 26 LocationX: 284 LocationY: 312 Level 25: Name: Start25 Description: Rocky_Hall ChooseNext: 0 NumNext: 1 NextLevel: 27 LocationX: 284 LocationY: 312 Level 26: Name: Start26 Description: Leave ChooseNext: 1 NumNext: 0 LocationX: 284 LocationY: 312 \ No newline at end of file +Campaign Levels: 27 Level 1: Name: Start1 Description: Village_-_start_campaign_mode! ChooseNext: 2 NumNext: 1 NextLevel: 2 LocationX: 264 LocationY: 310 Level 2: Name: Start2 Description: Stranger ChooseNext: 0 NumNext: 1 NextLevel: 3 LocationX: 264 LocationY: 310 Level 3: Name: Start3 Description: Village ChooseNext: 1 NumNext: 1 NextLevel: 4 LocationX: 264 LocationY: 310 Level 4: Name: Start4 Description: Wanderer ChooseNext: 1 NumNext: 1 NextLevel: 5 LocationX: 274 LocationY: 310 Level 5: Name: Start5 Description: Village ChooseNext: 1 NumNext: 1 NextLevel: 6 LocationX: 264 LocationY: 310 Level 6: Name: Start6 Description: Clearing ChooseNext: 1 NumNext: 1 NextLevel: 7 LocationX: 260 LocationY: 295 Level 7: Name: Start7 Description: Raider_Patrol ChooseNext: 1 NumNext: 1 NextLevel: 8 LocationX: 250 LocationY: 278 Level 8: Name: raidercamp Description: Raider_Camp ChooseNext: 1 NumNext: 1 NextLevel: 9 LocationX: 240 LocationY: 270 Level 8: Name: Start8 Description: Raider_Sentries ChooseNext: 1 NumNext: 1 NextLevel: 10 LocationX: 255 LocationY: 265 Level 9: Name: Start9 Description: Raider_Base ChooseNext: 0 NumNext: 1 NextLevel: 11 LocationX: 265 LocationY: 273 Level 10: Name: Start10 Description: Raider_Base ChooseNext: 1 NumNext: 1 NextLevel: 12 LocationX: 265 LocationY: 273 Level 11: Name: Start11 Description: Old_Raider_Base ChooseNext: 1 NumNext: 1 NextLevel: 13 LocationX: 286 LocationY: 276 Level 12: Name: Start12 Description: Village ChooseNext: 1 NumNext: 1 NextLevel: 14 LocationX: 264 LocationY: 310 Level 13: Name: Start13 Description: Rocky_Hall ChooseNext: 1 NumNext: 1 NextLevel: 15 LocationX: 284 LocationY: 312 Level 14: Name: Start14 Description: Heading_North ChooseNext: 1 NumNext: 1 NextLevel: 16 LocationX: 332 LocationY: 272 Level 15: Name: Start15 Description: Heading_North ChooseNext: 1 NumNext: 1 NextLevel: 17 LocationX: 345 LocationY: 246 Level 16: Name: Start16 Description: Jack's_camp ChooseNext: 0 NumNext: 1 NextLevel: 18 LocationX: 324 LocationY: 224 Level 17: Name: Start17 Description: Jack's_camp ChooseNext: 1 NumNext: 1 NextLevel: 19 LocationX: 324 LocationY: 224 Level 18: Name: Start18 Description: Rocky_Hall ChooseNext: 0 NumNext: 1 NextLevel: 20 LocationX: 284 LocationY: 312 Level 19: Name: Start19 Description: Rocky_Hall ChooseNext: 1 NumNext: 1 NextLevel: 21 LocationX: 284 LocationY: 312 Level 20: Name: Start20 Description: To_Alpha_Wolf ChooseNext: 1 NumNext: 1 NextLevel: 22 LocationX: 360 LocationY: 269 Level 21: Name: Start21 Description: To_Alpha_Wolf ChooseNext: 1 NumNext: 1 NextLevel: 23 LocationX: 343 LocationY: 219 Level 22: Name: Start22 Description: Wolf_Den ChooseNext: 0 NumNext: 1 NextLevel: 24 LocationX: 327 LocationY: 179 Level 23: Name: Start23 Description: Alpha_Wolf ChooseNext: 1 NumNext: 1 NextLevel: 25 LocationX: 314 LocationY: 179 Level 24: Name: Start24 Description: Rocky_Hall ChooseNext: 0 NumNext: 1 NextLevel: 26 LocationX: 284 LocationY: 312 Level 25: Name: Start25 Description: Rocky_Hall ChooseNext: 0 NumNext: 1 NextLevel: 27 LocationX: 284 LocationY: 312 Level 26: Name: Start26 Description: Leave ChooseNext: 1 NumNext: 0 LocationX: 284 LocationY: 312 \ No newline at end of file diff --git a/Data/Maps/start1 b/Data/Maps/Start1 similarity index 100% rename from Data/Maps/start1 rename to Data/Maps/Start1 diff --git a/Data/Maps/start10 b/Data/Maps/Start10 similarity index 100% rename from Data/Maps/start10 rename to Data/Maps/Start10 diff --git a/Data/Maps/start11 b/Data/Maps/Start11 similarity index 100% rename from Data/Maps/start11 rename to Data/Maps/Start11 diff --git a/Data/Maps/start12 b/Data/Maps/Start12 similarity index 100% rename from Data/Maps/start12 rename to Data/Maps/Start12 diff --git a/Data/Maps/start13 b/Data/Maps/Start13 similarity index 100% rename from Data/Maps/start13 rename to Data/Maps/Start13 diff --git a/Data/Maps/start14 b/Data/Maps/Start14 similarity index 100% rename from Data/Maps/start14 rename to Data/Maps/Start14 diff --git a/Data/Maps/start15 b/Data/Maps/Start15 similarity index 100% rename from Data/Maps/start15 rename to Data/Maps/Start15 diff --git a/Data/Maps/start16 b/Data/Maps/Start16 similarity index 100% rename from Data/Maps/start16 rename to Data/Maps/Start16 diff --git a/Data/Maps/start17 b/Data/Maps/Start17 similarity index 100% rename from Data/Maps/start17 rename to Data/Maps/Start17 diff --git a/Data/Maps/start18 b/Data/Maps/Start18 similarity index 100% rename from Data/Maps/start18 rename to Data/Maps/Start18 diff --git a/Data/Maps/start19 b/Data/Maps/Start19 similarity index 100% rename from Data/Maps/start19 rename to Data/Maps/Start19 diff --git a/Data/Maps/start2 b/Data/Maps/Start2 similarity index 100% rename from Data/Maps/start2 rename to Data/Maps/Start2 diff --git a/Data/Maps/start20 b/Data/Maps/Start20 similarity index 100% rename from Data/Maps/start20 rename to Data/Maps/Start20 diff --git a/Data/Maps/start21 b/Data/Maps/Start21 similarity index 100% rename from Data/Maps/start21 rename to Data/Maps/Start21 diff --git a/Data/Maps/start22 b/Data/Maps/Start22 similarity index 100% rename from Data/Maps/start22 rename to Data/Maps/Start22 diff --git a/Data/Maps/start23 b/Data/Maps/Start23 similarity index 100% rename from Data/Maps/start23 rename to Data/Maps/Start23 diff --git a/Data/Maps/start3 b/Data/Maps/Start3 similarity index 100% rename from Data/Maps/start3 rename to Data/Maps/Start3 diff --git a/Data/Maps/start4 b/Data/Maps/Start4 similarity index 100% rename from Data/Maps/start4 rename to Data/Maps/Start4 diff --git a/Data/Maps/start5 b/Data/Maps/Start5 similarity index 100% rename from Data/Maps/start5 rename to Data/Maps/Start5 diff --git a/Data/Maps/start6 b/Data/Maps/Start6 similarity index 100% rename from Data/Maps/start6 rename to Data/Maps/Start6 diff --git a/Data/Maps/start7 b/Data/Maps/Start7 similarity index 100% rename from Data/Maps/start7 rename to Data/Maps/Start7 diff --git a/Data/Maps/start8 b/Data/Maps/Start8 similarity index 100% rename from Data/Maps/start8 rename to Data/Maps/Start8 diff --git a/Data/Maps/start9 b/Data/Maps/Start9 similarity index 100% rename from Data/Maps/start9 rename to Data/Maps/Start9 diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index 829a4ad..0f3dd8c 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -2058,27 +2058,12 @@ void Game::DrawMenu() { glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); ReSizeGLScene(90,.1f); - int temptexdetail; - temptexdetail=texdetail; - if(texdetail>2)texdetail=2; - //~ if(mainmenu!=oldmainmenu&&oldmainmenu!=0){ - //~ if(mainmenu==1){ - //~ LoadTexture(":Data:Textures:Newgame.png",&Mainmenuitems[1],0,0); - //~ LoadTexture(":Data:Textures:Quit.png",&Mainmenuitems[3],0,0); - //~ } - //~ if(mainmenu==2){ - //~ LoadTexture(":Data:Textures:Resume.png",&Mainmenuitems[1],0,0); - //~ LoadTexture(":Data:Textures:Endgame.png",&Mainmenuitems[3],0,0); - //~ } - //~ } if(oldmainmenu!=mainmenu){ if(mainmenu==5){ LoadCampaign(); } } - texdetail=temptexdetail; - oldmainmenu=mainmenu; glClear(GL_DEPTH_BUFFER_BIT); @@ -2185,41 +2170,41 @@ void Game::DrawMenu() { startx[0]=10+20; starty[0]=440; - if(newdetail==2)sprintf (menustring[1], "Detail: High"); - else if(newdetail==1)sprintf (menustring[1], "Detail: Medium"); - else sprintf (menustring[1], "Detail: Low"); + if(newdetail==2) sprintf (menustring[1], "Detail: High"); + else if(newdetail==1) sprintf (menustring[1], "Detail: Medium"); + else sprintf (menustring[1], "Detail: Low"); startx[1]=10+60; starty[1]=405; - if(bloodtoggle==2)sprintf (menustring[2], "Blood: On, high detail (slower)"); - if(bloodtoggle==1)sprintf (menustring[2], "Blood: On, low detail"); - if(bloodtoggle==0)sprintf (menustring[2], "Blood: Off"); + if(bloodtoggle==2) sprintf (menustring[2], "Blood: On, high detail (slower)"); + if(bloodtoggle==1) sprintf (menustring[2], "Blood: On, low detail"); + if(bloodtoggle==0) sprintf (menustring[2], "Blood: Off"); startx[2]=10+70; starty[2]=370; - if(difficulty==2)sprintf (menustring[3], "Difficulty: Insane"); - if(difficulty==1)sprintf (menustring[3], "Difficulty: Difficult"); - if(difficulty==0)sprintf (menustring[3], "Difficulty: Easier"); + if(difficulty==2) sprintf (menustring[3], "Difficulty: Insane"); + if(difficulty==1) sprintf (menustring[3], "Difficulty: Difficult"); + if(difficulty==0) sprintf (menustring[3], "Difficulty: Easier"); startx[3]=10+20-1000; starty[3]=335-1000; - if(ismotionblur==1)sprintf (menustring[4], "Blur Effects: Enabled (less compatible)"); - if(ismotionblur==0)sprintf (menustring[4], "Blur Effects: Disabled (more compatible)"); + if(ismotionblur==1) sprintf (menustring[4], "Blur Effects: Enabled (less compatible)"); + if(ismotionblur==0) sprintf (menustring[4], "Blur Effects: Disabled (more compatible)"); startx[4]=10; starty[4]=335; - if(decals==1)sprintf (menustring[5], "Decals: Enabled (slower)"); - if(decals==0)sprintf (menustring[5], "Decals: Disabled"); + if(decals==1) sprintf (menustring[5], "Decals: Enabled (slower)"); + if(decals==0) sprintf (menustring[5], "Decals: Disabled"); startx[5]=10+60; starty[5]=300; - if(musictoggle==1)sprintf (menustring[6], "Music: Enabled"); - if(musictoggle==0)sprintf (menustring[6], "Music: Disabled"); + if(musictoggle==1) sprintf (menustring[6], "Music: Enabled"); + if(musictoggle==0) sprintf (menustring[6], "Music: Disabled"); startx[6]=10+70; starty[6]=265; - if(invertmouse==1)sprintf (menustring[9], "Invert mouse: Yes"); - if(invertmouse==0)sprintf (menustring[9], "Invert mouse: No"); + if(invertmouse==1) sprintf (menustring[9], "Invert mouse: Yes"); + if(invertmouse==0) sprintf (menustring[9], "Invert mouse: No"); startx[9]=10; starty[9]=230; @@ -2347,18 +2332,6 @@ void Game::DrawMenu() { sprintf (menustring[2], "No"); startx[2]=10; starty[2]=320; - - sprintf (menustring[3], "Extra 4"); - startx[3]=10; - starty[3]=280; - - sprintf (menustring[4], "Extra 5"); - startx[4]=10; - starty[4]=240; - - sprintf (menustring[5], "Back"); - startx[5]=10; - starty[5]=10; } break; case 7: { diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 3bf55e4..cd0a976 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -2350,8 +2350,6 @@ void Game::doTutorial(){ weapons[player[0].weaponids[player[0].weaponactive]].setType(staff); else weapons[0].setType(staff); - - //~ weapons.size()++; break; case 49: canattack=0; cananger=0; @@ -2362,10 +2360,8 @@ void Game::doTutorial(){ weapons[1].position=1000; weapons[1].tippoint=1000; - //~ weapons.size()=1; weapons[0].setType(knife); - //~ weapons.size()++; weapons[0].owner=0; player[1].weaponactive=-1; player[1].num_weapons=0; @@ -2427,7 +2423,7 @@ void Game::doTutorial(){ break; case 25: if(player[0].targetanimation==backhandspringanim)tutorialsuccess=1; break; case 28: if(animation[player[0].targetanimation].attack==reversed&&player[0].feint)tutorialsuccess=1; break; case 29: - if(player[0].escapednum==2){ + if(player[0].escapednum==2) { tutorialsuccess=1; reversaltrain=0; cananger=0; @@ -4554,7 +4550,7 @@ void Game::doAI(int i){ if( findDistancefastflat(&player[i].coords,&player[i].finalfinaltarget)< findDistancefastflat(&player[i].coords,&player[i].finaltarget)|| findDistancefastflat(&player[i].coords,&player[i].finaltarget)<.6*sq(player[i].scale*5)|| - player[i].lastpathfindpoint==player[i].finalpathfindpoint){ + player[i].lastpathfindpoint==player[i].finalpathfindpoint) { player[i].aitype=passivetype; } @@ -4566,7 +4562,7 @@ void Game::doAI(int i){ player[i].attackkeydown=0; player[i].throwkeydown=0; - if(player[i].avoidcollided>.8&&!player[i].jumpkeydown&&player[i].collided<.8) + if(player[i].avoidcollided>.8 && !player[i].jumpkeydown && player[i].collided<.8) player[i].targetrotation+=90*(player[i].whichdirection*2-1); if(player[i].collided<1||player[i].targetanimation!=jumpupanim) @@ -5141,7 +5137,7 @@ void Game::doAI(int i){ weapons[i].velocity.x==0&& weapons[i].velocity.z==0&& weapons[i].velocity.y==0){ - if(findDistancefast(&player[i].coords,&weapons[k].position)<16){ + if(findDistancefast(&player[i].coords,&weapons[k].position)<16) { player[i].wentforweapon++; player[i].lastchecktime=6; player[i].aitype=getweapontype; @@ -5170,7 +5166,7 @@ void Game::doAI(int i){ j=checkcollide(test2,test,player[i].laststanding); if(j==-1) j=checkcollide(test2,test); - if(j==-1){ + if(j==-1) { player[i].velocity=0; setAnimation(i,player[i].getStop()); player[i].targetrotation+=180; @@ -5183,7 +5179,7 @@ void Game::doAI(int i){ player[i].lastpathfindpoint2=-1; player[i].lastpathfindpoint3=-1; player[i].lastpathfindpoint4=-1; - }else + } else player[i].laststanding=j; } //lose sight of player in the air (?) @@ -7755,7 +7751,9 @@ void Game::TickOnceAfter(){ if(!firstload) LoadStuff(); whichchoice=0; + cout << "from " << campaignlevels[actuallevel].mapname.c_str() << "(" << actuallevel << ")" << endl; actuallevel=campaignlevels[actuallevel].nextlevel.front(); + cout << "to " << campaignlevels[actuallevel].mapname.c_str() << "(" << actuallevel << ")" << endl; visibleloading=1; stillloading=1; Loadlevel(campaignlevels[actuallevel].mapname.c_str()); diff --git a/Source/Terrain.cpp b/Source/Terrain.cpp index 649d3f3..d9c73b0 100644 --- a/Source/Terrain.cpp +++ b/Source/Terrain.cpp @@ -978,7 +978,7 @@ void Terrain::draw(int layer) endz=(viewer.z+viewdistance)/(patch_size)+1; if(endz>subdivision)endz=subdivision; - if(!layer) + if(!layer) { for(i=beginx;iviewdistsquared*fadestart-viewdistsquared)opacity=0; - if(opacity==1&&i!=subdivision)if(distance[i+1][j]>viewdistsquared*fadestart-viewdistsquared)opacity=0; - if(opacity==1&&j!=subdivision)if(distance[i][j+1]>viewdistsquared*fadestart-viewdistsquared)opacity=0; - if(opacity==1&&j!=subdivision&&i!=subdivision)if(distance[i+1][j+1]>viewdistsquared*fadestart-viewdistsquared)opacity=0; - glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix - glPushMatrix(); - if(frustum.CubeInFrustum(i*patch_size+patch_size*.5,avgypatch[i][j],j*patch_size+patch_size*.5,heightypatch[i][j]/2)) - { - if(environment==desertenvironment&&distance[i][j]>viewdistsquared/4)glTexEnvf( GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, blurness); - else if(environment==desertenvironment)glTexEnvf( GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 0 ); - if(!layer&&textureness[i][j]!=allsecond)drawpatch(i,j,opacity); - if(layer==1&&textureness[i][j]!=allfirst)drawpatchother(i,j,opacity); - if(layer==2&&textureness[i][j]!=allfirst)drawpatchotherother(i,j,opacity); - } - glPopMatrix(); - } + } + for(i=beginx;iviewdistsquared*fadestart-viewdistsquared) + opacity=0; + if(opacity==1&&i!=subdivision) + if(distance[i+1][j]>viewdistsquared*fadestart-viewdistsquared) + opacity=0; + if(opacity==1&&j!=subdivision) + if(distance[i][j+1]>viewdistsquared*fadestart-viewdistsquared) + opacity=0; + if(opacity==1&&j!=subdivision&&i!=subdivision) + if(distance[i+1][j+1]>viewdistsquared*fadestart-viewdistsquared) + opacity=0; + glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix + glPushMatrix(); + if(frustum.CubeInFrustum(i*patch_size+patch_size*.5,avgypatch[i][j],j*patch_size+patch_size*.5,heightypatch[i][j]/2)) + { + if(environment==desertenvironment&&distance[i][j]>viewdistsquared/4) + glTexEnvf( GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, blurness); + else if(environment==desertenvironment) + glTexEnvf( GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 0 ); + if(!layer&&textureness[i][j]!=allsecond) + drawpatch(i,j,opacity); + if(layer==1&&textureness[i][j]!=allfirst) + drawpatchother(i,j,opacity); + if(layer==2&&textureness[i][j]!=allfirst) + drawpatchotherother(i,j,opacity); + } + glPopMatrix(); } } - if(environment==desertenvironment)glTexEnvf( GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 0 ); + } + if(environment==desertenvironment) + glTexEnvf( GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 0 ); } void Terrain::drawdecals() { - if(decals){ + if(decals) { static int i,j; static float distancemult; static int lasttype; @@ -1186,8 +1199,8 @@ void Terrain::DeleteDecal(int which) } void Terrain::MakeDecal(int type, XYZ where, float size, float opacity, float rotation){ - if(decals){ - if(opacity>0&&size>0){ + if(decals) { + if(opacity>0&&size>0) { static int patchx[4]; static int patchy[4]; @@ -1237,11 +1250,9 @@ void Terrain::MakeDecalLock(int type, XYZ where,int whichx, int whichy, float si decalbrightness[numdecals]=(rot.x+rot.y+rot.z)/3; if(decalbrightness[numdecals]<.4)decalbrightness[numdecals]=.4; - //if(type==blooddecal||type==blooddecalfast||type==blooddecalslow){ if(environment==grassyenvironment){ decalbrightness[numdecals]*=.6; } - //} if(decalbrightness[numdecals]>1)decalbrightness[numdecals]=1; decalbright=decalbrightness[numdecals]; diff --git a/Source/Weapons.cpp b/Source/Weapons.cpp index 2f87d33..f6cf200 100644 --- a/Source/Weapons.cpp +++ b/Source/Weapons.cpp @@ -98,7 +98,8 @@ void Weapon::setType(int t) { } void Weapon::DoStuff(int i) { - static int whichpatchx,whichpatchz,whichhit,m; + //~ cout << position.x << "," << position.y << "," << position.z << "|" << tippoint.x << "," << tippoint.y << "," << tippoint.z << endl; + static int whichpatchx,whichpatchz,whichhit; static XYZ start,end,colpoint,normalrot,footvel,footpoint; static XYZ terrainnormal; static XYZ vel; @@ -116,20 +117,27 @@ void Weapon::DoStuff(int i) { static XYZ extramove; static float tempmult; - if(owner!=-1){ + if(owner!=-1) { oldowner=owner; } - if(damage>=2 && type==staff && owner!=-1){ + if(damage>=2 && type==staff && owner!=-1) { // the staff breaks emit_sound_at(staffbreaksound, tippoint); XYZ tempvel; - for(int j=0;j<40;j++){ + for(int j=0;j<40;j++) { tempvel.x=float(abs(Random()%100)-50)/20; tempvel.y=float(abs(Random()%100)-50)/20; tempvel.z=float(abs(Random()%100)-50)/20; Sprite::MakeSprite(splintersprite, position+(tippoint-position)*((float)j-8)/32,tempvel*.5, 115/255,73/255,12/255, .1, 1); } - int tempowner; - tempowner=owner; + if(owner!=-1) { + player[owner].weaponactive=-1; + player[owner].num_weapons--; + if(player[owner].num_weapons) { + player[owner].weaponids[0]=player[owner].weaponids[player[owner].num_weapons]; + if(player[owner].weaponstuck==player[owner].num_weapons) + player[owner].weaponstuck=0; + } + } owner=-1; hitsomething=0; missed=1; @@ -137,38 +145,32 @@ void Weapon::DoStuff(int i) { firstfree=1; position=0; physics=0; - if(tempowner!=-1) { - player[tempowner].num_weapons--; - if(player[tempowner].num_weapons) { - player[tempowner].weaponids[0]=player[tempowner].weaponids[player[tempowner].num_weapons]; - if(player[tempowner].weaponstuck==player[tempowner].num_weapons) - player[tempowner].weaponstuck=0; - } - player[tempowner].weaponactive=-1; - } } oldposition=position; oldtippoint=tippoint; - if(owner==-1&&(velocity.x||velocity.y||velocity.z)&&!physics){ + if(owner==-1 && (velocity.x||velocity.y||velocity.z) && !physics) { // if the weapon is flying position+=velocity*multiplier; tippoint+=velocity*multiplier; whichpatchx=position.x/(terrain.size/subdivision*terrain.scale); whichpatchz=position.z/(terrain.size/subdivision*terrain.scale); - if(whichpatchx>0 && whichpatchz>0 && whichpatchx0 && whichpatchz>0 && whichpatchxtemppoint2.x)rotation1=360-rotation1; + if(temppoint1.x>temppoint2.x) + rotation1=360-rotation1; rotation3=0; smallrotation=90; @@ -206,164 +209,176 @@ void Weapon::DoStuff(int i) { } } } - if(velocity.x||velocity.y||velocity.z) - for(int j=0;j0){ - player[j].weaponids[player[j].num_weapons]=player[j].weaponids[0]; - } - player[j].num_weapons++; - player[j].weaponids[0]=i; + } + + if(velocity.x||velocity.y||velocity.z) { + for(int j=0;j0){ + player[j].weaponids[player[j].num_weapons]=player[j].weaponids[0]; + } + player[j].num_weapons++; + player[j].weaponids[0]=i; - player[j].aitype=attacktypecutoff; + player[j].aitype=attacktypecutoff; + } + else { + if(j!=0) numthrowkill++; + player[j].num_weapons++; + player[j].weaponstuck=player[j].num_weapons-1; + if(normaldotproduct(player[j].facing,velocity)>0) + player[j].weaponstuckwhere=1; + else + player[j].weaponstuckwhere=0; + + player[j].weaponids[player[j].num_weapons-1]=i; + + player[j].RagDoll(0); + player[j].skeleton.joints[player[j].skeleton.jointlabels[abdomen]].velocity+=velocity*2; + player[j].skeleton.joints[player[j].skeleton.jointlabels[neck]].velocity+=velocity*2; + player[j].skeleton.joints[player[j].skeleton.jointlabels[rightshoulder]].velocity+=velocity*2; + player[j].skeleton.joints[player[j].skeleton.jointlabels[leftshoulder]].velocity+=velocity*2; + if(bloodtoggle&&tutoriallevel!=1) + Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3); + if(tutoriallevel==1) + Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .8, .3); + footvel=tippoint-position; + Normalise(&footvel); + if(bloodtoggle&&tutoriallevel!=1) + Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*-1, 1,0,0, .6, 1); + + if(tutoriallevel!=1) { + if(player[j].weaponstuckwhere==0) + player[j].DoBloodBig(2,205); + if(player[j].weaponstuckwhere==1) + player[j].DoBloodBig(2,200); + player[j].damage+=200/player[j].armorhigh; + player[j].deathbleeding=1; + player[j].bloodloss+=(200+abs((float)(Random()%40))-20)/player[j].armorhigh; + owner=j; + bloody=2; + blooddrip=5; } - else { - if(j!=0)numthrowkill++; - player[j].num_weapons++; - player[j].weaponstuck=player[j].num_weapons-1; - if(normaldotproduct(player[j].facing,velocity)>0)player[j].weaponstuckwhere=1; - else player[j].weaponstuckwhere=0; - - player[j].weaponids[player[j].num_weapons-1]=i; - - player[j].RagDoll(0); - player[j].skeleton.joints[player[j].skeleton.jointlabels[abdomen]].velocity+=velocity*2; - player[j].skeleton.joints[player[j].skeleton.jointlabels[neck]].velocity+=velocity*2; - player[j].skeleton.joints[player[j].skeleton.jointlabels[rightshoulder]].velocity+=velocity*2; - player[j].skeleton.joints[player[j].skeleton.jointlabels[leftshoulder]].velocity+=velocity*2; - if(bloodtoggle&&tutoriallevel!=1) - Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3); - if(tutoriallevel==1) - Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .8, .3); - footvel=tippoint-position; - Normalise(&footvel); - if(bloodtoggle&&tutoriallevel!=1) - Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*-1, 1,0,0, .6, 1); - - if(tutoriallevel!=1) { - if(player[j].weaponstuckwhere==0) - player[j].DoBloodBig(2,205); - if(player[j].weaponstuckwhere==1) - player[j].DoBloodBig(2,200); - player[j].damage+=200/player[j].armorhigh; - player[j].deathbleeding=1; - player[j].bloodloss+=(200+abs((float)(Random()%40))-20)/player[j].armorhigh; - owner=j; - bloody=2; - blooddrip=5; - } - emit_sound_at(fleshstabsound, position, 128.); + emit_sound_at(fleshstabsound, position, 128.); - if(animation[player[0].targetanimation].height==highheight) - award_bonus(0, ninja); - else - award_bonus(0, Bullseyebonus); - } + if(animation[player[0].targetanimation].height==highheight) + award_bonus(0, ninja); + else + award_bonus(0, Bullseyebonus); } - else missed=1; } + else missed=1; + } + } + } + if(position.ytemppoint2.x) rotation1=360-rotation1; + else if(environment==grassyenvironment){ + if(findDistancefast(&position,&viewer)temppoint2.x) rotation1=360-rotation1; + } + } + //Sword physics XYZ mid; XYZ oldmid; @@ -384,8 +399,10 @@ void Weapon::DoStuff(int i) { newpoint1=midp-vel*length*(tipmass/(mass+tipmass)); newpoint2=midp+vel*length*(mass/(mass+tipmass)); if(!freeze){ - if(freetime>.04)velocity=velocity+(newpoint1-position)/multiplier; - if(freetime>.04)tipvelocity=tipvelocity+(newpoint2-tippoint)/multiplier; + if(freetime>.04) { + velocity=velocity+(newpoint1-position)/multiplier; + tipvelocity=tipvelocity+(newpoint2-tippoint)/multiplier; + } } position=newpoint1; tippoint=newpoint2; @@ -395,41 +412,40 @@ void Weapon::DoStuff(int i) { whichpatchx=(position.x)/(terrain.size/subdivision*terrain.scale); whichpatchz=(position.z)/(terrain.size/subdivision*terrain.scale); if(whichpatchx>0&&whichpatchz>0&&whichpatchx0)velocity*=1-friction*frictionness; else velocity=0; velocity+=bounceness*elasticity; - if(findLengthfast(&bounceness)>1){ + if(findLengthfast(&bounceness)>1) { int whichsound; - if(type==staff)whichsound=footstepsound3+abs(Random()%2); - if(type!=staff)whichsound=clank1sound+abs(Random()%4); + if(type==staff) + whichsound=footstepsound3+abs(Random()%2); + else + whichsound=clank1sound+abs(Random()%4); emit_sound_at(whichsound, position, 128*findLengthfast(&bounceness)); } } start=oldtippoint; end=tippoint; whichhit=objects.model[k].LineCheck(&start,&end,&colpoint,&objects.position[k],&objects.rotation[k]); - if(whichhit!=-1){ + if(whichhit!=-1) { hitsomething=1; tippoint=colpoint; terrainnormal=DoRotation(objects.model[k].facenormals[whichhit],0,objects.rotation[k],0)*-1; @@ -479,14 +498,16 @@ void Weapon::DoStuff(int i) { if(findLengthfast(&bounceness)>1){ int whichsound; - if(type==staff)whichsound=footstepsound3+abs(Random()%2); - if(type!=staff)whichsound=clank1sound+abs(Random()%4); + if(type==staff) + whichsound=footstepsound3+abs(Random()%2); + else + whichsound=clank1sound+abs(Random()%4); emit_sound_at(whichsound, position, 128*findLengthfast(&bounceness)); } } - if((objects.type[k]!=boxtype&&objects.type[k]!=platformtype&&objects.type[k]!=walltype&&objects.type[k]!=weirdtype)||objects.rotation2[k]!=0) - for(m=0;m<2;m++){ + if((objects.type[k]!=boxtype && objects.type[k]!=platformtype && objects.type[k]!=walltype && objects.type[k]!=weirdtype)||objects.rotation2[k]!=0) + for(int m=0;m<2;m++){ mid=(position*(21+(float)m*10)+tippoint*(19-(float)m*10))/40; oldmid2=mid; oldmid=(oldposition*(21+(float)m*10)+oldtippoint*(19-(float)m*10))/40; @@ -494,7 +515,7 @@ void Weapon::DoStuff(int i) { start=oldmid; end=mid; whichhit=objects.model[k].LineCheck(&start,&end,&colpoint,&objects.position[k],&objects.rotation[k]); - if(whichhit!=-1){ + if(whichhit!=-1) { hitsomething=1; mid=colpoint; terrainnormal=DoRotation(objects.model[k].facenormals[whichhit],0,objects.rotation[k],0)*-1; @@ -510,8 +531,10 @@ void Weapon::DoStuff(int i) { if(findLengthfast(&bounceness)>1){ int whichsound; - if(type==staff)whichsound=footstepsound3+abs(Random()%2); - if(type!=staff)whichsound=clank1sound+abs(Random()%4); + if(type==staff) + whichsound=footstepsound3+abs(Random()%2); + else + whichsound=clank1sound+abs(Random()%4); emit_sound_at(whichsound, mid, 128*findLengthfast(&bounceness)); } position+=(mid-oldmid2)*(20/(1+(float)m*10)); @@ -524,7 +547,7 @@ void Weapon::DoStuff(int i) { start=oldmid; end=mid; whichhit=objects.model[k].LineCheck(&start,&end,&colpoint,&objects.position[k],&objects.rotation[k]); - if(whichhit!=-1){ + if(whichhit!=-1) { hitsomething=1; mid=colpoint; terrainnormal=DoRotation(objects.model[k].facenormals[whichhit],0,objects.rotation[k],0)*-1; @@ -540,8 +563,10 @@ void Weapon::DoStuff(int i) { if(findLengthfast(&bounceness)>1){ int whichsound; - if(type==staff)whichsound=footstepsound3+abs(Random()%2); - if(type!=staff)whichsound=clank1sound+abs(Random()%4); + if(type==staff) + whichsound=footstepsound3+abs(Random()%2); + else + whichsound=clank1sound+abs(Random()%4); emit_sound_at(whichsound, mid, 128*findLengthfast(&bounceness)); } tippoint+=(mid-oldmid2)*(20/(1+(float)m*10)); @@ -552,48 +577,52 @@ void Weapon::DoStuff(int i) { start=position; end=tippoint; whichhit=objects.model[k].LineCheck(&start,&end,&colpoint,&objects.position[k],&objects.rotation[k]); - if(whichhit!=-1){ + if(whichhit!=-1) { hitsomething=1; closestdistance=-1; closestswordpoint=colpoint;//(position+tippoint)/2; point[0]=DoRotation(objects.model[k].vertex[objects.model[k].Triangles[whichhit].vertex[0]],0,objects.rotation[k],0)+objects.position[k]; point[1]=DoRotation(objects.model[k].vertex[objects.model[k].Triangles[whichhit].vertex[1]],0,objects.rotation[k],0)+objects.position[k]; point[2]=DoRotation(objects.model[k].vertex[objects.model[k].Triangles[whichhit].vertex[2]],0,objects.rotation[k],0)+objects.position[k]; - if(DistancePointLine(&closestswordpoint, &point[0], &point[1], &distance,&colpoint )) + if(DistancePointLine(&closestswordpoint, &point[0], &point[1], &distance,&colpoint )) { if(distance1){ + + if(findLengthfast(&bounceness)>1) { int whichsound; if(terrain.getOpacity(position.x,position.z)>.2){ - if(type==staff)whichsound=footstepsound3+abs(Random()%2); - if(type!=staff)whichsound=clank1sound+abs(Random()%4); + if(type==staff) + whichsound=footstepsound3+abs(Random()%2); + else + whichsound=clank1sound+abs(Random()%4); + } else { + whichsound=footstepsound+abs(Random()%2); } - else whichsound=footstepsound+abs(Random()%2); emit_sound_at(whichsound, position, findLengthfast(&bounceness) - * (terrain.getOpacity(position.x,position.z) > .2 - ? 128. - : 32.)); + * (terrain.getOpacity(position.x,position.z) > .2 ? 128. : 32.)); - if(terrain.getOpacity(position.x,position.z)<.2){ + if(terrain.getOpacity(position.x,position.z)<.2) { XYZ terrainlight; terrainlight=terrain.getLighting(position.x,position.z); if(environment==snowyenvironment){ - if(findDistancefast(&position,&viewer)1){ + if(findLengthfast(&bounceness)>1){ int whichsound; if(terrain.getOpacity(tippoint.x,tippoint.z)>.2){ - if(type==staff)whichsound=footstepsound3+abs(Random()%2); - if(type!=staff)whichsound=clank1sound+abs(Random()%4); + if(type==staff) + whichsound=footstepsound3+abs(Random()%2); + else + whichsound=clank1sound+abs(Random()%4); + } else { + whichsound=footstepsound+abs(Random()%2); } - else whichsound=footstepsound+abs(Random()%2); emit_sound_at(whichsound, tippoint, findLengthfast(&bounceness) - * (terrain.getOpacity(tippoint.x,tippoint.z) > .2 - ? 128. - : 32.)); + * (terrain.getOpacity(tippoint.x,tippoint.z) > .2 ? 128. : 32.)); - if(terrain.getOpacity(tippoint.x,tippoint.z)<.2){ + if(terrain.getOpacity(tippoint.x,tippoint.z)<.2) { XYZ terrainlight; terrainlight=terrain.getLighting(tippoint.x,tippoint.z); if(environment==snowyenvironment){ - if(findDistancefast(&tippoint,&viewer).4){ velocity=0; tipvelocity=0; @@ -796,35 +830,35 @@ void Weapon::DoStuff(int i) { } } multiplier=tempmult; - if(blooddrip&&bloody){ + if(blooddrip && bloody) { blooddripdelay-=blooddrip*multiplier/2; blooddrip-=multiplier; - if(blooddrip<0)blooddrip=0; - if(blooddrip>5)blooddrip=5; - if(blooddripdelay<0&&bloodtoggle){ + if(blooddrip<0) blooddrip=0; + if(blooddrip>5) blooddrip=5; + if(blooddripdelay<0 && bloodtoggle) { blooddripdelay=1; XYZ bloodvel; XYZ bloodloc; bloodloc=position+(tippoint-position)*.7; bloodloc.y-=.05; - if(bloodtoggle){ + if(bloodtoggle) { bloodvel=0; Sprite::MakeSprite(bloodsprite, bloodloc,bloodvel, 1,1,1, .03, 1); } } } - if(onfire){ + if(onfire) { flamedelay-=multiplier; - if(onfire&&flamedelay<=0){ + if(onfire&&flamedelay<=0) { flamedelay=.020; flamedelay-=multiplier; normalrot=0; - if(owner!=-1){ + if(owner!=-1) { normalrot=player[owner].velocity; } normalrot.y+=1; - if(owner!=-1){ - if(player[owner].onterrain){ + if(owner!=-1) { + if(player[owner].onterrain) { normalrot.y=1; } } @@ -834,13 +868,13 @@ void Weapon::DoStuff(int i) { } } - if(!onfire&&owner==-1&&type!=staff){ + if(!onfire && owner==-1 && type!=staff) { flamedelay-=multiplier; - if(flamedelay<=0){ + if(flamedelay<=0) { flamedelay=.020; flamedelay-=multiplier; normalrot=0; - if(Random()%50==0&&findDistancefast(&position,&viewer)>80){ + if(Random()%50==0&&findDistancefast(&position,&viewer)>80) { XYZ shinepoint; shinepoint=position+(tippoint-position)*(((float)abs(Random()%100))/100); Sprite::MakeSprite(weaponshinesprite, shinepoint,normalrot, 1,1,1, (.1+(float)abs(Random()%100)/200-.25)*1/3*fast_sqrt(findDistance(&shinepoint,&viewer)), 1); @@ -860,30 +894,47 @@ void Weapons::DoStuff() { } void Weapon::Draw() { - static int j; static XYZ terrainlight; static GLfloat M[16]; - static bool draw; - if((frustum.SphereInFrustum(position.x,position.y,position.z,1)&&findDistancefast(&viewer,&position)1)||(player[owner].currentanimation==staffhitreversedanim&&player[owner].currentframe>1)||(player[owner].currentanimation==staffspinhitanim&&player[owner].currentframe>1)||(player[owner].currentanimation==staffspinhitreversedanim&&player[owner].currentframe>1)||(player[owner].currentanimation==staffgroundsmashanim&&player[owner].currentframe>1)||(player[owner].targetanimation==swordslashanim&&player[owner].targetframe<7)||player[owner].targetanimation==crouchstabanim||player[owner].targetanimation==swordslashreversalanim||player[owner].targetanimation==swordslashreversedanim||player[owner].targetanimation==knifefollowanim||player[owner].targetanimation==swordgroundstabanim||player[owner].targetanimation==knifethrowanim)&&player[owner].targetanimation==lastdrawnanim&&!player[owner].skeleton.free) + draw=true; + if ( + (player[owner].targetanimation==knifeslashstartanim|| + player[owner].targetanimation==swordsneakattackanim|| + (player[owner].currentanimation==staffhitanim && player[owner].currentframe>1)|| + (player[owner].currentanimation==staffhitreversedanim && player[owner].currentframe>1)|| + (player[owner].currentanimation==staffspinhitanim && player[owner].currentframe>1)|| + (player[owner].currentanimation==staffspinhitreversedanim && player[owner].currentframe>1)|| + (player[owner].currentanimation==staffgroundsmashanim && player[owner].currentframe>1)|| + (player[owner].targetanimation==swordslashanim && player[owner].targetframe<7)|| + player[owner].targetanimation==crouchstabanim|| + player[owner].targetanimation==swordslashreversalanim|| + player[owner].targetanimation==swordslashreversedanim|| + player[owner].targetanimation==knifefollowanim|| + player[owner].targetanimation==swordgroundstabanim|| + player[owner].targetanimation==knifethrowanim)&& + player[owner].targetanimation==lastdrawnanim&& + !player[owner].skeleton.free + ) { drawhowmany=10; + } else { + drawhowmany=1; } - else drawhowmany=1; if(player[owner].targetanimation==swordgroundstabanim) { lastdrawnrotation1=rotation1; @@ -903,14 +954,15 @@ void Weapon::Draw() { { glAlphaFunc(GL_GREATER, 0.01); } - for(j=drawhowmany;j>0;j--) + for(int j=drawhowmany;j>0;j--) { glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); glColor4f(terrainlight.x,terrainlight.y,terrainlight.z,j/drawhowmany); - if(owner!=-1)glTranslatef(position.x*(((float)(j))/drawhowmany)+lastdrawnposition.x*(1-((float)(j))/drawhowmany),position.y*(((float)(j))/drawhowmany)-.02+lastdrawnposition.y*(1-((float)(j))/drawhowmany),position.z*(((float)(j))/drawhowmany)+lastdrawnposition.z*(1-((float)(j))/drawhowmany)); - if(owner==-1)glTranslatef(position.x*(((float)(j))/drawhowmany)+lastdrawnposition.x*(1-((float)(j))/drawhowmany),position.y*(((float)(j))/drawhowmany)+lastdrawnposition.y*(1-((float)(j))/drawhowmany),position.z*(((float)(j))/drawhowmany)+lastdrawnposition.z*(1-((float)(j))/drawhowmany)); - //glTranslatef(position.x,position.y-.02,position.z); + if(owner==-1) + glTranslatef(position.x*(((float)(j))/drawhowmany)+lastdrawnposition.x*(1-((float)(j))/drawhowmany),position.y*(((float)(j))/drawhowmany)+lastdrawnposition.y*(1-((float)(j))/drawhowmany),position.z*(((float)(j))/drawhowmany)+lastdrawnposition.z*(1-((float)(j))/drawhowmany)); + else + glTranslatef(position.x*(((float)(j))/drawhowmany)+lastdrawnposition.x*(1-((float)(j))/drawhowmany),position.y*(((float)(j))/drawhowmany)-.02+lastdrawnposition.y*(1-((float)(j))/drawhowmany),position.z*(((float)(j))/drawhowmany)+lastdrawnposition.z*(1-((float)(j))/drawhowmany)); glRotatef(bigrotation*(((float)(j))/drawhowmany)+lastdrawnbigrotation*(1-((float)(j))/drawhowmany),0,1,0); glRotatef(bigtilt2*(((float)(j))/drawhowmany)+lastdrawnbigtilt2*(1-((float)(j))/drawhowmany),1,0,0); glRotatef(bigtilt*(((float)(j))/drawhowmany)+lastdrawnbigtilt*(1-((float)(j))/drawhowmany),0,0,1); -- 2.39.5