From decb00e82a2e65e25dbcdd8f16fff5a6a07d31d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20BERNIGAUD?= Date: Sun, 6 Jun 2010 00:51:18 +0400 Subject: [PATCH] Remove commented out code --- Source/GameDraw.cpp | 32 +-- Source/GameInitDispose.cpp | 32 --- Source/GameTick.cpp | 652 +------------------------------------------- Source/Person.cpp | 19 -- Source/Weapons.cpp | 7 - 5 files changed, 6 insertions(+), 736 deletions(-) --- Source/GameDraw.cpp | 32 +- Source/GameInitDispose.cpp | 32 -- Source/GameTick.cpp | 652 +------------------------------------ Source/Person.cpp | 19 -- Source/Weapons.cpp | 7 - 5 files changed, 6 insertions(+), 736 deletions(-) diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index 039df01..58142f3 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -567,29 +567,6 @@ int Game::DrawGLScene(StereoSide side) } glPopMatrix(); - //if(cellophane){ - /*glEnable(GL_CULL_FACE); - glCullFace(GL_FRONT); - glDepthMask(1); - for(k=0;k=1)glDisable(GL_BLEND); - if(distance>0){ - checkpoint=DoRotation(player[k].skeleton.joints[abs(Random()%player[k].skeleton.num_joints)].position,0,player[k].rotation,0)*player[k].scale+player[k].coords; - checkpoint.y+=1; - if(checkcollide(viewer,checkpoint)){ - player[k].occluded+=1; - } - else player[k].occluded=0; - if(player[k].occluded<25)player[k].DrawSkeleton(); - } - }*/ - glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_CULL_FACE); glCullFace(GL_FRONT); @@ -3614,13 +3591,6 @@ int Game::DrawGLScene(StereoSide side) } } glPopMatrix(); - /*} - else{ - glPushMatrix(); - sprintf (string, "Hooo!"); - text.glPrint(startx[0],starty[0],string,0,1,640,480); - glPopMatrix(); - }*/ glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE); for(i=0;i<15;i++) @@ -3634,7 +3604,7 @@ int Game::DrawGLScene(StereoSide side) if(mainmenu==4)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480); if(mainmenu==5)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480); if(mainmenu==6)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480); - if(mainmenu==7&&(j!=0||!entername))text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480); + if(mainmenu==7&&(j!=0||!entername)) text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480); if(mainmenu==8)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480); if(mainmenu==9)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480); if(mainmenu==11)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480); diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 47ceb90..9fb279b 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -996,19 +996,6 @@ void Game::InitGame() numchallengelevels=14; - /*char tempstring[256]; - sprintf (tempstring, "%s", registrationname); - long num1; - long num2; - long num3; - long num4; - long long longnum; - longnum = MD5_string ( tempstring); - //longnum = 1111111111111111; - num1 = longnum/100000000; - num2 = longnum%100000000; - sprintf (tempstring, "%d-%d-%d-%d", num1/10000, num1%10000, num2/10000, num2%10000); - */ FILE *tfile; @@ -1321,25 +1308,6 @@ void Game::InitGame() newdetail=detail; newscreenwidth=screenwidth; newscreenheight=screenheight; - - - - /* - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); - OPENAL_SetVolume(channels[firestartsound], 256); - OPENAL_SetPaused(channels[firestartsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; - */ } diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 8138608..155ee8a 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -1212,192 +1212,7 @@ void Screenshot (void) mkdir("Screenshots", S_IRWXU); #endif - ScreenShot(temp/*"Screenshots\\Screenshot.png"*/); - - /*FSSpec MAC_file; - GraphicsExportComponent QT_exporter; - OSErr MAC_error_code; - CGrafPtr MAC_currentPort; - GDHandle MAC_currentDevice; - unsigned char* MAC_pixels; - Rect MAC_picture_rectangle; - GWorldPtr MAC_offscreen_graphics_port; - - static int numscreenshots=0; - - // Make an FSSpec - static char buf[256]; - if(numscreenshots==0){ - buf[0]=26; - buf[1]=':'; - buf[2]='S'; - buf[3]='c'; - buf[4]='r'; - buf[5]='e'; - buf[6]='e'; - buf[7]='n'; - buf[8]='s'; - buf[9]='h'; - buf[10]='o'; - buf[11]='t'; - buf[12]='s'; - buf[13]=':'; - buf[14]='S'; - buf[15]='c'; - buf[16]='r'; - buf[17]='e'; - buf[18]='e'; - buf[19]='n'; - buf[20]='s'; - buf[21]='h'; - buf[22]='o'; - buf[23]='t'; - buf[24]='0'; - buf[25]='0'; - buf[26]='0'; - } - - FInfo *fndrInfo; - FSMakeFSSpec(0, 0, (unsigned char*)buf, &MAC_file); - while(!FSpGetFInfo (&MAC_file, fndrInfo)){ - FSMakeFSSpec(0, 0, (unsigned char*)buf, &MAC_file); - if(!FSpGetFInfo (&MAC_file, fndrInfo)){ - numscreenshots++; - buf[26]++; - if(buf[26]==':'){ - buf[26]='0'; - buf[25]++; - if(buf[25]==':'){ - buf[25]='0'; - buf[24]++; - if(buf[24]==':'){ - buf[24]='9'; - buf[25]='9'; - buf[26]='9'; - } - } - } - } - } - - - // Get the GWorld - GWorldPtr MAC_gWorld = (CGrafPtr) FrontWindow(); - //assert(MAC_gWorld != NULL); - - // Allocate memory for loading image - MAC_pixels = new unsigned char[(int)(screenheight * screenwidth * 4)]; - if (MAC_pixels == NULL) { - //UTIL_Error("Could not create Texture data."); - return; - } - - // Get GWorld - ::GetGWorld(&MAC_currentPort, &MAC_currentDevice); - - // Make a picture Rectangle - MAC_picture_rectangle.left = 0; - MAC_picture_rectangle.right = screenwidth; - MAC_picture_rectangle.top = 0; - MAC_picture_rectangle.bottom = screenheight; - - // Create new offscreen GWorld - MAC_error_code = ::QTNewGWorldFromPtr (&MAC_offscreen_graphics_port, k32ARGBPixelFormat, &MAC_picture_rectangle, NULL, NULL, 0, (char *) MAC_pixels, screenwidth * 4); - if (MAC_error_code) { - ::SetGWorld(MAC_currentPort, MAC_currentDevice); - delete MAC_pixels; - //UTIL_Error("Could not create offscreen GWorld. "); - return; - - } - - // Copy OpenGL Context to new GWorld - glReadBuffer(GL_FRONT); - glReadPixels(0,0,screenwidth,screenheight,GL_RGBA,GL_UNSIGNED_BYTE,MAC_pixels); - - // Swizzle texture - for (unsigned long byte = 0; byte < screenheight * screenwidth * 4; byte+=4) { - unsigned char temp = MAC_pixels[byte+0]; - MAC_pixels[byte+0] = MAC_pixels[byte+3]; - MAC_pixels[byte+3] = MAC_pixels[byte+2]; - MAC_pixels[byte+2] = MAC_pixels[byte+1]; - MAC_pixels[byte+1] = temp; - } - - // Flip the image :( This could probably be optimized - int vert; - int src_index; - int dst_index; - unsigned char temp; - for (int horz = 0; horz < screenwidth; ++horz) - for (vert = 0; vert < screenheight / 2; ++vert) { - src_index = (screenwidth * vert + horz) * 4; - dst_index = (screenwidth * (screenheight - vert - 1) + horz) * 4; - - temp=MAC_pixels[src_index+0]; - MAC_pixels[src_index+0]=MAC_pixels[dst_index+0]; - MAC_pixels[dst_index+0]=temp; - - temp=MAC_pixels[src_index+1]; - MAC_pixels[src_index+1]=MAC_pixels[dst_index+1]; - MAC_pixels[dst_index+1]=temp; - - temp=MAC_pixels[src_index+2]; - MAC_pixels[src_index+2]=MAC_pixels[dst_index+2]; - MAC_pixels[dst_index+2]=temp; - - temp=MAC_pixels[src_index+3]; - MAC_pixels[src_index+3]=MAC_pixels[dst_index+3]; - MAC_pixels[dst_index+3]=temp; - } - - - - // Export the Gworld - MAC_error_code = OpenADefaultComponent(GraphicsExporterComponentType, kQTFileTypeBMP, &QT_exporter); - if (MAC_error_code) { - //UTIL_Warning("Unable to export screenshot."); - ::SetGWorld(MAC_currentPort, MAC_currentDevice); - ::DisposeGWorld(MAC_offscreen_graphics_port); - delete MAC_pixels; - return; - } - - MAC_error_code = GraphicsExportSetInputGWorld(QT_exporter,MAC_offscreen_graphics_port); - if (MAC_error_code) { - ::CloseComponent(QT_exporter); - ::SetGWorld(MAC_currentPort, MAC_currentDevice); - ::DisposeGWorld(MAC_offscreen_graphics_port); - delete MAC_pixels; - //UTIL_Warning("Unable to export screenshot."); - return; - } - - MAC_error_code = GraphicsExportSetOutputFile(QT_exporter,&MAC_file); - if (MAC_error_code) { - ::CloseComponent(QT_exporter); - ::SetGWorld(MAC_currentPort, MAC_currentDevice); - ::DisposeGWorld(MAC_offscreen_graphics_port); - delete MAC_pixels; - //UTIL_Warning("Unable to export screenshot."); - return; - } - - MAC_error_code = GraphicsExportDoExport(QT_exporter,NULL); - if (MAC_error_code) { - ::CloseComponent(QT_exporter); - ::SetGWorld(MAC_currentPort, MAC_currentDevice); - ::DisposeGWorld(MAC_offscreen_graphics_port); - delete MAC_pixels; - //UTIL_Warning("Unable to export screenshot."); - return; - } - - ::CloseComponent(QT_exporter); - ::SetGWorld(MAC_currentPort, MAC_currentDevice); - ::DisposeGWorld(MAC_offscreen_graphics_port); - - delete MAC_pixels;*/ + ScreenShot(temp); } @@ -2532,12 +2347,7 @@ void Game::Loadlevel(char *name){ weapons.position[i]=-1000; weapons.tippoint[i]=-1000; } - -/* for(i=0;i<32;i++){ - //if(i<16||i>20) - OPENAL_StopSound(i); - } -*/ + LOG("Starting background music..."); OPENAL_StopSound(OPENAL_ALL); @@ -2577,17 +2387,6 @@ void Game::Loadlevel(char *name){ oldmusicvolume[2]=0; oldmusicvolume[3]=0; - - /*LoadTexture(":Data:Textures:cloud.png",&sprites.cloudtexture,1,1); - LoadTexture(":Data:Textures:cloudimpact.png",&sprites.cloudimpacttexture,1,1); - LoadTexture(":Data:Textures:bloodparticle.png",&sprites.bloodtexture,1,1); - LoadTexture(":Data:Textures:snowflake.png",&sprites.snowflaketexture,1,1); - LoadTexture(":Data:Textures:flame.png",&sprites.flametexture,1,1); - LoadTexture(":Data:Textures:bloodflame.png",&sprites.bloodflametexture,1,1); - LoadTexture(":Data:Textures:smoke.png",&sprites.smoketexture,1,1); - LoadTexture(":Data:Textures:shine.png",&sprites.shinetexture,1,0); - */ - if(!firstload) { firstload=1; @@ -2682,94 +2481,7 @@ void Game::Tick() if(mainmenu==0&&!winfreeze)mainmenu=2; else if(mainmenu==0&&winfreeze&&(campaignchoosenext[campaignchoicewhich[whichchoice]])==1)mainmenu=100; else if(mainmenu==0&&winfreeze){ - /* if(campaignchoosenext[campaignchoicewhich[whichchoice]]==2) - stealthloading=1; - else stealthloading=0; - - if(!stealthloading){ - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); - OPENAL_SetVolume(channels[firestartsound], 256); - OPENAL_SetPaused(channels[firestartsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; - } - - startbonustotal=0; - - for(i=0;i1&&numplayers1&&checkdelay<=0){ - checkdelay=.015; - for(k=0;kplayer[k].coords.y-3) - if(player[i].coords.yplayer[k].coords.x-3) - if(player[i].coords.xplayer[k].coords.z-3) - if(player[i].coords.zplayer[k].skeleton.longdead&&player[k].skeleton.free!=2)||player[i].skeleton.free==2){ - stuck=i; - moving=k; - } - else - { - moving=i; - stuck=k; - } - isgood=1; - - if(isgood){ - above[moving]=stuck; - for(l=0;l.8&&!player[i].jumpkeydown&&player[i].collided<.8)player[i].targetrotation+=90*(player[i].whichdirection*2-1); - /*for(j=0;jid==i&&(player[j].targetanimation==spinkickanim&&player[j].targetframe<3)){ - player[i].crouchkeydown=1; - } - }*/ if(Random()%2==0/*||player[0].weaponactive!=-1*/||player[i].weaponactive!=-1||player[i].creature==wolftype)player[i].attackkeydown=1; else player[i].attackkeydown=0; if((player[i].isRun())&&Random()%6&&findDistancefast(&player[i].coords,&player[0].coords)>7)player[i].attackkeydown=0; - //if(player[i].attackkeydown&&findDistancefast(&player[i].coords,&player[0].coords)<3&&player[i].targetanimation!=runanim&&!player[0].skeleton.free)player[i].crouchkeydown=1; - /*if(player[0].targetanimation==rabbitkickanim&&!player[0].skeleton.free){ - player[i].attackkeydown=0; - if(player[i].isIdle())player[i].crouchkeydown=1; - player[i].forwardkeydown=0; - player[i].aiupdatedelay=.02; - }*/ if(player[i].aitype!=playercontrolled&&(player[i].isIdle()||player[i].isCrouch()||player[i].isRun())){ target=-2; @@ -9050,42 +8460,7 @@ void Game::Tick() } objects.DoStuff(); - /* - player[0].righthandmorphstart=0; - player[0].righthandmorphend=1; - player[0].lefthandmorphstart=0; - player[0].lefthandmorphend=1; - player[0].headmorphstart=0; - player[0].headmorphend=2;*/ - - /* - if(IsKeyDown( theKeyMap, MAC_P_KEY )){ - if(player[0].righthandmorphend!=1)player[0].righthandmorphness=0; - player[0].righthandmorphend=1; - player[0].targetrighthandmorphness=1; - - if(player[0].lefthandmorphend!=0)player[0].lefthandmorphness=0; - player[0].lefthandmorphend=0; - player[0].targetlefthandmorphness=1; - - if(player[0].headmorphend!=2)player[0].headmorphness=0; - player[0].headmorphend=2; - player[0].targetheadmorphness=1; - } - if(IsKeyDown( theKeyMap, MAC_L_KEY )){ - if(player[0].righthandmorphend!=0)player[0].righthandmorphness=0; - player[0].righthandmorphend=0; - player[0].targetrighthandmorphness=1; - - if(player[0].lefthandmorphend!=1)player[0].lefthandmorphness=0; - player[0].lefthandmorphend=1; - player[0].targetlefthandmorphness=1; - - if(player[0].headmorphend!=0)player[0].headmorphness=0; - player[0].headmorphend=0; - player[0].targetheadmorphness=1; - } - */ + if(numenvsounds!=0) for(j=numenvsounds-1;j>=0;j--){ envsoundlife[j]-=multiplier; @@ -9252,7 +8627,6 @@ void Game::Tick() } void Game::TickOnce(){ - //if(!console){ if(!mainmenu) if(directing||indialogue==-1){ rotation+=deltah*.7; @@ -9262,8 +8636,6 @@ void Game::TickOnce(){ if(rotation2<-70)rotation2=-70; } if(mainmenu)rotation+=multiplier*5; - - //} } void Game::TickOnceAfter(){ @@ -9341,14 +8713,6 @@ void Game::TickOnceAfter(){ else musicvolume[1]-=multiplier*450; if(musicselected==stream_music3)musicvolume[2]+=multiplier*450; else musicvolume[2]-=multiplier*450; - /* - if(musicselected==music1)musicvolume[0]+=multiplier*100; - else musicvolume[0]-=multiplier*450; - if(musicselected==music2)musicvolume[1]+=multiplier*150; - else if(player[0].dead)musicvolume[1]-=multiplier*450; - else musicvolume[1]-=multiplier*100; - if(musicselected==music3)musicvolume[2]+=multiplier*450; - else musicvolume[2]-=multiplier*450;*/ for(i=0;i<3;i++){ if(musicvolume[i]<0)musicvolume[i]=0; @@ -9626,8 +8990,6 @@ void Game::TickOnceAfter(){ startbonustotal=0; ifstream ipstream(ConvertFileName(":Data:Campaigns:main.txt")); - //campaignnumlevels=0; - //accountcampaignchoicesmade[accountactive]=0; ipstream.ignore(256,':'); ipstream >> campaignnumlevels; for(i=0;iobjects.position[i].y+3*objects.scale[i]){ - /*if(onfire){ - if(!objects.onfire[i]){ - float gLoc[3]; - float vel[3]; - gLoc[0]=objects.position[i].x; - gLoc[1]=objects.position[i].y; - gLoc[2]=objects.position[i].z; - vel[0]=0; - vel[1]=0; - vel[2]=0; - PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); - OPENAL_SetVolume(channels[firestartsound], 256); - OPENAL_SetPaused(channels[firestartsound], false); - objects.onfire[i]=1; - } - }*/ if(objects.messedwith[i]<=0){ XYZ tempvel; XYZ pos; @@ -6276,8 +6259,6 @@ void Person::DoStuff(){ } } speechdelay=.3; - //else if(animation[targetanimation].label[targetframe]==4)whichsound=knifeswishsound; - //if(animation[targetanimation].label[targetframe]==8)whichsound=landsound2; if(whichsound!=-1){ PlaySoundEx( whichsound, samp[whichsound], NULL, true); diff --git a/Source/Weapons.cpp b/Source/Weapons.cpp index 2caa4c6..496e0fe 100644 --- a/Source/Weapons.cpp +++ b/Source/Weapons.cpp @@ -106,13 +106,6 @@ void Weapons::DoStuff(){ XYZ speed; //speed=(tippoint[i]-oldtippoint[i])/multiplier/6; speed=0; - /*for(j=0;j<10;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; - tempvel+=speed; - sprites.MakeSprite(cloudimpactsprite, position[i]+(tippoint[i]-position[i])*((float)j-2)/8,tempvel*.5, 115/255,73/255,12/255, .15+float(abs(Random()%100)-50)/1000, .7); - }*/ for(j=0;j<40;j++){ tempvel.x=float(abs(Random()%100)-50)/20; tempvel.y=float(abs(Random()%100)-50)/20; -- 2.39.2