global.h
上传用户:sycq158
上传日期:2008-10-22
资源大小:15361k
文件大小:2k
- #ifndef _ASIDER_TANK_ALPHA3_GLOBAL_H_
- #define _ASIDER_TANK_ALPHA3_GLOBAL_H_
- #define WIN32_LEAN_AND_MEAN // avoid all of mfc
- #include <windows.h>
- #include <mmsystem.h>
- #include <stdlib.h>
- #include "Res/resource.h"
- //-----------------------------------------------------------------------------
- // Messages definitions
- //-----------------------------------------------------------------------------
- enum MsgType{ MSG_NET, MSG_SYSTEM, MSG_CMD, MSG_CONSOLE, MSG_ALL };
- enum MsgNet { MSGNET_RECEIVEERROR };
- enum TankCmd { CMD_NONE, CMD_RIGHT, CMD_DOWN, CMD_UP, CMD_LEFT, CMD_FIRE };
- enum Layer { LAYER_NONE, LAYER_GROUND, LAYER_TANK, LAYER_BULLET, LAYER_TREE };
- enum Landform { LAND_BRICK, LAND_IRON, LAND_RIVER, LAND_GRASS, LAND_ICE, LAND_BASE, LAND_NONE=32 };
- // collision = 1 << landform
- enum Collision { COL_BRICK=1, COL_IRON=2, COL_RIVER=4, COL_ICE=16 };
- //-----------------------------------------------------------------------------
- // Miscellaneous helper functions
- //-----------------------------------------------------------------------------
- #define ERRORMSG(x) MessageBox(NULL,TEXT(x),TEXT("Error"),MB_ICONERROR)
- #define INCSCOPE(x,min,max) (++(x)>=(max))?((x)=(min)):(x)
- #define DESSCOPE(x,min,max) (--(x)<(min))?((x)=(max-1)):(x)
- #define MIN( x, y ) ((x)>(y)?(y):(x))
- #define MAX( x, y ) ((x)>(y)?(x):(y))
- #define DELETE_PTR(p) { if(p) { delete (p); (p)=NULL; } }
- #define DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
- //-----------------------------------------------------------------------------
- // Global variables
- //-----------------------------------------------------------------------------
- extern int g_FrameBig, g_FrameSmall, g_FrameLeft,
- g_FrameBasis, g_FrameWidth, g_FrameHeight;
- extern bool g_bActive;
- #endif // _ASIDER_TANK_ALPHA3_GLOBAL_H_