Update
This commit is contained in:
@@ -6,21 +6,14 @@
|
||||
|
||||
BitmapFont
|
||||
prepText(SDL_Renderer *renderer, unsigned char pxSize, const char *file, uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
|
||||
const unsigned char ptSize = floor(pxSize * 0.75);
|
||||
TTF_Font *gFont = TTF_OpenFont(file, ptSize);
|
||||
TTF_Font *gFont = TTF_OpenFont(file, pxSize);
|
||||
BitmapFont out;
|
||||
out.size = pxSize;
|
||||
out.color = (SDL_Color) {r, g, b, a};
|
||||
unsigned char i = 0;
|
||||
do {
|
||||
char tmpOut[2] = {i, 0};
|
||||
|
||||
out.surface[i] = TTF_RenderText_Solid(gFont, tmpOut, out.color);
|
||||
SDL_Rect dstRect;
|
||||
dstRect.x = 0;
|
||||
dstRect.y = 0;
|
||||
dstRect.w = pxSize;
|
||||
dstRect.h = pxSize;
|
||||
out.texture[i] = SDL_CreateTextureFromSurface(renderer, out.surface[i]);
|
||||
i++;
|
||||
} while (i < 255);
|
||||
|
Reference in New Issue
Block a user