3 Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 extern Settings g_settings;
27 // This makes and maps textures
29 extern ITextureSource *g_texturesource;
35 extern std::ostream *dout_con_ptr;
36 extern std::ostream *derr_con_ptr;
37 extern std::ostream *dout_client_ptr;
38 extern std::ostream *derr_client_ptr;
39 extern std::ostream *dout_server_ptr;
40 extern std::ostream *derr_server_ptr;
42 #define dout_con (*dout_con_ptr)
43 #define derr_con (*derr_con_ptr)
44 #define dout_client (*dout_client_ptr)
45 #define derr_client (*derr_client_ptr)
46 #define dout_server (*dout_server_ptr)
47 #define derr_server (*derr_server_ptr)
50 All kinds of stuff that needs to be exposed from main.cpp
53 #include "modalMenu.h"
54 #include "guiPauseMenu.h" //For IGameCallback
56 extern gui::IGUIEnvironment* guienv;
57 extern gui::IGUIStaticText *guiroot;
59 // Handler for the modal menus
61 class MainMenuManager : public IMenuManager
64 virtual void createdMenu(GUIModalMenu *menu)
66 for(core::list<GUIModalMenu*>::Iterator
68 i != m_stack.end(); i++)
73 if(m_stack.size() != 0)
74 (*m_stack.getLast())->setVisible(false);
75 m_stack.push_back(menu);
78 virtual void deletingMenu(GUIModalMenu *menu)
80 // Remove all entries if there are duplicates
83 removed_entry = false;
84 for(core::list<GUIModalMenu*>::Iterator
86 i != m_stack.end(); i++)
95 }while(removed_entry);
97 /*core::list<GUIModalMenu*>::Iterator i = m_stack.getLast();
101 if(m_stack.size() != 0)
102 (*m_stack.getLast())->setVisible(true);
107 return m_stack.size();
110 core::list<GUIModalMenu*> m_stack;
113 extern MainMenuManager g_menumgr;
115 extern bool noMenuActive();
117 class MainGameCallback : public IGameCallback
120 MainGameCallback(IrrlichtDevice *a_device):
121 disconnect_requested(false),
126 virtual void exitToOS()
128 device->closeDevice();
131 virtual void disconnect()
133 disconnect_requested = true;
136 bool disconnect_requested;
137 IrrlichtDevice *device;
140 extern MainGameCallback *g_gamecallback;