| 233 | |
| 234 | CacheUse(bank->_thisFrameWholeUsed); |
| 235 | _levelLoaded = levelMin; |
| 236 | } |
| 237 | |
| 238 | if (_interpolate) |
| 239 | _interpolate->_inUse--; |
| 240 | |
| 241 | if (ret < 0) |
| 242 | ReleaseMemory(true); |
| 243 | |
| 244 | return ret; |
| 245 | } |
| 246 | |
| 247 | void TextureGL33::ReleaseSmall(bool store) |
| 248 | { |
| 249 | TextBankGL33* bank = static_cast<TextBankGL33*>(GEngine->TextBank()); |
| 250 | if (_smallSurface.GetTexture()) |
| 251 | { |
| 252 | if (store) |
| 253 | { |
| 254 | bank->AddReleased(_smallSurface); |
| 255 | _smallSurface.Free(false); |
| 256 | } |
| 257 | else |
| 258 | { |
| 259 | bank->_totalAllocated -= _smallSurface.SizeUsed(); |
| 260 | bank->_thisFrameAlloc++; |
| 261 | _smallSurface.Free(true); |
| 262 | } |
| 263 | _smallLoaded = _nMipmaps; |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | int TextureGL33::LoadSmall() |
| 268 | { |
| 269 | if (_smallSurface.GetTexture()) |
| 270 | return 0; |
| 271 | |
| 272 | TextBankGL33* bank = static_cast<TextBankGL33*>(GEngine->TextBank()); |
| 273 | |
| 274 | if (_nMipmaps <= 0) |
| 275 | return -1; |
| 276 | |
| 277 | int i; |
| 278 | for (i = 0; i < _nMipmaps; i++) |
| 279 | { |
| 280 | int pixels = _mipmaps[i]._w * _mipmaps[i]._h; |
| 281 | if (pixels <= bank->_maxSmallTexturePixels) |
| 282 | break; |
no test coverage detected