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 -4
View File
@@ -28,13 +28,15 @@
#include "vgui_key_translation.h"
#include "filesystem.h"
#ifdef OSX
#include <Carbon/Carbon.h>
#if defined(OSX) || defined(BSD)
#include <sys/param.h>
#include <sys/mount.h>
#elif defined(LINUX)
#include <sys/vfs.h>
#endif
#ifdef OSX
#include <Carbon/Carbon.h>
#endif
#ifdef USE_SDL
#include "SDL_clipboard.h"
@@ -290,7 +292,7 @@ void CSystem::ShellExecute(const char *command, const char *file)
if ( pid == 0 )
{
// Child
#ifdef LINUX
#if defined(LINUX) || defined(BSD)
// Escape steam runtime if necessary
const char *szSteamRuntime = getenv( "STEAM_RUNTIME" );
if ( szSteamRuntime )
@@ -585,7 +587,7 @@ int CSystem::GetAvailableDrives(char *buf, int bufLen)
//-----------------------------------------------------------------------------
double CSystem::GetFreeDiskSpace(const char *path)
{
#if __DARWIN_ONLY_64_BIT_INO_T
#if __DARWIN_ONLY_64_BIT_INO_T || BSD
// MoeMod: newer macOS only support 64bit, so no statfs64 is provided
struct statfs buf;
int ret = statfs( path, &buf );
+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 = []