|
@@ -2,6 +2,8 @@
|
|
|
|
|
|
#include <Shader.h>
|
|
|
|
|
|
+#include "ChunkFluidModel.h"
|
|
|
+#include "ChunkGroundModel.h"
|
|
|
#include "Constants.h"
|
|
|
#include "CustomDX11API.h"
|
|
|
#include "FactoryCraftModel.h"
|
|
@@ -16,7 +18,7 @@ Chunk::Chunk(Framework::Punkt location)
|
|
|
{
|
|
|
blocks = new Block*[CHUNK_SIZE * CHUNK_SIZE * WORLD_HEIGHT];
|
|
|
memset(blocks, 0, CHUNK_SIZE * CHUNK_SIZE * WORLD_HEIGHT * sizeof(Block*));
|
|
|
- groundModel = new FactoryCraftModel();
|
|
|
+ FactoryCraftModel* ground = new FactoryCraftModel();
|
|
|
Model3DData* chunkModel
|
|
|
= uiFactory.initParam.bildschirm->zGraphicsApi()->getModel(
|
|
|
Text("chunk_ground_") + location.x + location.y);
|
|
@@ -30,17 +32,37 @@ Chunk::Chunk(Framework::Punkt location)
|
|
|
chunkModel->setDiffusFactor(1.f);
|
|
|
chunkModel->setSpecularFactor(0.f);
|
|
|
chunkModel->setVertecies(0, 0);
|
|
|
- groundModel->setModelDaten(chunkModel);
|
|
|
- groundModel->setPosition(
|
|
|
+ ground->setModelDaten(chunkModel);
|
|
|
+ ground->setPosition(
|
|
|
(float)location.x, (float)location.y, (float)WORLD_HEIGHT / 2.f);
|
|
|
- groundModel->tick(0);
|
|
|
+ ground->tick(0);
|
|
|
+ groundModel = new ChunkGroundModel(ground, this);
|
|
|
+ FactoryCraftModel* fluids = new FactoryCraftModel();
|
|
|
+ chunkModel = uiFactory.initParam.bildschirm->zGraphicsApi()->getModel(
|
|
|
+ Text("chunk_fluids_") + location.x + location.y);
|
|
|
+ if (!chunkModel)
|
|
|
+ {
|
|
|
+ chunkModel
|
|
|
+ = uiFactory.initParam.bildschirm->zGraphicsApi()->createModel(
|
|
|
+ Text("chunk_fluids_") + location.x + location.y);
|
|
|
+ }
|
|
|
+ chunkModel->setAmbientFactor(0.f);
|
|
|
+ chunkModel->setDiffusFactor(1.f);
|
|
|
+ chunkModel->setSpecularFactor(0.f);
|
|
|
+ chunkModel->setVertecies(0, 0);
|
|
|
+ fluids->setModelDaten(chunkModel);
|
|
|
+ fluids->setPosition(
|
|
|
+ (float)location.x, (float)location.y, (float)WORLD_HEIGHT / 2.f);
|
|
|
+ fluids->tick(0);
|
|
|
+ fluidModel = new ChunkFluidModel(fluids, this);
|
|
|
}
|
|
|
|
|
|
Chunk::Chunk(Framework::Punkt location, Framework::StreamReader* zReader)
|
|
|
: Chunk(location)
|
|
|
{
|
|
|
load(zReader);
|
|
|
- buildGroundModel();
|
|
|
+ buildModel(groundModel);
|
|
|
+ buildModel(fluidModel);
|
|
|
}
|
|
|
|
|
|
Chunk::~Chunk()
|
|
@@ -254,388 +276,33 @@ void Chunk::load(Framework::StreamReader* zReader)
|
|
|
isLoading = 0;
|
|
|
}
|
|
|
|
|
|
-void Chunk::buildGroundModel()
|
|
|
+void Chunk::buildModel(ChunkModelBuilder* builder)
|
|
|
{
|
|
|
vcs.lock();
|
|
|
- visibleBlocks.leeren();
|
|
|
- lightChanged = 0;
|
|
|
- Model3DData* chunkModel = groundModel->zModelData();
|
|
|
- // remove old model
|
|
|
- while (chunkModel->getPolygonAnzahl() > 0)
|
|
|
- {
|
|
|
- chunkModel->removePolygon(0);
|
|
|
- }
|
|
|
- // calculate verticies
|
|
|
- Trie<GroundModelPart*> groundModelBuidler;
|
|
|
- Array<GroundModelPart*> groundPartArray;
|
|
|
- Vertex3D* groundVerticies = new Vertex3D[10000];
|
|
|
- __int64* lightBuffer = new __int64[10000];
|
|
|
- int groundVertexCount = 0;
|
|
|
- int groundVertexArraySize = 10000;
|
|
|
- for (int i = 0; i < CHUNK_SIZE * CHUNK_SIZE * WORLD_HEIGHT; i++)
|
|
|
- {
|
|
|
- if (blocks[i])
|
|
|
- {
|
|
|
- if (blocks[i]
|
|
|
- ->zBlockType()
|
|
|
- ->getModelInfo()
|
|
|
- .getModelName()
|
|
|
- .istGleich("cube"))
|
|
|
- {
|
|
|
- blocks[i]->setPartOfGround(1);
|
|
|
- int index = 0;
|
|
|
- for (Text* textureName :
|
|
|
- *blocks[i]->zBlockType()->getModelInfo().getTexturNames())
|
|
|
- {
|
|
|
- Framework::Vec3<int> location(
|
|
|
- (i / WORLD_HEIGHT) / CHUNK_SIZE,
|
|
|
- (i / WORLD_HEIGHT) % CHUNK_SIZE,
|
|
|
- i % WORLD_HEIGHT);
|
|
|
- if (isPartOfGroundModel(location, index))
|
|
|
- {
|
|
|
- if (!groundModelBuidler.get(
|
|
|
- *textureName, textureName->getLength()))
|
|
|
- {
|
|
|
- GroundModelPart* part = new GroundModelPart();
|
|
|
- part->indexList = new int[10000];
|
|
|
- part->indexCount = 0;
|
|
|
- part->indexArraySize = 10000;
|
|
|
- part->name = *textureName;
|
|
|
- groundModelBuidler.set(
|
|
|
- *textureName, textureName->getLength(), part);
|
|
|
- groundPartArray.add(part);
|
|
|
- }
|
|
|
- GroundModelPart* part = groundModelBuidler.get(
|
|
|
- *textureName, textureName->getLength());
|
|
|
- const Vertex3D* vBuffer
|
|
|
- = blocks[i]->zModelData()->zVertexBuffer();
|
|
|
- Polygon3D* polygon
|
|
|
- = blocks[i]->zModelData()->getPolygon(index);
|
|
|
- if (part->indexCount + polygon->indexAnz
|
|
|
- > part->indexArraySize)
|
|
|
- {
|
|
|
- int* tmp = new int[part->indexArraySize + 10000];
|
|
|
- memcpy(tmp, part->indexList, part->indexCount * 4);
|
|
|
- delete[] part->indexList;
|
|
|
- part->indexList = tmp;
|
|
|
- part->indexArraySize += 10000;
|
|
|
- }
|
|
|
- if (groundVertexCount + polygon->indexAnz
|
|
|
- > groundVertexArraySize)
|
|
|
- {
|
|
|
- Vertex3D* tmp
|
|
|
- = new Vertex3D[groundVertexArraySize + 10000];
|
|
|
- memcpy(tmp,
|
|
|
- groundVerticies,
|
|
|
- groundVertexCount * sizeof(Vertex3D));
|
|
|
- delete[] groundVerticies;
|
|
|
- groundVerticies = tmp;
|
|
|
- groundVertexArraySize += 10000;
|
|
|
- __int64* lTmp = new __int64[groundVertexArraySize];
|
|
|
- memcpy(lTmp,
|
|
|
- lightBuffer,
|
|
|
- groundVertexCount * sizeof(__int64));
|
|
|
- delete[] lightBuffer;
|
|
|
- lightBuffer = lTmp;
|
|
|
- }
|
|
|
- for (int vi = 0; vi < polygon->indexAnz; vi++)
|
|
|
- {
|
|
|
- lightBuffer[groundVertexCount] = calculateLight(
|
|
|
- vBuffer[polygon->indexList[vi]].pos,
|
|
|
- location,
|
|
|
- getDirectionFromIndex(index));
|
|
|
- part->indexList[part->indexCount++]
|
|
|
- = groundVertexCount;
|
|
|
- groundVerticies[groundVertexCount++]
|
|
|
- = vBuffer[polygon->indexList[vi]];
|
|
|
- groundVerticies[groundVertexCount - 1].pos
|
|
|
- += blocks[i]->getPos()
|
|
|
- - Vec3<float>((float)this->location.x,
|
|
|
- (float)this->location.y,
|
|
|
- (float)WORLD_HEIGHT / 2.f);
|
|
|
- groundVerticies[groundVertexCount - 1].id
|
|
|
- = groundVertexCount - 1;
|
|
|
- }
|
|
|
- }
|
|
|
- index++;
|
|
|
- }
|
|
|
- }
|
|
|
- else if (blocks[i]
|
|
|
- ->zBlockType()
|
|
|
- ->getModelInfo()
|
|
|
- .getModelName()
|
|
|
- .istGleich("grass"))
|
|
|
- {
|
|
|
- blocks[i]->setPartOfGround(1);
|
|
|
- __int64 light = blocks[i]->getMaxLight();
|
|
|
- int index = 0;
|
|
|
- for (Text* textureName :
|
|
|
- *blocks[i]->zBlockType()->getModelInfo().getTexturNames())
|
|
|
- {
|
|
|
- if (!groundModelBuidler.get(
|
|
|
- *textureName, textureName->getLength()))
|
|
|
- {
|
|
|
- GroundModelPart* part = new GroundModelPart();
|
|
|
- part->indexList = new int[10000];
|
|
|
- part->indexCount = 0;
|
|
|
- part->indexArraySize = 10000;
|
|
|
- part->name = *textureName;
|
|
|
- groundModelBuidler.set(
|
|
|
- *textureName, textureName->getLength(), part);
|
|
|
- groundPartArray.add(part);
|
|
|
- }
|
|
|
- GroundModelPart* part = groundModelBuidler.get(
|
|
|
- *textureName, textureName->getLength());
|
|
|
- const Vertex3D* vBuffer
|
|
|
- = blocks[i]->zModelData()->zVertexBuffer();
|
|
|
- Polygon3D* polygon
|
|
|
- = blocks[i]->zModelData()->getPolygon(index);
|
|
|
- if (part->indexCount + polygon->indexAnz
|
|
|
- > part->indexArraySize)
|
|
|
- {
|
|
|
- int* tmp = new int[part->indexArraySize + 10000];
|
|
|
- memcpy(tmp, part->indexList, part->indexCount * 4);
|
|
|
- delete[] part->indexList;
|
|
|
- part->indexList = tmp;
|
|
|
- part->indexArraySize += 10000;
|
|
|
- }
|
|
|
- if (groundVertexCount + polygon->indexAnz
|
|
|
- > groundVertexArraySize)
|
|
|
- {
|
|
|
- Vertex3D* tmp
|
|
|
- = new Vertex3D[groundVertexArraySize + 10000];
|
|
|
- memcpy(tmp,
|
|
|
- groundVerticies,
|
|
|
- groundVertexCount * sizeof(Vertex3D));
|
|
|
- delete[] groundVerticies;
|
|
|
- groundVerticies = tmp;
|
|
|
- groundVertexArraySize += 10000;
|
|
|
- __int64* lTmp = new __int64[groundVertexArraySize];
|
|
|
- memcpy(lTmp,
|
|
|
- lightBuffer,
|
|
|
- groundVertexCount * sizeof(__int64));
|
|
|
- delete[] lightBuffer;
|
|
|
- lightBuffer = lTmp;
|
|
|
- }
|
|
|
- for (int vi = 0; vi < polygon->indexAnz; vi++)
|
|
|
- {
|
|
|
- lightBuffer[groundVertexCount] = light;
|
|
|
- part->indexList[part->indexCount++] = groundVertexCount;
|
|
|
- groundVerticies[groundVertexCount++]
|
|
|
- = vBuffer[polygon->indexList[vi]];
|
|
|
- groundVerticies[groundVertexCount - 1].pos
|
|
|
- += blocks[i]->getPos()
|
|
|
- - Vec3<float>((float)this->location.x,
|
|
|
- (float)this->location.y,
|
|
|
- (float)WORLD_HEIGHT / 2.f);
|
|
|
- groundVerticies[groundVertexCount - 1].id
|
|
|
- = groundVertexCount - 1;
|
|
|
- }
|
|
|
- index++;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- blocks[i]->setPartOfGround(0);
|
|
|
- visibleBlocks.add(blocks[i]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- Model3DTextur* textur = new Model3DTextur();
|
|
|
- int pi = 0;
|
|
|
- for (GroundModelPart* part : groundPartArray)
|
|
|
- {
|
|
|
- Polygon3D* polygon = new Polygon3D();
|
|
|
- polygon->indexAnz = part->indexCount;
|
|
|
- polygon->indexList = part->indexList;
|
|
|
- groundModel->zModelData()->addPolygon(polygon);
|
|
|
- textur->setPolygonTextur(pi,
|
|
|
- uiFactory.initParam.bildschirm->zGraphicsApi()->createOrGetTextur(
|
|
|
- part->name));
|
|
|
- pi++;
|
|
|
- delete part;
|
|
|
- }
|
|
|
- groundModel->zModelData()->setVertecies(groundVerticies, groundVertexCount);
|
|
|
- groundModel->setModelTextur(textur);
|
|
|
- groundModel->setVertexLightBuffer(lightBuffer, groundVertexCount);
|
|
|
+ modelChanged &= ~builder->getType();
|
|
|
+ lightChanged &= ~builder->getType();
|
|
|
+ builder->buildModel();
|
|
|
vcs.unlock();
|
|
|
}
|
|
|
|
|
|
-void Chunk::updateGroundLight()
|
|
|
+void Chunk::updateLight(ChunkModelBuilder* builder)
|
|
|
{
|
|
|
vcs.lock();
|
|
|
- __int64* lightBuffer = groundModel->zLightBuffer();
|
|
|
- int groundVertexCount = 0;
|
|
|
- for (int i = 0; i < CHUNK_SIZE * CHUNK_SIZE * WORLD_HEIGHT; i++)
|
|
|
- {
|
|
|
- if (blocks[i])
|
|
|
- {
|
|
|
- if (blocks[i]
|
|
|
- ->zBlockType()
|
|
|
- ->getModelInfo()
|
|
|
- .getModelName()
|
|
|
- .istGleich("cube"))
|
|
|
- {
|
|
|
- int index = 0;
|
|
|
- for (Text* textureName :
|
|
|
- *blocks[i]->zBlockType()->getModelInfo().getTexturNames())
|
|
|
- {
|
|
|
- Framework::Vec3<int> location(
|
|
|
- (i / WORLD_HEIGHT) / CHUNK_SIZE,
|
|
|
- (i / WORLD_HEIGHT) % CHUNK_SIZE,
|
|
|
- i % WORLD_HEIGHT);
|
|
|
- if (isPartOfGroundModel(location, index))
|
|
|
- {
|
|
|
- const Vertex3D* vBuffer
|
|
|
- = blocks[i]->zModelData()->zVertexBuffer();
|
|
|
- Polygon3D* polygon
|
|
|
- = blocks[i]->zModelData()->getPolygon(index);
|
|
|
- for (int vi = 0; vi < polygon->indexAnz; vi++)
|
|
|
- {
|
|
|
- lightBuffer[groundVertexCount++] = calculateLight(
|
|
|
- vBuffer[polygon->indexList[vi]].pos,
|
|
|
- location,
|
|
|
- getDirectionFromIndex(index));
|
|
|
- }
|
|
|
- }
|
|
|
- index++;
|
|
|
- }
|
|
|
- }
|
|
|
- else if (blocks[i]
|
|
|
- ->zBlockType()
|
|
|
- ->getModelInfo()
|
|
|
- .getModelName()
|
|
|
- .istGleich("grass"))
|
|
|
- {
|
|
|
- __int64 light = blocks[i]->getMaxLight();
|
|
|
- int index = 0;
|
|
|
- for (Text* textureName :
|
|
|
- *blocks[i]->zBlockType()->getModelInfo().getTexturNames())
|
|
|
- {
|
|
|
- const Vertex3D* vBuffer
|
|
|
- = blocks[i]->zModelData()->zVertexBuffer();
|
|
|
- Polygon3D* polygon
|
|
|
- = blocks[i]->zModelData()->getPolygon(index);
|
|
|
- for (int vi = 0; vi < polygon->indexAnz; vi++)
|
|
|
- {
|
|
|
- lightBuffer[groundVertexCount++] = light;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- groundModel->copyLightToGPU();
|
|
|
+ lightChanged &= ~builder->getType();
|
|
|
+ builder->updateLightning();
|
|
|
vcs.unlock();
|
|
|
}
|
|
|
|
|
|
-__int64 Chunk::calculateLight(
|
|
|
- Vec3<float> vertexPos, Vec3<int> blockPos, Direction direction)
|
|
|
-{
|
|
|
- __int64 result = 0;
|
|
|
- int sumCount = 1;
|
|
|
- short lightSum[6];
|
|
|
- Block* current = blocks[index(blockPos)];
|
|
|
- const unsigned char* light = current->getLightData(direction);
|
|
|
- for (int i = 0; i < 6; i++)
|
|
|
- {
|
|
|
- lightSum[i] = (short)light[i];
|
|
|
- }
|
|
|
- Vec3<int> vertexDirs(vertexPos.x < 0 ? -1 : 1,
|
|
|
- vertexPos.y < 0 ? -1 : 1,
|
|
|
- vertexPos.z < 0 ? -1 : 1);
|
|
|
- Directions dirs = getDirectionsFromVector(vertexDirs) & ~direction;
|
|
|
- Vec3<int> neighborDirs[3];
|
|
|
- int neighborIndex = 0;
|
|
|
- for (int i = 0; i < 6; i++)
|
|
|
- {
|
|
|
- Direction dir = getDirectionFromIndex(i);
|
|
|
- if ((dirs | dir) == dirs)
|
|
|
- {
|
|
|
- neighborDirs[neighborIndex++] = getDirection(dir);
|
|
|
- if (neighborIndex == 2) break;
|
|
|
- }
|
|
|
- }
|
|
|
- neighborDirs[2] = neighborDirs[0] + neighborDirs[1];
|
|
|
- for (int i = 0; i < 3; i++)
|
|
|
- {
|
|
|
- neighborDirs[i] += blockPos;
|
|
|
- if (neighborDirs[i].x >= 0 && neighborDirs[i].y >= 0
|
|
|
- && neighborDirs[i].z >= 0 && neighborDirs[i].x < CHUNK_SIZE
|
|
|
- && neighborDirs[i].y < CHUNK_SIZE
|
|
|
- && neighborDirs[i].z < WORLD_HEIGHT)
|
|
|
- {
|
|
|
- int neighborIndex = index(neighborDirs[i]);
|
|
|
- Block* neighbor = blocks[neighborIndex];
|
|
|
- if (neighbor)
|
|
|
- {
|
|
|
- const unsigned char* neighborLight
|
|
|
- = neighbor->getLightData(direction);
|
|
|
- if ((neighborLight[0] | neighborLight[1] | neighborLight[2]
|
|
|
- | neighborLight[3] | neighborLight[4]
|
|
|
- | neighborLight[5])
|
|
|
- != 0)
|
|
|
- {
|
|
|
- sumCount++;
|
|
|
- for (int j = 0; j < 6; j++)
|
|
|
- {
|
|
|
- lightSum[j] += (short)neighborLight[j];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- { // TODO: get light from neighbor chunk
|
|
|
- }
|
|
|
- }
|
|
|
- for (int i = 0; i < 6; i++)
|
|
|
- {
|
|
|
- lightSum[i] = (lightSum[i] / sumCount) & 0xFF;
|
|
|
- }
|
|
|
- result = ((__int64)lightSum[0] << 24) | ((__int64)lightSum[1] << 16)
|
|
|
- | ((__int64)lightSum[2] << 8) | ((__int64)lightSum[3] << 56)
|
|
|
- | ((__int64)lightSum[4] << 48) | ((__int64)lightSum[5] << 40);
|
|
|
- return result;
|
|
|
-}
|
|
|
-
|
|
|
-bool Chunk::isPartOfGroundModel(
|
|
|
- Framework::Vec3<int> location, int directionIndex)
|
|
|
-{
|
|
|
- Framework::Vec3<int> neighborLocation
|
|
|
- = location + getDirection(getDirectionFromIndex(directionIndex));
|
|
|
- bool needed = 0;
|
|
|
- if (neighborLocation.x < 0 || neighborLocation.y < 0
|
|
|
- || neighborLocation.z < 0 || neighborLocation.x >= CHUNK_SIZE
|
|
|
- || neighborLocation.y >= CHUNK_SIZE
|
|
|
- || neighborLocation.z >= WORLD_HEIGHT)
|
|
|
- {
|
|
|
- needed = 1;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- int naighborIndex = index(neighborLocation);
|
|
|
- if (!blocks[naighborIndex]
|
|
|
- || !blocks[naighborIndex]
|
|
|
- ->zBlockType()
|
|
|
- ->getModelInfo()
|
|
|
- .getModelName()
|
|
|
- .istGleich("cube"))
|
|
|
- {
|
|
|
- needed = 1;
|
|
|
- }
|
|
|
- }
|
|
|
- return needed;
|
|
|
-}
|
|
|
-
|
|
|
void Chunk::renderSolid(std::function<void(Model3D*)> f)
|
|
|
{
|
|
|
vcs.lock();
|
|
|
CustomDX11API* api
|
|
|
= (CustomDX11API*)uiFactory.initParam.bildschirm->zGraphicsApi();
|
|
|
api->setCullBack(false);
|
|
|
- f(groundModel);
|
|
|
+ f(groundModel->zModel());
|
|
|
api->setCullBack(true);
|
|
|
float dist = 0.f;
|
|
|
- if (api->isInFrustrum(groundModel->getPos(),
|
|
|
+ if (api->isInFrustrum(groundModel->zModel()->getPos(),
|
|
|
(CHUNK_SIZE / 2.f, CHUNK_SIZE / 2.f, WORLD_HEIGHT / 2.f),
|
|
|
&dist))
|
|
|
{
|
|
@@ -653,17 +320,15 @@ bool Chunk::tick(std::function<void(Model3D*)> f, double time)
|
|
|
{
|
|
|
acs.lock();
|
|
|
vcs.lock(); // TODO: enshure no dead lock occures
|
|
|
- if (modelChanged)
|
|
|
- {
|
|
|
- modelChanged = 0;
|
|
|
- buildGroundModel();
|
|
|
- }
|
|
|
- if (lightChanged)
|
|
|
- {
|
|
|
- lightChanged = 0;
|
|
|
- updateGroundLight();
|
|
|
- }
|
|
|
- bool res = groundModel->tick(time);
|
|
|
+ if ((modelChanged | CombinedModels::GROUND) == modelChanged)
|
|
|
+ buildModel(groundModel);
|
|
|
+ if ((modelChanged | CombinedModels::FLUID) == modelChanged)
|
|
|
+ buildModel(fluidModel);
|
|
|
+ if ((lightChanged | CombinedModels::GROUND) == lightChanged)
|
|
|
+ updateLight(groundModel);
|
|
|
+ if ((lightChanged | CombinedModels::FLUID) == lightChanged)
|
|
|
+ updateLight(fluidModel);
|
|
|
+ bool res = groundModel->zModel()->tick(time);
|
|
|
auto iterator = animations.begin();
|
|
|
while (iterator)
|
|
|
{
|
|
@@ -690,7 +355,7 @@ bool Chunk::tick(std::function<void(Model3D*)> f, double time)
|
|
|
|
|
|
void Chunk::destroy()
|
|
|
{
|
|
|
- Model3DData* chunkModel = groundModel->zModelData();
|
|
|
+ Model3DData* chunkModel = groundModel->zModel()->zModelData();
|
|
|
// remove old model
|
|
|
while (chunkModel->getPolygonAnzahl() > 0)
|
|
|
{
|
|
@@ -906,12 +571,12 @@ Framework::Vec3<int> Chunk::getMax() const
|
|
|
location.x + CHUNK_SIZE / 2, location.y + CHUNK_SIZE / 2, WORLD_HEIGHT};
|
|
|
}
|
|
|
|
|
|
-void Chunk::setGroundChanged()
|
|
|
+void Chunk::setModelChanged(int type)
|
|
|
{
|
|
|
- modelChanged = 1;
|
|
|
+ modelChanged |= type;
|
|
|
}
|
|
|
|
|
|
-void Chunk::setLightChanged()
|
|
|
+void Chunk::setLightChanged(int type)
|
|
|
{
|
|
|
- lightChanged = 1;
|
|
|
+ lightChanged |= type;
|
|
|
}
|