From 545678314f18b9ca57af88b6abe5f80ea119a5e4 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 28 Oct 2026 12:11:17 +0000 Subject: [PATCH] Decompile fn_02254 (LightmappedBuffer::Clear) Batch #1389 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_02254 LightmappedBuffer::Clear: logic confirmed by peer review Reviewed-by: ragnarok-clanker --- .../Primitives/LightmappedPrimitive.cpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Source/Render/Primitives/LightmappedPrimitive.cpp b/Source/Render/Primitives/LightmappedPrimitive.cpp index f49a1d7..75aafef 100644 --- a/Source/Render/Primitives/LightmappedPrimitive.cpp +++ b/Source/Render/Primitives/LightmappedPrimitive.cpp @@ -1,6 +1,7 @@ #include "Render/Primitives/DepthAlpha.h" #include "Render/Primitives/LightmappedPrimitive.h" +#include #include #include #include @@ -12,6 +13,26 @@ LightmappedCommand::LightmappedCommand() : vertices(nullptr), vertexCount(0), indices(nullptr), indexCount(0), texture(nullptr), lightmap(nullptr), primitiveType(D3DPT_TRIANGLESTRIP) { } +struct LightmappedBuffer { + void* vertices; + int count; + void* indices; + void Clear(); +}; + +// OFFSET: 0x00569310 +// FUNCTION: fn_02254 +void LightmappedBuffer::Clear() { + if (this->vertices) { + std::free(this->vertices); + this->vertices = nullptr; + } + if (this->indices) { + std::free(this->indices); + this->indices = nullptr; + } +} + // OFFSET: 0x00569020 // FUNCTION: fn_02246 LightmappedPrimitive::LightmappedPrimitive() : vertices(this->quad), vertexCount(4), indices(nullptr), indexCount(0), primitiveType(D3DPT_TRIANGLESTRIP) {