You are not logged in.

#1 2009-01-22 12:10:40

Cid2mizard
Member

Bug on Multiple DrawImg !

i have a little bug with multiple drawing

Exemple :

Code:

u8 *tex_bg1 = GRRLIB_LoadTexture(BG1);
u8 *tex_bg2 = GRRLIB_LoadTexture(BG2);
u8 *tex_bg3 = GRRLIB_LoadTexture(BG3);

while (stape == 0)
{
    GRRLIB_FillScreen(0xFF000000);

    GRRLIB_DrawImg(0, 0, 640, 480, tex_bg1, 0, 1, 1, 255);
    GRRLIB_DrawImg(0, 200, 640, 200, tex_bg2, 0, 1, 1, 255);
    GRRLIB_DrawImg(0, 250, 640, 100, tex_bg3, 0, 1, 1, 255);

    GRRLIB_Render();
    //if blabla stape = 1;
}

free(tex_bg1);
tex_bg1 = NULL;
free(tex_bg2);
tex_bg2 = NULL;
free(tex_bg3);
tex_bg3 = NULL;

sleep(1);

u8 *tex_bg4 = GRRLIB_LoadTexture(BG4);
u8 *tex_bg5 = GRRLIB_LoadTexture(BG5);
u8 *tex_bg6 = GRRLIB_LoadTexture(BG6);

while (stape == 1)
{
    GRRLIB_FillScreen(0xFF000000);

    GRRLIB_DrawImg(0, 0, 640, 480, tex_bg4, 0, 1, 1, 255);
    GRRLIB_DrawImg(0, 200, 640, 200, tex_bg5, 0, 1, 1, 255);
    GRRLIB_DrawImg(0, 250, 640, 100, tex_bg6, 0, 1, 1, 255);

    GRRLIB_Render();
    //if blabla stape = 2;
}

free(tex_bg4);
tex_bg4 = NULL;
free(tex_bg5);
tex_bg5 = NULL;
free(tex_bg6);
tex_bg6 = NULL;

sleep(1);

//etc...if i continu to bg12/13, i have a little bug when the new bg is drawing

free(tex_???); it's really good ?


www.nintendomax.com - 100% Hack  0% Warez

Offline

 

#2 2009-01-22 15:01:35

JustWoody
Member

Re: Bug on Multiple DrawImg !

I'm not quite sure what your bug is as you have not given much to go on in terms of you problem

A couple of observations are:

If you are freeing your textures then there is no need to null them

Why are you not just using the variables tex_bg1(to 3) that you have already created to load your next set of textures into instead of creating the new ones?

Offline

 

#3 2009-01-22 17:03:47

Cid2mizard
Member

Re: Bug on Multiple DrawImg !

JustWoody wrote:

I'm not quite sure what your bug is as you have not given much to go on in terms of you problem

A couple of observations are:

If you are freeing your textures then there is no need to null them

Why are you not just using the variables tex_bg1(to 3) that you have already created to load your next set of textures into instead of creating the new ones?

Good suggestion, i test it smile.


www.nintendomax.com - 100% Hack  0% Warez

Offline

 

Board footer

Powered by FluxBB