Rewrite comments that told the story of past rounds instead of the current code: dated "fixed on / tried on / reverted on" notes, "this used to...", "stale paragraph removed", "Phase 1/2" progress labels, and the "ClassifyTile still does not use ClassifyBox" claim (it does now, via VF_ClassifyBoxWithWarpRetry). Every invariant, unit, sign convention, trap and measurement that justified the design is kept, rephrased in the present tense and in its original language (French or English). Also fix comments that named symbols removed in the dead-code commit (EvaluateSDF wrapper, FTunnelCoreWorldEvaluation support-floor fields, BlendChunks -> TransitionBlendChunks) and the stale function name in the VF_RollStrateParamsDetailed determinism checkf message. Comment and message text only; no code token changed. Tests untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01URDGLsu7c4nunqNFPJEFPU
55 lines
1.8 KiB
C++
55 lines
1.8 KiB
C++
// VoxelForgeModule.cpp
|
|
// Module implementation - boilerplate
|
|
|
|
#include "VoxelForgeModule.h"
|
|
#include "VoxelStackSampler.h"
|
|
#include "VoxelGenerator.h"
|
|
#include "VoxelMarchingCubesMesher.h"
|
|
#include "Misc/CommandLine.h"
|
|
#include "Misc/Parse.h"
|
|
|
|
#if PLATFORM_WINDOWS
|
|
#include <math.h>
|
|
#endif
|
|
|
|
// This macro registers our module with Unreal
|
|
// "VoxelForge" must match the module name in VoxelForge.Build.cs and .uplugin
|
|
IMPLEMENT_MODULE(FVoxelForgeModule, VoxelForge)
|
|
|
|
void FVoxelForgeModule::StartupModule()
|
|
{
|
|
// Called when plugin loads
|
|
// Keep this diagnostic before any plugin-owned generation can begin. The UCRT may select
|
|
// its FMA3 math implementations during process startup; this switch lets the canonical export
|
|
// compare that path with the non-FMA3 implementation on the same machine.
|
|
#if PLATFORM_WINDOWS
|
|
const int32 Fma3Before = _get_FMA3_enable();
|
|
int32 RequestedFma3 = 0;
|
|
const bool bHasFma3Override = FParse::Value(
|
|
FCommandLine::Get(), TEXT("voxel.CrtFma3="), RequestedFma3);
|
|
if (bHasFma3Override)
|
|
{
|
|
_set_FMA3_enable(RequestedFma3 != 0 ? 1 : 0);
|
|
}
|
|
const int32 Fma3After = _get_FMA3_enable();
|
|
UE_LOG(LogTemp, Log,
|
|
TEXT("VoxelForge CRT FMA3 diagnostic: before=%d override=%s requested=%d after=%d"),
|
|
Fma3Before,
|
|
bHasFma3Override ? TEXT("yes") : TEXT("no"),
|
|
RequestedFma3,
|
|
Fma3After);
|
|
#endif
|
|
// Resolve the command line once while the module is starting, before any generation task is
|
|
// submitted, instead of lazily from worker-side density/mesher calls.
|
|
VoxelGenLOD::InitializeConsoleSwitches();
|
|
UVoxelMarchingCubesMesher::InitializeConsoleSwitches();
|
|
UE_LOG(LogTemp, Log, TEXT("VoxelForge module started!"));
|
|
}
|
|
|
|
void FVoxelForgeModule::ShutdownModule()
|
|
{
|
|
// Called when plugin unloads
|
|
FVoxelStackSampler::Get().Shutdown();
|
|
UE_LOG(LogTemp, Log, TEXT("VoxelForge module shutdown."));
|
|
}
|