utility.h: Change Buffer's interface to be more compatible with SharedBuffer's interf...
[oweals/minetest.git] / src / main.cpp
index 80daf744937f763088606081dd47ae6a8502e511..b959d8c6433eb47cace7361eab82dab9ee67d4c2 100644 (file)
@@ -481,6 +481,8 @@ MainGameCallback *g_gamecallback = NULL;
 // Connection
 std::ostream *dout_con_ptr = &dummyout;
 std::ostream *derr_con_ptr = &verbosestream;
+//std::ostream *dout_con_ptr = &infostream;
+//std::ostream *derr_con_ptr = &errorstream;
 
 // Server
 std::ostream *dout_server_ptr = &infostream;
@@ -1074,15 +1076,15 @@ void drawMenuBackground(video::IVideoDriver* driver)
        }
 }
 
-class DstreamLogOutput: public ILogOutput
+class StderrLogOutput: public ILogOutput
 {
 public:
        /* line: Full line with timestamp, level and thread */
        void printLog(const std::string &line)
        {
-               dstream<<line<<std::endl;
+               std::cerr<<line<<std::endl;
        }
-} main_dstream_log_out;
+} main_stderr_log_out;
 
 class DstreamNoStderrLogOutput: public ILogOutput
 {
@@ -1100,7 +1102,7 @@ int main(int argc, char *argv[])
                Initialization
        */
 
-       log_add_output_maxlev(&main_dstream_log_out, LMT_ACTION);
+       log_add_output_maxlev(&main_stderr_log_out, LMT_ACTION);
        log_add_output_all_levs(&main_dstream_no_stderr_log_out);
 
        log_register_thread("main");
@@ -1175,7 +1177,7 @@ int main(int argc, char *argv[])
 #endif
        
        if(cmd_args.getFlag("info-on-stderr"))
-               log_add_output(&main_dstream_log_out, LMT_INFO);
+               log_add_output(&main_stderr_log_out, LMT_INFO);
 
        porting::signal_handler_init();
        bool &kill = *porting::signal_handler_killstatus();
@@ -1278,6 +1280,9 @@ int main(int argc, char *argv[])
        
        // Initial call with g_texturesource not set.
        init_mapnode();
+       // Must be called before g_texturesource is created
+       // (for texture atlas making)
+       init_mineral();
 
        /*
                Run unit tests
@@ -1402,6 +1407,21 @@ int main(int argc, char *argv[])
        if (device == 0)
                return 1; // could not create selected driver.
        
+       /*
+               Continue initialization
+       */
+
+       video::IVideoDriver* driver = device->getVideoDriver();
+
+       // Disable mipmaps (because some of them look ugly)
+       driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
+
+       /*
+               This changes the minimum allowed number of vertices in a VBO.
+               Default is 500.
+       */
+       //driver->setMinHardwareBufferVertexCount(50);
+
        // Set the window caption
        device->setWindowCaption(L"Minetest [Main Menu]");
        
@@ -1434,18 +1454,6 @@ int main(int argc, char *argv[])
        else
                input = new RealInputHandler(device, &receiver);
        
-       /*
-               Continue initialization
-       */
-
-       //video::IVideoDriver* driver = device->getVideoDriver();
-
-       /*
-               This changes the minimum allowed number of vertices in a VBO.
-               Default is 500.
-       */
-       //driver->setMinHardwareBufferVertexCount(50);
-
        scene::ISceneManager* smgr = device->getSceneManager();
 
        guienv = device->getGUIEnvironment();
@@ -1475,7 +1483,6 @@ int main(int argc, char *argv[])
        */
 
        init_mapnode(); // Second call with g_texturesource set
-       init_mineral();
 
        /*
                GUI stuff
@@ -1539,6 +1546,8 @@ int main(int argc, char *argv[])
                                menudata.port = narrow_to_wide(itos(port));
                                menudata.fancy_trees = g_settings->getBool("new_style_leaves");
                                menudata.smooth_lighting = g_settings->getBool("smooth_lighting");
+                               menudata.clouds_3d = g_settings->getBool("enable_3d_clouds");
+                               menudata.opaque_water = g_settings->getBool("opaque_water");
                                menudata.creative_mode = g_settings->getBool("creative_mode");
                                menudata.enable_damage = g_settings->getBool("enable_damage");
 
@@ -1611,6 +1620,8 @@ int main(int argc, char *argv[])
                                        port = newport;
                                g_settings->set("new_style_leaves", itos(menudata.fancy_trees));
                                g_settings->set("smooth_lighting", itos(menudata.smooth_lighting));
+                               g_settings->set("enable_3d_clouds", itos(menudata.clouds_3d));
+                               g_settings->set("opaque_water", itos(menudata.opaque_water));
                                g_settings->set("creative_mode", itos(menudata.creative_mode));
                                g_settings->set("enable_damage", itos(menudata.enable_damage));