]> git.lizzy.rs Git - minetest.git/blobdiff - src/main.cpp
Merge pull request #24 from SpeedProg/master
[minetest.git] / src / main.cpp
index 41da310f450344af0c99b48f3ad6c32c8cc31e76..b6a53566e3f92e39fee6418bf810475916d4c049 100644 (file)
@@ -27,6 +27,33 @@ NOTE: Global locale is now set at initialization
 NOTE: If VBO (EHM_STATIC) is used, remember to explicitly free the\r
       hardware buffer (it is not freed automatically)\r
 \r
+NOTE: A random to-do list saved here as documentation:\r
+A list of "active blocks" in which stuff happens. (+=done)\r
+       + Add a never-resetted game timer to the server\r
+       + Add a timestamp value to blocks\r
+       + The simple rule: All blocks near some player are "active"\r
+       - Do stuff in real time in active blocks\r
+               + Handle objects\r
+               - Grow grass, delete leaves without a tree\r
+               - Spawn some mobs based on some rules\r
+               - Transform cobble to mossy cobble near water\r
+               - Run a custom script\r
+               - ...And all kinds of other dynamic stuff\r
+       + Keep track of when a block becomes active and becomes inactive\r
+       + When a block goes inactive:\r
+               + Store objects statically to block\r
+               + Store timer value as the timestamp\r
+       + When a block goes active:\r
+               + Create active objects out of static objects\r
+               - Simulate the results of what would have happened if it would have\r
+                 been active for all the time\r
+                       - Grow a lot of grass and so on\r
+       + Initially it is fine to send information about every active object\r
+         to every player. Eventually it should be modified to only send info\r
+         about the nearest ones.\r
+               + This was left to be done by the old system and it sends only the\r
+                 nearest ones.\r
+\r
 Old, wild and random suggestions that probably won't be done:\r
 -------------------------------------------------------------\r
 \r
@@ -73,9 +100,6 @@ SUGG: Make the amount of blocks sending to client and the total
 SUGG: Meshes of blocks could be split into 6 meshes facing into\r
       different directions and then only those drawn that need to be\r
 \r
-SUGG: Calculate lighting per vertex to get a lighting effect like in\r
-      bartwe's game\r
-\r
 SUGG: Background music based on cellular automata?\r
       http://www.earslap.com/projectslab/otomata\r
 \r
@@ -90,6 +114,8 @@ SUGG: Make a system for pregenerating quick information for mapblocks, so
          or even generated.\r
 \r
 SUGG: Erosion simulation at map generation time\r
+    - This might be plausible if larger areas of map were pregenerated\r
+         without lighting (which is slow)\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
@@ -100,6 +126,16 @@ SUGG: Erosion simulation at map generation time
        - Simulate rock falling from cliffs when water has removed\r
          enough solid rock from the bottom\r
 \r
+SUGG: For non-mapgen FarMesh: Add a per-sector database to store surface\r
+      stuff as simple flags/values\r
+      - Light?\r
+         - A building?\r
+         And at some point make the server send this data to the client too,\r
+         instead of referring to the noise functions\r
+         - Ground height\r
+         - Surface ground type\r
+         - Trees?\r
+\r
 Gaming ideas:\r
 -------------\r
 \r
@@ -173,12 +209,13 @@ SUGG: Make fetching sector's blocks more efficient when rendering
       sectors that have very large amounts of blocks (on client)\r
          - Is this necessary at all?\r
 \r
-TODO: Flowing water animation\r
-\r
 SUGG: Draw cubes in inventory directly with 3D drawing commands, so that\r
       animating them is easier.\r
 \r
 SUGG: Option for enabling proper alpha channel for textures\r
+\r
+TODO: Flowing water animation\r
+\r
 TODO: A setting for enabling bilinear filtering for textures\r
 \r
 TODO: Better control of draw_control.wanted_max_blocks\r
@@ -193,6 +230,12 @@ TODO: Artificial (night) light could be more yellow colored than sunlight.
 \r
 SUGG: Somehow make the night less colorful\r
 \r
+TODO: Occlusion culling\r
+      - At the same time, move some of the renderMap() block choosing code\r
+        to the same place as where the new culling happens.\r
+      - Shoot some rays per frame and when ready, make a new list of\r
+           blocks for usage of renderMap and give it a new pointer to it.\r
+\r
 Configuration:\r
 --------------\r
 \r
