#if USE_SOUND
#include "sound_openal.h"
#endif
-#ifdef __ANDROID__
- #include "porting.h"
-#endif
/* mainmenumanager.h
*/
ClientLauncher::~ClientLauncher()
{
- delete receiver;
-
delete input;
+ delete receiver;
+
delete g_fontengine;
delete g_gamecallback;
init_args(start_data, cmd_args);
- // List video modes if requested
- if (list_video_modes)
- return m_rendering_engine->print_video_modes();
-
#if USE_SOUND
if (g_settings->getBool("enable_sound"))
g_sound_manager_singleton = createSoundManagerSingleton();
skin->setColor(gui::EGDC_3D_SHADOW, video::SColor(255, 0, 0, 0));
skin->setColor(gui::EGDC_HIGH_LIGHT, video::SColor(255, 70, 120, 50));
skin->setColor(gui::EGDC_HIGH_LIGHT_TEXT, video::SColor(255, 255, 255, 255));
-#ifdef __ANDROID__
- float density = porting::getDisplayDensity();
+#ifdef HAVE_TOUCHSCREENGUI
+ float density = RenderingEngine::getDisplayDensity();
skin->setSize(gui::EGDS_CHECK_BOX_WIDTH, (s32)(17.0f * density));
skin->setSize(gui::EGDS_SCROLLBAR_SIZE, (s32)(14.0f * density));
skin->setSize(gui::EGDS_WINDOW_BUTTON_WIDTH, (s32)(15.0f * density));
if (cmd_args.exists("name"))
start_data.name = cmd_args.get("name");
- list_video_modes = cmd_args.getFlag("videomodes");
-
random_input = g_settings->getBool("random_input")
|| cmd_args.getFlag("random-input");
}
menudata.name = start_data.name;
menudata.password = start_data.password;
menudata.port = itos(start_data.socket_port);
- menudata.script_data.errormessage = error_message_lua;
+ menudata.script_data.errormessage = std::move(error_message_lua);
menudata.script_data.reconnect_requested = reconnect_requested;
main_menu(&menudata);
start_data.name = menudata.name;
start_data.password = menudata.password;
start_data.address = std::move(menudata.address);
+ start_data.allow_login_or_register = menudata.allow_login_or_register;
server_name = menudata.servername;
server_description = menudata.serverdescription;
// Load gamespec for required game
start_data.game_spec = findWorldSubgame(worldspec.path);
if (!start_data.game_spec.isValid()) {
- error_message = gettext("Could not find or load game \"")
- + worldspec.gameid + "\"";
+ error_message = gettext("Could not find or load game: ")
+ + worldspec.gameid;
errorstream << error_message << std::endl;
return false;
}
}
infostream << "Waited for other menus" << std::endl;
- // Cursor can be non-visible when coming from the game
#ifndef ANDROID
+ // Cursor can be non-visible when coming from the game
m_rendering_engine->get_raw_device()->getCursorControl()->setVisible(true);
+
+ // Set absolute mouse mode
+ m_rendering_engine->get_raw_device()->getCursorControl()->setRelativeMode(false);
#endif
/* show main menu */
// volatile to avoid some potential compiler optimisations
volatile static s16 temp16;
volatile static f32 tempf;
+ // Silence compiler warning
+ (void)temp16;
static v3f tempv3f1;
static v3f tempv3f2;
static std::string tempstring;
TimeTaker timer("Testing std::string speed");
const u32 jj = 10000;
for (u32 j = 0; j < jj; j++) {
- tempstring = "";
- tempstring2 = "";
+ tempstring.clear();
+ tempstring2.clear();
const u32 ii = 10;
for (u32 i = 0; i < ii; i++) {
tempstring2 += "asd";