mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Fix AerofoilX
This commit is contained in:
@@ -202,8 +202,7 @@ bool GpFileSystem_X::ResolvePath(PortabilityLayer::VirtualDirectory_t virtualDir
|
||||
}
|
||||
|
||||
GpFileSystem_X::GpFileSystem_X()
|
||||
: m_relay(nullptr)
|
||||
, m_delayCallback(nullptr)
|
||||
: m_delayCallback(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -338,30 +337,6 @@ bool GpFileSystem_X::DeleteFile(PortabilityLayer::VirtualDirectory_t virtualDire
|
||||
return true;
|
||||
}
|
||||
|
||||
IGpDirectoryCursor *GpFileSystem_X::ScanDirectoryNested(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *const *paths, size_t numPaths)
|
||||
{
|
||||
ScanDirectoryNestedContext ctx;
|
||||
ctx.m_this = this;
|
||||
ctx.m_returnValue = nullptr;
|
||||
ctx.m_virtualDirectory = virtualDirectory;
|
||||
ctx.m_paths = paths;
|
||||
ctx.m_numPaths = numPaths;
|
||||
m_relay->Invoke(ScanDirectoryNestedThunk, &ctx);
|
||||
|
||||
return ctx.m_returnValue;
|
||||
}
|
||||
|
||||
void GpFileSystem_X::ScanDirectoryNestedThunk(void *context)
|
||||
{
|
||||
ScanDirectoryNestedContext *ctx = static_cast<ScanDirectoryNestedContext*>(context);
|
||||
ctx->m_returnValue = ctx->m_this->ScanDirectoryNestedInternal(ctx->m_virtualDirectory, ctx->m_paths, ctx->m_numPaths);
|
||||
}
|
||||
|
||||
IGpDirectoryCursor *GpFileSystem_X::ScanDirectoryNestedInternal(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *const *paths, size_t numPaths)
|
||||
{
|
||||
return ScanDirectory(virtualDirectory, paths, numPaths);
|
||||
}
|
||||
|
||||
bool GpFileSystem_X::ValidateFilePath(const char *path, size_t length) const
|
||||
{
|
||||
for (size_t i = 0; i < length; i++)
|
||||
@@ -408,11 +383,6 @@ bool GpFileSystem_X::ValidateFilePathUnicodeChar(uint32_t c) const
|
||||
return false;
|
||||
}
|
||||
|
||||
void GpFileSystem_X::SetMainThreadRelay(IGpThreadRelay *relay)
|
||||
{
|
||||
m_relay = relay;
|
||||
}
|
||||
|
||||
void GpFileSystem_X::SetDelayCallback(DelayCallback_t delayCallback)
|
||||
{
|
||||
m_delayCallback = delayCallback;
|
||||
@@ -500,7 +470,7 @@ void GpDirectoryCursor_POSIX::Destroy()
|
||||
}
|
||||
|
||||
|
||||
IGpDirectoryCursor *GpFileSystem_X::ScanDirectory(PortabilityLayer::VirtualDirectory_t virtualDirectory, char const* const* paths, size_t numPaths)
|
||||
IGpDirectoryCursor *GpFileSystem_X::ScanDirectoryNested(PortabilityLayer::VirtualDirectory_t virtualDirectory, char const* const* paths, size_t numPaths)
|
||||
{
|
||||
std::string resolvedPath;
|
||||
std::vector<std::string> subPaths;
|
||||
|
@@ -26,30 +26,13 @@ public:
|
||||
bool ValidateFilePath(const char *path, size_t pathLen) const override;
|
||||
bool ValidateFilePathUnicodeChar(uint32_t ch) const override;
|
||||
|
||||
void SetMainThreadRelay(IGpThreadRelay *relay) override;
|
||||
void SetDelayCallback(DelayCallback_t delayCallback) override;
|
||||
|
||||
static GpFileSystem_X *GetInstance();
|
||||
|
||||
private:
|
||||
struct ScanDirectoryNestedContext
|
||||
{
|
||||
GpFileSystem_X *m_this;
|
||||
|
||||
IGpDirectoryCursor *m_returnValue;
|
||||
PortabilityLayer::VirtualDirectory_t m_virtualDirectory;
|
||||
char const *const *m_paths;
|
||||
size_t m_numPaths;
|
||||
};
|
||||
|
||||
static void ScanDirectoryNestedThunk(void *context);
|
||||
IGpDirectoryCursor *ScanDirectoryNestedInternal(PortabilityLayer::VirtualDirectory_t virtualDirectory, char const* const* paths, size_t numPaths);
|
||||
|
||||
IGpDirectoryCursor *ScanDirectory(PortabilityLayer::VirtualDirectory_t virtualDirectory, char const* const* paths, size_t numPaths);
|
||||
|
||||
bool ResolvePath(PortabilityLayer::VirtualDirectory_t virtualDirectory, char const* const* paths, size_t numPaths, std::string &resolution);
|
||||
|
||||
IGpThreadRelay *m_relay;
|
||||
DelayCallback_t m_delayCallback;
|
||||
|
||||
std::string m_prefsPath;
|
||||
|
@@ -5,7 +5,6 @@
|
||||
#include "GpAudioDriverFactory.h"
|
||||
#include "GpDisplayDriverFactory.h"
|
||||
#include "GpGlobalConfig.h"
|
||||
#include "GpFiber_Thread.h"
|
||||
#include "GpFileSystem_X.h"
|
||||
#include "GpLogDriver_X.h"
|
||||
#include "GpFontHandlerFactory.h"
|
||||
@@ -23,8 +22,6 @@
|
||||
|
||||
GpXGlobals g_gpXGlobals;
|
||||
|
||||
extern "C" IGpFontHandler *GpDriver_CreateFontHandler_FreeType2(const GpFontHandlerProperties &properties);
|
||||
|
||||
IGpDisplayDriver *GpDriver_CreateDisplayDriver_SDL_GL2(const GpDisplayDriverProperties &properties);
|
||||
IGpAudioDriver *GpDriver_CreateAudioDriver_SDL(const GpAudioDriverProperties &properties);
|
||||
IGpInputDriver *GpDriver_CreateInputDriver_SDL2_Gamepad(const GpInputDriverProperties &properties);
|
||||
@@ -50,7 +47,7 @@ SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[])
|
||||
|
||||
g_gpGlobalConfig.m_audioDriverType = EGpAudioDriverType_SDL2;
|
||||
|
||||
g_gpGlobalConfig.m_fontHandlerType = EGpFontHandlerType_FreeType2;
|
||||
g_gpGlobalConfig.m_fontHandlerType = EGpFontHandlerType_None;
|
||||
|
||||
EGpInputDriverType inputDrivers[] =
|
||||
{
|
||||
@@ -67,7 +64,6 @@ SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[])
|
||||
GpDisplayDriverFactory::RegisterDisplayDriverFactory(EGpDisplayDriverType_SDL_GL2, GpDriver_CreateDisplayDriver_SDL_GL2);
|
||||
GpAudioDriverFactory::RegisterAudioDriverFactory(EGpAudioDriverType_SDL2, GpDriver_CreateAudioDriver_SDL);
|
||||
GpInputDriverFactory::RegisterInputDriverFactory(EGpInputDriverType_SDL2_Gamepad, GpDriver_CreateInputDriver_SDL2_Gamepad);
|
||||
GpFontHandlerFactory::RegisterFontHandlerFactory(EGpFontHandlerType_FreeType2, GpDriver_CreateFontHandler_FreeType2);
|
||||
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Information, "SDL environment configured, starting up");
|
||||
|
@@ -12,53 +12,6 @@ add_library(stb STATIC
|
||||
stb/stb_image_write.c
|
||||
)
|
||||
|
||||
|
||||
add_library(FreeType STATIC
|
||||
FreeType/freetype/src/base/ftbase.c
|
||||
FreeType/freetype/src/base/ftbitmap.c
|
||||
FreeType/freetype/src/base/ftdebug.c
|
||||
FreeType/freetype/src/base/ftinit.c
|
||||
FreeType/freetype/src/base/ftsystem.c
|
||||
FreeType/freetype/src/winfonts/winfnt.c
|
||||
FreeType/freetype/src/autofit/autofit.c
|
||||
FreeType/freetype/src/bdf/bdf.c
|
||||
FreeType/freetype/src/cff/cff.c
|
||||
FreeType/freetype/src/gzip/ftgzip.c
|
||||
FreeType/freetype/src/lzw/ftlzw.c
|
||||
FreeType/freetype/src/pcf/pcf.c
|
||||
FreeType/freetype/src/pfr/pfr.c
|
||||
FreeType/freetype/src/psaux/psaux.c
|
||||
FreeType/freetype/src/pshinter/pshinter.c
|
||||
FreeType/freetype/src/psnames/psnames.c
|
||||
FreeType/freetype/src/raster/raster.c
|
||||
FreeType/freetype/src/sfnt/sfnt.c
|
||||
FreeType/freetype/src/smooth/smooth.c
|
||||
FreeType/freetype/src/truetype/truetype.c
|
||||
FreeType/freetype/src/type1/type1.c
|
||||
FreeType/freetype/src/cid/type1cid.c
|
||||
FreeType/freetype/src/type42/type42.c
|
||||
)
|
||||
|
||||
target_compile_options(FreeType PRIVATE -ansi)
|
||||
target_compile_definitions(FreeType PRIVATE -DFT2_BUILD_LIBRARY)
|
||||
|
||||
target_include_directories(FreeType PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/FreeType/freetype/include>
|
||||
)
|
||||
|
||||
add_library(GpFontHandler_FreeType2 STATIC
|
||||
GpFontHandler_FreeType2/GpFontHandler_FreeType2.cpp
|
||||
)
|
||||
|
||||
target_include_directories(GpFontHandler_FreeType2 PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GpCommon>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Common>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/FreeType/freetype/include>
|
||||
)
|
||||
|
||||
target_link_libraries(GpFontHandler_FreeType2 FreeType)
|
||||
|
||||
|
||||
add_library(zlib STATIC
|
||||
zlib/adler32.c
|
||||
zlib/crc32.c
|
||||
@@ -281,8 +234,6 @@ if(CMAKE_HOST_UNIX)
|
||||
add_executable(AerofoilX
|
||||
AerofoilPortable/GpSystemServices_POSIX.cpp
|
||||
AerofoilPortable/GpThreadEvent_Cpp11.cpp
|
||||
AerofoilPortable/GpFiber_Thread.cpp
|
||||
AerofoilPortable/GpFiberStarter_Thread.cpp
|
||||
AerofoilSDL/GpAudioDriver_SDL2.cpp
|
||||
AerofoilSDL/GpDisplayDriver_SDL_GL2.cpp
|
||||
AerofoilSDL/GpInputDriver_SDL_Gamepad.cpp
|
||||
@@ -307,7 +258,7 @@ if(CMAKE_HOST_UNIX)
|
||||
${SDL2_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(AerofoilX ${SDL2_LIBRARIES} GpApp GpShell GpFontHandler_FreeType2)
|
||||
target_link_libraries(AerofoilX ${SDL2_LIBRARIES} GpApp GpShell)
|
||||
endif()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user