mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-25 23:25:40 +00:00
When the translator map is enabled the colour values seem to use 4 bits, 0-16. Why not 0-31 I don't know. Anyway virtua on is overflowing these values for some of the smoke effects. For us the numbers were wrapping around. Clamping is enough to fix this. (Thanks model123)
This commit is contained in:
parent
5b406059ce
commit
e2ad593e88
|
@ -1141,9 +1141,9 @@ void CNew3D::CacheModel(Model *m, const UINT32 *data)
|
|||
p.faceColour[2] = ((ph.header[4] >> 8) & 0xFF);
|
||||
|
||||
if (ph.TranslatorMap()) {
|
||||
p.faceColour[0] = (p.faceColour[0] * 255) / 16; // When the translator map is enabled, max colour seems
|
||||
p.faceColour[1] = (p.faceColour[1] * 255) / 16; // to be 16. Scaling these up gives the correct colours.
|
||||
p.faceColour[2] = (p.faceColour[2] * 255) / 16; // Not sure why didn't allow 32 colours with 4 bits?
|
||||
p.faceColour[0] = std::min((p.faceColour[0] * 255) / 16, 255); // When the translator map is enabled, max colour seems to be 16. Why not 4 bits?
|
||||
p.faceColour[1] = std::min((p.faceColour[1] * 255) / 16, 255); // We clamp the result because virtua on will overflow for only the smoke effects
|
||||
p.faceColour[2] = std::min((p.faceColour[2] * 255) / 16, 255); // It's passing 33 instead of a max of 16.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue