summaryrefslogtreecommitdiffstats
path: root/source/WGFlat.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-05-25 09:18:52 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-05-25 09:18:52 +0200
commita4a418a679f1ac760a8763edd856f0178cfc6dde (patch)
tree85300ca3a2b3a942998a0c864ae90894857ebf5f /source/WGFlat.cpp
parentFixed output directory structure in the "Release profiled" configuration (diff)
downloadcuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar
cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.gz
cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.bz2
cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.lz
cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.xz
cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.zst
cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.zip
Diffstat (limited to '')
-rw-r--r--source/WGFlat.cpp101
1 files changed, 0 insertions, 101 deletions
diff --git a/source/WGFlat.cpp b/source/WGFlat.cpp
deleted file mode 100644
index cb1392a77..000000000
--- a/source/WGFlat.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-
-// WGFlat.cpp
-
-// Implements the cWGFlat class representing the flat world generator
-
-#include "Globals.h"
-#include "WGFlat.h"
-#include "../iniFile/iniFile.h"
-#include "cWorld.h"
-
-
-
-
-
-cWGFlat::cWGFlat(cWorld * a_World) :
- super(a_World)
-{
- // Load the settings from the INI file:
- cIniFile INI(a_World->GetIniFileName());
- INI.ReadFile();
- m_Height = INI.GetValueI("flat", "height", 5);
- if (m_Height < 1)
- {
- m_Height = 1;
- }
- if (m_Height > 250)
- {
- m_Height = 250;
- }
-}
-
-
-
-
-
-void cWGFlat::GenerateChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, BLOCKTYPE * a_BlockData, cEntityList & a_Entities, cBlockEntityList & a_BlockEntities)
-{
- int SliceSize = cChunkDef::Width * cChunkDef::Width;
- memset(a_BlockData, E_BLOCK_BEDROCK, SliceSize);
- switch (m_Height)
- {
- case 1:
- {
- // Just the bedrock layer
- break;
- }
- case 2:
- {
- // Bedrock + 1 dirt layer:
- memset(a_BlockData + SliceSize, E_BLOCK_GRASS, SliceSize);
- break;
- }
- case 3:
- {
- // Bedrock + 2 dirt layers:
- memset(a_BlockData + SliceSize, E_BLOCK_DIRT, SliceSize);
- memset(a_BlockData + 2 * SliceSize, E_BLOCK_GRASS, SliceSize);
- break;
- }
- case 4:
- {
- // Bedrock + 3 dirt layers:
- memset(a_BlockData + SliceSize, E_BLOCK_DIRT, 2 * SliceSize);
- memset(a_BlockData + 3 * SliceSize, E_BLOCK_GRASS, SliceSize);
- break;
- }
- default:
- {
- // Bedrock + stone layers + 3 dirt layers:
- memset(a_BlockData + SliceSize, E_BLOCK_STONE, SliceSize * (m_Height - 4));
- memset(a_BlockData + SliceSize * (m_Height - 3), E_BLOCK_DIRT, SliceSize * 2);
- memset(a_BlockData + SliceSize * (m_Height - 1), E_BLOCK_GRASS, SliceSize);
- break;
- }
- }
- memset(a_BlockData + SliceSize * m_Height, E_BLOCK_AIR, cChunkDef::NumBlocks - SliceSize * m_Height);
-
- SliceSize /= 2; // Nibbles from now on
- BLOCKTYPE * Meta = a_BlockData + cChunkDef::NumBlocks;
- memset(Meta, 0, cChunkDef::NumBlocks / 2);
-
- BLOCKTYPE * SkyLight = Meta + cChunkDef::NumBlocks / 2;
- memset(SkyLight, 0, m_Height * SliceSize);
- memset(SkyLight + m_Height * SliceSize, 0xff, cChunkDef::NumBlocks / 2 - m_Height * SliceSize);
-
- BLOCKTYPE * BlockLight = SkyLight + cChunkDef::NumBlocks / 2;
- memset(BlockLight, 0, cChunkDef::NumBlocks / 2);
-}
-
-
-
-
-
-void cWGFlat::PostGenerateChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
-{
- // Nothing needed yet, just don't call the parent
-}
-
-
-
-