mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
pnmimage: don't return values larger than 1.0f from from_val()
This commit is contained in:
parent
a50d375c35
commit
6f782ce519
@ -210,7 +210,7 @@ from_val(xelval input_value) const {
|
|||||||
switch (_xel_encoding) {
|
switch (_xel_encoding) {
|
||||||
case XE_generic:
|
case XE_generic:
|
||||||
case XE_generic_alpha:
|
case XE_generic_alpha:
|
||||||
return (float)input_value * _inv_maxval;
|
return std::min((float)input_value * _inv_maxval, 1.0f);
|
||||||
|
|
||||||
case XE_generic_sRGB:
|
case XE_generic_sRGB:
|
||||||
case XE_generic_sRGB_alpha:
|
case XE_generic_sRGB_alpha:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user