MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / LoadSmall

Method LoadSmall

engine/PoseidonGL33/TextureGL33_Loading.cpp:235–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
247void 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
267int 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;

Callers 1

UseMipmapMethod · 0.80

Calls 6

DstFormatMethod · 0.80
UseReleasedMethod · 0.80
ReserveMemoryMethod · 0.80
CreateGPUSurfaceMethod · 0.80
GetTextureMethod · 0.45
TextBankMethod · 0.45

Tested by

no test coverage detected