standalone: VoxelForgeCore link-safe next to Unreal -- internals in vfcore::detail, symbol check
- The copied generator, mesher and Compat stand-ins compile inside vfcore::detail. - CheckCoreSymbols.ps1 (run by Build.ps1) fails on any unqualified Unreal-style symbol in the library: 16,255 on557f6aa, 0 now. A UE 5.7 CoreMinimal.h + VoxelForgeCore.h smoke compile passes. - Output identical: 11 hash rows at W1/W8, routes 5642/5642, look/passage/far audits pass, bad-shell control fails, six captures byte-identical. Cost, measured by me interleaved (8 workers, cold, 4 runs each, first run excluded): 0.963 s vs 0.937 s for557f6aa, ~27 ms in shape compilation; same math, so codegen/inlining. To be found. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MmSoF64BbRFmk9C3p1VsBJ
This commit is contained in:
1 parent
557f6aac30
commit
aeeedaa73d
11 files changed
+461
-87
No files matched your search
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
// Every standard or platform header used by the copied implementation must be included before
|
||||
// its wrapper opens vfcore::detail. This prevents system declarations from being nested in the
|
||||
// private namespace when the implementation includes its Unreal-shaped compatibility headers.
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <bit>
|
||||
#include <cassert>
|
||||
#include <cctype>
|
||||
#include <charconv>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <condition_variable>
|
||||
#include <cstdarg>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <functional>
|
||||
#include <immintrin.h>
|
||||
#include <initializer_list>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <math.h>
|
||||
#include <memory>
|
||||
#include <memory_resource>
|
||||
#include <mutex>
|
||||
#include <new>
|
||||
#include <numeric>
|
||||
#include <optional>
|
||||
#include <shared_mutex>
|
||||
#include <span>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <thread>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
// VFJson is a small, stateless standalone input parser with no Unreal-shaped names. Keeping its
|
||||
// value tree shared lets the viewer resolve its reference world and Core snapshot from one parse.
|
||||
#include "Json.h"
|
||||
@@ -1,12 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "OwnerWorldLoader.h"
|
||||
#include "Json.h"
|
||||
#include "VoxelForgeCore/VoxelForgeCore.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace VoxelForgeCore
|
||||
{
|
||||
// Private standalone adapter: keeps the compatibility holders behind the public value API.
|
||||
ResolvedWorldSnapshot MakeStandaloneSnapshot(std::shared_ptr<FStandaloneOwnerWorld> owner);
|
||||
// Standalone-only bridge. Core parses into its namespaced compatibility snapshot and applies
|
||||
// the same command-line overrides as the viewer's reference loader.
|
||||
ResolvedWorldSnapshot MakeStandaloneSnapshotFromParsedJson(const VFJson::Value& jsonRoot,
|
||||
std::int32_t seed,std::int32_t clipRadius,std::int32_t maxLodOverride,
|
||||
bool roundTunnels,bool enhancedTunnelWalls,std::string& error);
|
||||
}
|
||||
@@ -1,20 +1,18 @@
|
||||
#include "CoreNamespacePreamble.h"
|
||||
#include "StandaloneSnapshotAdapter.h"
|
||||
#include "VoxelForgeCore/VoxelForgeCore.h"
|
||||
|
||||
namespace vfcore::detail
|
||||
{
|
||||
#include "FarShellsInternal.h"
|
||||
#include "VoxelClipmapDesiredTiles.h"
|
||||
#include "VoxelMarchingCubesMesher.h"
|
||||
#include "VoxelForgeCore/VoxelForgeCore.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <bit>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
#include <numeric>
|
||||
#include <stdexcept>
|
||||
}
|
||||
|
||||
namespace VoxelForgeCore
|
||||
{
|
||||
using namespace ::vfcore::detail;
|
||||
|
||||
struct ResolvedWorldSnapshot::Data
|
||||
{
|
||||
std::shared_ptr<FStandaloneOwnerWorld> owner;
|
||||
@@ -185,8 +183,36 @@ namespace VoxelForgeCore
|
||||
}
|
||||
};
|
||||
|
||||
ResolvedWorldSnapshot MakeStandaloneSnapshot(std::shared_ptr<FStandaloneOwnerWorld> owner)
|
||||
{ return detail_StandaloneSnapshotAdapter::FromOwner(std::move(owner)); }
|
||||
ResolvedWorldSnapshot MakeStandaloneSnapshotFromParsedJson(const VFJson::Value& jsonRoot,
|
||||
std::int32_t seed,std::int32_t clipRadius,std::int32_t maxLodOverride,
|
||||
bool roundTunnels,bool enhancedTunnelWalls,std::string& error)
|
||||
{
|
||||
auto owner=std::make_shared<FStandaloneOwnerWorld>();
|
||||
if(!StandaloneOwnerLoader::Resolve(jsonRoot,*owner,error))return {};
|
||||
|
||||
const bool seedChanged=owner->Seed!=seed;
|
||||
owner->Settings->Seed=seed;
|
||||
owner->Seed=seed;
|
||||
owner->ClipRadius=clipRadius;
|
||||
owner->Settings->ClipRadius=clipRadius;
|
||||
if(seedChanged)
|
||||
{
|
||||
owner->Manager=std::make_unique<UVoxelStrateManager>();
|
||||
if(!owner->Manager->Initialize(owner->Settings.get(),seed))
|
||||
{error="standalone copied strate manager failed while applying viewer settings";return {};}
|
||||
owner->Generator=std::make_unique<UVoxelGenerator>();
|
||||
owner->Generator->InitializeSettings(owner->Settings.get());
|
||||
owner->Generator->SetStrateManager(owner->Manager.get());
|
||||
}
|
||||
owner->Generator->bStandaloneResearchRoundTunnels=roundTunnels;
|
||||
owner->Generator->bStandaloneResearchEnhancedWalls=enhancedTunnelWalls;
|
||||
if(maxLodOverride>=0)
|
||||
{
|
||||
owner->MaxClipLevel=maxLodOverride;
|
||||
owner->Settings->MaxClipLevel=maxLodOverride;
|
||||
}
|
||||
return detail_StandaloneSnapshotAdapter::FromOwner(std::move(owner));
|
||||
}
|
||||
|
||||
std::optional<ResolvedWorldSnapshot> ResolvedWorldSnapshot::FromJson(
|
||||
std::string_view json,std::string& error)
|
||||
|
||||
Reference in new issue
Block a user