#enable_fog = true
#new_style_water = true
#new_style_leaves = true
+#frametime_graph = false
# Server side stuff
g_settings.setDefault("enable_fog", "true");
g_settings.setDefault("new_style_water", "true");
g_settings.setDefault("new_style_leaves", "true");
+ g_settings.setDefault("frametime_graph", "false");
g_settings.setDefault("free_move", "false");
g_settings.setDefault("continuous_forward", "false");
# maybe done\r
* not done\r
\r
-=== Immediate stuff\r
-* Combine meshes to bigger ones in ClientMap and set them EHM_STATIC\r
-\r
-=== Making it more portable\r
-* MinGW: Switch away from swprintf; mingw has a bad version of it.\r
- Use snprintf + narrow_to_wide or (w)ostringstream\r
-* Some MSVC: std::sto* are defined without a namespace and collide\r
- with the ones in utility.h\r
-\r
=== Stuff to do before release\r
* Save the new mapgen stuff\r
- map/meta.txt, which should contain only plain text, something like this:\r
* only_from_disk might not work anymore - check and fix it.\r
* Check the fixmes in the list above\r
\r
+=== Making it more portable\r
+* MinGW: Switch away from swprintf; mingw has a bad version of it.\r
+ Use snprintf + narrow_to_wide or (w)ostringstream\r
+* Some MSVC: std::sto* are defined without a namespace and collide\r
+ with the ones in utility.h\r
+\r
=== Stuff to do after release\r
+* Move digging property stuff from material.{h,cpp} to mapnode.cpp...\r
+ - Or maybe move content_features to material.{h,cpp}?\r
* Add some kind of erosion and other stuff that now is possible\r
* Make client to fetch stuff asynchronously\r
- Needs method SyncProcessData\r
is generated. Fix it.\r
* Make a small history check to transformLiquids to detect and log\r
continuous oscillations, in such detail that they can be fixed.\r
+* Combine meshes to bigger ones in ClientMap and set them EHM_STATIC\r
\r
======================================================================\r
\r
IrrlichtWrapper *g_irrlicht = NULL;\r
\r
// This makes textures\r
-TextureSource *g_texturesource = NULL;\r
+ITextureSource *g_texturesource = NULL;\r
\r
MapDrawControl draw_control;\r
\r
\r
g_device = device;\r
g_irrlicht = new IrrlichtWrapper(device);\r
- g_texturesource = new TextureSource(device);\r
+ TextureSource *texturesource = new TextureSource(device);\r
+ g_texturesource = texturesource;\r
\r
/*\r
Speed tests (done after irrlicht is loaded to get timer)\r
\r
init_content_inventory_texture_paths();\r
init_mapnode(); // Second call with g_texturesource set\r
- init_mineral(g_irrlicht);\r
+ init_mineral();\r
\r
/*\r
GUI stuff\r
/*\r
Process TextureSource's queue\r
*/\r
- g_texturesource->processQueue();\r
+ texturesource->processQueue();\r
\r
/*\r
Random calculations\r
/*\r
Frametime log\r
*/\r
+ if(g_settings.getBool("frametime_graph") == true)\r
{\r
s32 x = 10;\r
for(core::list<float>::Iterator\r
// This makes and maps textures
#include "tile.h"
-extern TextureSource *g_texturesource;
+extern ITextureSource *g_texturesource;
// Debug streams
//m_chunksize = 2;
// TODO: Save to and load from a file
- m_seed = (((u64)myrand()<<0)%0x7fff)
- + (((u64)myrand()<<16)%0x7fff)
- + (((u64)myrand()<<32)%0x7fff)
- + (((u64)myrand()<<48)%0x7fff);
+ m_seed = (((u64)(myrand()%0xffff)<<0)
+ + ((u64)(myrand()%0xffff)<<16)
+ + ((u64)(myrand()%0xffff)<<32)
+ + ((u64)(myrand()%0xffff)<<48));
/*
Experimental and debug stuff
}
else
{
- // Load master heightmap
- loadMasterHeightmap();
+ // Load map metadata (seed, chunksize)
+ loadMapMeta();
- // Load sector (0,0) and throw and exception on fail
+ // Load chunk metadata
+ loadChunkMeta();
+
+ /*// Load sector (0,0) and throw and exception on fail
if(loadSectorFull(v2s16(0,0)) == false)
- throw LoadError("Failed to load sector (0,0)");
+ throw LoadError("Failed to load sector (0,0)");*/
- dstream<<DTIME<<"Server: Successfully loaded master "
- "heightmap and sector (0,0) from "<<savedir<<
+ /*dstream<<DTIME<<"Server: Successfully loaded chunk "
+ "metadata and sector (0,0) from "<<savedir<<
", assuming valid save directory."
+ <<std::endl;*/
+
+ dstream<<DTIME<<"INFO: Server: Successfully loaded map "
+ <<"and chunk metadata from "<<savedir
+ <<", assuming valid save directory."
<<std::endl;
m_map_saving_enabled = true;
}
catch(std::exception &e)
{
- dstream<<DTIME<<"Server: Failed to load map from "<<savedir
+ dstream<<DTIME<<"WARNING: Server: Failed to load map from "<<savedir
<<", exception: "<<e.what()<<std::endl;
- dstream<<DTIME<<"Please remove the map or fix it."<<std::endl;
- dstream<<DTIME<<"WARNING: Map saving will be disabled."<<std::endl;
+ dstream<<"Please remove the map or fix it."<<std::endl;
+ dstream<<"WARNING: Map saving will be disabled."<<std::endl;
}
- dstream<<DTIME<<"Initializing new map."<<std::endl;
+ dstream<<DTIME<<"INFO: Initializing new map."<<std::endl;
// Create zero sector
emergeSector(v2s16(0,0));
return h;
}
+#define VMANIP_FLAG_DUNGEON VOXELFLAG_CHECKED1
+
/*
This is the main map generation method
*/
vmanip.initialEmerge(bigarea_blocks_min, bigarea_blocks_max);
}
+ // Clear all flags
+ vmanip.clearFlag(0xff);
+
TimeTaker timer_generate("generateChunkRaw() generate");
// Maximum height of the stone surface and obstacles.
/*
Make dungeons
*/
- u32 dungeons_count = relative_volume / 600000;
+ u32 dungeons_count = relative_volume / 400000;
u32 bruises_count = relative_volume * stone_surface_max_y / 40000000;
if(stone_surface_max_y < WATER_LEVEL)
bruises_count = 0;
{
s16 min_tunnel_diameter = 2;
s16 max_tunnel_diameter = 6;
- u16 tunnel_routepoints = 15;
+ u16 tunnel_routepoints = 25;
bool bruise_surface = (jj < bruises_count);
of -= v3s16(1,0,1) * more;
s16 route_y_min = 0;
- //s16 route_y_max = ar.Y-1;
- s16 route_y_max = -of.Y + stone_surface_max_y + max_tunnel_diameter/2;
- // If dungeons
+ // Allow half a diameter + 7 over stone surface
+ s16 route_y_max = -of.Y + stone_surface_max_y + max_tunnel_diameter/2 + 7;
+
+ /*// If dungeons, don't go through surface too often
if(bruise_surface == false)
- {
- // Don't go through surface too often
- route_y_max -= myrand_range(0, max_tunnel_diameter*2);
- }
+ route_y_max -= myrand_range(0, max_tunnel_diameter*2);*/
+
+ // Limit maximum to area
route_y_max = rangelim(route_y_max, 0, ar.Y-1);
if(bruise_surface)
/*dstream<<"route_y_min = "<<route_y_min
<<", route_y_max = "<<route_y_max<<std::endl;*/
+ s16 route_start_y_min = route_y_min;
+ s16 route_start_y_max = route_y_max;
+
+ // Start every 2nd dungeon from surface
+ bool coming_from_surface = (jj % 2 == 0 && bruise_surface == false);
+
+ if(coming_from_surface)
+ {
+ route_start_y_min = -of.Y + stone_surface_max_y + 5;
+ }
+
+ route_start_y_min = rangelim(route_start_y_min, 0, ar.Y-1);
+ route_start_y_max = rangelim(route_start_y_max, 0, ar.Y-1);
+
// Randomize starting position
v3f orp(
(float)(myrand()%ar.X)+0.5,
- (float)(myrand_range(route_y_min, route_y_max))+0.5,
+ (float)(myrand_range(route_start_y_min, route_start_y_max))+0.5,
(float)(myrand()%ar.Z)+0.5
);
s16 max_d = max_tunnel_diameter;
s16 rs = myrand_range(min_d, max_d);
- v3s16 maxlen(15, 5, 15);
-
+ v3s16 maxlen;
if(bruise_surface)
{
maxlen = v3s16(rs*7,rs*7,rs*7);
}
+ else
+ {
+ maxlen = v3s16(15, myrand_range(1, 20), 15);
+ }
+
+ v3f vec;
+
+ if(coming_from_surface && j < 3)
+ {
+ vec = v3f(
+ (float)(myrand()%(maxlen.X*2))-(float)maxlen.X,
+ (float)(myrand()%(maxlen.Y*1))-(float)maxlen.Y,
+ (float)(myrand()%(maxlen.Z*2))-(float)maxlen.Z
+ );
+ }
+ else
+ {
+ vec = v3f(
+ (float)(myrand()%(maxlen.X*2))-(float)maxlen.X,
+ (float)(myrand()%(maxlen.Y*2))-(float)maxlen.Y,
+ (float)(myrand()%(maxlen.Z*2))-(float)maxlen.Z
+ );
+ }
- v3f vec(
- (float)(myrand()%(maxlen.X*2))-(float)maxlen.X,
- (float)(myrand()%(maxlen.Y*2))-(float)maxlen.Y,
- (float)(myrand()%(maxlen.Z*2))-(float)maxlen.Z
- );
v3f rp = orp + vec;
if(rp.X < 0)
rp.X = 0;
//s16 si2 = rs - MYMAX(0, maxabsxz-rs/4);
s16 si2 = rs - MYMAX(0, maxabsxz-rs/7);
//s16 si2 = rs - abs(x0);
- for(s16 y0=-si2+1+1; y0<=si2-1; y0++)
+ for(s16 y0=-si2+1+2; y0<=si2-1; y0++)
{
s16 z = cp.Z + z0;
s16 y = cp.Y + y0;
// water afterwards
u32 i = vmanip.m_area.index(p);
vmanip.m_data[i] = airnode;
+
+ if(bruise_surface == false)
+ {
+ // Set tunnel flag
+ vmanip.m_flags[i] |= VMANIP_FLAG_DUNGEON;
+ }
}
}
}
break;
}
- n->d = CONTENT_WATERSOURCE;
- n->setLight(LIGHTBANK_DAY, light);
+ // Make water only not in dungeons
+ if(!(vmanip.m_flags[i]&VMANIP_FLAG_DUNGEON))
+ {
+ n->d = CONTENT_WATERSOURCE;
+ //n->setLight(LIGHTBANK_DAY, light);
- // Add to transforming liquid queue (in case it'd
- // start flowing)
- v3s16 p = v3s16(p2d.X, y, p2d.Y);
- m_transforming_liquid.push_back(p);
+ // Add to transforming liquid queue (in case it'd
+ // start flowing)
+ v3s16 p = v3s16(p2d.X, y, p2d.Y);
+ m_transforming_liquid.push_back(p);
+ }
// Next one
vmanip.m_area.add_y(em, i, -1);
//TimeTaker timer("generateChunkRaw() blitBackAll");
vmanip.blitBackAll(&changed_blocks);
}
+
/*
Update day/night difference cache of the MapBlocks
*/
}
/*
- Set central chunk non-volatile and return it
+ Set central chunk non-volatile
*/
MapChunk *chunk = getChunk(chunkpos);
assert(chunk);
// Set non-volatile
//chunk->setIsVolatile(false);
chunk->setGenLevel(GENERATED_FULLY);
- // Return it
+
+ /*
+ Save changed parts of map
+ */
+ save(true);
+
+ /*
+ Return central chunk (which was requested)
+ */
return chunk;
}
dstream<<DTIME<<"ServerMap: Saving whole map, this can take time."
<<std::endl;
- saveMasterHeightmap();
+ saveMapMeta();
+ saveChunkMeta();
u32 sector_meta_count = 0;
u32 block_count = 0;
{
DSTACK(__FUNCTION_NAME);
dstream<<DTIME<<"ServerMap: Loading map..."<<std::endl;
-
- loadMasterHeightmap();
+
+ loadMapMeta();
+ loadChunkMeta();
std::vector<fs::DirListNode> list = fs::GetDirListing(m_savedir+"/sectors/");
dstream<<DTIME<<"ServerMap: Map loaded."<<std::endl;
}
+#if 0
void ServerMap::saveMasterHeightmap()
{
DSTACK(__FUNCTION_NAME);
if(is.good() == false)
throw FileNotGoodException("Cannot open master heightmap");*/
}
+#endif
+
+void ServerMap::saveMapMeta()
+{
+ DSTACK(__FUNCTION_NAME);
+
+ dstream<<"INFO: ServerMap::saveMapMeta(): "
+ <<"seed="<<m_seed<<", chunksize="<<m_chunksize
+ <<std::endl;
+
+ createDir(m_savedir);
+
+ std::string fullpath = m_savedir + "/meta.txt";
+ std::ofstream os(fullpath.c_str(), std::ios_base::binary);
+ if(os.good() == false)
+ {
+ dstream<<"ERROR: ServerMap::saveMapMeta(): "
+ <<"could not open"<<fullpath<<std::endl;
+ throw FileNotGoodException("Cannot open chunk metadata");
+ }
+
+ Settings params;
+ params.setU64("seed", m_seed);
+ params.setS32("chunksize", m_chunksize);
+
+ params.writeLines(os);
+
+ os<<"[end_of_params]\n";
+
+}
+
+void ServerMap::loadMapMeta()
+{
+ DSTACK(__FUNCTION_NAME);
+
+ dstream<<"INFO: ServerMap::loadMapMeta(): Loading chunk metadata"
+ <<std::endl;
+
+ std::string fullpath = m_savedir + "/meta.txt";
+ std::ifstream is(fullpath.c_str(), std::ios_base::binary);
+ if(is.good() == false)
+ {
+ dstream<<"ERROR: ServerMap::loadMapMeta(): "
+ <<"could not open"<<fullpath<<std::endl;
+ throw FileNotGoodException("Cannot open chunk metadata");
+ }
+
+ Settings params;
+
+ for(;;)
+ {
+ if(is.eof())
+ throw SerializationError
+ ("ServerMap::loadMapMeta(): [end_of_params] not found");
+ std::string line;
+ std::getline(is, line);
+ std::string trimmedline = trim(line);
+ if(trimmedline == "[end_of_params]")
+ break;
+ params.parseConfigLine(line);
+ }
+
+ m_seed = params.getU64("seed");
+ m_chunksize = params.getS32("chunksize");
+
+ dstream<<"INFO: ServerMap::loadMapMeta(): "
+ <<"seed="<<m_seed<<", chunksize="<<m_chunksize
+ <<std::endl;
+}
+
+void ServerMap::saveChunkMeta()
+{
+ DSTACK(__FUNCTION_NAME);
+
+ u32 count = m_chunks.size();
+
+ dstream<<"INFO: ServerMap::saveChunkMeta(): Saving metadata of "
+ <<count<<" chunks"<<std::endl;
+
+ createDir(m_savedir);
+
+ std::string fullpath = m_savedir + "/chunk_meta";
+ std::ofstream os(fullpath.c_str(), std::ios_base::binary);
+ if(os.good() == false)
+ {
+ dstream<<"ERROR: ServerMap::saveChunkMeta(): "
+ <<"could not open"<<fullpath<<std::endl;
+ throw FileNotGoodException("Cannot open chunk metadata");
+ }
+
+ u8 version = 0;
+
+ // Write version
+ os.write((char*)&version, 1);
+
+ u8 buf[4];
+
+ // Write count
+ writeU32(buf, count);
+ os.write((char*)buf, 4);
+
+ for(core::map<v2s16, MapChunk*>::Iterator
+ i = m_chunks.getIterator();
+ i.atEnd()==false; i++)
+ {
+ v2s16 p = i.getNode()->getKey();
+ MapChunk *chunk = i.getNode()->getValue();
+ // Write position
+ writeV2S16(buf, p);
+ os.write((char*)buf, 4);
+ // Write chunk data
+ chunk->serialize(os, version);
+ }
+}
+
+void ServerMap::loadChunkMeta()
+{
+ DSTACK(__FUNCTION_NAME);
+
+ dstream<<"INFO: ServerMap::loadChunkMeta(): Loading chunk metadata"
+ <<std::endl;
+
+ std::string fullpath = m_savedir + "/chunk_meta";
+ std::ifstream is(fullpath.c_str(), std::ios_base::binary);
+ if(is.good() == false)
+ {
+ dstream<<"ERROR: ServerMap::loadChunkMeta(): "
+ <<"could not open"<<fullpath<<std::endl;
+ throw FileNotGoodException("Cannot open chunk metadata");
+ }
+
+ u8 version = 0;
+
+ // Read version
+ is.read((char*)&version, 1);
+
+ u8 buf[4];
+
+ // Read count
+ is.read((char*)buf, 4);
+ u32 count = readU32(buf);
+
+ dstream<<"INFO: ServerMap::loadChunkMeta(): Loading metadata of "
+ <<count<<" chunks"<<std::endl;
+
+ for(u32 i=0; i<count; i++)
+ {
+ v2s16 p;
+ MapChunk *chunk = new MapChunk();
+ // Read position
+ is.read((char*)buf, 4);
+ p = readV2S16(buf);
+ // Read chunk data
+ chunk->deSerialize(is, version);
+ m_chunks.insert(p, chunk);
+ }
+}
void ServerMap::saveSectorMeta(ServerMapSector *sector)
{
void save(bool only_changed);
void loadAll();
- // TODO
+ // Saves map seed and possibly other stuff
void saveMapMeta();
void loadMapMeta();
- // TODO
void saveChunkMeta();
void loadChunkMeta();
- // DEPRECATED
- void saveMasterHeightmap();
- void loadMasterHeightmap();
-
// The sector mutex should be locked when calling most of these
// This only saves sector-specific data such as the heightmap
v3s16 face_dir)
{
try{
- // DEBUG
- /*{
- if(n.d == CONTENT_WATER)
- {
- u8 l = n.param2*2;
- if(l > LIGHT_MAX)
- l = LIGHT_MAX;
- return l;
- }
- if(n2.d == CONTENT_WATER)
- {
- u8 l = n2.param2*2;
- if(l > LIGHT_MAX)
- l = LIGHT_MAX;
- return l;
- }
- }*/
-
-
u8 light;
u8 l1 = n.getLightBlend(daynight_ratio);
u8 l2 = n2.getLightBlend(daynight_ratio);
// Make some nice difference to different sides
+ // This makes light come from a corner
/*if(face_dir.X == 1 || face_dir.Z == 1 || face_dir.Y == -1)
light = diminish_light(diminish_light(light));
else if(face_dir.X == -1 || face_dir.Z == -1)
light = diminish_light(light);*/
-
+
+ // All neighboring faces have different shade (like in minecraft)
if(face_dir.X == 1 || face_dir.X == -1 || face_dir.Y == -1)
light = diminish_light(diminish_light(light));
else if(face_dir.Z == 1 || face_dir.Z == -1)
// Flowing water material
video::SMaterial material_water1;
material_water1.setFlag(video::EMF_LIGHTING, false);
- material_water1.setFlag(video::EMF_BACK_FACE_CULLING, false);
+ //material_water1.setFlag(video::EMF_BACK_FACE_CULLING, false);
material_water1.setFlag(video::EMF_BILINEAR_FILTER, false);
material_water1.setFlag(video::EMF_FOG_ENABLE, true);
material_water1.MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA;
video::S3DVertex(BS/2,0,BS/2, 0,0,0, c, 1,1),
video::S3DVertex(BS/2,0,BS/2, 0,0,0, c, 1,0),
video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c, 0,0),*/
- video::S3DVertex(-BS/2,0,-BS/2, 0,0,0, c,
+ video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c,
pa_water1.x0(), pa_water1.y1()),
- video::S3DVertex(BS/2,0,-BS/2, 0,0,0, c,
+ video::S3DVertex(BS/2,0,BS/2, 0,0,0, c,
pa_water1.x1(), pa_water1.y1()),
video::S3DVertex(BS/2,0,BS/2, 0,0,0, c,
pa_water1.x1(), pa_water1.y0()),
video::S3DVertex(BS/2,0,-BS/2, 0,0,0, c, 1,1),
video::S3DVertex(BS/2,0,BS/2, 0,0,0, c, 1,0),
video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c, 0,0),*/
- video::S3DVertex(-BS/2,0,-BS/2, 0,0,0, c,
+ video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c,
pa_water1.x0(), pa_water1.y1()),
- video::S3DVertex(BS/2,0,-BS/2, 0,0,0, c,
- pa_water1.x1(), pa_water1.y1()),
video::S3DVertex(BS/2,0,BS/2, 0,0,0, c,
+ pa_water1.x1(), pa_water1.y1()),
+ video::S3DVertex(BS/2,0,-BS/2, 0,0,0, c,
pa_water1.x1(), pa_water1.y0()),
- video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c,
+ video::S3DVertex(-BS/2,0,-BS/2, 0,0,0, c,
pa_water1.x0(), pa_water1.y0()),
};
+
+ // This fixes a strange bug
+ s32 corner_resolve[4] = {3,2,1,0};
for(s32 i=0; i<4; i++)
{
//vertices[i].Pos.Y += water_level;
//vertices[i].Pos.Y += neighbor_levels[v3s16(0,0,0)];
- vertices[i].Pos.Y += corner_levels[i];
+ s32 j = corner_resolve[i];
+ vertices[i].Pos.Y += corner_levels[j];
vertices[i].Pos += intToFloat(p + getPosRelative());
}
some MapSectors. (something like 16x16)
*/
+// These should fit in 8 bits, as they are saved as such.
enum{
GENERATED_FULLY = 0,
GENERATED_PARTLY = 10,
{
public:
MapChunk():
- //m_is_volatile(true)
m_generation_level(GENERATED_NOT)
{
}
- /*
- If is_volatile is true, chunk can be modified when
- neighboring chunks are generated.
-
- It is set to false when all the 8 neighboring chunks have
- been generated.
- */
- /*bool getIsVolatile(){ return m_is_volatile; }
- void setIsVolatile(bool is){ m_is_volatile = is; }*/
-
/*
Generation level. Possible values:
GENERATED_FULLY = 0 = fully generated
u16 getGenLevel(){ return m_generation_level; }
void setGenLevel(u16 lev){ m_generation_level = lev; }
+ void serialize(std::ostream &os, u8 version)
+ {
+ os.write((char*)&m_generation_level, 1);
+ }
+ void deSerialize(std::istream &is, u8 version)
+ {
+ is.read((char*)&m_generation_level, 1);
+ }
+
private:
- //bool m_is_volatile;
- u16 m_generation_level;
+ u8 m_generation_level;
};
#endif
DiggingProperties(true, 1.0, 0));
g_material_properties[CONTENT_SAND].setDiggingProperties("",
- DiggingProperties(true, 0.5, 0));
+ DiggingProperties(true, 0.4, 0));
/*
Add MesePick to everything
//textureid_t mineral_textures[MINERAL_COUNT] = {0};
std::string mineral_textures[MINERAL_COUNT];
-void init_mineral(IIrrlichtWrapper *irrlicht)
+void init_mineral()
{
for(u32 i=0; i<MINERAL_COUNT; i++)
{
if(mineral_filenames[i] == NULL)
continue;
- //mineral_textures[i] = irrlicht->getTextureId(mineral_filenames[i]);
- //mineral_textures[i] = 0;
mineral_textures[i] = mineral_filenames[i];
}
}
#include "inventory.h"
#include "texture.h"
-#include "iirrlichtwrapper.h"
/*
Minerals
*/
// Caches textures
-void init_mineral(IIrrlichtWrapper *irrlicht);
+void init_mineral();
#define MINERAL_NONE 0
#define MINERAL_COAL 1
extern void set_default_settings();
+// A dummy thing
+ITextureSource *g_texturesource = NULL;
+
/*
Debug streams
*/
// Initialize stuff
- IIrrlichtWrapper irrlicht; // Dummy
- init_mapnode(&irrlicht);
- init_mineral(&irrlicht);
+ init_mapnode();
+ init_mineral();
/*
Check parameters
#include <winsock2.h>
#include <ws2tcpip.h>
#ifdef _MSC_VER
- #pragma comment(lib, "wsock32.lib")
+ #pragma comment(lib, "ws2_32.lib")
#endif
typedef SOCKET socket_t;
typedef int socklen_t;
}
};
+/*
+ Implementation (to be used as a no-op on the server)
+*/
+class ITextureSource
+{
+public:
+ ITextureSource(){}
+ virtual ~ITextureSource(){}
+ virtual u32 getTextureId(const std::string &name){return 0;}
+ virtual u32 getTextureIdDirect(const std::string &name){return 0;}
+ virtual std::string getTextureName(u32 id){return "";}
+ virtual AtlasPointer getTexture(u32 id){return AtlasPointer(0);}
+ virtual AtlasPointer getTexture(const std::string &name)
+ {return AtlasPointer(0);}
+ virtual video::ITexture* getTextureRaw(const std::string &name)
+ {return NULL;}
+};
+
/*
Creates and caches textures.
*/
-class TextureSource
+class TextureSource : public ITextureSource
{
public:
TextureSource(IrrlichtDevice *device);
return value;
}
+ u64 getU64(std::string name)
+ {
+ u64 value = 0;
+ std::string s = get(name);
+ std::istringstream ss(s);
+ ss>>value;
+ return value;
+ }
+
void setS32(std::string name, s32 value)
{
set(name, itos(value));
set(name, os.str());
}
+ void setU64(std::string name, u64 value)
+ {
+ std::ostringstream os;
+ os<<value;
+ set(name, os.str());
+ }
+
void clear()
{
m_settings.clear();
// Checked as being inexistent in source
#define VOXELFLAG_INEXISTENT (1<<1)
// Algorithm-dependent
-// flowWater: "visited"
-#define VOXELFLAG_CHECKED (1<<2)
+#define VOXELFLAG_CHECKED1 (1<<2)
// Algorithm-dependent
-// getWaterPressure: "visited"
#define VOXELFLAG_CHECKED2 (1<<3)
// Algorithm-dependent
-// spreadWaterPressure: "visited"
#define VOXELFLAG_CHECKED3 (1<<4)
// Algorithm-dependent
-// water: "pressure check route node"
#define VOXELFLAG_CHECKED4 (1<<5)
enum VoxelPrintMode