diff --git a/source/code/main.cpp b/source/code/main.cpp index 27ec2a5..65186dc 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp @@ -1950,12 +1950,11 @@ void DrawStats() string toPrint = numberAsString + "/" + numberAsString2; SFont_Write(screen,fBlueFont,x_offset+230,y,toPrint.c_str()); } - - SDL_Flip(screen); //Update screen } void OpenScoresDisplay() { + int mousex,mousey; bool done = false; //We are done! int page = 0; const int numberOfPages = 3; @@ -1977,12 +1976,16 @@ void OpenScoresDisplay() }; - SDL_Flip(screen); //Update screen + SDL_Delay(10); SDL_Event event; + + SDL_GetMouseState(&mousex,&mousey); while ( SDL_PollEvent(&event) ) { + + if ( event.type == SDL_QUIT ) { done = true; } @@ -2013,7 +2016,8 @@ void OpenScoresDisplay() } } //while(event) - + DrawIMG(mouse,screen,mousex,mousey); + SDL_Flip(screen); //Update screen } } @@ -2085,13 +2089,13 @@ bool OpenFileDialogbox(int x, int y, char *name) bMouseUp = false; //The Forward Button: - if ( (mousex>x+460) && (mousexy+420) && (mouseyx+460) && (mousexy+420) && (mouseyx+20) && (mousexy+420) && (mouseyx+20) && (mousexy+420) && (mouseyx+460) && (mousexy+420) && (mouseyx+460) && (mousexy+420) && (mouseyx+20) && (mousexy+420) && (mouseyx+20) && (mousexy+420) && (mouseyx+460) && (mousexy+420) && (mouseyx+460) && (mousexy+420) && (mouseyx+20) && (mousexy+420) && (mouseyx+20) && (mousexy+420) && (mouseySave clicked! //cout << "Replay->Save clicked" << endl; @@ -4451,7 +4455,7 @@ int main(int argc, char *argv[]) closeAllMenus(); } else - if ((360Load clicked! //cout << "Replay->Load clicked" << endl; @@ -4497,7 +4501,7 @@ int main(int argc, char *argv[]) closeAllMenus(); } else - if ((xsize-120mousex) && (ysize-120mousey)) + if ((xsize-120mousex) && (ysize-buttonXsizemousey)) { //Exit clicked done=1; diff --git a/source/code/mainVars.hpp b/source/code/mainVars.hpp index a7d5ef9..4dfa66a 100644 --- a/source/code/mainVars.hpp +++ b/source/code/mainVars.hpp @@ -321,6 +321,9 @@ enum stageButton {SBdontShow, SBstageClear, SBpuzzleMode}; stageButton stageButtonStatus = SBdontShow; +const int buttonXsize = 120; +const int buttonYsize = 40; + struct ButtonCords { int x; @@ -330,14 +333,14 @@ struct ButtonCords }; ButtonCords cordNextButton = { -cordNextButton.x = 150+(150-120)/2, +cordNextButton.x = 150+(150-buttonXsize)/2, cordNextButton.y = 500, -cordNextButton.xsize = 120, -cordNextButton.ysize = 40}; +cordNextButton.xsize = buttonXsize, +cordNextButton.ysize = buttonYsize}; ButtonCords cordRetryButton = { -cordRetryButton.x = (150-120)/2, +cordRetryButton.x = (150-buttonXsize)/2, cordRetryButton.y = 500, -cordRetryButton.xsize = 120, -cordRetryButton.ysize = 40 +cordRetryButton.xsize = buttonXsize, +cordRetryButton.ysize = buttonYsize };