DrawAnim corruption on iPhone

Previous topic - Next topic

kaotiklabs

Hi,
I´m using a transition animation for ingame menus.
The animation uses all the screen, 480x320.

Works fine on Windows but on the iPhone the animation gets corrupted.
This is not the first time I get this behaviour on the iphone in landscape mode.

Usually drawing with drawsprite bypass the problem.
So I believe there´s some problem with loadanim/drawanim in landscape mode.

This sample reproduces the behaviour:

Code (glbasic) Select
SETSCREEN 480,320, TRUE

GLOBAL ANI_TRANSITION = 0
LOADANIM "Media/transition.png", ANI_TRANSITION, 480, 320


WHILE TRUE
GOSUB OpenTransition
MOUSEWAIT
WEND

SUB OpenTransition:
LOCAL done=FALSE
LOCAL timer
LOCAL i=0

WHILE done = FALSE
timer = timer + GETTIMER()
DRAWANIM ANI_TRANSITION, i, 0, 0
SHOWSCREEN

IF timer > 84
INC i, 1
timer = 0
ENDIF

IF i > 4 THEN done = TRUE
WEND
ENDSUB



The png is attached.

Any idea about what could be happening?



[attachment deleted by admin]
Vote Cthulhu! Because the stars are right!!!!
Ia Ia Cthulhu F' tang!

matchy

The original image dimensions are 2400x320px. When this is resized to 1020x100 and 2 lines of code changed shows that 1023px width is the limit.
   LOADANIM "transition.png", ANI_TRANSITION, 204, 100
      STRETCHANIM ANI_TRANSITION, i, 0,0, 480,320

I suppose you could just tile anim plot it but what about poly map plot?

kaotiklabs

sorry, but I don´t understand you.

is there a width limit of 1023px for load animations on iphone platforms??

Ok, I will try drawing with polys!
Vote Cthulhu! Because the stars are right!!!!
Ia Ia Cthulhu F' tang!

doimus

Quote from: kaotiklabs on 2009-Nov-07
sorry, but I don´t understand you.

is there a width limit of 1023px for load animations on iphone platforms??

Yes there is a limit: all textures must be powers of two and preferably square, up to 1024x1024.

codegit

#4
Yes stick on or below 1024. Use 32, 64, 128, 512 etc. I have had no problems with these values and I use drawanim alot.   ;)
------------------------------------------
1 X Acer TravelMate 4270, laptop, XP PRO
1 X Dell Studio 17 laptop, Windows 7
1 X MacBook Pro 2,2 GHz Core 2 Duo, 2 GB RAM, 160 GB HDD, 9400M
2 X iTouch
1 X HTC Desire (Android 2.1)
iPad soon to be added

kaotiklabs

Using polyvectors the problem remains so I have finally changed the image size and use stretch.
Now works. Thanks for the help!
Vote Cthulhu! Because the stars are right!!!!
Ia Ia Cthulhu F' tang!

Kitty Hello

Why aren't you just storing 2 images and use drawsprite to move them toghether?

codegit

Quote from: Kitty Hello on 2009-Nov-09
Why aren't you just storing 2 images and use drawsprite to move them toghether?

Also, this way you will be able to get much smoother animation, as all you movements are at pixel level.  8)
------------------------------------------
1 X Acer TravelMate 4270, laptop, XP PRO
1 X Dell Studio 17 laptop, Windows 7
1 X MacBook Pro 2,2 GHz Core 2 Duo, 2 GB RAM, 160 GB HDD, 9400M
2 X iTouch
1 X HTC Desire (Android 2.1)
iPad soon to be added

kaotiklabs

Yes, is the simple solution but the 3d feeling will disappear due to shadows overlapping.
Eitherway, better simple than superscaled.
Vote Cthulhu! Because the stars are right!!!!
Ia Ia Cthulhu F' tang!

Kitty Hello

draw all with alhamode -0.5, then with alphamode 0.0 and offset slightly to the left and up.