removed alternative name "pressure" from param2
authorPerttu Ahola <celeron55@gmail.com>
Tue, 25 Jan 2011 07:53:21 +0000 (09:53 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 25 Jan 2011 07:53:21 +0000 (09:53 +0200)
src/main.cpp
src/map.cpp
src/mapblock.cpp
src/mapnode.h
src/tile.cpp
src/voxel.cpp

index 858d25fa1466483a306ed7a89124a74cfbd501e9..171f1538a6f3e0e221b8c1c9d12607304dc2e3a1 100644 (file)
@@ -236,7 +236,7 @@ Map:
 NOTE: There are some lighting-related todos and fixmes in\r
       ServerMap::emergeBlock. And there always will be. 8)\r
 \r
-TODO: Map generator version 2\r
+FEATURE: Map generator version 2\r
        - Create surface areas based on central points; a given point's\r
          area type is given by the nearest central point\r
          - Separate points for heightmap, caves, plants and minerals?\r
@@ -246,18 +246,33 @@ TODO: Map generator version 2
          where some minerals are found\r
        - Create a system that allows a huge amount of different "map\r
          generator modules/filters"\r
+         \r
+FEATURE: The map could be generated procedually:\r
+      - This would need the map to be generated in larger pieces\r
+           - How large? How do they connect to each other?\r
+      * Make the stone level with a heightmap\r
+         * Carve out stuff in the stone\r
+         * Dump dirt all around, and simulate it falling off steep\r
+           places\r
+         * Erosion simulation at map generation time\r
+               - Simulate water flows, which would carve out dirt fast and\r
+                 then turn stone into gravel and sand and relocate it.\r
+               - How about relocating minerals, too? Coal and gold in\r
+                 downstream sand and gravel would be kind of cool\r
+                 - This would need a better way of handling minerals, mainly\r
+                   to have mineral content as a separate field\r
+               - Simulate rock falling from cliffs when water has removed\r
+                 enough solid rock from the bottom\r
 \r
 TODO: Change AttributeList to split the area into smaller sections so\r
       that searching won't be as heavy.\r
-TODO: Change AttributeList to be 2D, as it would be too slow to search\r
-      in 3D fields anyway.\r
 \r
 TODO: Remove HMParams\r
 \r
 TODO: Flowing water to actually contain flow direction information\r
 \r
 TODO: Remove duplicate lighting implementation from Map (leave\r
-      VoxelManipulator)\r
+      VoxelManipulator, which is faster)\r
 \r
 Doing now:\r
 ----------\r
index bbcc0f36f0e33cb440bd25934d89ea617fe3c7de..0b5872e05e3c53cae49f28ba74fde447333fd15f 100644 (file)
@@ -1804,7 +1804,7 @@ ServerMap::ServerMap(std::string savedir, HMParams hmp, MapParams mp):
                        float randmax = 0;
                        float randfactor = 0;
 
-                       if(myrand()%5 == 0)
+                       /*if(myrand()%5 == 0)
                        {
                                baseheight = 100;
                                randmax = 50;
@@ -1833,7 +1833,11 @@ ServerMap::ServerMap(std::string savedir, HMParams hmp, MapParams mp):
                                baseheight = -3;
                                randmax = 20;
                                randfactor = 0.5;
-                       }
+                       }*/
+                       
+                       baseheight = 0;
+                       randmax = 15;
+                       randfactor = 0.63;
 
                        list_baseheight->addPoint(p, Attribute(baseheight));
                        list_randmax->addPoint(p, Attribute(randmax));
index 620c29fdd57ecb9e73bd695a9cd33cd42ac325be..3eb65b4da461d767c6ae92c3b8d3ac08902c4537 100644 (file)
@@ -1504,13 +1504,13 @@ void MapBlock::serialize(std::ostream &os, u8 version)
                
                if(version >= 10)
                {
-                       // Get and compress pressure
-                       SharedBuffer<u8> pressuredata(nodecount);
+                       // Get and compress param2
+                       SharedBuffer<u8> param2data(nodecount);
                        for(u32 i=0; i<nodecount; i++)
                        {
-                               pressuredata[i] = data[i].pressure;
+                               param2data[i] = data[i].param2;
                        }
-                       compress(pressuredata, os, version);
+                       compress(param2data, os, version);
                }
        }
        // All other versions (newest)
@@ -1544,10 +1544,10 @@ void MapBlock::serialize(std::ostream &os, u8 version)
                        databuf[i+nodecount] = data[i].param;
                }
 
