mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-05 17:44:52 +01:00
Move ressource files to a separate directory
This commit is contained in:
parent
843b3abde6
commit
22b9cfcb8b
8 changed files with 12 additions and 13 deletions
|
@ -4,9 +4,9 @@ link_directories(${ZLIB_LIBRARY_DIRS} ${LIBPNG_LIBRARY_DIRS})
|
||||||
add_executable(MinedMap
|
add_executable(MinedMap
|
||||||
MinedMap.cpp
|
MinedMap.cpp
|
||||||
NBT/Tag.cpp
|
NBT/Tag.cpp
|
||||||
World/Biome.cpp
|
Resource/Biome.cpp
|
||||||
|
Resource/BlockType.cpp
|
||||||
World/Block.cpp
|
World/Block.cpp
|
||||||
World/BlockType.cpp
|
|
||||||
World/Chunk.cpp
|
World/Chunk.cpp
|
||||||
World/Region.cpp
|
World/Region.cpp
|
||||||
)
|
)
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "World/BlockType.hpp"
|
|
||||||
#include "World/Region.hpp"
|
#include "World/Region.hpp"
|
||||||
#include "NBT/ListTag.hpp"
|
#include "NBT/ListTag.hpp"
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
|
|
||||||
namespace MinedMap {
|
namespace MinedMap {
|
||||||
namespace World {
|
namespace Resource {
|
||||||
|
|
||||||
const Biome BIOMES[256] = {
|
const Biome BIOMES[256] = {
|
||||||
/* 0 */ {0.25, 1, 0.25},
|
/* 0 */ {0.25, 1, 0.25},
|
|
@ -27,7 +27,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
namespace MinedMap {
|
namespace MinedMap {
|
||||||
namespace World {
|
namespace Resource {
|
||||||
|
|
||||||
struct Biome {
|
struct Biome {
|
||||||
float r, g, b;
|
float r, g, b;
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
|
|
||||||
namespace MinedMap {
|
namespace MinedMap {
|
||||||
namespace World {
|
namespace Resource {
|
||||||
|
|
||||||
const BlockType BLOCK_TYPES[256] = {
|
const BlockType BLOCK_TYPES[256] = {
|
||||||
{false, false, {0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,}}, /* 0 */
|
{false, false, {0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,}}, /* 0 */
|
|
@ -29,7 +29,7 @@
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
namespace MinedMap {
|
namespace MinedMap {
|
||||||
namespace World {
|
namespace Resource {
|
||||||
|
|
||||||
struct BlockType {
|
struct BlockType {
|
||||||
bool opaque;
|
bool opaque;
|
|
@ -25,15 +25,15 @@
|
||||||
|
|
||||||
|
|
||||||
#include "Block.hpp"
|
#include "Block.hpp"
|
||||||
#include "BlockType.hpp"
|
#include "../Resource/BlockType.hpp"
|
||||||
#include "Biome.hpp"
|
#include "../Resource/Biome.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace MinedMap {
|
namespace MinedMap {
|
||||||
namespace World {
|
namespace World {
|
||||||
|
|
||||||
uint32_t Block::getColor() const {
|
uint32_t Block::getColor() const {
|
||||||
const World::BlockType &t = World::BLOCK_TYPES[id];
|
const Resource::BlockType &t = Resource::BLOCK_TYPES[id];
|
||||||
|
|
||||||
if (!t.opaque)
|
if (!t.opaque)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -54,7 +54,7 @@ uint32_t Block::getColor() const {
|
||||||
b *= lightCoef * heightCoef;
|
b *= lightCoef * heightCoef;
|
||||||
|
|
||||||
if (t.green) {
|
if (t.green) {
|
||||||
const Biome &biomeDef = BIOMES[biome];
|
const Resource::Biome &biomeDef = Resource::BIOMES[biome];
|
||||||
|
|
||||||
r *= biomeDef.r;
|
r *= biomeDef.r;
|
||||||
g *= biomeDef.g;
|
g *= biomeDef.g;
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "Chunk.hpp"
|
#include "Chunk.hpp"
|
||||||
#include "BlockType.hpp"
|
#include "../Resource/BlockType.hpp"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
@ -152,7 +152,7 @@ Chunk::Blocks Chunk::getTopLayer() const {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
uint8_t id = getBlockAt(x, y, z);
|
uint8_t id = getBlockAt(x, y, z);
|
||||||
if (!BLOCK_TYPES[id].opaque)
|
if (!Resource::BLOCK_TYPES[id].opaque)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Block &b = ret.blocks[x][z];
|
Block &b = ret.blocks[x][z];
|
||||||
|
|
Loading…
Add table
Reference in a new issue