forked from len0rd/rockbox
Theme Editor: Implemented line scrolling
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27344 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d4f4104a4a
commit
13e97cd5f5
5 changed files with 126 additions and 3 deletions
|
@ -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])
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue