]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/emerge.h
Pre-select current game in world creation dialog
[dragonfireclient.git] / src / emerge.h
index 7e0cc4850b39f633b96c511b9e83f5edd6fc1144..fdca93c06253676ec11501d330e6120c68438815 100644 (file)
@@ -1,3 +1,22 @@
+/*
+Minetest
+Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
 #ifndef EMERGE_HEADER
 #define EMERGE_HEADER
 
@@ -7,6 +26,10 @@
 
 #define BLOCK_EMERGE_ALLOWGEN (1<<0)
 
+#define EMERGE_DBG_OUT(x) \
+       { if (enable_mapgen_debug_info) \
+       infostream << "EmergeThread: " x << std::endl; }
+
 class Mapgen;
 class MapgenParams;
 class MapgenFactory;
@@ -18,7 +41,6 @@ class ManualMapVoxelManipulator;
 #include "server.h"
 
 struct BlockMakeData {
-       bool no_op;
        ManualMapVoxelManipulator *vmanip;
        u64 seed;
        v3s16 blockpos_min;
@@ -28,7 +50,6 @@ struct BlockMakeData {
        INodeDefManager *nodedef;
 
        BlockMakeData():
-               no_op(false),
                vmanip(NULL),
                seed(0),
                nodedef(NULL)
@@ -44,6 +65,8 @@ struct BlockEmergeData {
 
 class EmergeManager {
 public:
+       INodeDefManager *ndef;
+
        std::map<std::string, MapgenFactory *> mglist;
        
        std::vector<Mapgen *> mapgen;
@@ -51,6 +74,7 @@ class EmergeManager {
        
        //settings
        MapgenParams *params;
+       bool mapgen_debug_info;
        u16 qlimit_total;
        u16 qlimit_diskonly;
        u16 qlimit_generate;
@@ -60,10 +84,11 @@ class EmergeManager {
        std::map<v3s16, BlockEmergeData *> blocks_enqueued;
        std::map<u16, u16> peer_queue_count;
 
-       //biome manager
+       //Mapgen-related structures
        BiomeDefManager *biomedef;
+       std::vector<Ore *> ores;
 
-       EmergeManager(IGameDef *gamedef, BiomeDefManager *bdef);
+       EmergeManager(IGameDef *gamedef);
        ~EmergeManager();
 
        void initMapgens(MapgenParams *mgparams);
@@ -72,7 +97,7 @@ class EmergeManager {
        MapgenParams *createMapgenParams(std::string mgname);
        bool enqueueBlockEmerge(u16 peer_id, v3s16 p, bool allow_generate);
        
-       bool registerMapgen(std::string name, MapgenFactory *mgfactory);
+       void registerMapgen(std::string name, MapgenFactory *mgfactory);
        MapgenParams *getParamsFromSettings(Settings *settings);
        void setParamsToSettings(Settings *settings);
        
@@ -104,7 +129,6 @@ class EmergeThread : public SimpleThread
                mapgen(NULL),
                id(ethreadid)
        {
-               enable_mapgen_debug_info = g_settings->getBool("enable_mapgen_debug_info");
        }
 
        void *Thread();