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) {