diff --git a/engines/grim/gfx_opengl_shaders.cpp b/engines/grim/gfx_opengl_shaders.cpp index 944d5467e11..36141eb4482 100644 --- a/engines/grim/gfx_opengl_shaders.cpp +++ b/engines/grim/gfx_opengl_shaders.cpp @@ -1275,7 +1275,9 @@ void GfxOpenGLS::createBitmap(BitmapData *bitmap) { if (val == 0xf81f) { val = 0; } - zbufPtr[i] = 0xffff - ((uint32)val) * 0x10000 / 100 / (0x10000 - val); + // This is later read as a LA pair when filling texture + // with L being used as the LSB in fragment shader + zbufPtr[i] = TO_LE_16(0xffff - ((uint32)val) * 0x10000 / 100 / (0x10000 - val)); } } }