mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 23:00:42 +00:00
Fix web build and add export path
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "SDL_main.h"
|
||||
|
||||
#include "GpMain.h"
|
||||
#include "GpAllocator_C.h"
|
||||
#include "GpAudioDriverFactory.h"
|
||||
#include "GpDisplayDriverFactory.h"
|
||||
#include "GpGlobalConfig.h"
|
||||
@@ -28,9 +29,12 @@ IGpAudioDriver *GpDriver_CreateAudioDriver_SDL(const GpAudioDriverProperties &pr
|
||||
IGpInputDriver *GpDriver_CreateInputDriver_SDL2_Gamepad(const GpInputDriverProperties &properties);
|
||||
|
||||
EM_JS(void, InitFileSystem, (), {
|
||||
Asyncify.handleSleep(wakeUp => {
|
||||
FS.mkdir('/aerofoil');
|
||||
Asyncify.handleSleep(wakeUp => {
|
||||
FS.mkdir('/aerofoil');
|
||||
//FS.mkdir('/aerofoil_memfs');
|
||||
FS.mount(IDBFS, {}, '/aerofoil');
|
||||
//FS.mount(MEMFS, {}, '/aerofoil_memfs');
|
||||
//FS.mkdir('/aerofoil_memfs/Export');
|
||||
FS.syncfs(true, function (err) {
|
||||
assert(!err);
|
||||
wakeUp();
|
||||
@@ -40,6 +44,8 @@ EM_JS(void, InitFileSystem, (), {
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
IGpAllocator *alloc = GpAllocator_C::GetInstance();
|
||||
|
||||
InitFileSystem();
|
||||
|
||||
GpLogDriver_Web::Init();
|
||||
@@ -65,6 +71,7 @@ int main(int argc, char* argv[])
|
||||
drivers->SetDriver<GpDriverIDs::kFileSystem>(GpFileSystem_Web::GetInstance());
|
||||
drivers->SetDriver<GpDriverIDs::kSystemServices>(GpSystemServices_Web::GetInstance());
|
||||
drivers->SetDriver<GpDriverIDs::kLog>(GpLogDriver_Web::GetInstance());
|
||||
drivers->SetDriver<GpDriverIDs::kAlloc>(alloc);
|
||||
|
||||
g_gpGlobalConfig.m_displayDriverType = EGpDisplayDriverType_SDL_GL2;
|
||||
|
||||
@@ -83,6 +90,7 @@ int main(int argc, char* argv[])
|
||||
g_gpGlobalConfig.m_osGlobals = &g_gpXGlobals;
|
||||
g_gpGlobalConfig.m_logger = logger;
|
||||
g_gpGlobalConfig.m_systemServices = GpSystemServices_Web::GetInstance();
|
||||
g_gpGlobalConfig.m_allocator = alloc;
|
||||
|
||||
GpDisplayDriverFactory::RegisterDisplayDriverFactory(EGpDisplayDriverType_SDL_GL2, GpDriver_CreateDisplayDriver_SDL_GL2);
|
||||
GpAudioDriverFactory::RegisterAudioDriverFactory(EGpAudioDriverType_SDL2, GpDriver_CreateAudioDriver_SDL);
|
||||
|
Reference in New Issue
Block a user