Eliminate lpx-paths.hpp, which contains hardwired paths.

This commit is contained in:
2026-02-25 17:22:26 -05:00
parent 816c3f6a0d
commit 56dc1319c1
4 changed files with 11 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
#include "LockedWrapper.h"
#include "lpx-drvutil.hpp"
#include "lpx-paths.hpp"
#include "Misc/Paths.h"
using namespace LpxCommonTypes;
@@ -17,7 +17,13 @@ void FlxLockedWrapper::InitWrapper() {
// Already initialized.
return;
}
FString dll((const UTF8CHAR*)LUPREX_DLL_PATH);
#if PLATFORM_LINUX
FString dll = FPaths::Combine(FPaths::ProjectDir(), TEXT("luprex/build/Linux/luprexlib.so"));
#elif PLATFORM_WINDOWS
FString dll = FPaths::Combine(FPaths::ProjectDir(), TEXT("luprex/build/Windows/luprexlib.dll"));
#else
#error "Unsupported platform"
#endif
UE_LOG(LogLuprex, Verbose, TEXT("Luprex DLL Path: %s"), *dll);
void* DLL = FPlatformProcess::GetDllHandle(*dll);
if (DLL != nullptr) {

View File

@@ -2,7 +2,7 @@
#include "LuprexGameModeBase.h"
#include "lpx-drvutil.hpp"
#include "lpx-paths.hpp"
#include "Misc/Paths.h"
#include "Tangible.h"
#include "TangibleManager.h"
#include "LuaCall.h"
@@ -41,7 +41,8 @@ uint32 ALuprexGameModeBase::Run() {
if (lockedwrap->get_rescan_lua_source(lockedwrap.Get()))
{
drvutil::ostringstream srcpak;
std::string srcpakerr = drvutil::package_lua_source(LUPREX_ROOT_PATH, &srcpak);
FString LuprexRoot = FPaths::Combine(FPaths::ProjectDir(), TEXT("luprex"));
std::string srcpakerr = drvutil::package_lua_source(TCHAR_TO_UTF8(*LuprexRoot), &srcpak);
if (!srcpakerr.empty())
{
FString FMessage((const UTF8CHAR *)(srcpakerr.c_str()));