LuaVoxelManip: Add option to allocate blank data
[oweals/minetest.git] / src / main.cpp
index 7141bec66dcda67290b73ee3e5bd05181d7593ab..0c5f73b23ae3ef7bec7c14d90759f5d4ad54e4be 100644 (file)
@@ -1395,6 +1395,12 @@ static bool determine_subgame(GameParams *game_params)
                } else { // Otherwise we will be using "minetest"
                        gamespec = findSubgame(g_settings->get("default_game"));
                        infostream << "Using default gameid [" << gamespec.id << "]" << std::endl;
+                       if (!gamespec.isValid()) {
+                               errorstream << "Subgame specified in default_game ["
+                                           << g_settings->get("default_game")
+                                           << "] is invalid." << std::endl;
+                               return false;
+                       }
                }
        } else { // World exists
                std::string world_gameid = getWorldGameId(game_params->world_path, false);
@@ -1569,13 +1575,14 @@ ClientLauncher::~ClientLauncher()
        if (input)
                delete input;
 
-       if (glb_fontengine)
-               delete glb_fontengine;
+       if (g_fontengine)
+               delete g_fontengine;
 
        if (device)
                device->drop();
 }
 
+
 bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
 {
        init_args(game_params, cmd_args);
@@ -1596,11 +1603,14 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
                return true;
        }
 
-       if (device->getVideoDriver() == NULL) {
+       video::IVideoDriver *video_driver = device->getVideoDriver();
+       if (video_driver == NULL) {
                errorstream << "Could not initialize video driver." << std::endl;
                return false;
        }
 
+       porting::setXorgClassHint(video_driver->getExposedVideoData(), "Minetest");
+
        /*
                This changes the minimum allowed number of vertices in a VBO.
                Default is 500.
@@ -1630,8 +1640,8 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
        skin->setColor(gui::EGDC_HIGH_LIGHT, video::SColor(255, 70, 100, 50));
        skin->setColor(gui::EGDC_HIGH_LIGHT_TEXT, video::SColor(255, 255, 255, 255));
 
-       glb_fontengine = new FontEngine(g_settings, guienv);
-       assert(glb_fontengine != NULL);
+       g_fontengine = new FontEngine(g_settings, guienv);
+       assert(g_fontengine != NULL);
 
 #if (IRRLICHT_VERSION_MAJOR >= 1 && IRRLICHT_VERSION_MINOR >= 8) || IRRLICHT_VERSION_MAJOR >= 2
        // Irrlicht 1.8 input colours
@@ -1931,6 +1941,10 @@ bool ClientLauncher::launch_game(std::wstring *error_message,
                        errorstream << wide_to_narrow(*error_message) << std::endl;
                        return false;
                }
+
+               if (porting::signal_handler_killstatus())
+                       return true;
+
                if (game_params.game_spec.isValid() &&
                                game_params.game_spec.id != worldspec.gameid) {
                        errorstream << "WARNING: Overriding gamespec from \""