spritemodel.h 1.4 KB

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