Finish porting to Linux

This commit is contained in:
2023-10-16 16:54:41 -04:00
parent 320b4dd714
commit f647025a97
4 changed files with 34 additions and 21 deletions

View File

@@ -71,3 +71,12 @@ ConnectionType=USBOnly
bUseManualIPAddress=False bUseManualIPAddress=False
ManualIPAddress= ManualIPAddress=
[/Script/LinuxTargetPlatform.LinuxTargetSettings]
SpatializationPlugin=
SourceDataOverridePlugin=
ReverbPlugin=
OcclusionPlugin=
SoundCueCookQualityIndex=-1
-TargetedRHIs=SF_VULKAN_SM5
+TargetedRHIs=SF_VULKAN_SM6

View File

@@ -2,6 +2,7 @@
#include "IntegrationGameModeBase.h" #include "IntegrationGameModeBase.h"
#include "lpx-drvutil.hpp" #include "lpx-drvutil.hpp"
#include "lpx-paths.hpp"
#include "DebugPrint.h" #include "DebugPrint.h"
#include "Tangible.h" #include "Tangible.h"
#include "TangibleManager.h" #include "TangibleManager.h"
@@ -193,22 +194,25 @@ void AIntegrationGameModeBase::BeginPlay()
if (w->play_initialize != nullptr) if (w->play_initialize != nullptr)
{ {
drvutil::ostringstream srcpak; drvutil::ostringstream srcpak;
std::string srcpakerr = drvutil::package_lua_source("c:\\Luprex", &srcpak); std::string srcpakerr = drvutil::package_lua_source(LUPREX_ROOT_PATH, &srcpak);
if (!srcpakerr.empty()) if (!srcpakerr.empty())
{ {
DPrint(srcpakerr.c_str()); DPrint(srcpakerr.c_str());
} }
std::string_view srcpakv = srcpak.view(); else
char* argv[1];
argv[0] = const_cast<char*>("lpxserver");
w->play_initialize(w.Get(), 1, argv, srcpakv.size(), srcpakv.data(), "");
if (w->error[0])
{ {
DPrint(w->error); std::string_view srcpakv = srcpak.view();
} char* argv[1];
if (w->engine != nullptr) { argv[0] = const_cast<char*>("lpxserver");
DPrint("Luprex initialize success"); w->play_initialize(w.Get(), 1, argv, srcpakv.size(), srcpakv.data(), "");
Playing = true; if (w->error[0])
{
DPrint(w->error);
}
if (w->engine != nullptr) {
DPrint("Luprex initialize success");
Playing = true;
}
} }
} }

View File

@@ -2,6 +2,7 @@
#include "LockedWrapper.h" #include "LockedWrapper.h"
#include "DebugPrint.h" #include "DebugPrint.h"
#include "lpx-drvutil.hpp" #include "lpx-drvutil.hpp"
#include "lpx-paths.hpp"
using namespace CommonTypes; using namespace CommonTypes;
@@ -10,7 +11,9 @@ void FlxLockedWrapper::InitWrapper() {
// Already initialized. // Already initialized.
return; return;
} }
void* DLL = FPlatformProcess::GetDllHandle(TEXT("c:\\Luprex\\build\\visual\\luprexlib.dll")); FString dll((const UTF8CHAR*)LUPREX_DLL_PATH);
DebugPrint::DPrint(dll);
void* DLL = FPlatformProcess::GetDllHandle(*dll);
if (DLL != nullptr) { if (DLL != nullptr) {
using InitFn = void (*)(EngineWrapper*); using InitFn = void (*)(EngineWrapper*);
InitFn init = (InitFn)FPlatformProcess::GetDllExport(DLL, TEXT("init_engine_wrapper")); InitFn init = (InitFn)FPlatformProcess::GetDllExport(DLL, TEXT("init_engine_wrapper"));

View File

@@ -11,13 +11,10 @@ LUPREX=$HOME/luprex
rm -f Source/Integration/lpx-*.hpp rm -f Source/Integration/lpx-*.hpp
rm -f Source/Integration/lpx-*.cpp rm -f Source/Integration/lpx-*.cpp
rm -f Binaries/Linux/luprexlib.so
mkdir -p Binaries/Linux
echo '#include "'$LUPREX'/ext/base-writer.hpp"' > Source/Integration/lpx-basewriter.hpp
echo '#include "'$LUPREX'/cpp/drv/drvutil.hpp"' > Source/Integration/lpx-drvutil.hpp
echo '#include "'$LUPREX'/cpp/drv/drvutil.cpp"' > Source/Integration/lpx-drvutil.cpp
echo '#include "'$LUPREX'/cpp/core/enginewrapper.hpp"' > Source/Integration/lpx-enginewrapper.hpp
ln -s $LUPREX/build/linux/luprexlib.so Binaries/Linux/luprexlib.so
echo '#include "'$LUPREX'/ext/base-writer.hpp"' > Source/Integration/lpx-basewriter.hpp
echo '#include "'$LUPREX'/cpp/drv/drvutil.hpp"' > Source/Integration/lpx-drvutil.hpp
echo '#include "'$LUPREX'/cpp/drv/drvutil.cpp"' > Source/Integration/lpx-drvutil.cpp
echo '#include "'$LUPREX'/cpp/core/enginewrapper.hpp"' > Source/Integration/lpx-enginewrapper.hpp
echo '#define LUPREX_DLL_PATH "'$LUPREX'/build/linux/luprexlib.so"' > Source/Integration/lpx-paths.hpp
echo '#define LUPREX_ROOT_PATH "'$LUPREX'"' >> Source/Integration/lpx-paths.hpp