diff --git a/GRRLIB/GRRLIB/GRRLIB_print.c b/GRRLIB/GRRLIB/GRRLIB_print.c index 7ecffe0..1a22df1 100644 --- a/GRRLIB/GRRLIB/GRRLIB_print.c +++ b/GRRLIB/GRRLIB/GRRLIB_print.c @@ -45,15 +45,16 @@ void GRRLIB_Printf (const f32 xpos, const f32 ypos, int i, size; char tmp[1024]; + f32 offset = tex->tilew * zoom; va_list argp; va_start(argp, text); - size = vsprintf(tmp, text, argp); + size = vsnprintf(tmp, sizeof(tmp), text, argp); va_end(argp); for (i = 0; i < size; i++) { - u8 c = tmp[i]-tex->tilestart; - GRRLIB_DrawTile(xpos+i*tex->tilew*zoom, ypos, tex, 0, zoom, zoom, color, c); + GRRLIB_DrawTile(xpos+i*offset, ypos, tex, 0, zoom, zoom, color, + tmp[i] - tex->tilestart); } } diff --git a/GRRLIB/GRRLIB/GRRLIB_render.c b/GRRLIB/GRRLIB/GRRLIB_render.c index a2e1d83..ff33c96 100644 --- a/GRRLIB/GRRLIB/GRRLIB_render.c +++ b/GRRLIB/GRRLIB/GRRLIB_render.c @@ -167,11 +167,11 @@ void GRRLIB_DrawImgQuad (const guVector pos[4], GRRLIB_texImg *tex, const u32 c * @param xpos Specifies the x-coordinate of the upper-left corner. * @param ypos Specifies the y-coordinate of the upper-left corner. * @param tex The texture containing the tile to draw. - * @param frame Specifies the frame to draw. * @param degrees Angle of rotation. * @param scaleX Specifies the x-coordinate scale. -1 could be used for flipping the texture horizontally. * @param scaleY Specifies the y-coordinate scale. -1 could be used for flipping the texture vertically. * @param color Color in RGBA format. + * @param frame Specifies the frame to draw. */ void GRRLIB_DrawTile (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex, const f32 degrees, const f32 scaleX, const f32 scaleY, const u32 color, const int frame) { GXTexObj texObj;