From 5ac25db7f860eae62caf13b8a0f21a0a84babbce Mon Sep 17 00:00:00 2001 From: Benau Date: Sat, 2 Apr 2016 12:55:20 +0800 Subject: [PATCH] Initial work to support transparent kart in ghost replay --- lib/irrlicht/include/EMaterialTypes.h | 9 +++++++++ lib/irrlicht/include/IMesh.h | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/lib/irrlicht/include/EMaterialTypes.h b/lib/irrlicht/include/EMaterialTypes.h index 086ca3459..364f01aaf 100644 --- a/lib/irrlicht/include/EMaterialTypes.h +++ b/lib/irrlicht/include/EMaterialTypes.h @@ -10,6 +10,15 @@ namespace irr namespace video { + //! Flag for karts in STK to use specific material + enum E_CUSTOM_MATERIAL_TYPE + { + ECMT_DEFAULT = 0, + ECMT_TRANSPARENT, + ECMT_RED, + ECMT_BLUE + }; + //! Abstracted and easy to use fixed function/programmable pipeline material modes. enum E_MATERIAL_TYPE { diff --git a/lib/irrlicht/include/IMesh.h b/lib/irrlicht/include/IMesh.h index 8e0bcc2d3..22e1a550e 100644 --- a/lib/irrlicht/include/IMesh.h +++ b/lib/irrlicht/include/IMesh.h @@ -23,6 +23,9 @@ namespace scene class IMesh : public virtual IReferenceCounted { public: + IMesh() : cmt(video::ECMT_DEFAULT) {} + + virtual ~IMesh() {} //! Get the amount of mesh buffers. /** \return Amount of mesh buffers (IMeshBuffer) in this mesh. */ @@ -66,6 +69,15 @@ namespace scene indices have changed. Otherwise, changes won't be updated on the GPU in the next render cycle. */ virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) = 0; + + //! Set the mesh to use custom material type (mainly karts in STK) + /** \param m New custom material type for the mesh. */ + void setCustomMaterialType(video::E_CUSTOM_MATERIAL_TYPE m) { cmt = m; } + + //! Get the mesh to use custom material type (mainly karts in STK) + video::E_CUSTOM_MATERIAL_TYPE getCustomMaterialType() const { return cmt; } + private: + video::E_CUSTOM_MATERIAL_TYPE cmt; }; } // end namespace scene