diff --git a/terrain/cachewriter.d b/terrain/cachewriter.d index 572481df4..61a52addb 100644 --- a/terrain/cachewriter.d +++ b/terrain/cachewriter.d @@ -20,6 +20,8 @@ */ +module terrain.cachewriter; + import terrain.archive; import terrain.outbuffer; diff --git a/terrain/cpp_terrain.cpp b/terrain/cpp_terrain.cpp index 295301b06..2b40b602a 100644 --- a/terrain/cpp_terrain.cpp +++ b/terrain/cpp_terrain.cpp @@ -130,7 +130,8 @@ protected: { TRACE("Terrain frame"); d_terr_terrainUpdate(); - g_baseLand->update(); + if(g_baseLand) + g_baseLand->update(); return true; } }; @@ -285,7 +286,7 @@ extern "C" // Add the base land. This is the ground beneath the actual // terrain mesh that makes the terrain look infinite. - g_baseLand = new BaseLand(); + //g_baseLand = new BaseLand(); g_alphaSize = d_terr_getAlphaSize(); diff --git a/terrain/myfile.d b/terrain/myfile.d index 575151ed9..15239ac2e 100644 --- a/terrain/myfile.d +++ b/terrain/myfile.d @@ -20,6 +20,8 @@ */ +module terrain.myfile; + import std.stream; import std.stdio; diff --git a/terrain/outbuffer.d b/terrain/outbuffer.d index 885a92fea..c496a4787 100644 --- a/terrain/outbuffer.d +++ b/terrain/outbuffer.d @@ -28,6 +28,8 @@ buffer to a stream in one operation. */ +module terrain.outbuffer; + import util.regions; import std.stream; diff --git a/terrain/terrain.d b/terrain/terrain.d index e9a168470..4bf03c87b 100644 --- a/terrain/terrain.d +++ b/terrain/terrain.d @@ -60,20 +60,14 @@ void initTerrain(bool doGen) int Y = 0; bool next = false; - void doQuad(int x, int y, int lev) + void doQuad(int x, int y, int lev, int diffx, int diffy) { if(!g_archive.hasQuad(x,y,lev)) return; - int diffx = x-X; - int diffy = y-Y; - diffx *= 8192; diffy *= 8192; - if(diffx == 0 && lev == 2) - diffx = 8192 * 2; - auto node = terr_createChildNode(20000+diffx,-60000+diffy,null); auto info = g_archive.getQuad(x,y,lev); g_archive.mapQuad(info); @@ -81,12 +75,14 @@ void initTerrain(bool doGen) terr_makeMesh(node, mi, info.level, TEX_SCALE); } - doQuad(X,Y,1); - doQuad(X+1,Y,1); - doQuad(X,Y+1,1); - doQuad(X+1,Y+1,1); + doQuad(X,Y,1, 0,0); + doQuad(X+1,Y,1, 1,0); + doQuad(X,Y+1,1, 0,1); + doQuad(X+1,Y+1,1, 1,1); + + doQuad(X + (next?2:0),Y,2, 2,0); - doQuad(X + (next?2:0),Y,2); + doQuad(20,Y,3, 0,2); } else {