diff --git a/CMakeLists.txt b/CMakeLists.txt index 973380b..34e6895 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ add_definitions(-DSHAREDIR=\"${INSTALL_DATA_DIR}\") endif() #Compiler options -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-sign-compare -std=c++11") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -g") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -O2") diff --git a/source/code/MenuSystem.cpp b/source/code/MenuSystem.cpp index ca4761e..7f84287 100644 --- a/source/code/MenuSystem.cpp +++ b/source/code/MenuSystem.cpp @@ -227,19 +227,19 @@ void Menu::run() { if (event.key.keysym.sym == SDLK_DOWN) { marked++; - if (marked>buttons.size()) { + if (marked> (int)buttons.size()) { marked = 0; } } if (event.key.keysym.sym == SDLK_RETURN || event.key.keysym.sym == SDLK_KP_ENTER ) { - if (marked < buttons.size()) { + if (marked < (int)buttons.size()) { buttons.at(marked)->doAction(); if (buttons.at(marked)->isPopOnRun()) { running = false; } } - if (marked == buttons.size()) { + if (marked == (int)buttons.size()) { running = false; } } @@ -248,10 +248,10 @@ void Menu::run() { } - for (int i=0; imarked = (i == marked); } - exit.marked = (marked == buttons.size()); + exit.marked = (marked == (int)buttons.size()); Uint8 buttonState = SDL_GetMouseState(&mousex,&mousey); // If the mouse button is released, make bMouseUp equal true if ( (buttonState&SDL_BUTTON(1))==0) { @@ -259,7 +259,7 @@ void Menu::run() { } if (abs(mousex-oldmousex)>5 || abs(mousey-oldmousey)>5) { - for (int i=0; i< buttons.size(); ++i) { + for (int i=0; i< (int)buttons.size(); ++i) { if (buttons.at(i)->isClicked(mousex,mousey)) { marked = i; } @@ -274,7 +274,7 @@ void Menu::run() { //mouse clicked if ( (buttonState&SDL_BUTTON(1) )==SDL_BUTTON(1) && bMouseUp) { bMouseUp = false; - for (int i=0; i< buttons.size(); ++i) { + for (int i=0; i< (int)buttons.size(); ++i) { if (buttons.at(i)->isClicked(mousex,mousey)) { buttons.at(i)->doAction(); if (buttons.at(i)->isPopOnRun()) { diff --git a/source/code/ReadKeyboard.cpp b/source/code/ReadKeyboard.cpp index e0897f9..695cec5 100644 --- a/source/code/ReadKeyboard.cpp +++ b/source/code/ReadKeyboard.cpp @@ -47,19 +47,13 @@ ReadKeyboard::ReadKeyboard(const char* oldName) { void ReadKeyboard::putchar(const std::string& thing) { - /*for (char a : thing) { - std::cout << (int)a; - } - std::cout << std::endl; - cout << "Length (pre): " << std::distance(text_string.begin(), position) << endl;*/ - if (text_string.length() < maxLength) { + if ( (int)text_string.length() < maxLength) { int oldPostition = utf8::distance(text_string.begin(), position); int lengthOfInsertString = utf8::distance(thing.begin(), thing.end()); text_string.insert(position, thing.begin(), thing.end()); position = text_string.begin(); //Inserting may destroy our old iterator utf8::advance(position, oldPostition + lengthOfInsertString, text_string.end()); } - //cout << "Length (post): " << std::distance(text_string.begin(), position) << endl; } @@ -82,10 +76,6 @@ bool ReadKeyboard::ReadKey(const SDL_Event& key) { } bool ReadKeyboard::ReadKey(SDL_Keycode keyPressed) { - /*if (keyPressed == SDLK_SPACE) { - ReadKeyboard::putchar(' '); - return true; - }*/ if (keyPressed == SDLK_DELETE) { if ((text_string.length()>0)&& (position stageCleared(nrOfStageLevels); //vector that tells if a stage is cleared -std::vector stageTimes(nrOfStageLevels); //For statistical puposes -std::vector stageScores(nrOfStageLevels); //--||-- -Uint32 totalScore = 0; -Uint32 totalTime = 0; +std::vector stageTimes(nrOfStageLevels); //For statistical puposes +std::vector stageScores(nrOfStageLevels); //--||-- +Sint32 totalScore = 0; +Sint32 totalTime = 0; using namespace std;