From 7ab234b959f75aa6d063b61f8e2a98adf19f2ee6 Mon Sep 17 00:00:00 2001 From: "chirs241097@gmail.com" Date: Mon, 24 Mar 2014 13:57:49 +0000 Subject: Bring back complete scene.(partly) --- CHANGELOG.TXT | 17 +++++++++-------- VERSION.TXT | 2 +- main.cpp | 42 ++++++++++++++++++++++++++++++++++++------ menus.h | 41 +++++++++++++++++++++++++---------------- scorec.h | 24 ++++++++++++------------ 5 files changed, 83 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index da257ad..2cfe05c 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,16 +1,16 @@ =================================================================== Next version: -0.8.1-1_PR (b77) +0.8.2-0_PR (b78) Todo's: -(the only) New level. -Random segmentation fault in "Hyper-threading". -Random crashes in Windows. -Circle Indicator crashes in mingw-w64 build. +Random segmentation fault in "Hyper-threading".(seen only once, +can not reproduce now...) Pre-Released versions: +0.8.1-1_PR (b77) +All parts from level -1 to 7 are completed! +Fixed the crash in the mingw-w64 build. + 0.8.1-0_PR (b76) -There're only one level left before another public PR version!... -===Real changelog starts from here=== New level "Sink over the horizon". New level "Gravity vortex". New level "Double reflective". @@ -20,7 +20,8 @@ Modify "Gravity vortex". Modify "Achromatopsia". (Thanks to my classmate's advice...) Report build and version in the log file. Add command line argument support. Use "--help" for usage. -Add freetype support to hge. It's still pretty buggy. +Add freetype support to hge. It's still pretty buggy. (and make +the executable extremely big!) Add experimental support for cross compiling with mingw-w64. (Mingw-w64 build might be the official build in the future.) Fix blinking HangUpText. diff --git a/VERSION.TXT b/VERSION.TXT index f5a179d..82bd847 100755 --- a/VERSION.TXT +++ b/VERSION.TXT @@ -1 +1 @@ -0.8.1-0_PR (b76) \ No newline at end of file +0.8.1-1_PR (b77) \ No newline at end of file diff --git a/main.cpp b/main.cpp index 55a8d2b..14f7e51 100644 --- a/main.cpp +++ b/main.cpp @@ -518,12 +518,42 @@ void CallLevels() if (level==-1&&part==20)Levelm1Part20(); if (level==-1&&part==21)Levelm1Part21(); if (level==1&&part==5)level=2,part=0; - if (level==2&&part==10)level=3,part=0; - if (level==3&&part==7)level=4,part=0; - if (level==4&&part==26)level=5,part=0; - if (level==5&&part==23)level=6,part=0; - if (level==6&&part==32)level=7,part=0; - if (level==7&&part==27)level=-1,part=0; + if (level==2&&part==10) + { + if(mode==3&&coll>10){CompleteGUI_Init();return;} + if(mode==1&&restarts>1){CompleteGUI_Init();return;} + level=3,part=0; + } + if (level==3&&part==7) + { + if(mode==3&&coll>40){CompleteGUI_Init();return;} + if(mode==1&&restarts>2){CompleteGUI_Init();return;} + level=4,part=0; + } + if (level==4&&part==26) + { + if(mode==3&&coll>75){CompleteGUI_Init();return;} + if(mode==1&&restarts>3){CompleteGUI_Init();return;} + level=5,part=0; + } + if (level==5&&part==23) + { + if(mode==3&&coll>125){CompleteGUI_Init();return;} + if(mode==1&&restarts>5){CompleteGUI_Init();return;} + level=6,part=0; + } + if (level==6&&part==32) + { + if(mode==3&&coll>200){CompleteGUI_Init();return;} + if(mode==1&&restarts>8){CompleteGUI_Init();return;} + level=7,part=0; + } + if (level==7&&part==27) + { + if(mode==3&&coll>50){CompleteGUI_Init();return;} + if(mode==1&&restarts>2){CompleteGUI_Init();return;} + level=-1,part=0; + } } bool ProcessCurCred() { diff --git a/menus.h b/menus.h index 97d4a2d..f616946 100644 --- a/menus.h +++ b/menus.h @@ -9,7 +9,7 @@ hgeGUI *StartGUI,*DeathGUI,*CompleteGUI,*HighScoreGUI; hgeGUI *HSViewGUI,*HSDetailGUI,*PauseGUI,*BkTTitleGUI; hgeGUI *OptionsGUI,*PlayerProfGUI; char ds1[255],ds2[255],ds3[255],ds4[255]; -char hs1[255],hs2[255],hs3[255],hs4[255],hs5[255],hs6[255]; +char hs1[255],hs2[255],hs3[255],hs4[255],hs5[255],hs6[255],hs7[255]; char HSVstr[7][255]; char HSDetstr[10][255]; char opt[10][255]; @@ -224,24 +224,33 @@ void NewHighScoreGUI_Render() else TipFont->printf(200,240,HGETEXT_LEFT,"%s_",newname); } +char *getRank() +{ + static char retval[256]; + //stub! + //sprintf something to retval + return retval; +} void CompleteGUI_Init() { CompleteGUI=new hgeGUI(); Current_Position=6; DisableAllTower=true;DisablePlayer=true; - CompleteGUI->AddCtrl(new hgeGUIMenuItem(1,fnt,snd,400,120,0.0f,"YOU DID THAT!")); + CompleteGUI->AddCtrl(new hgeGUIMenuItem(1,fnt,snd,400,120,0.0f,"It Ends Here!")); #ifdef WIN32 if (CheckHighScore()!=-1) sprintf(hs1,"New Highscore %I64d!",score); else sprintf(hs1,"Score %I64d",score); #else - if (CheckHighScore()!=-1) + if (~CheckHighScore()) sprintf(hs1,"New Highscore %lld!",score); else sprintf(hs1,"Score %lld",score); #endif CompleteGUI->AddCtrl(new hgeGUIMenuItem(2,fnt,snd,400,160,0.1f,hs1)); + sprintf(hs7,"Your Ranking: %s",getRank()); + CompleteGUI->AddCtrl(new hgeGUIMenuItem(3,fnt,snd,400,200,0.1f,hs7)); switch (mode) { case 1: @@ -249,29 +258,29 @@ void CompleteGUI_Init() case 4:sprintf(hs2,"Restarts %d",restarts);break; case 3:sprintf(hs2,"Collisions %d",coll);break; } - CompleteGUI->AddCtrl(new hgeGUIMenuItem(3,fnt,snd,400,200,0.2f,hs2)); + CompleteGUI->AddCtrl(new hgeGUIMenuItem(4,fnt,snd,400,240,0.2f,hs2)); sprintf(hs3,"Semi-Collisions %d",semicoll); - CompleteGUI->AddCtrl(new hgeGUIMenuItem(4,fnt,snd,400,240,0.3f,hs3)); + CompleteGUI->AddCtrl(new hgeGUIMenuItem(5,fnt,snd,400,280,0.3f,hs3)); sprintf(hs4,"CLR usage %d",clrusg); - CompleteGUI->AddCtrl(new hgeGUIMenuItem(5,fnt,snd,400,280,0.3f,hs4)); + CompleteGUI->AddCtrl(new hgeGUIMenuItem(6,fnt,snd,400,320,0.3f,hs4)); sprintf(hs5,"Average FPS %.2f",averfps); - CompleteGUI->AddCtrl(new hgeGUIMenuItem(6,fnt,snd,400,320,0.4f,hs5)); + CompleteGUI->AddCtrl(new hgeGUIMenuItem(7,fnt,snd,400,360,0.4f,hs5)); if (CheckHighScore()!=-1) { - CompleteGUI->AddCtrl(new hgeGUIMenuItem(7,fnt,snd,400,360,0.5f,"Keep this in your record?")); - CompleteGUI->AddCtrl(new hgeGUIMenuItem(8,fnt,snd,400,400,0.6f,"Yes")); - CompleteGUI->AddCtrl(new hgeGUIMenuItem(9,fnt,snd,400,440,0.7f,"No thanks...")); + CompleteGUI->AddCtrl(new hgeGUIMenuItem(8,fnt,snd,400,400,0.5f,"Keep this in your record?")); + CompleteGUI->AddCtrl(new hgeGUIMenuItem(9,fnt,snd,400,440,0.6f,"Yes")); + CompleteGUI->AddCtrl(new hgeGUIMenuItem(10,fnt,snd,400,480,0.7f,"No thanks...")); } else { - CompleteGUI->AddCtrl(new hgeGUIMenuItem(7,fnt,snd,400,360,0.5f,"")); - CompleteGUI->AddCtrl(new hgeGUIMenuItem(8,fnt,snd,400,400,0.6f,"")); - CompleteGUI->AddCtrl(new hgeGUIMenuItem(9,fnt,snd,400,440,0.7f,"Back to menu")); + CompleteGUI->AddCtrl(new hgeGUIMenuItem(8,fnt,snd,400,400,0.5f,"")); + CompleteGUI->AddCtrl(new hgeGUIMenuItem(9,fnt,snd,400,440,0.6f,"")); + CompleteGUI->AddCtrl(new hgeGUIMenuItem(10,fnt,snd,400,480,0.7f,"Back to menu")); } for (int i=1;i<=7;++i)CompleteGUI->EnableCtrl(i,false); CompleteGUI->SetCursor(spr); CompleteGUI->SetNavMode(HGEGUI_UPDOWN|HGEGUI_CYCLED); - CompleteGUI->SetFocus(7); + CompleteGUI->SetFocus(8); CompleteGUI->Enter(); } void CompleteGUI_FrameFnk() @@ -282,8 +291,8 @@ void CompleteGUI_FrameFnk() { switch (id) { - case 8:NewHighScoreGUI_Init();CompleteGUI->Leave();break; - case 9:Current_Position=0;gui->Enter();CompleteGUI->Leave();break; + case 9:NewHighScoreGUI_Init();CompleteGUI->Leave();break; + case 10:Current_Position=0;gui->Enter();CompleteGUI->Leave();break; } } } diff --git a/scorec.h b/scorec.h index 69d0cf0..ed4a1b7 100644 --- a/scorec.h +++ b/scorec.h @@ -38,26 +38,26 @@ long long Getll() void Putuint(unsigned int a) { unsigned int c1,c2,c3,c4; - c1=a&0xFF000000;c2=a&0x00FF0000; - c3=a&0x0000FF00;c4=a&0x000000FF; + c1=a&0xFF000000;c1>>=24;c2=a&0x00FF0000;c2>>=16; + c3=a&0x0000FF00;c3>>=8;c4=a&0x000000FF; printf("%c%c%c%c",c1,c2,c3,c4); } void Putint(int a) { Putuint((unsigned int)a); } -void Putll(long long a) +void Putll(unsigned long long a) { - int c1,c2,c3,c4,c5,c6,c7,c8; - c1=a&0xFF00000000000000; - c2=a&0x00FF000000000000; - c3=a&0x0000FF0000000000; - c4=a&0x000000FF00000000; - c5=a&0x00000000FF000000; - c6=a&0x0000000000FF0000; - c7=a&0x000000000000FF00; + unsigned long long c1,c2,c3,c4,c5,c6,c7,c8; + c1=a&0xFF00000000000000;c1>>=44LL; + c2=a&0x00FF000000000000;c2>>=40LL; + c3=a&0x0000FF0000000000;c3>>=36LL; + c4=a&0x000000FF00000000;c4>>=32LL; + c5=a&0x00000000FF000000;c5>>=24LL; + c6=a&0x0000000000FF0000;c6>>=16LL; + c7=a&0x000000000000FF00;c7>>=8LL; c8=a&0x00000000000000FF; - printf("%c%c%c%c%c%c%c%c",c1,c2,c3,c4,c5,c6,c7,c8); + printf("%c%c%c%c%c%c%c%c",(int)c1,(int)c2,(int)c3,(int)c4,(int)c5,(int)c6,(int)c7,(int)c8); } TRecord GetTRecord() { -- cgit v1.2.3