X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fmainmenumanager.h;h=ea9327813407e03dae232ebfaba72cb6793dd84e;hb=5f489efc69e5e8e31891481d412ad569a6e1bcf8;hp=b9bd3762bf37ccf6e64267ce1645730ad517a63e;hpb=8f7785771b9e02b1a1daf7a252550d78ea93053d;p=oweals%2Fminetest.git diff --git a/src/mainmenumanager.h b/src/mainmenumanager.h index b9bd3762b..ea9327813 100644 --- a/src/mainmenumanager.h +++ b/src/mainmenumanager.h @@ -17,14 +17,13 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MAINMENUMANAGER_HEADER -#define MAINMENUMANAGER_HEADER +#pragma once /* All kinds of stuff that needs to be exposed from main.cpp */ -#include "debug.h" // assert #include "modalMenu.h" +#include #include class IGameCallback @@ -49,12 +48,11 @@ class MainMenuManager : public IMenuManager public: virtual void createdMenu(gui::IGUIElement *menu) { - for(std::list::iterator - i = m_stack.begin(); - i != m_stack.end(); ++i) - { - assert(*i != menu); +#ifndef NDEBUG + for (gui::IGUIElement *i : m_stack) { + assert(i != menu); } +#endif if(!m_stack.empty()) m_stack.back()->setVisible(false); @@ -104,10 +102,8 @@ public: bool pausesGame() { - for(std::list::iterator - i = m_stack.begin(); i != m_stack.end(); ++i) - { - GUIModalMenu *mm = dynamic_cast(*i); + for (gui::IGUIElement *i : m_stack) { + GUIModalMenu *mm = dynamic_cast(i); if (mm && mm->pausesGame()) return true; } @@ -124,17 +120,12 @@ extern bool isMenuActive(); class MainGameCallback : public IGameCallback { public: - MainGameCallback(IrrlichtDevice *a_device): - device(a_device) - { - } + MainGameCallback() = default; + virtual ~MainGameCallback() = default; virtual void exitToOS() { shutdown_requested = true; -#ifndef __ANDROID__ - device->closeDevice(); -#endif } virtual void disconnect() @@ -170,11 +161,6 @@ public: bool shutdown_requested = false; bool keyconfig_changed = false; - - IrrlichtDevice *device; }; extern MainGameCallback *g_gamecallback; - -#endif -