mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
CFrameBuffer: fb-generic.cpp - add methode for clean up icon cache
This could be required eg. on changed resoulutions or changed iconsets on runtime.
This commit is contained in:
@@ -207,16 +207,9 @@ nolfb:
|
|||||||
lbb = lfb = NULL;
|
lbb = lfb = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CFrameBuffer::~CFrameBuffer()
|
CFrameBuffer::~CFrameBuffer()
|
||||||
{
|
{
|
||||||
std::map<std::string, rawIcon>::iterator it;
|
clearIconCache();
|
||||||
|
|
||||||
for(it = icon_cache.begin(); it != icon_cache.end(); ++it) {
|
|
||||||
/* printf("FB: delete cached icon %s: %x\n", it->first.c_str(), (int) it->second.data); */
|
|
||||||
cs_free_uncached(it->second.data);
|
|
||||||
}
|
|
||||||
icon_cache.clear();
|
|
||||||
|
|
||||||
if (background) {
|
if (background) {
|
||||||
delete[] background;
|
delete[] background;
|
||||||
@@ -921,6 +914,17 @@ _display:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CFrameBuffer::clearIconCache()
|
||||||
|
{
|
||||||
|
std::map<std::string, rawIcon>::iterator it;
|
||||||
|
|
||||||
|
for(it = icon_cache.begin(); it != icon_cache.end(); ++it) {
|
||||||
|
/* printf("FB: delete cached icon %s: %x\n", it->first.c_str(), (int) it->second.data); */
|
||||||
|
cs_free_uncached(it->second.data);
|
||||||
|
}
|
||||||
|
icon_cache.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void CFrameBuffer::loadPal(const std::string & filename, const unsigned char offset, const unsigned char endidx)
|
void CFrameBuffer::loadPal(const std::string & filename, const unsigned char offset, const unsigned char endidx)
|
||||||
{
|
{
|
||||||
if (!getActive())
|
if (!getActive())
|
||||||
|
@@ -239,6 +239,7 @@ class CFrameBuffer : public sigc::trackable
|
|||||||
const int h = 0, const unsigned char offset = 1, bool paint = true, bool paintBg = false, const fb_pixel_t colBg = 0);
|
const int h = 0, const unsigned char offset = 1, bool paint = true, bool paintBg = false, const fb_pixel_t colBg = 0);
|
||||||
bool paintIcon8(const std::string & filename, const int x, const int y, const unsigned char offset = 0);
|
bool paintIcon8(const std::string & filename, const int x, const int y, const unsigned char offset = 0);
|
||||||
void loadPal (const std::string & filename, const unsigned char offset = 0, const unsigned char endidx = 255);
|
void loadPal (const std::string & filename, const unsigned char offset = 0, const unsigned char endidx = 255);
|
||||||
|
void clearIconCache();
|
||||||
|
|
||||||
bool loadPicture2Mem (const std::string & filename, fb_pixel_t * const memp);
|
bool loadPicture2Mem (const std::string & filename, fb_pixel_t * const memp);
|
||||||
bool loadPicture2FrameBuffer(const std::string & filename);
|
bool loadPicture2FrameBuffer(const std::string & filename);
|
||||||
|
Reference in New Issue
Block a user