rodecomp/Source/Render/Primitives/RenderPrimitive.h
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

66 lines
1.4 KiB
C++

#ifndef RAGNAROK_SOURCE_RENDER_PRIMITIVES_RENDERPRIMITIVE_H
#define RAGNAROK_SOURCE_RENDER_PRIMITIVES_RENDERPRIMITIVE_H
#include <cstddef>
#include <cstdint>
class CTexture;
struct RenderVertex {
float x;
float y;
float z;
float rhw;
std::uint32_t diffuse;
std::uint32_t specular;
float u;
float v;
RenderVertex* Reset();
};
struct RenderTriangle {
RenderVertex vertices[3];
CTexture* texture;
std::uint32_t unknown_0064;
std::uint32_t unknown_0068;
bool Visible() const;
};
struct RenderCommand {
RenderVertex* vertices;
std::int32_t vertexCount;
CTexture* texture;
std::uint16_t* indices;
std::uint32_t indexCount;
std::uint16_t unknown_0014;
std::uint16_t unknown_0016;
std::uint32_t unknown_0018;
std::uint32_t unknown_001C;
std::uint32_t unknown_0020;
std::uint32_t primitiveType;
RenderCommand();
RenderCommand* FreeVertices();
void AllocateTriangles(std::uint32_t triangleCount);
void SetPosition(std::uint32_t index, const float* position);
void Draw(int unused);
};
struct RenderPrimitive : RenderCommand {
RenderVertex quad[4];
RenderPrimitive();
RenderPrimitive(const RenderPrimitive& other);
RenderPrimitive& operator=(const RenderPrimitive& other);
};
static_assert(sizeof(RenderVertex) == 32);
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(RenderCommand) == 40);
static_assert(sizeof(RenderTriangle) == 108);
static_assert(sizeof(RenderPrimitive) == 168);
#endif
#endif