From ca360204743ecdfd5919d0f8db07c16a86159e2f Mon Sep 17 00:00:00 2001 From: aixxe Date: Mon, 19 Dec 2016 21:13:48 +0000 Subject: [PATCH] Add IVModelRender interface. Signed-off-by: aixxe --- include/cstrike/Interfaces/IVModelRender.h | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 include/cstrike/Interfaces/IVModelRender.h diff --git a/include/cstrike/Interfaces/IVModelRender.h b/include/cstrike/Interfaces/IVModelRender.h new file mode 100644 index 0000000..bf452db --- /dev/null +++ b/include/cstrike/Interfaces/IVModelRender.h @@ -0,0 +1,55 @@ +#pragma once + +typedef unsigned short ModelInstanceHandle_t; + +class model_t; +class studiohdr_t; +class studiohwdata_t; +class IClientRenderable; +class matrix3x4_t; +class StudioDecalHandle_t; +class IMaterial; + +struct DrawModelState_t { + studiohdr_t* m_pStudioHdr; + studiohwdata_t* m_pStudioHWData; + IClientRenderable* m_pRenderable; + const matrix3x4_t* m_pModelToWorld; + StudioDecalHandle_t* m_decals; + int m_drawFlags; + int m_lod; +}; + +struct ModelRenderInfo_t { + Vector origin; + QAngle angles; + IClientRenderable* pRenderable; + const model_t* pModel; + const matrix3x4_t* pModelToWorld; + const matrix3x4_t* pLightingOffset; + const Vector* pLightingOrigin; + int flags; + int entity_index; + int skin; + int body; + int hitboxset; + ModelInstanceHandle_t instance; +}; + +enum OverrideType_t: int { + OVERRIDE_NORMAL = 0, + OVERRIDE_BUILD_SHADOWS, + OVERRIDE_DEPTH_WRITE, + OVERRIDE_SSAO_DEPTH_WRITE, +}; + +class IVModelRender { + public: + void ForcedMaterialOverride(IMaterial* material, OverrideType_t override_type = OVERRIDE_NORMAL) { + GetVirtualFunction(this, 1)(this, material, override_type); + } + + void DrawModelExecute(DrawModelState_t const& state, ModelRenderInfo_t const& info, matrix3x4_t* bone) { + GetVirtualFunction(this, 19)(this, state, info, bone); + } +}; \ No newline at end of file