Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.1 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef ENGINESPRITE_H
  8. #define ENGINESPRITE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "mathlib/vector.h"
  13. #include "avi/iavi.h"
  14. #include "avi/ibik.h"
  15. #include "const.h"
  16. //-----------------------------------------------------------------------------
  17. // Forward declarations
  18. //-----------------------------------------------------------------------------
  19. class IMaterial;
  20. class IMaterialVar;
  21. typedef struct wrect_s wrect_t;
  22. //-----------------------------------------------------------------------------
  23. // Purpose: Sprite Models
  24. //-----------------------------------------------------------------------------
  25. class CEngineSprite
  26. {
  27. // NOTE: don't define a constructor or destructor so that this can be allocated
  28. // as before.
  29. public:
  30. int GetWidth() { return m_width; }
  31. int GetHeight() { return m_height; }
  32. int GetNumFrames() { return m_numFrames; }
  33. IMaterial *GetMaterial( RenderMode_t nRenderMode ) { return m_material[nRenderMode]; }
  34. IMaterial *GetMaterial( RenderMode_t nRenderMode, int nFrame );
  35. void SetFrame( RenderMode_t nRenderMode, int nFrame );
  36. bool Init( const char *name );
  37. void Shutdown( void );
  38. void UnloadMaterial();
  39. void SetColor( float r, float g, float b );
  40. int GetOrientation( void );
  41. void GetHUDSpriteColor( float* color );
  42. float GetUp() { return up; }
  43. float GetDown() { return down; }
  44. float GetLeft() { return left; }
  45. float GetRight() { return right; }
  46. void DrawFrame( RenderMode_t nRenderMode, int frame, int x, int y, const wrect_t *prcSubRect );
  47. void DrawFrameOfSize( RenderMode_t nRenderMode, int frame, int x, int y, int iWidth, int iHeight, const wrect_t *prcSubRect);
  48. bool IsAVI();
  49. bool IsBIK();
  50. void GetTexCoordRange( float *pMinU, float *pMinV, float *pMaxU, float *pMaxV );
  51. private:
  52. AVIMaterial_t m_hAVIMaterial;
  53. BIKMaterial_t m_hBIKMaterial;
  54. int m_width;
  55. int m_height;
  56. int m_numFrames;
  57. IMaterial *m_material[kRenderModeCount];
  58. int m_orientation;
  59. float m_hudSpriteColor[3];
  60. float up, down, left, right;
  61. };
  62. #endif // ENGINESPRITE_H