summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/models/parsetreenode.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-07 22:25:42 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-07 22:25:42 +0000
commit13e97cd5f5330e5c7f52f243ddee5cdce61edfa6 (patch)
treeee53f022c50fc005665597b4f8146809a053016f /utils/themeeditor/models/parsetreenode.cpp
parentd4f4104a4ab04cbca75dff874e57dbe34002ded7 (diff)
downloadrockbox-13e97cd5f5330e5c7f52f243ddee5cdce61edfa6.tar.gz
rockbox-13e97cd5f5330e5c7f52f243ddee5cdce61edfa6.tar.bz2
rockbox-13e97cd5f5330e5c7f52f243ddee5cdce61edfa6.zip
Theme Editor: Implemented line scrolling
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27344 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/models/parsetreenode.cpp')
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp
index b2b5fbbdb4..e5eb9df9b3 100644
--- a/utils/themeeditor/models/parsetreenode.cpp
+++ b/utils/themeeditor/models/parsetreenode.cpp
@@ -29,6 +29,7 @@
#include "rbprogressbar.h"
#include <iostream>
+#include <cmath>
int ParseTreeNode::openConditionals = 0;
bool ParseTreeNode::breakFlag = false;
@@ -552,8 +553,16 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport,
for(int i = 0; i < children.count() ; i++)
times.append(findBranchTime(children[i], info));
+ double totalTime = 0;
+ for(int i = 0; i < children.count(); i++)
+ totalTime += times[i];
+
/* Now we figure out which branch to select */
double timeLeft = info.device()->data(QString("simtime")).toDouble();
+
+ /* Skipping any full cycles */
+ timeLeft -= totalTime * std::floor(timeLeft / totalTime);
+
int branch = 0;
while(timeLeft > 0)
{
@@ -654,6 +663,17 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport)
return false;
+ case 's':
+ switch(element->tag->name[1])
+ {
+ case '\0':
+ /* %s */
+ viewport->scrollText(info.device()->data("simtime").toDouble());
+ return true;
+ }
+
+ return false;
+
case 'w':
switch(element->tag->name[1])
{