WINTERMUTE: WME3D: Restore original code for fog parameters handling

This commit is contained in:
Paweł Kołodziejski 2022-07-02 22:39:01 +02:00
parent 3ffbb3b030
commit 599097964f
No known key found for this signature in database
GPG key ID: 0BDADC9E74440FF7
7 changed files with 36 additions and 44 deletions

View file

@ -505,16 +505,17 @@ bool BaseRenderOpenGL3D::setup3D(Camera3D *camera, bool force) {
glLightfv(GL_LIGHT0 + i, GL_SPOT_DIRECTION, _lightDirections[i].getData());
}
FogParameters fogParameters;
_gameRef->getFogParams(fogParameters);
bool fogEnabled;
uint32 fogColor;
float fogStart, fogEnd;
if (fogParameters._enabled) {
_gameRef->getFogParams(&fogEnabled, &fogColor, &fogStart, &fogEnd);
if (fogEnabled) {
glEnable(GL_FOG);
glFogi(GL_FOG_MODE, GL_LINEAR);
glFogf(GL_FOG_START, fogParameters._start);
glFogf(GL_FOG_END, fogParameters._end);
glFogf(GL_FOG_START, fogStart);
glFogf(GL_FOG_END, fogEnd);
uint32 fogColor = fogParameters._color;
GLfloat color[4] = { RGBCOLGetR(fogColor) / 255.0f,
RGBCOLGetG(fogColor) / 255.0f,
RGBCOLGetB(fogColor) / 255.0f,