diff --git a/src/FileData.h b/src/FileData.h index 817adaa93..a0c7abde8 100644 --- a/src/FileData.h +++ b/src/FileData.h @@ -8,6 +8,7 @@ class FileData { public: + virtual ~FileData() { }; virtual bool isFolder() = 0; virtual std::string getName() = 0; virtual std::string getPath() = 0; diff --git a/src/Font.cpp b/src/Font.cpp index 5ed2372a3..c68acdbfb 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -149,6 +149,8 @@ void Font::buildAtlas() x += g->bitmap.width; } + std::cout << "Final texture coords: " << x << ", " << y << "\n"; + glBindTexture(GL_TEXTURE_2D, 0); //std::cout << "generated texture \"" << textureID << "\" (w: " << w << " h: " << h << ")" << std::endl; diff --git a/src/SystemData.cpp b/src/SystemData.cpp index 1c231dd28..e887372de 100644 --- a/src/SystemData.cpp +++ b/src/SystemData.cpp @@ -84,10 +84,11 @@ void SystemData::launchGame(GameData* game) std::cout << " " << command << "\n"; std::cout << "=====================================================\n"; - system(command.c_str()); + int exitCode = system(command.c_str()); std::cout << "=====================================================\n"; - std::cout << "...launch terminated!\n"; + if(exitCode != 0) + std::cout << "...launch terminated with nonzero exit code!\n"; Renderer::init(0, 0); AudioManager::init(); diff --git a/src/components/GuiFastSelect.cpp b/src/components/GuiFastSelect.cpp index 4823fed07..f8dfff002 100644 --- a/src/components/GuiFastSelect.cpp +++ b/src/components/GuiFastSelect.cpp @@ -126,7 +126,7 @@ void GuiFastSelect::setListPos() int min = 0; int max = mList->getObjectCount() - 1; - int mid; + int mid = 0; while(max >= min) { diff --git a/src/components/GuiMenu.cpp b/src/components/GuiMenu.cpp index a88505c85..c62abd294 100644 --- a/src/components/GuiMenu.cpp +++ b/src/components/GuiMenu.cpp @@ -41,7 +41,10 @@ void GuiMenu::onInput(InputManager::InputButton button, bool keyDown) if(button == InputManager::BUTTON1 && keyDown) { - system(mList->getSelectedObject().c_str()); + if(system(mList->getSelectedObject().c_str()) != 0) + { + std::cout << "(menu command terminated with a nonzero errorcode)\n"; + } } } @@ -49,6 +52,10 @@ void GuiMenu::populateList() { mList->clear(); + //if you want to add your own commands to the menu, here is where you need to change! + //commands added here are called with system() when selected (so are executed as shell commands) + //the method is GuiList::addObject(std::string displayString, std::string commandString, unsigned int displayHexColor); + //the list will automatically adjust as items are added to it, this should be the only area you need to change mList->addObject("Restart", "sudo shutdown -r now", 0x0000FFFF); mList->addObject("Shutdown", "sudo shutdown -h now", 0x0000FFFF); }