 
		You are not logged in.
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... 
        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(¤tTime);
        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 crashThanks, 
Manny
Last edited by manny2008 (2009-03-14 00:23:23)
Offline

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
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?
#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

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
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
Fixed.. 
The aleator crash was produces by two  WPAD_Init();   seems that now is fixed
  seems that now is fixed   
Thanks, 
Manny
Offline