diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/MinedMap.cpp | 1 | ||||
-rw-r--r-- | src/Resource/Biome.cpp (renamed from src/World/Biome.cpp) | 2 | ||||
-rw-r--r-- | src/Resource/Biome.hpp (renamed from src/World/Biome.hpp) | 2 | ||||
-rw-r--r-- | src/Resource/BlockType.cpp (renamed from src/World/BlockType.cpp) | 2 | ||||
-rw-r--r-- | src/Resource/BlockType.hpp (renamed from src/World/BlockType.hpp) | 2 | ||||
-rw-r--r-- | src/World/Block.cpp | 8 | ||||
-rw-r--r-- | src/World/Chunk.cpp | 4 |
8 files changed, 12 insertions, 13 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6869adb..1f04cbc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,9 +4,9 @@ link_directories(${ZLIB_LIBRARY_DIRS} ${LIBPNG_LIBRARY_DIRS}) add_executable(MinedMap MinedMap.cpp NBT/Tag.cpp - World/Biome.cpp + Resource/Biome.cpp + Resource/BlockType.cpp World/Block.cpp - World/BlockType.cpp World/Chunk.cpp World/Region.cpp ) diff --git a/src/MinedMap.cpp b/src/MinedMap.cpp index 594268c..f9f9736 100644 --- a/src/MinedMap.cpp +++ b/src/MinedMap.cpp @@ -24,7 +24,6 @@ */ -#include "World/BlockType.hpp" #include "World/Region.hpp" #include "NBT/ListTag.hpp" diff --git a/src/World/Biome.cpp b/src/Resource/Biome.cpp index f90e54c..2862daf 100644 --- a/src/World/Biome.cpp +++ b/src/Resource/Biome.cpp @@ -28,7 +28,7 @@ namespace MinedMap { -namespace World { +namespace Resource { const Biome BIOMES[256] = { /* 0 */ {0.25, 1, 0.25}, diff --git a/src/World/Biome.hpp b/src/Resource/Biome.hpp index 4534db0..1d8f396 100644 --- a/src/World/Biome.hpp +++ b/src/Resource/Biome.hpp @@ -27,7 +27,7 @@ #pragma once namespace MinedMap { -namespace World { +namespace Resource { struct Biome { float r, g, b; diff --git a/src/World/BlockType.cpp b/src/Resource/BlockType.cpp index 3edf31d..b8ad331 100644 --- a/src/World/BlockType.cpp +++ b/src/Resource/BlockType.cpp @@ -28,7 +28,7 @@ namespace MinedMap { -namespace World { +namespace Resource { const BlockType BLOCK_TYPES[256] = { {false, false, {0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,}}, /* 0 */ diff --git a/src/World/BlockType.hpp b/src/Resource/BlockType.hpp index 11a9621..6b2c114 100644 --- a/src/World/BlockType.hpp +++ b/src/Resource/BlockType.hpp @@ -29,7 +29,7 @@ #include <cstdint> namespace MinedMap { -namespace World { +namespace Resource { struct BlockType { bool opaque; diff --git a/src/World/Block.cpp b/src/World/Block.cpp index 6bd6a00..b19d67c 100644 --- a/src/World/Block.cpp +++ b/src/World/Block.cpp @@ -25,15 +25,15 @@ #include "Block.hpp" -#include "BlockType.hpp" -#include "Biome.hpp" +#include "../Resource/BlockType.hpp" +#include "../Resource/Biome.hpp" namespace MinedMap { namespace World { uint32_t Block::getColor() const { - const World::BlockType &t = World::BLOCK_TYPES[id]; + const Resource::BlockType &t = Resource::BLOCK_TYPES[id]; if (!t.opaque) return 0; @@ -54,7 +54,7 @@ uint32_t Block::getColor() const { b *= lightCoef * heightCoef; if (t.green) { - const Biome &biomeDef = BIOMES[biome]; + const Resource::Biome &biomeDef = Resource::BIOMES[biome]; r *= biomeDef.r; g *= biomeDef.g; diff --git a/src/World/Chunk.cpp b/src/World/Chunk.cpp index 3a1e9a2..64b3988 100644 --- a/src/World/Chunk.cpp +++ b/src/World/Chunk.cpp @@ -25,7 +25,7 @@ #include "Chunk.hpp" -#include "BlockType.hpp" +#include "../Resource/BlockType.hpp" #include <iostream> #include <stdexcept> @@ -152,7 +152,7 @@ Chunk::Blocks Chunk::getTopLayer() const { continue; uint8_t id = getBlockAt(x, y, z); - if (!BLOCK_TYPES[id].opaque) + if (!Resource::BLOCK_TYPES[id].opaque) continue; Block &b = ret.blocks[x][z]; |