cs sdk v 1.14 released

Home  |  Product  |  Documents  |  Tutorials  |  FAQ |   Download  |   Forum |   Contacts  |   Link  


  Cross Suit

 Cross Suit SDK

 Documents
      classes
 Starting...
           Tutorials

 LUA tutorials

   Support

  Forum
  q&a

 Product parts

 Virtual File system

 Virtual Render
 Virtual Machine
   

  Demo Games

   

 3D Engine

  gvSystem(dx9)

 Link

 

 

gdefine.h

Go to the documentation of this file.
00001 /******************************************************
00002         gv System engine 3D/2D
00003 *******************************************************/
00004 
00005 #pragma once
00006 #ifndef __GDEFINE_H__
00007 #define __GDEFINE_H__
00009 
00010 
00012 //
00013 #define _APP_           "gvSystem"
00014 
00016 #define _VERSION_       "v2.1521233 (passed build)"
00017 
00018 //#define _OS_ "linux"
00019 //#define LINUX
00020 //#define ASM 0
00021 
00022 #define BASE_PATH       ""              // µðÆúÆ® ÆÐ½ºÀÌ´Ù.
00023 #define BASE_PATH1      "data/"
00024 
00025 #define MAXTOKEN                        1024
00026 /*----------------------------------------------------------------------------
00027         Platform specifics types and defines.
00028 ----------------------------------------------------------------------------*/
00029 //typedef HWND WindowHandle;
00030 
00031 // Undo any Windows defines.
00032 #undef BYTE
00033 #undef WORD
00034 #undef DWORD
00035 #undef INT
00036 #undef UINT
00037 #undef FLOAT
00038 #ifdef _WIN32
00039 #undef MAXBYTE
00040 #undef MAXWORD
00041 #undef MAXDWORD
00042 #undef MAXINT
00043 #undef BOOL
00044 #endif
00045 #undef CDECL
00046 
00047 
00048 // Unsigned base types.
00049 typedef unsigned char           BYTE;           // 8-bit  unsigned.
00050 typedef unsigned short          WORD;           // 16-bit unsigned.
00051 typedef unsigned long           DWORD;          // 32-bit unsigned.
00052 #ifdef _WIN32
00053 typedef unsigned __int64        QWORD;          // 64-bit unsigned.
00054 #endif
00055 
00056 // Signed base types.
00057 typedef signed char                     SBYTE;          // 8-bit  signed.
00058 typedef signed short            SWORD;          // 16-bit signed.
00059 typedef signed int              INT;            // 32-bit signed.
00060 typedef unsigned int            UINT;           // 32-bit signed.
00061 #ifdef _WIN32
00062 typedef signed __int64          SQWORD;         // 64-bit signed.
00063 #endif
00064 
00065 //
00066 typedef long                            LONG;
00067 //
00068 // small letter version:
00069 typedef unsigned char           byte;
00070 typedef unsigned short          word;
00071 typedef unsigned int            dword;
00072 
00073 // other types.
00074 typedef float                           FLOAT;
00075 typedef double                          DOUBLE;         // 64-bit IEEE double.
00076 typedef INT                                     BOOL;
00077 
00078 
00079 // Strings.
00080 #define LINE_TERMINATOR TEXT("\r\n")
00081 #define PATH_SEPARATOR TEXT("\\")
00082 
00083 // DLL file extension.
00084 
00085 #define DLLEXT TEXT(".dll")
00086 // dinamic link libraries.
00087 #define LIBRARY HMODULE
00088 #define LIB_PREFIX              ""
00089 #define LIB_SUFFIX              ".dll"
00090 #define LOADLIB(file)   LoadLibrary(file)
00091 #define UNLOADLIB(lib)  FreeLibrary((HMODULE)lib)
00092 #define INVALID_LIBRARY NULL
00093 
00094 
00095 // No asm if not compiling for x86.
00096 #ifndef _M_IX86
00097         #undef ASM
00098         #define _OS_ "linux"
00099         #define ASM 0
00100 #else 
00101         #define _OS_ "x86-win32"
00102         #define ASM 1
00103 #endif
00104 
00105 
00106 
00107 // path comparator.
00108 #define pathcmp stricmp
00109 /*-----------------------------------------------------------------------------
00110         Guard macros for call stack display. (taken from unreal)
00111 -----------------------------------------------------------------------------*/
00112 //
00113 // guard/unguardf/unguard macros.
00114 // For showing calling stack when errors occur in major functions.
00115 // Meant to be enabled in release builds.
00116 //
00117 // µð¹ö±×¸ÅÅ©·Î»ç¿ëÇÒ¶§
00118 #define guard(func)                     {static const char __FUNC_NAME__[]=TEXT(#func);
00119 #define unguard                         }
00120 #define unguardf(msg)           }
00121 
00122 /*
00123         currently we use those simple definitions, because all functions arent guarded
00124         once we guard every function we could throw and catch errors and propagate them
00125         till recursion ends showing at the end all the calling stack.
00126 */
00127 
00128 /*----------------------------------------------------------------------------
00129         OS dependant functions:
00130 ----------------------------------------------------------------------------*/
00131 #include <math.h>
00132 #include <memory.h>
00133 
00134 //
00135 // Round a floating point number to an integer.
00136 // Note that (int+.5) is rounded to (int+1).
00137 //
00138 int appRound(float F);
00139 int appFloor(float F );
00140 
00141 
00142 char appToUpper( char c );
00143 char appToLower( char c );
00144 bool appIsAlpha( char c );
00145 bool appIsDigit( char c );
00146 bool appIsAlnum( char c );
00147 
00148 int gvStrcmp (const char *s1, const char *s2);
00149 int gvStrncmp (const char *s1, const char *s2, int len);
00150 char *gvStrcpy(register char *s1, register const char *s2);
00151 //
00152 // CPU cycles, related to GSecondsPerCycle.
00153 //
00154 #if ASM
00155 #define DEFINED_appCycles 1
00156 #pragma warning (push)
00157 #pragma warning (disable : 4035)
00158 #pragma warning (disable : 4715)
00159 DWORD appCycles();
00160 #pragma warning (pop)
00161 #else
00162 DWORD appCycles();
00163 #endif
00164 
00165 //
00166 // Memory copy.
00167 //
00168 void appMemcpy( void* Dest, const void* Src, INT Count );
00169 
00170 //
00171 // Memory zero.
00172 //
00173 #if ASM
00174 #define DEFINED_appMemzero
00175 void appMemzero( void* Dest, INT Count );
00176 #else
00177 void appMemzero( void* Dest, INT Count );
00178 #endif
00179 
00180 void appMemset(void *Dest, int setvalue, int nsize);
00181 
00182 /*float __fastcall FastAbs(float a);
00183 float __fastcall FastSin(float a);
00184 float __fastcall FastCos(float a);
00185 
00186 __declspec(naked) float __fastcall FastAbs(float a) 
00187 {
00188         __asm 
00189         {
00190                 fld             DWORD PTR [esp+4] 
00191                 fabs
00192                 ret 4
00193         }
00194 }
00195 
00196 __declspec(naked) float __fastcall FastSin(float a) 
00197 {
00198         __asm 
00199         {
00200                 fld             DWORD PTR [esp+4] 
00201                 fsin
00202                 ret 4
00203         }
00204 }
00205 
00206 __declspec(naked) float __fastcall FastCos(float a) 
00207 {
00208         __asm 
00209         {
00210                 fld             DWORD PTR [esp+4] 
00211                 fcos
00212                 ret 4
00213         }
00214 }
00215 */
00216 //
00217 
00218 #define MAX_DISP                                32
00219 #define MAX_KEYBKEYS                    256
00220 #define DINPUT_BUFFERSIZE               2048
00221 
00222 // devices:
00223 enum inputType 
00224 {
00225         ID_KEYBOARD=0x01,
00226         ID_MOUSE=0x02,
00227         ID_JOYSTICK1=0x04,
00228         ID_JOYSTICK2=0x08,
00229 };
00230 
00231 // mouse values:
00232 enum mouseAction 
00233 {
00234         MV_XPOS,
00235         MV_YPOS,
00236         MV_XAXIS,
00237         MV_YAXIS,
00238         MV_ZAXIS,
00239         MV_BUTTON1,
00240         MV_BUTTON2,
00241         MV_BUTTON3,
00242         MV_BUTTON4,
00243         MV_WHEELUP,
00244         MV_WHEELDOWN
00245 };
00246 
00247 enum errorType 
00248 {
00249         _NO_ERROR,
00250         ERROR_LOADING_FILE,
00251         ERROR_LOADING_MODULE,
00252         ERROR_FREEING_MODULE,
00253         ERROR_ALLOCATING_MEMORY,
00254         ERROR_READING_FILE,
00255         ERROR_INVALID_FILENAME,
00256         ERROR_FORMAT_NOT_SUPPORTED,
00257         ERROR_CREATING_WINDOW,
00258         CRITICAL_ERROR,
00259         HEAP_ERROR,
00260         PARSE_ERROR,
00261         UNKNOWN_ERROR,
00262 };
00263 
00264 
00265 enum varType 
00266 {
00267         VF_CHEAT=0x0001,                        // Å×½ºÆ®¸ðµå ¶Ç´Â µð¹ö±ë ½ÇÇà¸ðµåÀ϶§ º¯°æ°¡´É.
00268         VF_SYSTEM=0x0002,                       // ³»ºÎ ¸ðµâ¿¡¼­ º¯°æ °¡´É.
00269         VF_PERSISTENT=0x0004,           // default.cfg ¿¡ ±âº»ÀúÀåµÇ´Â º¯¼öŸÀÔ.
00270         VF_LATCH=0x0008,                        // cvars ±âº»µ¥ÀÌŸ
00271         VF_USER=0x0010,                 // Ä¿½ºÅÒ º¯¼ö.
00272         VF_TEMP=0x0020,                 // Àӽú¯¼ö.
00273         VF_AUTO=0x0040,                 // ÀÚµ¿µî·Ï. »ç¿ë¾ÈÇÔ.
00274 };
00275 
00276 #ifdef __cplusplus
00277 #define strlen (int)strlen
00278 #endif
00280 
00285 /*
00286 #if defined(WIN32) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400)
00287 #define _GV_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX __asm mov eax,100
00288 #else
00289 #define _GV_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
00290 #endif // _IRR_MANAGED_MARSHALLING_BUGFIX
00291 */
00292 
00293 #endif
00294 

Copyright(C) gvSystem & GamePlus All Rights Reserved.