1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Add a getter ofr retrieving a texture

This commit is contained in:
Mathieu Schroeter 2018-07-24 23:59:52 +02:00
parent 32497b173b
commit b321d915d3
2 changed files with 13 additions and 2 deletions

View File

@ -455,6 +455,16 @@ CPixmap::Cache (size_t channel, SDL_Surface * surface, Point totalDim)
return true;
}
SDL_Texture *
CPixmap::getTexture (size_t channel)
{
auto it = this->m_SDLTextureInfo.find (channel);
if (it == this->m_SDLTextureInfo.end ())
return nullptr;
return it->second.texture;
}
// Modifie la r�gion de clipping.
void

View File

@ -69,8 +69,9 @@ public:
Point iconDim, Mode mode = FIX, size_t chBackWide = CHNONE);
bool Cache (size_t channel, const std::string & pFilename, Point totalDim);
bool Cache (size_t channel, SDL_Surface * surface, Point totalDim);
void SetClipping (Rect clip);
Rect GetClipping ();
SDL_Texture * getTexture (size_t channel);
void SetClipping (Rect clip);
Rect GetClipping ();
bool IsIconPixel (size_t channel, Sint32 rank, Point pos);