-               // Get pressure
+               // Get param2
                for(u32 i=0; i<nodecount; i++)
                {
-                       databuf[i+nodecount*2] = data[i].pressure;
+                       databuf[i+nodecount*2] = data[i].param2;
                }
 
                /*
@@ -1621,7 +1621,7 @@ void MapBlock::deSerialize(std::istream &is, u8 version)
        
                if(version >= 10)
                {
-                       // Uncompress and set pressure data
+                       // Uncompress and set param2 data
                        std::ostringstream os(std::ios_base::binary);
                        decompress(is, os, version);
                        std::string s = os.str();
@@ -1630,7 +1630,7 @@ void MapBlock::deSerialize(std::istream &is, u8 version)
                                                ("MapBlock::deSerialize: invalid format");
                        for(u32 i=0; i<s.size(); i++)
                        {
-                               data[i].pressure = s[i];
+                               data[i].param2 = s[i];
                        }
                }
        }
@@ -1662,10 +1662,10 @@ void MapBlock::deSerialize(std::istream &is, u8 version)
                {
                        data[i].param = s[i+nodecount];
                }
-               // Set pressure
+               // Set param2
                for(u32 i=0; i<nodecount; i++)
                {
-                       data[i].pressure = s[i+nodecount*2];
+                       data[i].param2 = s[i+nodecount*2];
                }
        }
 }
index 286edcc2bb86adca87582a86c1fbab1c451f4105..69a5a08cd58b6fdd0bc73e3b711c117b588a58a8 100644 (file)
@@ -374,11 +374,6 @@ struct MapNode
        union
        {
                u8 param2;
-               
-               /*
-                       Pressure for liquids
-               */
-               u8 pressure;
 
                /*
                        Direction for torches and other stuff.
@@ -392,18 +387,18 @@ struct MapNode
                *this = n;
        }
        
-       MapNode(u8 data=CONTENT_AIR, u8 a_param=0, u8 a_pressure=0)
+       MapNode(u8 data=CONTENT_AIR, u8 a_param=0, u8 a_param2=0)
        {
                d = data;
                param = a_param;
-               pressure = a_pressure;
+               param2 = a_param2;
        }
 
        bool operator==(const MapNode &other)
        {
                return (d == other.d
                                && param == other.param
-                               && pressure == other.pressure);
+                               && param2 == other.param2);
        }
 
        bool light_propagates()
@@ -557,7 +552,7 @@ struct MapNode
                {
                        dest[0] = d;
                        dest[1] = param;
-                       dest[2] = pressure;
+                       dest[2] = param2;
                }
        }
        void deSerialize(u8 *source, u8 version)
@@ -587,7 +582,7 @@ struct MapNode
                {
                        d = source[0];
                        param = source[1];
-                       pressure = source[2];
+                       param2 = source[2];
                }
        }
 };
index 79d68d4c3cc46bce1e49c3a2146d714399e38e89..18a2f155ab77d8090ee7ce1401905f6ed793deac 100644 (file)
@@ -23,51 +23,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "main.h"
 #include <string>
 
-// A mapping from tiles to paths of textures
-
-/*const char * g_tile_texture_filenames[TILES_COUNT] =
-{
-       NULL,
-       "stone.png",
-       "water.png",
-       "grass.png",
-       "tree.png",
-       "leaves.png",
-       "grass_footsteps.png",
-       "mese.png",
-       "mud.png",
-       "tree_top.png",
-       "mud.png_sidegrass",
-       "cloud.png",
-       "coalstone.png",
-       "wood.png",
-};*/
-
 /*
        These can either be real paths or generated names of preloaded
        textures (like "mud.png_sidegrass")
 */
 std::string g_tile_texture_paths[TILES_COUNT];
 
-/*std::string g_tile_texture_path_strings[TILES_COUNT];
-const char * g_tile_texture_paths[TILES_COUNT] = {0};
-
-void init_tile_texture_paths()
-{
-       for(s32 i=0; i<TILES_COUNT; i++)
-       {
-               const char *filename = g_tile_texture_filenames[i];
-
-               if(filename != NULL)
-               {
-                       g_tile_texture_path_strings[i] =
-                                       porting::getDataPath(filename);
-                       g_tile_texture_paths[i] =
-                                       g_tile_texture_path_strings[i].c_str();
-               }
-       }
-}*/
-
 const char * tile_texture_path_get(u32 i)
 {
        assert(i < TILES_COUNT);
index a0cc44d715967397c260c79bf04f732d68dd490d..272e11ccc4007de2bd1affd432e156c6bc7d4837 100644 (file)
@@ -96,7 +96,7 @@ void VoxelManipulator::print(std::ostream &o, VoxelPrintMode mode)
                                {
                                        c = 'X';
                                        u8 m = m_data[m_area.index(x,y,z)].d;
-                                       u8 pr = m_data[m_area.index(x,y,z)].pressure;
+                                       u8 pr = m_data[m_area.index(x,y,z)].param2;
                                        if(mode == VOXELPRINT_MATERIAL)
                                        {
                                                if(m <= 9)