diff --git a/Source/Render/Primitives/LightmappedPrimitive.cpp b/Source/Render/Primitives/LightmappedPrimitive.cpp index 75aafef2..cfa23083 100644 --- a/Source/Render/Primitives/LightmappedPrimitive.cpp +++ b/Source/Render/Primitives/LightmappedPrimitive.cpp @@ -1,5 +1,6 @@ #include "Render/Primitives/DepthAlpha.h" #include "Render/Primitives/LightmappedPrimitive.h" +#include "Render/Renderer.h" #include #include @@ -13,6 +14,13 @@ LightmappedCommand::LightmappedCommand() : vertices(nullptr), vertexCount(0), indices(nullptr), indexCount(0), texture(nullptr), lightmap(nullptr), primitiveType(D3DPT_TRIANGLESTRIP) { } +// OFFSET: 0x00569090 +// FUNCTION: fn_02247 +ModelRenderCommand::ModelRenderCommand() + : vertices(nullptr), vertexCount(0), texture(nullptr), indices(nullptr), indexCount(0), unknown_0014(1), unknown_0018(0), unknown_001C(0), unknown_0020(0), + primitiveType(D3DPT_TRIANGLELIST) { +} + struct LightmappedBuffer { void* vertices; int count; @@ -54,6 +62,18 @@ LightmappedPrimitive::LightmappedPrimitive(const LightmappedPrimitive& other) : std::memcpy(this->quad, other.quad, sizeof(this->quad)); } +// OFFSET: 0x00569480 +// FUNCTION: fn_02258 +void LightmappedPrimitive::DrawLightmapped(int unused) { + g_renderer->DrawLightmappedPrimitive(this); +} + +// OFFSET: 0x00569490 +// FUNCTION: fn_02259 +void LightmappedPrimitive::DrawAuxiliary(int unused) { + g_renderer->DrawAuxiliaryPrimitive(this); +} + // INLINED LightmappedPrimitivePool::LightmappedPrimitivePool() { this->m_commands.resize(8192, LightmappedPrimitive()); diff --git a/Source/Render/Primitives/LightmappedPrimitive.h b/Source/Render/Primitives/LightmappedPrimitive.h index 666c4c44..1813fe55 100644 --- a/Source/Render/Primitives/LightmappedPrimitive.h +++ b/Source/Render/Primitives/LightmappedPrimitive.h @@ -32,9 +32,27 @@ struct LightmappedCommand { /* 0018 */ std::uint32_t primitiveType; }; +struct ModelRenderCommand { + ModelRenderCommand(); + + /* 0000 */ void* vertices; + /* 0004 */ std::int32_t vertexCount; + /* 0008 */ CTexture* texture; + /* 000C */ std::uint16_t* indices; + /* 0010 */ std::uint32_t indexCount; + /* 0014 */ std::uint16_t unknown_0014; + /* 0016 */ std::uint16_t unknown_0016; + /* 0018 */ std::uint32_t unknown_0018; + /* 001C */ std::uint32_t unknown_001C; + /* 0020 */ std::uint32_t unknown_0020; + /* 0024 */ std::uint32_t primitiveType; +}; + struct LightmappedPrimitive { LightmappedPrimitive(); LightmappedPrimitive(const LightmappedPrimitive& other); + void DrawAuxiliary(int unused); + void DrawLightmapped(int unused); /* 0000 */ LightmappedVertex* vertices; /* 0004 */ std::int32_t vertexCount; @@ -68,6 +86,7 @@ static_assert(sizeof(LightmappedVertex) == 40); #if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(LightmappedPrimitive) == 188); static_assert(sizeof(LightmappedCommand) == 28); +static_assert(sizeof(ModelRenderCommand) == 40); static_assert(sizeof(LightmappedPrimitivePool) == 0x20); static_assert(sizeof(LightmappedQueues) == 0x18); static_assert(offsetof(LightmappedVertex, lightU) == 0x0020);