[CHG] Micro-optimization

This commit is contained in:
Crayon2000 2010-01-25 21:26:45 +00:00
parent c7eef805bc
commit c1f5de97c8

View file

@ -136,8 +136,6 @@ void GRRLIB_PrintfTTFW(int x, int y, GRRLIB_ttfFont *myFont, const wchar_t *utf3
for (loop = 0; loop < length; ++loop) {
glyphIndex = FT_Get_Char_Index(myFont->face, utf32[ loop ]);
/* To the best of my knowledge, none of the other freetype
* implementations use kerning */
if (myFont->kerning && previousGlyph && glyphIndex) {
FT_Vector delta;
FT_Get_Kerning(myFont->face, previousGlyph, glyphIndex, FT_KERNING_DEFAULT, &delta);
@ -167,14 +165,15 @@ static void DrawBitmap(FT_Bitmap *bitmap, int offset, int top, const u32 color)
FT_Int i, j, p, q;
FT_Int x_max = offset + bitmap->width;
FT_Int y_max = top + bitmap->rows;
u8 cR = R(color), cG = G(color), cB = B(color);
for ( i = offset, p = 0; i < x_max; i++, p++ ) {
for ( j = top, q = 0; j < y_max; j++, q++ ) {
GRRLIB_Plot( i, j,
RGBA(R(color),
G(color),
B(color),
bitmap->buffer[ q * bitmap->width + p ]) );
GX_Begin(GX_POINTS, GX_VTXFMT0, 1);
GX_Position3f32(i, j, 0);
GX_Color4u8(cR, cG, cB,
bitmap->buffer[ q * bitmap->width + p ]);
GX_End();
}
}
}