mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-11-22 15:02:20 +00:00
[CHG] Small optimization in GRRLIB_Printf
This commit is contained in:
parent
69d4eab793
commit
6174a3e4f8
2 changed files with 5 additions and 4 deletions
|
@ -45,15 +45,16 @@ void GRRLIB_Printf (const f32 xpos, const f32 ypos,
|
||||||
|
|
||||||
int i, size;
|
int i, size;
|
||||||
char tmp[1024];
|
char tmp[1024];
|
||||||
|
f32 offset = tex->tilew * zoom;
|
||||||
|
|
||||||
va_list argp;
|
va_list argp;
|
||||||
va_start(argp, text);
|
va_start(argp, text);
|
||||||
size = vsprintf(tmp, text, argp);
|
size = vsnprintf(tmp, sizeof(tmp), text, argp);
|
||||||
va_end(argp);
|
va_end(argp);
|
||||||
|
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
u8 c = tmp[i]-tex->tilestart;
|
GRRLIB_DrawTile(xpos+i*offset, ypos, tex, 0, zoom, zoom, color,
|
||||||
GRRLIB_DrawTile(xpos+i*tex->tilew*zoom, ypos, tex, 0, zoom, zoom, color, c);
|
tmp[i] - tex->tilestart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 xpos Specifies the x-coordinate of the upper-left corner.
|
||||||
* @param ypos Specifies the y-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 tex The texture containing the tile to draw.
|
||||||
* @param frame Specifies the frame to draw.
|
|
||||||
* @param degrees Angle of rotation.
|
* @param degrees Angle of rotation.
|
||||||
* @param scaleX Specifies the x-coordinate scale. -1 could be used for flipping the texture horizontally.
|
* @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 scaleY Specifies the y-coordinate scale. -1 could be used for flipping the texture vertically.
|
||||||
* @param color Color in RGBA format.
|
* @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) {
|
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;
|
GXTexObj texObj;
|
||||||
|
|
Loading…
Reference in a new issue