You are not logged in.

#1 2010-01-24 22:50:07

scognito
Member

[RESOLVED] Strange behaviour of GRRLIB_DrawImg?

I use GRRLIB_DrawImg for displaying images in my platform game.
When an object hits an object it turns direction (and flip image horizontally): I tought passing -1 parameter to the zoom one, as the doc says.
GRRLIB flips the image but when I try to display it the coordinate isn't correct, infact the starting coordinate of display is flipped too.
The following code produces the image I posted.

Code:

int x = 10;
GRRLIB_DrawImg(x, 10, tex_square, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(x, 60, tex_square, 0, -1, 1, 0xFFFFFFFF);

http://img694.imageshack.us/img694/590/squarez.jpg

I tried to add a workaround, adding image width to the x coordinate:

Code:

GRRLIB_DrawImg(x+tex_square->w, 60, tex_square, , -1, 1, 0xFFFFFFFF);

It works correctly, but in the game, only at a specific zone (99% of the rest of the game it work), exactly at same location, the game CRASHES.
The address of the function in the dump shows me that the error is in the GRRLIB_DrawImg.
It doesn't crash if I remove the -1.

I don't know where the problem could be...

1) Is the flipping behaviour intended?
2) Where could be the problem?
3) Any workaround?

Thanks in advance

Offline

 

#2 2010-01-24 23:11:55

NoNameNo
Administrator

Re: [RESOLVED] Strange behaviour of GRRLIB_DrawImg?

hi,
have a look at the function : GRRLIB_SetHandle

Offline

 

#3 2010-01-25 00:26:10

scognito
Member

Re: [RESOLVED] Strange behaviour of GRRLIB_DrawImg?

It is what I tought initially, but before adding it as workaround I wanted to know if that beahaviour was ok.
It works now thanks...my game will be released soon! (I'm still searching some japanese guy to translate some text message)

Offline

 

Board footer

Powered by FluxBB