Palm Pre problem

Previous topic - Next topic

Ian Price

Hi Gernot

The following code will exit/crash and/or hang a Palm Pre (landscape mode) quite quickly - just move your finger around on the screen and it will fail.

Code (glbasic) Select

FOR n=0 TO 1000
DRAWRECT RND(480),RND(320)+10,RND(16),RND(16),RGB(RND(255),RND(255),RND(255))
NEXT

GRABSPRITE 1,0,0,480,320

LOCAL mx,my,b1,b2

WHILE TRUE

MOUSESTATE mx,my,b1,b2

DRAWSPRITE 1,0,0

PRINT GETPIXEL (mx,my),0,0

DRAWLINE mx-10,my,mx+10,my,RGB(255,255,255)
DRAWLINE mx,my-10,mx,my+10,RGB(255,255,255)

SHOWSCREEN

WEND
I came. I saw. I played.

Marmor

cant test yet ,iam at work but maybe you must check mx and my
test this evening


Ian Price

#2
The problem appears to be related to the GRABSPRITE command (although this seems to work fine in that it does what it's suppoed to do). Without using it the program works well.

At first I thought it might be the GETPIXEL commands, as I was getting some very strange results and couldn't get a reading over a certain point on the screen (like the orientation was portrait and not landscape) - but again using them on their own (without GRABSPRITE) they worked fine.

The odd thing here is that the exits/crashes and hangs aren't consistant - sometimes it's like swiping the app off the screen, others there are obvious mouse touches but the app has crashed and using the HOME key/swipe has  no effect. Other times it just exits. There are also times where it just seems to hang, but leave for a while and the phone comes back to life. Sometimes it takes just a second or two, other times 10seconds or more. But it will definitely fail within 30seconds of moving your finger on the screen (not tested without any action).

Maybe I'm abusing the GETPIXEL by using it in the PRINT command (maybe better using something like pixel=GETPIXEL (mx,my) then PRINT pixel,X,Y. Dunno.

It could be a combination of several things, it could be something unrelated - a memory leak of some sort maybe? It's an odd one.
I came. I saw. I played.

Kitty Hello

sounds like a memory leak. Only in landscape mode? Rings a bell.