]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - plugins/spritemodel/spritemodel.h
reformat code! now the code is only ugly on the *inside*
[xonotic/netradiant.git] / plugins / spritemodel / spritemodel.h
1 /*
2    Copyright (C) 2002 Dominic Clifton.
3
4    This file is part of GtkRadiant.
5
6    GtkRadiant is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10
11    GtkRadiant is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with GtkRadiant; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  */
20
21 //
22 // Sprite Model Plugin
23 //
24 // Code by Hydra aka Dominic Clifton
25 //
26 // Based on MD3Model source code by SPoG
27 //
28
29 #include "plugin.h"
30
31 /*! i guess a description should go here... */
32 class CSpriteModel : public IRender //, public ISelect
33 {
34 public:
35     CSpriteModel();
36
37     ~CSpriteModel();
38
39     void IncRef()
40     { refCount++; }
41
42     void DecRef()
43     {
44         if (--refCount == 0) {
45             delete this;
46         }
47     }
48
49 //IRender
50     void Draw(int state, int rflags) const;
51
52     const aabb_t *GetAABB() const
53     { return &m_BBox; }
54
55 //ISelect
56 //bool TestRay (const ray_t *ray, vec_t *dist) const;
57
58     void Construct(IShader *pShader);
59
60 protected:
61     IShader *m_pShader;
62
63 private:
64     int refCount;
65     aabb_t m_BBox;
66 };
67
68 void LoadSpriteModel(entity_interfaces_t *interfaces, const char *name);