mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-06-05 13:54:31 +00:00
* fixed performance issue on getting texture height for rendering the player model as it loades the player texture on every frame * updated the lifetime of the texture * fixed 20 MB memory leak * delay window display until engine init is done
24 lines
847 B
C++
24 lines
847 B
C++
#pragma once
|
|
class BufferedImage;
|
|
class MemTextureProcessor;
|
|
using namespace std;
|
|
|
|
class MemTexture {
|
|
public:
|
|
BufferedImage *loadedImage;
|
|
int count;
|
|
int id;
|
|
bool isLoaded;
|
|
int ticksSinceLastUse;
|
|
// @CDevJoud
|
|
// changing the lifetime of the texture from 20 ticks(1 sec) to 200 ticks (10 sec)
|
|
// as it helps the texture to have longer lifetime and reducing the usage of loadTexture for every second/frame
|
|
// note that we dont remove the code that removes the textures from `tick()` as it is required in memory limited environment such as older Consoles(PS3/XBOX360)
|
|
static const int UNUSED_TICKS_TO_FREE = 200;
|
|
|
|
//default ctor for int Texture::getHeight(const wstring& url, int backup)
|
|
MemTexture() = default;
|
|
|
|
MemTexture(const wstring& _name, PBYTE pbData, DWORD dwBytes, MemTextureProcessor *processor);
|
|
~MemTexture();
|
|
}; |