GLBasic forum

Main forum => Bug Reports => Topic started by: Crivens on 2011-Jul-22

Title: Screen error
Post by: Crivens on 2011-Jul-22
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]
Title: Re: Screen error
Post by: MrTAToad on 2011-Jul-22
Are you using USESCREEN and/or the release version ?
Title: Re: Screen error
Post by: Ian Price on 2011-Jul-22
There is text in your picture? ;) :P

BTW I'm not seeing that error on Pre or pc.
Title: Re: Screen error
Post by: Crivens on 2011-Jul-22
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
Title: Re: Screen error
Post by: MrTAToad on 2011-Jul-22
I wonder if you should do  a SHOWSCREEN after CLEARSCREEN but before LOADBMP
Title: Re: Screen error
Post by: Crivens on 2011-Jul-23
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
Title: Re: Screen error
Post by: MrTAToad on 2011-Jul-23
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 ?
Title: Re: Screen error
Post by: MrTAToad on 2011-Jul-23
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...
Title: Re: Screen error
Post by: Crivens on 2011-Jul-23
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

Title: Re: Screen error
Post by: Crivens on 2011-Jul-27
Gernot, did you find what this was?

Cheers
Title: Re: Screen error
Post by: Kitty Hello on 2011-Jul-27
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.
Title: Re: Screen error
Post by: erico on 2011-Jul-27
What!?
what is a picture of my girlfriend doing in your app??

..Sorry Crivens, could not resist to joke. :P
Title: Re: Screen error
Post by: Crivens on 2011-Jul-27
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
Title: Re: Screen error
Post by: Crivens on 2011-Jul-27
Hah I'm married so I deny all knowledge. Interestingly it was her idea for this app. Love her :)

X
Title: Re: Screen error
Post by: Ian Price on 2011-Jul-27
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
Title: Re: Screen error
Post by: erico on 2011-Jul-27
oh well, natural artists (cartoonists too)hire some almost naked ladies for pure drawing research, I see no reason for it to be different to coders hehe
Title: Re: Screen error
Post by: Ian Price on 2011-Jul-27
Quoteoh well, natural artists (cartoonists too)hire some almost naked ladies for pure drawing research, I see no reason for it to be different to coders hehe
I'll have to tell my wife that... ;)
Title: Re: Screen error
Post by: Crivens on 2011-Jul-27
Yep she thought of it. Gotta love it. Going out with friends is always a laugh with some of the subject matter she comes up with :)

Cheers
Title: Re: Screen error
Post by: Kitty Hello on 2011-Jul-28
...until she has an idea you could hire naked men for a photo session  :puke:

Try this:
CLEARSCREEN; SHOWSCREEN; CLREARSCREEN;SHOWSCREEN; LOADBMP ..
Title: Re: Screen error
Post by: Crivens on 2011-Jul-28
She had that idea already. I think we will wait until we see how the female version goes first...

Ok, will try tonight if I get a chance.

Cheers