You are not logged in.

#1 2009-03-12 18:29:14

manny2008
Member

[RESOLVED] GRRLIB_Printf hang up

Hi ALL,

I'm tring to move to the GRRLIB engine the Willander game.. but seems that I have a mistake in my code... I think that is related to the GRRLIB_Printf,  and "const char *tex"  + local->tm_min because with int variables or fix strings like "Game Over" I don't have issues at all...

Code:

        PX= SCR_WIDTH/16-10;PY= SCR_HEIGHT/64+24;color= 0xffafafaf;

//        s_printf("Fuel:  %d",Fuel_Nave);

        GRRLIB_Printf (PX, PY,tex_font, color, 0.3,"FUEL: % d" ,Fuel_Nave);

    

        struct tm *local;

        time_t currentTime = time(NULL)-startTime;  

        local = localtime(&currentTime);





        PX= SCR_WIDTH/2-20;PY= SCR_HEIGHT/64;color= 0xffafafaf;

//        s_printf("Level: %d",Nivel);

        GRRLIB_Printf (PX, PY,tex_font, color, 0.3,"LEVEL: % d" , Nivel);

        

        PX= SCR_WIDTH/16-10;PY= SCR_HEIGHT/64+48;color= 0xffafafaf;

//        s_printf("Time: %d:%d",local->tm_min, local->tm_sec);

//        GRRLIB_Printf (PX, PY,tex_font, color, 0.3,"TIME: %02d:%02d",local->tm_min, local->tm_sec);
  // << this give me an instant crash
        GRRLIB_Printf (PX, PY,tex_font, color, 0.3,"TIME: %02d",(int)local->tm_sec);  // << with this you have to wait a bit to have the crash

Thanks,

Manny

Last edited by manny2008 (2009-03-14 00:23:23)

Offline

 

#2 2009-03-12 19:09:53

Crayon
Bad Mother Fucker

Re: [RESOLVED] GRRLIB_Printf hang up

What does your font looks like, which characters are you using?
Do you call GRRLIB_InitTileSet?
How do you load the file?
Is the file a PNG or JPEG?
Are you using the SVN version of GRRLIB, if yes which version?

Offline

 

#3 2009-03-12 22:02:25

manny2008
Member

Re: [RESOLVED] GRRLIB_Printf hang up

Thanks in advance Crayon,

Crayon wrote:

What does your font looks like, which characters are you using?
Is the file a PNG or JPEG?

I used the font.png included in Demo1


Crayon wrote:

Do you call GRRLIB_InitTileSet?
How do you load the file?

Code:

#include "gfx/font.h"
....
GRRLIB_texImg tex_font = GRRLIB_LoadTexture(font);
GRRLIB_InitTileSet(&tex_font, 32, 33, 32);

Crayon wrote:

Are you using the SVN version of GRRLIB, if yes which version?

I'm using this version...
http://grrlib.santo.fr/release/GRRLib4.0.0.rar

... not the latest from the SVN

Thanks,

Manny

Offline

 

#4 2009-03-13 15:49:24

Crayon
Bad Mother Fucker

Re: [RESOLVED] GRRLIB_Printf hang up

If you try something simple like:
        GRRLIB_Printf (PX, PY,tex_font, color, 0.3,"TIME: %d", 2);
Does it crash?

BTW I don't think the command localtime exist in libogc.

Offline

 

#5 2009-03-14 01:27:41

manny2008
Member

Re: [RESOLVED] GRRLIB_Printf hang up

With:  GRRLIB_Printf (PX, PY,tex_font, color, 0.3,"TIME: %d", 2);  No crash..

Regarding localtime check this url:

http://forums.devkitpro.org/viewtopic.p … &p=489
or any source from wplaat

Offline

 

#6 2009-03-17 23:44:26

manny2008
Member

Re: [RESOLVED] GRRLIB_Printf hang up

Fixed..

The aleator crash was produces by two  WPAD_Init();  sad  seems that now is fixed   wink

Thanks,

Manny

Offline

 

Board footer

Powered by FluxBB