It appears that using POLYVECTOR crashes the program on a Palm Pre. I think it was mentioned before - but you never know :)
Err no it doesn't.
I've been using POLYVECTOR since day 1 and it works just fine.
See attached image - The board and the scrolling background are POLYVECTORs.
[attachment deleted by admin]
Thats odd - mine crashes right out...
You're too quick - I've just edited my post to include a screenie.
B'lox! on Pre uses POLYVECTORs too. No problems so far.
Are you using 320x480 or the other way around?
480x320 for both apps (and something completely new, plus tests).
Could you try this with with 320x480 :
// ---------------------------------
// Project: Plasma
// Start: Wednesday, March 11, 2009
// IDE Version: 6.184
TYPE tCosTable
value
ENDTYPE
TYPE tColour
value%
ENDTYPE
TYPE TPlasma
cosTable[] AS tCosTable
colourTable[] AS tColour
screenWidth%;screenHeight%
wave%
stp%
FUNCTION Initialise_Plasma%:
LOCAL loop%
LOCAL cTable AS tCosTable
LOCAL cColour AS tColour
DIM self.cosTable[0]
DIM self.colourTable[0]
GETSCREENSIZE self.screenWidth%,self.screenHeight%
// Create COS table
FOR loop%=0 TO self.screenWidth%*2
cTable.value=SIN(360.0*loop%/320.0)*32+32
DIMPUSH self.cosTable[],cTable
NEXT
FOR loop%=0 TO 255
cColour.value%=RGB(loop%,loop%,0)
DIMPUSH self.colourTable[],cColour
NEXT
self.wave%=0
self.stp%=14
ENDFUNCTION
FUNCTION Update_Plasma%:
LOCAL x%,y%
LOCAL pos1,pos2
INC self.wave%,3
IF self.wave%>320
self.wave%=0
ENDIF
FOR y%=0 TO self.screenHeight%-1 STEP self.stp%
pos1 = self.cosTable[y%+self.wave%].value
FOR x% = 0 TO self.screenWidth%-1 STEP self.stp%
pos2 = (self.cosTable[x%+self.wave%].value + self.cosTable[x%+y%].value + pos1)
STARTPOLY -1
POLYVECTOR x%+self.stp%,y%,0,0,self.colourTable[self.cosTable[pos2].value].value
POLYVECTOR x%,y%,0,0,self.colourTable[self.cosTable[pos2].value].value
POLYVECTOR x%,y%+self.stp%,0,0,self.colourTable[self.cosTable[pos2].value].value
POLYVECTOR x%+self.stp%,y%+self.stp%,0,0,self.colourTable[self.cosTable[pos2].value].value
ENDPOLY
NEXT
NEXT
ENDPOLY
ENDFUNCTION
ENDTYPE
LOCAL plasma AS TPlasma
plasma.Initialise_Plasma()
WHILE TRUE
plasma.Update_Plasma()
SHOWSCREEN
WEND
Its my animated plasma routine...
Ah - interesting thing is that using 320x480 on Windows also crashes it :)
Ahh - does look like an out of bounds problem with this resolution - ah good :)
Yes, it should be quite alright...
QuoteAh - interesting thing is that using 320x480 on Windows also crashes it :)
Confirmed - it does indeed crash on Windows at 320x480. No point in trying it on the Pre - result will be the same.
yes - it was my code causing the problem. Which is good :)
Running in debug mode, I get:
pos2 = (self.cosTable[x%+self.wave%].value + self.cosTable[x%+y%].value + pos1)
bounds: [ 641]
access: [ 644]
"C:\Users\GF\Documents\GLBasic\_support\_support.gbas"(59) error : Ausserhalb des DIM Bereichs
So it's an out of bounds error.
Check the cos/sin table size and what you call it with.
Yes, it was a bounds problem :)