Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: JdGordon on June 23, 2008, 02:08:32 AM

Title: conditional viewports problems thread
Post by: JdGordon on June 23, 2008, 02:08:32 AM
if you have a problem with the new viewport tags post here....
Title: Re: conditional viewports problems thread
Post by: BdN3504 on June 23, 2008, 09:36:21 AM
I get a divide by zero at 0xC0000094 when running this code:

Code: [Select]
...
%V|30|140|180|18|1|FFFFFF|FFFFFF|
%pb|pb.bmp|0|0|0|0|
...

OK, i found out that the %pb parameters height and width have to be other than 0 or you get that error.
Title: Re: conditional viewports problems thread
Post by: PaulJam on June 23, 2008, 09:44:01 AM
Hi,

this line looks wrong:
%pb|pb.bmp|0|0|0|0|

(height and width of the progressbar are zero.)
Title: Re: conditional viewports problems thread
Post by: GodEater on June 23, 2008, 09:47:48 AM
Which would mean it's nothing to do with the new conditional viewports code...

Please people - before you start hassling Jd left right and centre - make sure your WPS works *without* the conditionals first!!
Title: Re: conditional viewports problems thread
Post by: BdN3504 on June 23, 2008, 09:51:01 AM
Well this line worked without the update:

%V|30|161|180|36|1|FFFFFF|FFFFFF|
%pb|0|0|0|0|

So it sure has something to do with the change.
Title: Re: conditional viewports problems thread
Post by: GodEater on June 23, 2008, 09:52:24 AM
Yes, it would appear the %pb behaviour has been changed too in the same patch - so folks need to be careful of that too.
Title: Re: conditional viewports problems thread
Post by: JdGordon on June 23, 2008, 09:52:50 AM
GodEater, thanks, but the commit also completly changed the %pb tags so th eventual error was completly OK....
that said, had he looked at the CustomWPS page (or even the commit message) he would have figuredd out that he is using %pb completly wrong. (also the colours in the viewports... )

Title: Re: conditional viewports problems thread
Post by: BdN3504 on June 23, 2008, 10:04:14 AM
had he looked at the CustomWPS page (or even the commit message) he would have figuredd out that he is using %pb completly wrong. (also the colours in the viewports... )
I do look at the customwps page quite often. If i use a viewport which serves only to display an image (in this case the progressbar) do the colours matter? I don't think so. I understood the changes to %pb and have included the filename into that part removing the %P line. The code i posted refers to an old wps with the old syntax. All i wanted to say is you could very well use %pb with 0 as parameters as i did in that example but now it doesn't work anymore.
Title: Re: conditional viewports problems thread
Post by: JdGordon on June 23, 2008, 10:07:08 AM
All i wanted to say is you could very well use %pb with 0 as parameters as i did in that example but now it doesn't work anymore.
1) thats irrelevant.. the syntax changed, therefor what used to work by definition shouldnt work anymore...
2) you probably could have got away with doing %pb before
Title: Re: conditional viewports problems thread
Post by: Llorean on June 23, 2008, 10:09:21 AM
Old Syntax is broken, that was made clear by the commit message: This commit is not backward compatible.
Title: Re: conditional viewports problems thread
Post by: BdN3504 on June 23, 2008, 10:25:06 AM
I'm not asking for the commit to be backward compatible... If people who have created wps in the past and use the %pb syntax as i did, and try to adjust their wps to meet the new syntax, they will definitely stumble upon that same error. In the Customwps page it says nothing about the fact, that 0 as values for height and width are illegal. So if people get that error, they know what they have to change, is all i want to get across.
Title: Re: conditional viewports problems thread
Post by: PaulJam on June 23, 2008, 10:31:40 AM
In my opinion setting the width or height of the progressbar to zero is pointless, because it wouldn't be visible. I don't really think this needs extra mentioning.
But i think the WPS should just be rejected by the parser and not cause a crash.
Title: Re: conditional viewports problems thread
Post by: Llorean on June 23, 2008, 10:36:55 AM
Agreed, DivX0 should never show up. But I consider it a bug of the old tag that it accepted 0-width or 0-height bars in the first place.
Title: Re: conditional viewports problems thread
Post by: robin0800 on June 23, 2008, 12:47:34 PM
The Progress Bar commit Uses |-| to indicate zero or the default
Title: Re: conditional viewports problems thread
Post by: JdGordon on June 29, 2008, 03:46:39 AM
I've just done another commit to the cabbie themes, so let me know if you notice anything bad happening with them... otherwise I tihnk we can close this thread...