Fixes for non-standart icon sizes. Not complete yet, work in progress. Probably will broke commit #568

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@569 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
focus
2010-05-06 09:39:29 +00:00
parent 7373559b3d
commit 56674d5561
38 changed files with 678 additions and 354 deletions

View File

@@ -826,13 +826,17 @@ void CFrameBuffer::getIconSize(const char * const filename, int* width, int *hei
/* if code ask for size, lets cache it. assume we have enough ram for cache */
/* FIXME offset seems never used in code, always default = 1 ? */
if(paintIcon(filename, 0, 0, 0, 1, false)) {
it = icon_cache.find(filename);
if(it != icon_cache.end()) {
*width = it->second.width;
*height = it->second.height;
it = icon_cache.find(filename);
if(it == icon_cache.end()) {
if(paintIcon(filename, 0, 0, 0, 1, false)) {
it = icon_cache.find(filename);
}
}
if(it != icon_cache.end()) {
*width = it->second.width;
*height = it->second.height;
}
}
bool CFrameBuffer::paintIcon8(const std::string & filename, const int x, const int y, const unsigned char offset)
@@ -946,8 +950,6 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in
icon_cache.insert(std::pair <std::string, rawIcon> (filename, tmpIcon));
//printf("Cached %s, cache size %d\n", newname.c_str(), cache_size);
}
if(!paint)
return true;
goto _display;
}
@@ -1003,10 +1005,10 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in
height = it->second.height;
//printf("paintIcon: already cached %s %d x %d\n", newname.c_str(), width, height);
}
_display:
if(!paint)
return true;
_display:
if (h != 0)
yy += (h - height) / 2;