/* ** Command & Conquer Generals(tm) ** Copyright 2025 Electronic Arts Inc. ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . */ //////////////////////////////////////////////////////////////////////////////// // // // (c) 2001-2003 Electronic Arts Inc. // // // //////////////////////////////////////////////////////////////////////////////// #include "always.h" #include "hanim.h" #include "proto.h" #include "rendobj.h" #include "LightEnvironment.h" #include "w3d_file.h" #include "dx8vertexbuffer.h" #include "dx8indexbuffer.h" #include "shader.h" #include "vertmaterial.h" #include "Lib/BaseType.h" #pragma once #ifndef __W3DGRANNY_H_ #define __W3DGRANNY_H_ #ifdef INCLUDE_GRANNY_IN_BUILD #include "granny.h" class GrannyRenderObjSystem; ///Set_Shininess(0.0); m_vertexMaterial->Set_Specular(0,0,0); m_vertexMaterial->Set_Lighting(true); } struct grannyMeshDesc { const UnsignedInt *index; ///< pointer to pool of face indices Int indexCount; ///< number of face indices in this mesh const granny_pnt332_vertex *vertex; ///< pointer to pool of mesh vertices Int vertexCount; ///< number of vertices in this mesh. }; virtual ~GrannyPrototypeClass(void) { if (m_vertexMaterial) REF_PTR_RELEASE (m_vertexMaterial); if (m_file) GrannyFreeFile(m_file); } virtual const char * Get_Name(void) const { return m_name; } virtual int Get_Class_ID(void) const { return RenderObjClass::CLASSID_UNKNOWN; } virtual RenderObjClass * Create(void) { return NEW_REF( GrannyRenderObjClass, (*this) ); } void Set_Name(char *name) {strcpy(m_name,name);} void setBoundingBox(AABoxClass & box) {m_boundingBox=box;} void setBoundingSphere(SphereClass & sphere) {m_boundingSphere=sphere;} void setVertexCount(Int vertexCount) {m_vertexCount=vertexCount;} void setIndexCount(Int indexCount) {m_indexCount=indexCount;} void setMeshCount(Int meshCount) {m_meshCount=meshCount;} void setMeshData(grannyMeshDesc &meshdesc, Int index) {m_meshData[index]=meshdesc;} const UnsignedInt *getMeshIndexList(int index) const { if (index < m_meshCount) return m_meshData[0].index; else return NULL;} const granny_pnt332_vertex *getMeshVertexList(int index) const { if (index < m_meshCount) return m_meshData[0].vertex; else return NULL;} const Int getIndexCount(void) const {return m_indexCount;} //return total number of indices in model private: granny_file *m_file; ///