#ifndef RAGNAROK_SOURCE_CONTENTS_MODELS_MODELRENDERING_H #define RAGNAROK_SOURCE_CONTENTS_MODELS_MODELRENDERING_H #include "Render/Primitives/RenderPrimitive.h" #include struct RenderProjection; struct RenderQueues; class RenderCommandPool; class RenderVertexPool; class C3dNode; struct ModelTextureTransform; struct ModelFaceState { std::uint32_t colors[3]; float uv[3][2]; }; struct ModelLightingContext { const float* position; const std::uint32_t* color; const float* direction; const float* diffuse; const float* ambient; const int* shade; const class GroundGeometry& ground; std::array colors{}; }; struct ModelRenderContext { const RenderProjection& projection; RenderCommandPool& commands; RenderVertexPool& vertices; RenderQueues& queues; const int& width; const int& height; const bool& depthAlpha; const float& depthStart; const float& depthEnd; const bool& overrideColor; const bool& integerColor; const float* overrideScale; const float* colorScale; std::array legacyProjected{}; std::array modernProjected{}; ModelRenderContext( const RenderProjection& projection, RenderCommandPool& commands, RenderVertexPool& vertices, RenderQueues& queues, const int& width, const int& height, const bool& depthAlpha, const float& depthStart, const float& depthEnd, const bool& overrideColor, const bool& integerColor, const float* overrideScale, const float* colorScale ); }; bool ModelTriangleVisible(const RenderVertex* a, const RenderVertex* b, const RenderVertex* c, const ModelRenderContext& context); void TransformModelUV(float& u, float& v, const ModelTextureTransform& transform); void DrawModelNode(C3dNode& node, const float* matrix, unsigned char reversed, bool clip, unsigned char commandMode, ModelRenderContext& context, bool modern); static_assert(sizeof(ModelFaceState) == 36); #endif