Falling sand and gravel
[oweals/minetest.git] / src / main.cpp
index df1347f121d3624aa8a494f707e3335e9322fd2a..0646494fcf51fbcfd4f48059f1c036bc33facb98 100644 (file)
@@ -334,11 +334,6 @@ TODO: Add a long step function to objects that is called with the time
 Map:
 ----
 
-TODO: Mineral and ground material properties
-      - This way mineral ground toughness can be calculated with just
-           some formula, as well as tool strengths. Sounds too.
-         - There are TODOs in appropriate files: material.h, content_mapnode.h
-
 TODO: Flowing water to actually contain flow direction information
       - There is a space for this - it just has to be implemented.
 
@@ -365,11 +360,6 @@ SUGG: Restart irrlicht completely when coming back to main menu from game.
 
 TODO: Merge bahamada's audio stuff (clean patch available)
 
-TODO: Move content_features to mapnode_content_features.{h,cpp} or so
-
-TODO: Fix item use() stuff; dropping a stack of cooked rats and eating
-      it gives 3 hearts and consumes all the rats.
-
 Making it more portable:
 ------------------------
  
@@ -390,11 +380,11 @@ Doing currently:
 */
 
 #ifdef NDEBUG
-       #ifdef _WIN32
+       /*#ifdef _WIN32
                #pragma message ("Disabling unit tests")
        #else
                #warning "Disabling unit tests"
-       #endif
+       #endif*/
        // Disable unit tests
        #define ENABLE_TESTS 0
 #else
@@ -440,9 +430,6 @@ Doing currently:
 #include "profiler.h"
 #include "log.h"
 
-// This makes textures
-ITextureSource *g_texturesource = NULL;
-
 /*
        Settings.
        These are loaded from the config file.
@@ -481,6 +468,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;
@@ -1276,9 +1265,7 @@ int main(int argc, char *argv[])
                These are needed for unit tests at least.
        */
        
-       // Initial call with g_texturesource not set.
-       init_mapnode();
-       // Must be called before g_texturesource is created
+       // Must be called before texturesource is created
        // (for texture atlas making)
        init_mineral();
 
@@ -1405,6 +1392,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]");
        
@@ -1414,9 +1416,6 @@ int main(int argc, char *argv[])
        // Create game callback for menus
        g_gamecallback = new MainGameCallback(device);
        
-       // Create texture source
-       g_texturesource = new TextureSource(device);
-
        /*
                Speed tests (done after irrlicht is loaded to get timer)
        */
@@ -1437,18 +1436,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();
@@ -1473,12 +1460,6 @@ int main(int argc, char *argv[])
        skin->setColor(gui::EGDC_3D_HIGH_LIGHT, video::SColor(255,0,0,0));
        skin->setColor(gui::EGDC_3D_SHADOW, video::SColor(255,0,0,0));
        
-       /*
-               Preload some textures and stuff
-       */
-
-       init_mapnode(); // Second call with g_texturesource set
-
        /*
                GUI stuff
        */
@@ -1541,6 +1522,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");
 
@@ -1613,6 +1596,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));
                                
@@ -1648,9 +1633,6 @@ int main(int argc, char *argv[])
                        if(device->run() == false)
                                break;
                        
-                       // Initialize mapnode again to enable changed graphics settings
-                       init_mapnode();
-
                        /*
                                Run game
                        */