aboutsummaryrefslogtreecommitdiff
path: root/sp/src/game/client/enginesprite.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /sp/src/game/client/enginesprite.h
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/game/client/enginesprite.h')
-rw-r--r--sp/src/game/client/enginesprite.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/sp/src/game/client/enginesprite.h b/sp/src/game/client/enginesprite.h
new file mode 100644
index 00000000..7c057ba0
--- /dev/null
+++ b/sp/src/game/client/enginesprite.h
@@ -0,0 +1,65 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//===========================================================================//
+
+#ifndef ENGINESPRITE_H
+#define ENGINESPRITE_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "mathlib/vector.h"
+#include "video/ivideoservices.h"
+#include "const.h"
+//-----------------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------------
+class IMaterial;
+class IMaterialVar;
+typedef struct wrect_s wrect_t;
+
+
+//-----------------------------------------------------------------------------
+// Purpose: Sprite Models
+//-----------------------------------------------------------------------------
+class CEngineSprite
+{
+ // NOTE: don't define a constructor or destructor so that this can be allocated
+ // as before.
+public:
+ int GetWidth() { return m_width; }
+ int GetHeight() { return m_height; }
+ int GetNumFrames() { return m_numFrames; }
+ IMaterial *GetMaterial( RenderMode_t nRenderMode ) { return m_material[nRenderMode]; }
+ IMaterial *GetMaterial( RenderMode_t nRenderMode, int nFrame );
+ void SetFrame( RenderMode_t nRenderMode, int nFrame );
+ bool Init( const char *name );
+ void Shutdown( void );
+ void UnloadMaterial();
+ void SetColor( float r, float g, float b );
+ int GetOrientation( void );
+ void GetHUDSpriteColor( float* color );
+ float GetUp() { return up; }
+ float GetDown() { return down; }
+ float GetLeft() { return left; }
+ float GetRight() { return right; }
+ void DrawFrame( RenderMode_t nRenderMode, int frame, int x, int y, const wrect_t *prcSubRect );
+ void DrawFrameOfSize( RenderMode_t nRenderMode, int frame, int x, int y, int iWidth, int iHeight, const wrect_t *prcSubRect);
+ bool IsVideo();
+ void GetTexCoordRange( float *pMinU, float *pMinV, float *pMaxU, float *pMaxV );
+
+private:
+ IVideoMaterial *m_VideoMaterial;
+ int m_width;
+ int m_height;
+ int m_numFrames;
+ IMaterial *m_material[kRenderModeCount];
+ int m_orientation;
+ float m_hudSpriteColor[3];
+ float up, down, left, right;
+};
+
+#endif // ENGINESPRITE_H