mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 09:06:55 -04:00
fix last commit
This commit is contained in:
parent
4fb020a336
commit
ac98c00f3b
@ -438,7 +438,7 @@ static void DrawBitmappedTextCore(struct Bitmap* bmp, struct DrawTextArgs* args,
|
|||||||
String text = args->text;
|
String text = args->text;
|
||||||
int i, point = args->font->size, count = 0;
|
int i, point = args->font->size, count = 0;
|
||||||
|
|
||||||
int xPadding, yPadding;
|
int xPadding;
|
||||||
int srcX, srcY, dstX, dstY;
|
int srcX, srcY, dstX, dstY;
|
||||||
int fontX, fontY;
|
int fontX, fontY;
|
||||||
int srcWidth, dstWidth;
|
int srcWidth, dstWidth;
|
||||||
@ -472,11 +472,11 @@ static void DrawBitmappedTextCore(struct Bitmap* bmp, struct DrawTextArgs* args,
|
|||||||
|
|
||||||
dstHeight = point; begX = x;
|
dstHeight = point; begX = x;
|
||||||
/* adjust coords to make drawn text match GDI fonts */
|
/* adjust coords to make drawn text match GDI fonts */
|
||||||
|
y += (args->font->height - dstHeight) / 2;
|
||||||
xPadding = Drawer2D_XPadding(point);
|
xPadding = Drawer2D_XPadding(point);
|
||||||
yPadding = (args->font->height - dstHeight) / 2;
|
|
||||||
|
|
||||||
for (yy = 0; yy < dstHeight; yy++) {
|
for (yy = 0; yy < dstHeight; yy++) {
|
||||||
dstY = y + (yy + yPadding);
|
dstY = y + yy;
|
||||||
if ((unsigned)dstY >= (unsigned)bmp->height) continue;
|
if ((unsigned)dstY >= (unsigned)bmp->height) continue;
|
||||||
|
|
||||||
fontY = 0 + yy * tileSize / dstHeight;
|
fontY = 0 + yy * tileSize / dstHeight;
|
||||||
@ -516,7 +516,7 @@ static void DrawBitmappedTextCore(struct Bitmap* bmp, struct DrawTextArgs* args,
|
|||||||
if (!(args->font->flags & FONT_FLAGS_UNDERLINE)) return;
|
if (!(args->font->flags & FONT_FLAGS_UNDERLINE)) return;
|
||||||
/* scale up bottom row of a cell to drawn text font */
|
/* scale up bottom row of a cell to drawn text font */
|
||||||
cellY = (8 - 1) * dstHeight / 8;
|
cellY = (8 - 1) * dstHeight / 8;
|
||||||
underlineY = y + (cellY + yPadding);
|
underlineY = y + cellY;
|
||||||
underlineHeight = dstHeight - cellY;
|
underlineHeight = dstHeight - cellY;
|
||||||
|
|
||||||
for (i = 0; i < count; ) {
|
for (i = 0; i < count; ) {
|
||||||
@ -697,19 +697,18 @@ struct IGameComponent Drawer2D_Component = {
|
|||||||
*#########################################################################################################################*/
|
*#########################################################################################################################*/
|
||||||
#ifdef CC_BUILD_WEB
|
#ifdef CC_BUILD_WEB
|
||||||
void Font_GetNames(struct StringsBuffer* buffer) { }
|
void Font_GetNames(struct StringsBuffer* buffer) { }
|
||||||
String Font_Lookup(const String* fontName, int style) {
|
String Font_Lookup(const String* fontName, int flags) {
|
||||||
String str = String_FromConst("-----"); return str;
|
String str = String_FromConst("-----"); return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
cc_result Font_Make(struct FontDesc* desc, const String* fontName, int size, int style) {
|
cc_result Font_Make(struct FontDesc* desc, const String* fontName, int size, int flags) {
|
||||||
desc->size = size;
|
desc->size = size;
|
||||||
desc->style = style;
|
desc->flags = flags;
|
||||||
desc->height = 0;
|
desc->height = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
void Font_Free(struct FontDesc* desc) {
|
void Font_Free(struct FontDesc* desc) {
|
||||||
desc->size = 0;
|
desc->size = 0;
|
||||||
desc->style = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SysFonts_Register(const String* path) { }
|
void SysFonts_Register(const String* path) { }
|
||||||
@ -1010,7 +1009,6 @@ cc_result Font_Make(struct FontDesc* desc, const String* fontName, int size, int
|
|||||||
void Font_Free(struct FontDesc* desc) {
|
void Font_Free(struct FontDesc* desc) {
|
||||||
struct SysFont* font;
|
struct SysFont* font;
|
||||||
desc->size = 0;
|
desc->size = 0;
|
||||||
desc->flags = 0;
|
|
||||||
/* NULL for fonts created by Drawer2D_MakeFont and bitmapped text mode is on */
|
/* NULL for fonts created by Drawer2D_MakeFont and bitmapped text mode is on */
|
||||||
if (!desc->handle) return;
|
if (!desc->handle) return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user