mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 19:45:23 -04:00
C client: start work on getting freetype working with linux backend too
This commit is contained in:
parent
202511164b
commit
c891e16824
11
src/Game.c
11
src/Game.c
@ -765,14 +765,3 @@ void Game_Run(Int32 width, Int32 height, const String* title, struct DisplayDevi
|
|||||||
Game_RenderFrame(time);
|
Game_RenderFrame(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: Implement all these stubs.... */
|
|
||||||
#if CC_BUILD_NIX
|
|
||||||
void Font_Make(FontDesc* desc, const String* fontName, UInt16 size, UInt16 style) { desc->Size = size; desc->Style = style; }
|
|
||||||
void Font_Free(FontDesc* desc) { }
|
|
||||||
void Font_GetNames(StringsBuffer* buffer) { }
|
|
||||||
Size2D Platform_TextMeasure(struct DrawTextArgs* args) { }
|
|
||||||
void Platform_SetBitmap(Bitmap* bmp) { }
|
|
||||||
Size2D Platform_TextDraw(struct DrawTextArgs* args, Int32 x, Int32 y, PackedCol col) { }
|
|
||||||
void Platform_ReleaseBitmap(void) { }
|
|
||||||
#endif
|
|
||||||
|
@ -735,7 +735,7 @@ void Font_Free(FontDesc* desc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void Font_DirCallback(const String* filename, void* obj) {
|
static void Font_DirCallback(const String* filename, void* obj) {
|
||||||
char pathBuffer[MAX_PATH * 5 + 1];
|
char pathBuffer[FILENAME_SIZE + 1];
|
||||||
String path = String_NT_Array(pathBuffer);
|
String path = String_NT_Array(pathBuffer);
|
||||||
String* dir = obj;
|
String* dir = obj;
|
||||||
|
|
||||||
@ -747,7 +747,7 @@ static void Font_DirCallback(const String* filename, void* obj) {
|
|||||||
if (error) return;
|
if (error) return;
|
||||||
|
|
||||||
bool styled = (face->style_flags & FT_STYLE_FLAG_BOLD) || (face->style_flags & FT_STYLE_FLAG_ITALIC);
|
bool styled = (face->style_flags & FT_STYLE_FLAG_BOLD) || (face->style_flags & FT_STYLE_FLAG_ITALIC);
|
||||||
if (!styled) {
|
if (!styled && face->family_name) {
|
||||||
StringsBuffer_Add(&fonts_list, &path);
|
StringsBuffer_Add(&fonts_list, &path);
|
||||||
path.length = 0;
|
path.length = 0;
|
||||||
|
|
||||||
@ -799,7 +799,7 @@ Size2D Platform_TextDraw(struct DrawTextArgs* args, Bitmap* bmp, Int32 x, Int32
|
|||||||
y += offset;
|
y += offset;
|
||||||
|
|
||||||
for (yy = 0; yy < img->rows; yy++) {
|
for (yy = 0; yy < img->rows; yy++) {
|
||||||
if ((y + yy) < 0|| (y + yy) >= bmp->Height) continue;
|
if ((y + yy) < 0 || (y + yy) >= bmp->Height) continue;
|
||||||
UInt8* src = img->buffer + (yy * img->width);
|
UInt8* src = img->buffer + (yy * img->width);
|
||||||
UInt8* dst = (UInt8*)Bitmap_GetRow(bmp, y + yy) + (x * BITMAP_SIZEOF_PIXEL);
|
UInt8* dst = (UInt8*)Bitmap_GetRow(bmp, y + yy) + (x * BITMAP_SIZEOF_PIXEL);
|
||||||
|
|
||||||
@ -815,6 +815,7 @@ Size2D Platform_TextDraw(struct DrawTextArgs* args, Bitmap* bmp, Int32 x, Int32
|
|||||||
src++; dst += BITMAP_SIZEOF_PIXEL;
|
src++; dst += BITMAP_SIZEOF_PIXEL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
x += TEXT_CEIL(face->glyph->advance.x);
|
x += TEXT_CEIL(face->glyph->advance.x);
|
||||||
y -= offset;
|
y -= offset;
|
||||||
}
|
}
|
||||||
|
@ -1,61 +0,0 @@
|
|||||||
/***************************************************************************/
|
|
||||||
/* */
|
|
||||||
/* ftver.rc */
|
|
||||||
/* */
|
|
||||||
/* FreeType VERSIONINFO resource for Windows DLLs. */
|
|
||||||
/* */
|
|
||||||
/* Copyright 2018 by */
|
|
||||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
|
||||||
/* */
|
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
|
||||||
/* modified, and distributed under the terms of the FreeType project */
|
|
||||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
|
||||||
/* this file you indicate that you have read the license and */
|
|
||||||
/* understand and accept it fully. */
|
|
||||||
/* */
|
|
||||||
/***************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
#include<windows.h>
|
|
||||||
|
|
||||||
#define FT_VERSION 2,9,1,0
|
|
||||||
#define FT_VERSION_STR "2.9.1"
|
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
|
||||||
FILEVERSION FT_VERSION
|
|
||||||
PRODUCTVERSION FT_VERSION
|
|
||||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
|
||||||
#ifdef _DEBUG
|
|
||||||
FILEFLAGS VS_FF_DEBUG
|
|
||||||
#endif
|
|
||||||
#ifdef _DLL
|
|
||||||
FILETYPE VFT_DLL
|
|
||||||
#define FT_FILENAME "freetype.dll"
|
|
||||||
#else
|
|
||||||
FILETYPE VFT_STATIC_LIB
|
|
||||||
#define FT_FILENAME "freetype.lib"
|
|
||||||
#endif
|
|
||||||
BEGIN
|
|
||||||
BLOCK "StringFileInfo"
|
|
||||||
BEGIN
|
|
||||||
BLOCK "040904E4"
|
|
||||||
BEGIN
|
|
||||||
VALUE "CompanyName", "The FreeType Project"
|
|
||||||
VALUE "FileDescription", "Font Rendering Library"
|
|
||||||
VALUE "FileVersion", FT_VERSION_STR
|
|
||||||
VALUE "ProductName", "FreeType"
|
|
||||||
VALUE "ProductVersion", FT_VERSION_STR
|
|
||||||
VALUE "LegalCopyright", "\251 2018 The FreeType Project www.freetype.org. All rights reserved."
|
|
||||||
VALUE "InternalName", "freetype"
|
|
||||||
VALUE "OriginalFilename", FT_FILENAME
|
|
||||||
END
|
|
||||||
END
|
|
||||||
|
|
||||||
BLOCK "VarFileInfo"
|
|
||||||
BEGIN
|
|
||||||
/* The following line should only be modified for localized versions. */
|
|
||||||
/* It consists of any number of WORD,WORD pairs, with each pair */
|
|
||||||
/* describing a "language,codepage" combination supported by the file. */
|
|
||||||
VALUE "Translation", 0x409, 1252
|
|
||||||
END
|
|
||||||
END
|
|
Loading…
x
Reference in New Issue
Block a user