mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-11-22 15:02:20 +00:00
[CHG] Micro-optimization
This commit is contained in:
parent
c7eef805bc
commit
c1f5de97c8
1 changed files with 6 additions and 7 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue