3 Copyright (C) 2010-2013 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 Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser 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.
20 #ifndef __CLIENT_LAUNCHER_H__
21 #define __CLIENT_LAUNCHER_H__
23 #include "irrlichttypes_extrabloated.h"
24 #include "client/inputhandler.h"
25 #include "gameparams.h"
27 // A small helper class
31 virtual u32 getTime(TimePrecision prec) = 0;
34 // A precise irrlicht one
35 class IrrlichtTimeGetter: public TimeGetter
38 IrrlichtTimeGetter(IrrlichtDevice *device):
41 u32 getTime(TimePrecision prec)
43 if (prec == PRECISION_MILLI) {
46 return m_device->getTimer()->getRealTime();
48 return porting::getTime(prec);
52 IrrlichtDevice *m_device;
54 // Not so precise one which works without irrlicht
55 class SimpleTimeGetter: public TimeGetter
58 u32 getTime(TimePrecision prec)
60 return porting::getTime(prec);
68 list_video_modes(false),
69 skip_main_menu(false),
80 simple_singleplayer_mode(false),
81 current_playername("invĀ£lid"),
83 current_address("does-not-exist"),
89 bool run(GameParams &game_params, const Settings &cmd_args);
92 void init_args(GameParams &game_params, const Settings &cmd_args);
96 bool launch_game(std::string &error_message, bool reconnect_requested,
97 GameParams &game_params, const Settings &cmd_args);
99 void main_menu(MainMenuData *menudata);
100 bool create_engine_device();
103 bool print_video_modes();
105 bool list_video_modes;
110 std::string playername;
111 std::string password;
112 IrrlichtDevice *device;
114 MyEventReceiver *receiver;
117 scene::ISceneManager *smgr;
118 SubgameSpec gamespec;
120 bool simple_singleplayer_mode;
122 // These are set up based on the menu and other things
123 // TODO: Are these required since there's already playername, password, etc
124 std::string current_playername;
125 std::string current_password;
126 std::string current_address;