-/*\r
-Copyright (C) 1999-2007 id Software, Inc. and contributors.\r
-For a list of contributors, see the accompanying CONTRIBUTORS file.\r
-\r
-This file is part of GtkRadiant.\r
-\r
-GtkRadiant is free software; you can redistribute it and/or modify\r
-it under the terms of the GNU General Public License as published by\r
-the Free Software Foundation; either version 2 of the License, or\r
-(at your option) any later version.\r
-\r
-GtkRadiant is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with GtkRadiant; if not, write to the Free Software\r
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\r
-*/\r
-\r
-#ifndef _CPICOMODEL_H_\r
-#define _CPICOMODEL_H_\r
-\r
-#include "plugin.h"\r
-#include "picomodel.h"\r
-\r
-#include "gtkr_vector.h"\r
-\r
-class CPicoParent\r
-{\r
-public:\r
- virtual void UpdateShaders( void ) = 0;\r
-};\r
-\r
-class CModelManager; // forward declaration\r
-\r
-//typedef std::pair<Str, int> PicoModelKey;\r
-typedef pair<Str, int> PicoModelKey;\r
-\r
-class CPicoModel : public IRender, public ISelect\r
-{\r
- friend class CModelManager;\r
-public:\r
- CPicoModel(const PicoModelKey& key);\r
- CPicoModel(const Str& name);\r
- CPicoModel(const Str& name, const int frame);\r
- CPicoModel(const char *name, const int frame);\r
- ~CPicoModel(); \r
- void CPicoModel::load(const char *name, const int frame);\r
- \r
- void IncRef()\r
- {\r
- ++m_refcount;\r
- }\r
- void DecRef()\r
- {\r
- if(--m_refcount == 0)\r
- delete this;\r
- }\r
-\r
- void AddParent( CPicoParent *parent );\r
- void RemoveParent( CPicoParent *parent );\r
-\r
- void Reload( void );\r
-\r
- void Draw(int state, vector<IShader*> shaders, int rflags) const;\r
- //IRender\r
- virtual void Draw( int state, int rflags ) const;\r
- virtual const aabb_t *GetAABB() const { return &m_BBox; }\r
-\r
- //ISelect\r
- virtual bool TestRay( const ray_t *ray, vec_t *dist ) const;\r
-\r
- int GetNumSurfaces( void );\r
- char *GetShaderNameForSurface( const unsigned int surf );\r
-\r
-private:\r
- void AccumulateBBox();\r
-\r
- char *m_name;\r
- int m_frame;\r
- picoModel_t *m_pModel;\r
- unsigned int m_refcount;\r
- aabb_t m_BBox;\r
- GPtrArray *m_children; // array of CPicoSurface\r
- GPtrArray *m_parents; // array of CPicoParent\r
-\r
- GPtrArray* m_shaders;\r
-\r
- bool m_bReloaded; // managed by CModelManager\r
-};\r
-\r
-#endif // _CPICOMODEL_H_\r
+/*
+Copyright (C) 1999-2007 id Software, Inc. and contributors.
+For a list of contributors, see the accompanying CONTRIBUTORS file.
+
+This file is part of GtkRadiant.
+
+GtkRadiant 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 2 of the License, or
+(at your option) any later version.
+
+GtkRadiant 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 GtkRadiant; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef _CPICOMODEL_H_
+#define _CPICOMODEL_H_
+
+#include "plugin.h"
+#include "picomodel.h"
+
+#include "gtkr_vector.h"
+
+class CPicoParent
+{
+public:
+ virtual void UpdateShaders( void ) = 0;
+};
+
+class CModelManager; // forward declaration
+
+//typedef std::pair<Str, int> PicoModelKey;
+typedef pair<Str, int> PicoModelKey;
+
+class CPicoModel : public IRender, public ISelect
+{
+ friend class CModelManager;
+public:
+ CPicoModel(const PicoModelKey& key);
+ CPicoModel(const Str& name);
+ CPicoModel(const Str& name, const int frame);
+ CPicoModel(const char *name, const int frame);
+ ~CPicoModel();
+ void CPicoModel::load(const char *name, const int frame);
+
+ void IncRef()
+ {
+ ++m_refcount;
+ }
+ void DecRef()
+ {
+ if(--m_refcount == 0)
+ delete this;
+ }
+
+ void AddParent( CPicoParent *parent );
+ void RemoveParent( CPicoParent *parent );
+
+ void Reload( void );
+
+ void Draw(int state, vector<IShader*> shaders, int rflags) const;
+ //IRender
+ virtual void Draw( int state, int rflags ) const;
+ virtual const aabb_t *GetAABB() const { return &m_BBox; }
+
+ //ISelect
+ virtual bool TestRay( const ray_t *ray, vec_t *dist ) const;
+
+ int GetNumSurfaces( void );
+ char *GetShaderNameForSurface( const unsigned int surf );
+
+private:
+ void AccumulateBBox();
+
+ char *m_name;
+ int m_frame;
+ picoModel_t *m_pModel;
+ unsigned int m_refcount;
+ aabb_t m_BBox;
+ GPtrArray *m_children; // array of CPicoSurface
+ GPtrArray *m_parents; // array of CPicoParent
+
+ GPtrArray* m_shaders;
+
+ bool m_bReloaded; // managed by CModelManager
+};
+
+#endif // _CPICOMODEL_H_