Screen error

Previous topic - Next topic

Crivens

I'm getting an error where the screen isn't being cleared each loop like it used to. Identical code running on my Palm Pre from an older GLB version (not sure if was 9 or one of the 10 betas to be honest) worked fine, but now I am getting repeated graphics from previous screens staying on the screen. I can get around it by clearing that area each time, but it definitely didn't used to happen on an older GLB. See the attached pic to see what I mean. It should be just showing the foremost text (5 seconds left and no other text) and nothing else in the last 80 or so pixels (just black in the background).

Note this happens on my Palm Pre as well as my PCs (10.057 and 10.054). I would check my Mac Mini but it's going through installing Lion etc.

Cheers

[attachment deleted by admin]
Current fave quote: Cause you like musicians and I like people with boobs.

MrTAToad

Are you using USESCREEN and/or the release version ?

Ian Price

There is text in your picture? ;) :P

BTW I'm not seeing that error on Pre or pc.
I came. I saw. I played.

Crivens

#3
QuoteThere is text in your picture?
No, the text below the picture. A few version before (can't tell you which) this didn't happen as can be seen on my app that is now on the store. Same code and I'm getting that repeated text. Ha, didn't see the smiley faces for some reason. :)

QuoteAre you using USESCREEN and/or the release version ?
No. I don't use since it didn't work on my laptop (works on desktop) so I used alternative commands. Either way the same bug happens on both my PCs (latest version and previous one to that) and my Pre. It would probably happen on iOS but my Mac is in a state of upgrading at the minute...

Note that for this example I used the following command when the screen first loads:-
Code (glbasic) Select
CLEARSCREEN
LOADBMP "Media/"+templevel+"-"+tempgame+".png"
and then I get a SHOWSCREEN shortly after.

In my main loop I do this code a fair bit before the SHOWSCREEN:-
Code (glbasic) Select
secsdone=(GETTIMERALL()-fulltime)/1000
IF secsdone>maxsecs
fulltime=0
CLEARSCREEN
ELSE
IF maxsecs-secsdone>3
SETFONT 0
ELSE
SETFONT 1
ENDIF
showsecs$=INTEGER(1+maxsecs-secsdone)+" seconds left"
DRAWRECT 0,401,screenx,80,0
PRINT showsecs$,(gamescreenx/2)-(LEN(showsecs$,kern)/2),screeny-fonty,kern
ENDIF
The DRAWRECT line didn't exist until a minute ago which makes sure anything behind the text is blanked out before it's printed. Otherwise it looks like the example I posted earlier. Note as well that the loaded BMP is not 320x480, but 320x400, so this last 80 pixels are not used.

But remember, only a short time ago (definitely no more than a week or so as that's when I posted the first Rotaslider which had identical code) this all worked perfectly. Perhaps the LOADBMP should make sure the rest of the screen is blanked out or something? Dunno. Suspicious though that the area going wrong is less than the actual size of the screen.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

MrTAToad

I wonder if you should do  a SHOWSCREEN after CLEARSCREEN but before LOADBMP

Crivens

Maybe. But why would this have changed in the last week or so? Pretty sure my original Pre app was compiled using the 10 beta about a week ago and is fine. No code changes to the code since and a recompile today has that problem.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

MrTAToad

#6
I dont think SHOWSCREEN has been changed, so possibly an addition feature in LOADBMP :)

I wonder if the screen isn't being cleared when it should be.  What if
Code (glbasic) Select
IF secsdone>maxsecs is taking long that it should ?

MrTAToad

#7
Could you make the LOADBMP file available ?

I think I've replicated the problem...  I think its because the LOADBMP file doesn't cover the whole screen.

I wonder if LOADBMP was originally loading the image, and, if it was smaller than the screen it would change the dimensions accordingly and fill with the current transparency.  Now, its possibly just loading the image to its "correct" size and leaving the rest of the screen to an indeterminable value...

Crivens

Yes I believe that is what it happening as the screen is 480 and the image is 400. The old version of GLB must have made the rest of the screen black out. If you need it then I'll dig out the png later.

Cheers

Current fave quote: Cause you like musicians and I like people with boobs.

Crivens

Gernot, did you find what this was?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Kitty Hello

No time, yet. I think that the non-bitmap area of the background texture is not cleared beforehand. Can't you make the image large enough to cover the screen? That's what LOADBMP is designed for. I might be able to fix it, but it will be a slight speed impact for those who use it properly.

erico

What!?
what is a picture of my girlfriend doing in your app??

..Sorry Crivens, could not resist to joke. :P

Crivens

I did fix it but it gave strange results until I found a proper fix. Really didn't work like I thought it would. It worked fine before do any chance of an optional colour parameter that fills the remainder with that colour? Could then be exactly the sane as before if you want it that way.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Crivens

Hah I'm married so I deny all knowledge. Interestingly it was her idea for this app. Love her :)

X
Current fave quote: Cause you like musicians and I like people with boobs.

Ian Price

QuoteInterestingly it was her idea for this app. Love her :)

I can just see me saying to my wife - "I'm just looking at half naked ladies on the internet for my next game. It's purely for research purposes"

:P
I came. I saw. I played.