|
@@ -19,12 +19,17 @@ FactoryCraftModel::FactoryCraftModel()
|
|
|
"blocks.ltdb/crack.png", 0);
|
|
"blocks.ltdb/crack.png", 0);
|
|
|
effectAlpha = 0;
|
|
effectAlpha = 0;
|
|
|
memset(averageLight, 0, 8);
|
|
memset(averageLight, 0, 8);
|
|
|
|
|
+ *(int*)averageLight = 0xFFFFFF00;
|
|
|
|
|
+ fallbackVertexLightBuffer = uiFactory.initParam.bildschirm->zGraphicsApi()
|
|
|
|
|
+ ->createStructuredBuffer(16);
|
|
|
|
|
+ fallbackVertexLightBuffer->setData(averageLight);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
FactoryCraftModel::~FactoryCraftModel()
|
|
FactoryCraftModel::~FactoryCraftModel()
|
|
|
{
|
|
{
|
|
|
breakTextur->release();
|
|
breakTextur->release();
|
|
|
if (vertexLightBuffer) vertexLightBuffer->release();
|
|
if (vertexLightBuffer) vertexLightBuffer->release();
|
|
|
|
|
+ fallbackVertexLightBuffer->release();
|
|
|
delete[] lightBuffer;
|
|
delete[] lightBuffer;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -55,12 +60,8 @@ void FactoryCraftModel::beforeRender(Framework::GraphicsApi* api,
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- World::INSTANCE->zFallbackVertexLightBuffer()->setData(
|
|
|
|
|
- averageLight);
|
|
|
|
|
- World::INSTANCE->zFallbackVertexLightBuffer()->setChanged();
|
|
|
|
|
- World::INSTANCE->zFallbackVertexLightBuffer()->copyToGPU(8);
|
|
|
|
|
- cApi->setVertexLightBuffer(
|
|
|
|
|
- World::INSTANCE->zFallbackVertexLightBuffer());
|
|
|
|
|
|
|
+ fallbackVertexLightBuffer->copyToGPU(8);
|
|
|
|
|
+ cApi->setVertexLightBuffer(fallbackVertexLightBuffer);
|
|
|
}
|
|
}
|
|
|
if (destroyedState > 0 && effectAlpha)
|
|
if (destroyedState > 0 && effectAlpha)
|
|
|
{
|
|
{
|
|
@@ -149,4 +150,5 @@ void FactoryCraftModel::setAverageLight(unsigned char light[3])
|
|
|
*(averageLight + 5) = light[2];
|
|
*(averageLight + 5) = light[2];
|
|
|
*(averageLight + 6) = light[1];
|
|
*(averageLight + 6) = light[1];
|
|
|
*(averageLight + 7) = light[0];
|
|
*(averageLight + 7) = light[0];
|
|
|
|
|
+ fallbackVertexLightBuffer->setChanged();
|
|
|
}
|
|
}
|