@@ -231,6 +274,7 @@ FIXME: Server sometimes goes into some infinite PeerNotFoundException loop
 * Fix the problem with the server constantly saving one or a few\r
   blocks? List the first saved block, maybe it explains.\r
   - It is probably caused by oscillating water\r
+  - TODO: Investigate if this still happens (this is a very old one)\r
 * Make a small history check to transformLiquids to detect and log\r
   continuous oscillations, in such detail that they can be fixed.\r
 \r
@@ -238,44 +282,12 @@ FIXME: The new optimized map sending doesn't sometimes send enough blocks
        from big caves and such\r
 FIXME: Block send distance configuration does not take effect for some reason\r
 \r
-TODO: Map saving should be done by EmergeThread\r
-\r
-SUGG: Map unloading based on sector reference is not very good, it keeps\r
-       unnecessary stuff in memory. I guess. Investigate this.\r
-\r
-TODO: When block is placed and it has param_type==CPT_FACEDIR_SIMPLE, set\r
-      the direction accordingly.\r
-\r
 Environment:\r
 ------------\r
 \r
-TODO: A list of "active blocks" in which stuff happens. (+=done)\r
-       + Add a never-resetted game timer to the server\r
-       + Add a timestamp value to blocks\r
-       + The simple rule: All blocks near some player are "active"\r
-       - Do stuff in real time in active blocks\r
-               + Handle objects\r
-               TODO: Make proper hooks in here\r
-               - Grow grass, delete leaves without a tree\r
-               - Spawn some mobs based on some rules\r
-               - Transform cobble to mossy cobble near water\r
-               - Run a custom script\r
-               - ...And all kinds of other dynamic stuff\r
-       + Keep track of when a block becomes active and becomes inactive\r
-       + When a block goes inactive:\r
-               + Store objects statically to block\r
-               + Store timer value as the timestamp\r
-       + When a block goes active:\r
-               + Create active objects out of static objects\r
-               TODO: Make proper hooks in here\r
-               - Simulate the results of what would have happened if it would have\r
-                 been active for all the time\r
-                       - Grow a lot of grass and so on\r
-       + Initially it is fine to send information about every active object\r
-         to every player. Eventually it should be modified to only send info\r
-         about the nearest ones.\r
-               + This was left to be done by the old system and it sends only the\r
-                 nearest ones.\r
+TODO: Add proper hooks to when adding and removing active blocks\r
+\r
+TODO: Finish the ActiveBlockModifier stuff and use it for something\r
 \r
 Objects:\r
 --------\r
@@ -287,6 +299,7 @@ TODO: Get rid of MapBlockObjects and use only ActiveObjects
 \r
 SUGG: MovingObject::move and Player::move are basically the same.\r
       combine them.\r
+       - NOTE: This is a bit tricky because player has the sneaking ability\r
        - NOTE: Player::move is more up-to-date.\r
        - NOTE: There is a simple move implementation now in collision.{h,cpp}\r
        - NOTE: MovingObject will be deleted (MapBlockObject)\r
@@ -305,59 +318,25 @@ TODO: Mineral and ground material properties
 TODO: Flowing water to actually contain flow direction information\r
       - There is a space for this - it just has to be implemented.\r
 \r
