GRRLIB_ttf.c: DrawBitmap: Use less GX_Begin/GX_End calls

This commit is contained in:
Thomas Perl 2015-11-12 09:43:12 +01:00
parent 18a7f280e5
commit 3ab4c90b24

View file

@ -175,15 +175,15 @@ static void DrawBitmap(FT_Bitmap *bitmap, int offset, int top, const u8 cR, cons
FT_Int x_max = offset + bitmap->width; FT_Int x_max = offset + bitmap->width;
FT_Int y_max = top + bitmap->rows; FT_Int y_max = top + bitmap->rows;
GX_Begin(GX_POINTS, GX_VTXFMT0, (x_max - offset) * (y_max - top));
for ( i = offset, p = 0; i < x_max; i++, p++ ) { for ( i = offset, p = 0; i < x_max; i++, p++ ) {
for ( j = top, q = 0; j < y_max; j++, q++ ) { for ( j = top, q = 0; j < y_max; j++, q++ ) {
GX_Begin(GX_POINTS, GX_VTXFMT0, 1);
GX_Position3f32(i, j, 0); GX_Position3f32(i, j, 0);
GX_Color4u8(cR, cG, cB, GX_Color4u8(cR, cG, cB,
bitmap->buffer[ q * bitmap->width + p ]); bitmap->buffer[ q * bitmap->width + p ]);
}
}
GX_End(); GX_End();
}
}
} }
/** /**