Commit 50612703 authored by Dirk Wilden's avatar Dirk Wilden

removed nan in texture control

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6271 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0cea8577
......@@ -680,6 +680,17 @@ void TextureControlPlugin::computeValue(Texture& _texture, double _min, double _
_value = clamp_min;
}
// if all texCoords have the same value
if ( _min == _max ){
if ( ! repeat )
_value = 0.0;
else
_value = max_val;
return;
}
// if the texture should not be repeated, scale to 0..1
if ( ! repeat ) {
if (! center ) {
......@@ -693,8 +704,12 @@ void TextureControlPlugin::computeValue(Texture& _texture, double _min, double _
_value /= ( _max * 2.0);
_value += 0.5;
} else {
_value /= ( _min * 2.0);
_value = 0.5 - _value;
if ( _min == 0.0 ){
_value = 0.0;
} else {
_value /= ( _min * 2.0);
_value = 0.5 - _value;
}
}
}
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment