mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-14 09:04:31 +02:00
#15 fix shadows for TR3 PSX levels
This commit is contained in:
@@ -3434,8 +3434,10 @@ namespace TR {
|
|||||||
|
|
||||||
if (version & VER_TR2)
|
if (version & VER_TR2)
|
||||||
stream.read(r.lightMode);
|
stream.read(r.lightMode);
|
||||||
} else
|
} else {
|
||||||
|
r.ambient = 0x1FFF - r.ambient;
|
||||||
stream.read(r.ambient2);
|
stream.read(r.ambient2);
|
||||||
|
}
|
||||||
|
|
||||||
// lights
|
// lights
|
||||||
r.lights = stream.read(r.lightsCount) ? new Room::Light[r.lightsCount] : NULL;
|
r.lights = stream.read(r.lightsCount) ? new Room::Light[r.lightsCount] : NULL;
|
||||||
@@ -3464,11 +3466,14 @@ namespace TR {
|
|||||||
stream.seek(4); // radius2
|
stream.seek(4); // radius2
|
||||||
|
|
||||||
if ((version & VER_VERSION) < VER_TR3) {
|
if ((version & VER_VERSION) < VER_TR3) {
|
||||||
int value = 2555 - clamp((intensity > 0x1FFF) ? 0 : (intensity >> 5), 0, 255);
|
int value = 255 - clamp((intensity > 0x1FFF) ? 0 : (intensity >> 5), 0, 255);
|
||||||
light.color.r = light.color.g = light.color.b = value;
|
light.color.r = light.color.g = light.color.b = value;
|
||||||
light.color.a = 0;
|
light.color.a = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (version == VER_TR3_PSX)
|
||||||
|
light.radius >>= 2;
|
||||||
|
|
||||||
light.radius *= 2;
|
light.radius *= 2;
|
||||||
}
|
}
|
||||||
// meshes
|
// meshes
|
||||||
|
Reference in New Issue
Block a user