My Project
TextureParams.h
1 #pragma once
2 
3 namespace ParaEngine
4 {
5  class CPainter;
6 
11  {
12  public:
13  TextureParams(const char * str);
14 
20  void Init(const char * str);
21  int m_left;
22  int m_top;
23  int m_right;
24  int m_bottom;
25 
26  int m_toLeft;
27  int m_toTop;
28  int m_toRight;
29  int m_toBottom;
30  TextureEntity* m_pTexture;
31 
33  TextureEntity* GetTexture() { return m_pTexture; }
34 
36  inline bool IsNineTileTexture()
37  {
38  return m_toLeft != 0 || m_toTop != 0 || m_toRight != 0 || m_toBottom != 0;
39  };
40 
42  inline bool HasSubRegion() { return m_right != 0; };
43 
48  int GetImageRects(RECT* rcTextures);
49 
54  void drawTexture(CPainter* painter, int x, int y, int w, int h, const RECT* rcTextures = NULL, int nCount = -1);
55 
56  protected:
57  void DrawNineTileTexture(CPainter* painter, int x, int y, int w, int h, const RECT* rcTextures);
58  void DrawSingleTexture(CPainter* painter, int x, int y, int w, int h, const RECT &rc);
59  };
60 }
Which DXT Compression to Use? Obviously, there are some trade-offs between the different formats whic...
Definition: TextureEntity.h:29
different physics engine has different winding order.
Definition: EventBinding.h:32
Definition: ManagedDef.h:18
void Init(const char *str)
Definition: TextureParams.cpp:21
base class for a surface to paint to.
Definition: Painter.h:38
bool IsNineTileTexture()
whether it is nine tile image.
Definition: TextureParams.h:36
void drawTexture(CPainter *painter, int x, int y, int w, int h, const RECT *rcTextures=NULL, int nCount=-1)
draw texture to given target.
Definition: TextureParams.cpp:141
int GetImageRects(RECT *rcTextures)
return all image rects
Definition: TextureParams.cpp:55
bool HasSubRegion()
if a sub region of the original image should be used.
Definition: TextureParams.h:42
for reading texture parameters from strings like "texture/whitedot.png:10 10 10 10", "texture/whitedot.png;0 0 64 64:10 10 10 10"
Definition: TextureParams.h:10
TextureEntity * GetTexture()
get the texture
Definition: TextureParams.h:33