-SUGG: Try out the notch way of generating maps, that is, make bunches\r
-      of low-res 3d noise and interpolate linearly.\r
-\r
-Mapgen v2 (the current one):\r
-* Possibly add some kind of erosion and other stuff\r
-* Better water generation (spread it to underwater caverns but don't\r
-  fill dungeons that don't touch big water masses)\r
-* When generating a chunk and the neighboring chunk doesn't have mud\r
-  and stuff yet and the ground is fairly flat, the mud will flow to\r
-  the other chunk making nasty straight walls when the other chunk\r
-  is generated. Fix it. Maybe just a special case if the ground is\r
-  flat?\r
-* Consider not updating this one and make a good mainly block-based\r
-  generator\r
-\r
-SUGG: Make two "modified states", one that forces the block to be saved at\r
-       the next save event, and one that makes the block to be saved at exit\r
-       time.\r
-\r
-TODO: Add a not_fully_generated flag to MapBlock, which would be set for\r
-       blocks that contain eg. trees from neighboring generations but haven't\r
-       been generated itself. This is required for the future generator.\r
+TODO: Consider smoothening cave floors after generating them\r
 \r
 Misc. stuff:\r
 ------------\r
-- Make sure server handles removing grass when a block is placed (etc)\r
-    - The client should not do it by itself\r
-- Block cube placement around player's head\r
-- Protocol version field\r
-- Consider getting some textures from cisoun's texture pack\r
-       - Ask from Cisoun\r
-- Make sure the fence implementation and data format is good\r
-       - Think about using same bits for material for fences and doors, for\r
-       example\r
-- Finish the ActiveBlockModifier stuff and use it for something\r
-- Move mineral to param2, increment map serialization version, add conversion\r
-\r
-TODO: Add a per-sector database to store surface stuff as simple flags/values\r
-      - Light?\r
-         - A building?\r
-         And at some point make the server send this data to the client too,\r
-         instead of referring to the noise functions\r
-         - Ground height\r
-         - Surface ground type\r
-         - Trees?\r
+TODO: Make sure server handles removing grass when a block is placed (etc)\r
+      - The client should not do it by itself\r
+         - NOTE: I think nobody does it currently...\r
+TODO: Block cube placement around player's head\r
+TODO: Protocol version field\r
+TODO: Think about using same bits for material for fences and doors, for\r
+         example\r
+TODO: Move mineral to param2, increment map serialization version, add\r
+      conversion\r
 \r
 TODO: Restart irrlicht completely when coming back to main menu from game.\r
        - This gets rid of everything that is stored in irrlicht's caches.\r
 \r
 TODO: Merge bahamada's audio stuff (clean patch available)\r
 \r
-TODO: Merge spongie's chest/furnace direction (by hand)\r
-\r
 TODO: Merge key configuration menu (no clean patch available)\r
 \r
 Making it more portable:\r
@@ -375,9 +354,6 @@ Stuff to do after release:
 Doing currently:\r
 ----------------\r
 \r
-TODO: Use MapBlock::resetUsageTimer() in appropriate places\r
-      (on client and server)\r
-\r
 ======================================================================\r
 \r
 */\r
@@ -406,16 +382,12 @@ TODO: Use MapBlock::resetUsageTimer() in appropriate places
 \r
 #include <iostream>\r
 #include <fstream>\r
-//#include <jmutexautolock.h>\r
 #include <locale.h>\r
 #include "main.h"\r
 #include "common_irrlicht.h"\r
 #include "debug.h"\r
-//#include "map.h"\r
-//#include "player.h"\r
 #include "test.h"\r
 #include "server.h"\r
-//#include "client.h"\r
 #include "constants.h"\r
 #include "porting.h"\r
 #include "gettime.h"\r
@@ -424,11 +396,12 @@ TODO: Use MapBlock::resetUsageTimer() in appropriate places
 #include "config.h"\r
 #include "guiMainMenu.h"\r
 #include "mineral.h"\r
-//#include "noise.h"\r
-//#include "tile.h"\r
 #include "materials.h"\r
 #include "game.h"\r
 #include "keycode.h"\r
+#include "tile.h"\r
+\r
+#include "gettext.h"\r
 \r
 // This makes textures\r
 ITextureSource *g_texturesource = NULL;\r
@@ -1087,7 +1060,6 @@ int main(int argc, char *argv[])
        std::locale::global(std::locale("C"));\r
        // This enables printing all characters in bitmap font\r
        setlocale(LC_CTYPE, "en_US");\r
-\r
        /*\r
                Parse command line\r
        */\r
@@ -1159,6 +1131,10 @@ int main(int argc, char *argv[])
 \r
        // Create user data directory\r
        fs::CreateDir(porting::path_userdata);\r
+\r
+       setlocale(LC_ALL, "");\r
+       bindtextdomain("minetest-c55", (porting::path_userdata+"/locale").c_str());\r
+       textdomain("minetest-c55");\r
        \r
        // Initialize debug streams\r
 #ifdef RUN_IN_PLACE\r
@@ -1374,6 +1350,9 @@ int main(int argc, char *argv[])
        \r
        // Set device in game parameters\r
        device = device;\r
+
+       // Set the window caption
+       device->setWindowCaption(L"Minetest [Main Menu]");
        \r
        // Create time getter\r
        g_timegetter = new IrrlichtTimeGetter(device);\r