Theme Editor: Implemented %xd tag with subimages
authorbieber <bieber@a1c6a512-1295-4272-9138-f99709370657>
Wed, 23 Jun 2010 07:37:48 +0000 (23 07:37 +0000)
committerbieber <bieber@a1c6a512-1295-4272-9138-f99709370657>
Wed, 23 Jun 2010 07:37:48 +0000 (23 07:37 +0000)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27085 a1c6a512-1295-4272-9138-f99709370657

utils/themeeditor/models/parsetreenode.cpp

index 41bee5c..c75e691 100644 (file)
@@ -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;