diff --git a/icon.jpg b/icon.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2a774d3eac3a7969ace32f300d13a08de7652ad9 Binary files /dev/null and b/icon.jpg differ diff --git a/include/Cursor.hpp b/include/Cursor.hpp index 0e991fbb060ddbfbba4bf1e6e252699896e114e8..68b4da2303c69adcad89c3025b163a09cfc5e6e7 100644 --- a/include/Cursor.hpp +++ b/include/Cursor.hpp @@ -25,7 +25,7 @@ public: void printCursor(RenderWindow render); - bool checkInputCursor(int value); + int checkInputCursor(int value); int getPosX(){ return posX; diff --git a/source/cursor.cpp b/source/cursor.cpp index 68cdb9dcf60d90ae311ed566f56f207593b315d8..af078ad087b38228c97c8a9053d6e534358068bc 100644 --- a/source/cursor.cpp +++ b/source/cursor.cpp @@ -25,7 +25,7 @@ void Cursor::moveCursorX(bool right) } } -bool Cursor::checkInputCursor(int value) +int Cursor::checkInputCursor(int value) { std::cout << "dans check input\n"; @@ -79,7 +79,11 @@ bool Cursor::checkInputCursor(int value) } else if (line == 1 and column == 1){ - return true; + return 1; + } + + else if (line == 1 and column == 0){ + return 2; } } diff --git a/source/main.cpp b/source/main.cpp index 0c44450424413eb96b89eae98b19680810142bd6..e5df8929c45f3303d3c49342e808e92d5f6debc1 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -24,6 +24,7 @@ int main(int argc, char *argv[]) SDL_Event event; int inputValue = -1; + int inputcheck = 0; bool isOpen = true; @@ -37,10 +38,15 @@ int main(int argc, char *argv[]) { case SDL_JOYBUTTONDOWN: inputValue = event.jbutton.button; - if(cursor.checkInputCursor(inputValue)) + inputcheck = cursor.checkInputCursor(inputValue); + if(inputcheck == 1) { menu.printAbout(); } + else if(inputcheck == 2) + { + isOpen = false; + } default: inputValue = -1; @@ -56,14 +62,15 @@ int main(int argc, char *argv[]) cursor.printCursor(window); - - - window.display(); SDL_Delay(1000 / window.getRefreshRate()); } + SDL_Quit(); + IMG_Quit(); + TTF_Quit(); + return 0; } void init() @@ -83,7 +90,7 @@ void init() if (!(TTF_Init())) { - std::cout << "HEY... IMG_Init HAS FAILED. SDL_ERROR: " << TTF_GetError() << std::endl; + std::cout << "HEY... TTF_Init HAS FAILED. SDL_ERROR: " << TTF_GetError() << std::endl; } std::cout << "after ttf\n"; diff --git a/source/menu.cpp b/source/menu.cpp index c9375778f654978cd9d80f65fa0e31b9b0a5ebe6..5962522a45d5a74174ad93b54d59e91bb5611ada 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -70,7 +70,7 @@ void Menu::printMenu() vEntityCursor.push_back(Entity (Vector2f(rectTemplate.x, rectTemplate.y), tHekate, 258, 258, 0, 0)); vEntityCursor.push_back(Entity (Vector2f(rectTemplate.x + rectTemplate.w + 14, rectTemplate.y), tAMS, 258, 258, 0, 0)); vEntityCursor.push_back(Entity (Vector2f(rectTemplate.x + (rectTemplate.w + 14) * 2, rectTemplate.y), tLockpick, 258, 258, 0, 0)); - vEntityCursor.push_back(Entity (Vector2f(rectTemplate.x + (rectTemplate.w + 14) * 3, rectTemplate.y), tLakka, 258, 258, 0, 0)); + //vEntityCursor.push_back(Entity (Vector2f(rectTemplate.x + (rectTemplate.w + 14) * 3, rectTemplate.y), tLakka, 258, 258, 0, 0)); /*CIRCLE BEHIND SMALL ICONS*/ window.drawCircleBehindIcons(); diff --git a/source/reboot.cpp b/source/reboot.cpp index dd94088629c5fe7fa9f0f0f774e14be8594e5844..eb3c92ab564eac278a946e07a8a4ba45b1a4d1ac 100644 --- a/source/reboot.cpp +++ b/source/reboot.cpp @@ -72,9 +72,8 @@ std::string whichPayload(int payload) return "payload/lockpick.bin"; } - else if (payload == 3) //LAKKA - { - return "payload/lakka.rom"; + else if (payload > 2){ + return "null"; } } @@ -82,6 +81,10 @@ void Reboot::rebootNow(int payload) //0 = hekate, 1 = ams, 2 = lockpick, 3 = lak { Result rc = splInitialize(); + if (whichPayload(payload) == "null"){ + return; + } + FILE *f = fopen(whichPayload(payload).c_str(), "rb"); std::cout << "test\n";