BSD: Add support (#140)

* BSD: Add support

* BSD: other fixes

There is still a bug when vgui haven't got text, maybe because of resources.

Also there is bug where when trying to start new game caption names shows wrong.

* BSD: Debugging

* BSD: modify preprocessor and fix windows

* BSD: Remove debugging and fix labels in gameui

* BSD: Remove disabling some DX9 commands

* BSD: Remove -g flag
This commit is contained in:
Er2
2022-11-24 22:04:29 +03:00
committed by GitHub
parent 807eaae850
commit 53bd92f7a8
49 changed files with 221 additions and 178 deletions
+6 -6
View File
@@ -43,7 +43,7 @@ CFontManager::CFontManager()
m_FontAmalgams.AddToTail();
m_Win32Fonts.EnsureCapacity( MAX_INITIAL_FONTS );
#if defined(LINUX) || defined(OSX)
#ifdef POSIX
FT_Error error = FT_Init_FreeType( &library );
if ( error )
Error( "Unable to initalize freetype library, is it installed?" );
@@ -75,7 +75,7 @@ CFontManager::~CFontManager()
{
ClearAllFonts();
m_FontAmalgams.RemoveAll();
#if defined(LINUX) || defined(OSX)
#ifdef POSIX
FT_Done_FreeType( library );
#endif
}
@@ -280,7 +280,7 @@ font_t *CFontManager::CreateOrFindWin32Font(const char *windowsFontName, int tal
i = m_Win32Fonts.AddToTail();
m_Win32Fonts[i] = NULL;
#if defined(LINUX) || defined(OSX)
#ifdef POSIX
int memSize = 0;
void *pchFontData = m_pFontDataHelper( windowsFontName, memSize, NULL );
@@ -584,7 +584,7 @@ FallbackFont_t g_FallbackFonts[] =
{ NULL, "Monaco" } // every other font falls back to this
};
#elif defined(LINUX)
#elif defined(LINUX) || defined(BSD)
static const char *g_szValidAsianFonts[] = { "Marlett", "WenQuanYi Zen Hei", "unifont", NULL };
// list of how fonts fallback
@@ -649,7 +649,7 @@ const char *CFontManager::GetForeignFallbackFontName()
return "Tahoma";
#elif defined(OSX)
return "Helvetica";
#elif defined(LINUX)
#elif defined(LINUX) || defined(BSD)
return "WenQuanYi Zen Hei";
#elif defined(_PS3)
return "Tahoma";
@@ -750,7 +750,7 @@ void CFontManager::GetKernedCharWidth( vgui::HFont font, wchar_t ch, wchar_t chB
if ( m_FontAmalgams[font].GetFontForChar( chAfter ) != pFont )
chAfter = 0;
#if defined(LINUX) || defined(OSX)
#ifdef POSIX
pFont->GetKernedCharWidth( ch, chBefore, chAfter, wide, flabcA, flabcC );
#else
pFont->GetKernedCharWidth( ch, chBefore, chAfter, wide, flabcA );
+1 -1
View File
@@ -39,7 +39,7 @@ def build(bld):
'../../public/tier0',
'../../public/tier1',
'../../common',
] + bld.env.INCLUDES_FT2
] + bld.env.INCLUDES_FC + bld.env.INCLUDES_FT2
defines = []