| 245 | } |
| 246 | |
| 247 | Ref<Texture> TextBankGL33::LoadInterpolated(RStringB n1, RStringB n2, float factor) |
| 248 | { |
| 249 | const float eps = 1.0 / 256; |
| 250 | if (factor >= 1.0 - eps) |
| 251 | return Load(n2); |
| 252 | if (factor <= eps) |
| 253 | return Load(n1); |
| 254 | |
| 255 | Ref<Texture> txt2 = Load(n2); |
| 256 | TextureGL33* interpolate = static_cast<TextureGL33*>(txt2.GetRef()); |
| 257 | int index = Find(n1, interpolate); |
| 258 | if (index >= 0) |
| 259 | { |
| 260 | TextureGL33* t = _texture[index]; |
| 261 | const float iPolEps = 1.0 / 64; |
| 262 | if (fabs(t->_iFactor - factor) > iPolEps) |
| 263 | { |
| 264 | t->ReleaseMemory(true); |
| 265 | t->ReleaseSmall(true); |
| 266 | t->_iFactor = factor; |
| 267 | } |
| 268 | return t; |
| 269 | } |
| 270 | Ref<Texture> temp = Load(n1); |
| 271 | int index1 = Find(n1); |
| 272 | Ref<TextureGL33> t = Copy(index1); |
| 273 | if (t) |
| 274 | { |
| 275 | t->_interpolate = interpolate; |
| 276 | t->_iFactor = factor; |
| 277 | } |
| 278 | return t.GetRef(); |
| 279 | } |
| 280 | |
| 281 | void TextBankGL33::ReleaseAllTextures() |
| 282 | { |
nothing calls this directly
no test coverage detected