arsa  2.7
cdx.h
Go to the documentation of this file.
1 #ifndef __CDX_H__
2 #define __CDX_H__
3 
5 #define CDX_VERSION_MAJOR 1
6 #define CDX_VERSION_MINOR 0
7 #define CDX_VERSION_REVISION 0
8 #define CDX_SDK_VERSION "1.0.0"
9 
10 #ifndef CDX_GET_VERSION_ONLY
11 
12 // push avoid dll warning
13 #ifdef __WIN32__
14 #pragma warning( push )
15 #pragma warning( disable: 4251 )
16 #endif
17 
18 #include "arsa_begin_code.h"
19 #include <ctype.h>
20 #include <irrlicht.h>
21 #include <SDL/SDL.h>
22 #include "ctimer.h"
23 
24 namespace irr
25 {
26 namespace arsa
27 {
28  class CARSAPsd;
29 } // arsa
30 } // irr
31 
33 #define CDX_Color irr::video::SColor
34 #define CDXSurface irr::video::ITexture
35 //#define CDXScreen void
36 #define CDXSpritePool void
37 
39 #define CDXBLT_BLK 0
40 #define CDXBLT_BLKALPHA 1
41 #define CDXBLT_BLKALPHAFAST 2
42 #define CDXBLT_BLKSCALED 3
43 #define CDXBLT_BLKSHADOW 4
44 #define CDXBLT_BLKSHADOWFAST 5
45 #define CDXBLT_BLKROTATED 6
46 #define CDXBLT_BLKROTOZOOM 7
47 #define CDXBLT_BLKHFLIP 8
48 #define CDXBLT_BLKVFLIP 9
49 #define CDXBLT_BLKSTRETCHED 10
50 
51 #define CDXBLT_TRANS 100
52 #define CDXBLT_TRANSALPHA 101
53 #define CDXBLT_TRANSALPHAFAST 102
54 #define CDXBLT_TRANSSCALED 103
55 #define CDXBLT_TRANSSHADOW 104
56 #define CDXBLT_TRANSSHADOWFAST 105
57 #define CDXBLT_TRANSROTATED 106
58 #define CDXBLT_TRANSROTOZOOM 107
59 #define CDXBLT_TRANSHFLIP 108
60 #define CDXBLT_TRANSVFLIP 109
61 #define CDXBLT_TRANSSTRETCHED 110
62 #define CDXBLT_TRANSSHADOWFASTHFLIP 111
63 #define CDXBLT_TRANSVHFLIP 112
64 
65 #define CDXBLT_TRANSALPHAMASK 120
66 
68 #define CDXMEM_VIDEOONLY 0
69 #define CDXMEM_SYSTEMONLY 1
70 #define CDXMEM_VIDTHENSYS 2
71 
73 #define CDXSIMD_NONE 0
74 #define CDXSIMD_MMX 2
75 #define CDXSIMD_3DNOW 4
76 
78 {
79  ETA_LEFT = 0,
83 };
84 
86 typedef irr::io::path CB_CDX_PRE_NAME(const char* filename);
88 extern ARSA_API irr::io::path ARSACALLCONV cdx_exist_filename(const irr::io::path& folder, const char* filename );
89 
90 #ifdef __WIN32__
91 #include <Windows.h>
92 #else//*/
93 
94 #ifndef _MAX_PATH
95 #define _MAX_PATH 256
96 #endif
97 
98 #ifndef _MAX_DIR
99 #define _MAX_DIR 32
100 #endif
101 
102 #ifndef _MAX_FNAME
103 #define _MAX_FNAME 64
104 #endif
105 
106 typedef struct POINT
107 {
109  {
110  x = 0;
111  y = 0;
112  }
113  POINT( int X, int Y )
114  {
115  x = X;
116  y = Y;
117  }
118 
119  long x, y;
120 }POINT, *PPOINT;
121 
122 typedef struct RECT
123 {
125  {
126  left = 0;
127  top = 0;
128  right = 0;
129  bottom = 0;
130  }
131  RECT( int l, int t, int r, int b )
132  {
133  left = l;
134  top = t;
135  right = r;
136  bottom = b;
137  }
138 
139  long left, top, right, bottom;
140 }RECT, *PRECT;
141 
142 typedef struct POINTFLOAT
143 {
145  {
146  x = 0;
147  y = 0;
148  }
149 
150  float x, y;
152 
153 //#endif
154 
155 #define CONST const
156 #define BYTE unsigned char
157 #define UCHAR unsigned char
158 #define WORD unsigned int
159 #define UINT unsigned int
160 #define BOOL unsigned int
161 #define UINT32 unsigned long
162 #define DWORD unsigned long
163 #define CHAR char
164 #define LONG long
165 #define FLOAT float
166 #define LPCTSTR char*
167 #define FW_NORMAL 400
168 
169 #ifndef FALSE
170 #define FALSE 0
171 #endif
172 
173 #ifndef TRUE
174 #define TRUE 1
175 #endif
176 
178 #ifndef _MAXNAME
179 #define _MAXNAME 256
180 #endif
181 
182 #ifndef _MAXNAME30
183 #define _MAXNAME30 30
184 #endif
185 
186 #endif // #ifdef __WIN32__
187 
189 // Globals functions
191 //#ifdef __cplusplus
192 //extern "C" {
193 //#endif
194  extern ARSA_API void ARSACALLCONV CDXError( char *str, ...);
195  extern ARSA_API DWORD ARSACALLCONV _timeGetTime( void );
196  extern ARSA_API char* ARSACALLCONV stristr(const char *StrBase,const char *SubBase);
197 
198 //#ifndef WIN32
199 #ifndef __WIN32__
200  extern ARSA_API bool ARSACALLCONV IntersectRect( PRECT Dest, PRECT Rect1, PRECT Rect2 );
201  extern ARSA_API bool ARSACALLCONV SetRect( PRECT lprc, int xLeft, int yTop, int xRight, int yBottom );
202  extern ARSA_API bool ARSACALLCONV PtInRect( CONST RECT *lprc, POINT pt );
203  extern ARSA_API void ARSACALLCONV Sleep( DWORD dwMilliseconds );
204  ARSA_API irr::u32 ARSACALLCONV RGB(int r, int g, int b);
205 #endif
206 
207  // text
208  ARSA_API void ARSACALLCONV TextPsdColor(irr::arsa::CARSAPsd* psd, const irr::core::stringc& layer_name, irr::gui::IGUIFont* _font, int r, int g, int b, int a, int alignment, char* pString, ...);
209  ARSA_API void ARSACALLCONV TextPsd( irr::arsa::CARSAPsd* psd, const irr::core::stringc& layer_name, irr::gui::IGUIFont* _font, char* pString, ...);
210  ARSA_API void ARSACALLCONV TextPsdColor(const irr::core::stringc& layer_name, int r, int g, int b, int a, char* pString, ...);
211  ARSA_API void ARSACALLCONV TextPsd(const irr::core::stringc& layer_name, char* pString, ...);
212  ARSA_API void ARSACALLCONV TextXY(irr::gui::IGUIFont* _font, int x, int y, int r, int g, int b, int a, int alignment, char* pString, ...);
213  ARSA_API void ARSACALLCONV TextXY(irr::gui::IGUIFont* _font, int x, int y, int r, int g, int b, int a, char* pString, ...);
214  ARSA_API void ARSACALLCONV TextXY(void* unused, int x, int y, int r, int g, int b, int a, char* pString, ...);
215  ARSA_API void ARSACALLCONV TextXY(int x, int y, int r, int g, int b, int a, char* pString, ...);
216  ARSA_API void ARSACALLCONV TextXY(int x, int y, irr::u32 Col, char* pString, ...);
217 
218 
219  // draw primitive
221  ARSA_API void ARSACALLCONV PutPixel(int X, int Y, irr::u32 Col, int Thickness = 2);
222  ARSA_API void ARSACALLCONV rectangleRGBA(void* unused, int x1, int y1, int x2, int y2, int r, int g, int b, int a);
223  ARSA_API void ARSACALLCONV boxRGBA(void* unused, int x1, int y1, int x2, int y2, int r, int g, int b, int a);
224  ARSA_API void ARSACALLCONV lineRGBA(void* unused, int x1, int y1, int x2, int y2, int r, int g, int b, int a);
225 
226  //#endif
227 
228 //#ifdef __cplusplus
229 //}
230 //#endif
231 
233 // MACROS
235 #ifndef SkipWhite
236 #define SkipWhite(p) while ( isspace(*p) ) p++
237 #endif
238 
239 #ifndef SAFEDELETE
240 #define SAFEDELETE(x) if(x != NULL) { delete x; x = NULL; }
241 #endif
242 
243 #ifndef DELETEARRAY
244 #define DELETEARRAY(x) if(x != NULL) { delete [] x; x = NULL; }
245 #endif
246 
247 #ifdef __WIN32__
248 #ifndef ODS
249 #define ODS(a) OutputDebugString(a)
250 #endif
251 #endif
252 
254 {
255 public:
256  CDXScreen() { }
257  virtual ~CDXScreen() { }
258 
259  virtual int GetWidth(void) const;
260  virtual int GetHeight(void) const;
261  virtual irr::video::ITexture* GetBack() { return 0; }
262  virtual void Flip() {}
263 };
264 
265 // pop avoid dll warning
266 #ifdef __WIN32__
267 #pragma warning( pop )
268 #endif
269 
270 #endif // CDX_GET_VERSION_ONLY
271 #endif // __CDX_H__
ARSA_API void ARSACALLCONV TextXY(irr::gui::IGUIFont *_font, int x, int y, int r, int g, int b, int a, int alignment, char *pString,...)
Definition: cdx.h:80
ARSA_API void ARSACALLCONV Fill(irr::u32 Col)
POINT(int X, int Y)
Definition: cdx.h:113
#define CONST
Definition: cdx.h:155
ARSA_API bool ARSACALLCONV PtInRect(CONST RECT *lprc, POINT pt)
GLuint GLfloat GLfloat GLfloat x1
GLdouble GLdouble t
Definition: SDL_opengl.h:2071
Definition: cdx.h:106
Definition: cdx.h:79
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
ARSA_API char *ARSACALLCONV stristr(const char *StrBase, const char *SubBase)
ARSA_API void ARSACALLCONV rectangleRGBA(void *unused, int x1, int y1, int x2, int y2, int r, int g, int b, int a)
struct POINTFLOAT POINTFLOAT
virtual ~CDXScreen()
Definition: cdx.h:257
GLfixed GLfixed GLfixed y2
long bottom
Definition: cdx.h:139
struct RECT * PRECT
irr::io::path CB_CDX_PRE_NAME(const char *filename)
pre name variable & function
Definition: cdx.h:86
long left
Definition: cdx.h:139
Everything in the Irrlicht Engine can be found in this namespace.
Definition: CARSADPad.h:6
Main header file of the irrlicht, the only file needed to include.
ARSA_API void ARSACALLCONV TextPsdColor(irr::arsa::CARSAPsd *psd, const irr::core::stringc &layer_name, irr::gui::IGUIFont *_font, int r, int g, int b, int a, int alignment, char *pString,...)
ARSA_API void ARSACALLCONV PutPixel(int X, int Y, irr::u32 Col, int Thickness=2)
ARSA_API void ARSACALLCONV TextPsd(irr::arsa::CARSAPsd *psd, const irr::core::stringc &layer_name, irr::gui::IGUIFont *_font, char *pString,...)
GLfixed GLfixed x2
long x
Definition: cdx.h:119
GLint GLint bottom
E_TEXT_ALIGNMENT
Definition: cdx.h:77
Definition: cdx.h:82
GLfixed y1
Font interface.
Definition: IGUIFont.h:39
long y
Definition: cdx.h:119
RECT(int l, int t, int r, int b)
Definition: cdx.h:131
virtual irr::video::ITexture * GetBack()
Definition: cdx.h:261
struct POINT POINT
ARSA_API void ARSACALLCONV CDXError(char *str,...)
RECT()
Definition: cdx.h:124
struct RECT RECT
ARSA_API bool ARSACALLCONV IntersectRect(PRECT Dest, PRECT Rect1, PRECT Rect2)
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
CDXScreen()
Definition: cdx.h:256
long top
Definition: cdx.h:139
ARSA_API irr::io::path ARSACALLCONV cdx_exist_filename(const irr::io::path &folder, const char *filename)
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
ARSA_API void ARSACALLCONV boxRGBA(void *unused, int x1, int y1, int x2, int y2, int r, int g, int b, int a)
ARSA_API DWORD ARSACALLCONV _timeGetTime(void)
long right
Definition: cdx.h:139
GLdouble GLdouble GLdouble GLdouble top
ARSA_API void ARSACALLCONV lineRGBA(void *unused, int x1, int y1, int x2, int y2, int r, int g, int b, int a)
float y
Definition: cdx.h:150
GLenum func
#define ARSA_API
GLint left
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
struct POINTFLOAT * PPOINTFLOAT
ARSA_API irr::u32 ARSACALLCONV RGB(int r, int g, int b)
ARSA_API void ARSACALLCONV Sleep(DWORD dwMilliseconds)
POINT()
Definition: cdx.h:108
Definition: cdx.h:253
Interface of a Video Driver dependent Texture.
Definition: ITexture.h:177
virtual void Flip()
Definition: cdx.h:262
Definition: cdx.h:122
GLdouble GLdouble right
GLboolean GLboolean GLboolean GLboolean a
struct POINT * PPOINT
Definition: cdx.h:81
ARSA_API void ARSACALLCONV CDX_SET_PRE_NAME(CB_CDX_PRE_NAME *func)
GLboolean GLboolean g
ARSA_API bool ARSACALLCONV SetRect(PRECT lprc, int xLeft, int yTop, int xRight, int yBottom)
#define ARSACALLCONV
float x
Definition: cdx.h:150
POINTFLOAT()
Definition: cdx.h:144
#define DWORD
Definition: cdx.h:162