Skip to content
Permalink
Browse files

Better c89 compatibility

  • Loading branch information...
UnknownShadow200 committed Oct 7, 2019
1 parent 955cfd1 commit e07712d7251dc0cffc4b9db0dc2476b2e7374945
Showing with 7 additions and 4 deletions.
  1. +1 −1 src/Core.h
  2. +6 −3 src/Drawer2D.c
@@ -90,7 +90,7 @@ typedef uint64_t cc_uint64;
typedef uintptr_t cc_uintptr;
#endif
#ifndef CC_HAS_MISC
#define CC_INLINE inline
#define CC_INLINE
#define CC_NOINLINE
#define CC_API
#define CC_VAR
@@ -829,6 +829,9 @@ static ReturnCode SysFont_Init(const String* path, struct SysFont* font, FT_Open
FileHandle file;
cc_uint32 size;
ReturnCode res;
#ifdef CC_BUILD_OSX
String filename;
#endif

if ((res = File_Open(&file, path))) return res;
if ((res = File_Length(file, &size))) { File_Close(file); return res; }
@@ -854,7 +857,7 @@ static ReturnCode SysFont_Init(const String* path, struct SysFont* font, FT_Open

/* For OSX font suitcase files */
#ifdef CC_BUILD_OSX
String filename = String_NT_Array(font->filename);
String_InitArray_NT(filename, font->filename);
String_Copy(&filename, path);
font->filename[filename.length] = '\0';
args->pathname = font->filename;
@@ -1126,6 +1129,7 @@ static void DrawBlackWhiteGlyph(FT_Bitmap* img, Bitmap* bmp, int x, int y, Bitma
}
}

static FT_Vector shadow_delta = { 83, -83 };
static int Font_SysTextDraw(struct DrawTextArgs* args, Bitmap* bmp, int x, int y, BitmapCol col, bool shadow) {
struct SysFont* font = (struct SysFont*)args->font->handle;
FT_BitmapGlyph* glyphs = font->glyphs;
@@ -1143,8 +1147,7 @@ static int Font_SysTextDraw(struct DrawTextArgs* args, Bitmap* bmp, int x, int y

if (shadow) {
glyphs = font->shadow_glyphs;
FT_Vector delta = { 83, -83 };
FT_Set_Transform(face, NULL, &delta);
FT_Set_Transform(face, NULL, &shadow_delta);
}

height = args->font->height;

0 comments on commit e07712d

Please sign in to comment.
You can’t perform that action at this time.