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
This commit is contained in:
ragnarok-clanker 2026-10-28 12:11:17 +00:00
commit 545678314f

View file

@ -1,6 +1,7 @@
#include "Render/Primitives/DepthAlpha.h"
#include "Render/Primitives/LightmappedPrimitive.h"
#include <cstdlib>
#include <cstring>
#include <windows.h>
#include <d3d9types.h>
@ -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) {