Theme Editor: Implemented %xd tag with subimages
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27085 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f4fd16cd64
commit
66a13be787
1 changed files with 28 additions and 1 deletions
|
@ -523,7 +523,8 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport)
|
|||
{
|
||||
QString filename;
|
||||
QString id;
|
||||
int x, y, tiles;
|
||||
int x, y, tiles, tile;
|
||||
char c;
|
||||
RBImage* image;
|
||||
|
||||
/* Two switch statements to narrow down the tag name */
|
||||
|
@ -533,6 +534,32 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport)
|
|||
case 'x':
|
||||
switch(element->tag->name[1])
|
||||
{
|
||||
case 'd':
|
||||
/* %xd */
|
||||
id = "";
|
||||
id.append(element->params[0].data.text[0]);
|
||||
c = element->params[0].data.text[1];
|
||||
|
||||
if(c == '\0')
|
||||
{
|
||||
tile = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isupper(c))
|
||||
tile = c - 'A' + 25;
|
||||
else
|
||||
tile = c - 'a';
|
||||
}
|
||||
|
||||
image = info.screen()->getImage(id);
|
||||
if(image)
|
||||
{
|
||||
image->setTile(tile);
|
||||
image->show();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
/* %xl */
|
||||
id = element->params[0].data.text;
|
||||
|
|
Loading…
Reference in a new issue