Fix copying of pixels from surface.texPixels to LMTextureData

This commit is contained in:
RaveYard 2023-09-01 10:17:27 +02:00 committed by Christoph Oelckers
parent 72ccf127ba
commit 8d2b03b7ef

View file

@ -569,7 +569,7 @@ void VulkanRenderDevice::SetLevelMesh(hwrenderer::LevelMesh* mesh)
for (int j = 0; j < surface.texWidth; j++)
{
// get texture offset
int offs = ((surface.texWidth * (i + surface.atlasY)) + surface.atlasX) * 3;
int offs = ((mesh->LMTextureSize * (i + surface.atlasY)) + surface.atlasX) * 3;
// convert RGB to bytes
currentTexture[offs + j * 3 + 0] = floatToHalf(clamp(colorSamples[i * surface.texWidth + j].X, 0.0f, 65000.0f));