Standalone/ (C++20, MSVC /O2 /arch:AVX2 /fp:precise, Build.ps1): copied density pipeline, op stack, cave morphology, passages, strate manager/composer, noise, DetSinCos, mesher, clipmap selection, with a UE compatibility layer (Compat/). Owner data exported once to Standalone/data/owner_world.json by a default-off explore-commandlet exporter (the only plugin-source change). 25 cm voxels. Parity: seed 0, 3,436 samples (strate edges, negative/far coords, rooms, tunnels, passages, landings): bit-identical. Viewer: full 7-level clipmap, per-level toggles 1-7, T = round winding tunnels (standalone option), N/P seed, F wireframe. Timing NOT yet a baseline: 515 s for 12,054 tiles (L0 70 s, L6 296 s); the compat TMap/TSet are vector-backed with linear lookup, which the plugin's caches do not expect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MmSoF64BbRFmk9C3p1VsBJ
60 lines
2.9 KiB
PowerShell
60 lines
2.9 KiB
PowerShell
[CmdletBinding()]
|
|
param()
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
$Root = [IO.Path]::GetFullPath($PSScriptRoot)
|
|
$BuildDir = Join-Path $Root 'Build'
|
|
$BinDir = Join-Path $Root 'bin'
|
|
[IO.Directory]::CreateDirectory($BuildDir) | Out-Null
|
|
[IO.Directory]::CreateDirectory($BinDir) | Out-Null
|
|
$VcVars = 'E:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat'
|
|
if (-not (Test-Path -LiteralPath $VcVars -PathType Leaf)) { throw "MSVC environment script not found: $VcVars" }
|
|
|
|
$Sources = @(
|
|
(Join-Path $Root 'Source\StandaloneViewer.cpp'),
|
|
(Join-Path $Root 'Compat\UnrealPerlin.cpp'),
|
|
(Join-Path $Root 'Compat\StandaloneDataAssetGlue.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelBiomeDefinition.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelCaveMorphology.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelDensityAblation.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelDensityOpStack.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelDensityProfile.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelDiffLayer.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelGenerator.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelHeightOpStack.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelMarchingCubesMesher.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelSettings.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelStrateComposer.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelStrateManager.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelStrateMeasure.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelTerrainOpDefinition.cpp'),
|
|
(Join-Path $Root 'Source\VoxelForge\Private\VoxelWormField.cpp')
|
|
)
|
|
foreach ($Source in $Sources) {
|
|
if (-not (Test-Path -LiteralPath $Source -PathType Leaf)) { throw "Required source is missing: $Source" }
|
|
}
|
|
|
|
$ResponsePath = Join-Path $BuildDir 'standalone.rsp'
|
|
$RspLines = @(
|
|
'/nologo', '/std:c++20', '/O2', '/arch:AVX2', '/fp:precise', '/EHsc',
|
|
'/D_CRT_SECURE_NO_WARNINGS',
|
|
('/I"{0}"' -f (Join-Path $Root 'Compat')),
|
|
('/I"{0}"' -f (Join-Path $Root 'Source')),
|
|
('/I"{0}"' -f (Join-Path $Root 'Source\VoxelForge\Public')),
|
|
('/I"{0}"' -f (Join-Path $Root 'Source\VoxelForge\Private')),
|
|
('/Fe"{0}"' -f (Join-Path $BinDir 'VoxelForgeStandalone.exe'))
|
|
)
|
|
foreach ($Source in $Sources) { $RspLines += ('"{0}"' -f $Source) }
|
|
$RspLines += @('/link','d3d11.lib','dxgi.lib','d3dcompiler.lib','user32.lib','gdi32.lib')
|
|
[IO.File]::WriteAllLines($ResponsePath,$RspLines,[Text.UTF8Encoding]::new($false))
|
|
|
|
Push-Location $BuildDir
|
|
try {
|
|
$CommandLine = 'call "{0}" >nul && cl.exe @"{1}"' -f $VcVars,$ResponsePath
|
|
& $env:ComSpec /d /s /c $CommandLine
|
|
if ($LASTEXITCODE -ne 0) { throw "Standalone MSVC build failed with exit code $LASTEXITCODE" }
|
|
} finally {
|
|
Pop-Location
|
|
}
|
|
Write-Host "Built $((Join-Path $BinDir 'VoxelForgeStandalone.exe'))"
|