自己用

#define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
#define _RGB16BIT565(r,g,b) ((b & 31) + ((g & 63) << 5) + ((r & 31) << 11))
#define _RGB32BIT(a,r,g,b) ((b) + ((g) << 8) + ((r) << 16) + ((a) << 24))
#define DDRAW_INIT_STRUCT(ddstruct) { memset(&ddstruct,0,sizeof(ddstruct)); ddstruct.dwSize=sizeof(ddstruct); }
#define GetWindowStyle(hwnd)    ((DWORD)GetWindowLong(hwnd, GWL_STYLE))
#define GetWindowExStyle(hwnd)  ((DWORD)GetWindowLong(hwnd, GWL_EXSTYLE))

//BOB struct
typedef struct BOB_TYP
        {
        int state;          // the state of the object (general)
        float x,y;            // position bitmap will be displayed at
        float vx,vy;          // velocity of object
        int width, height;  // the width and height of the bob
        int nBubble;     //the player's bubble number
        int nShoes;      // the player's shoes number
        int nPower;      // the player's power number
        int curr_frame;     // current animation frame
        int num_frames;     // total number of animation frames
        int curr_animation; //  Player directions
  LPDIRECTDRAWSURFACE7 images[12]; // the bitmap images DD surfaces
 
        } BOB, *BOB_PTR;
// Object struct
typedef struct BOB_TYP
        {
  STATE_e state;          // the state of the object (general) 存在
        float x,y;            // position bitmap will be displayed at 位置//减少计算时间
        int width, height;  //大小 //减少计算时间
        OBJECT_e object;      //实际物体
        PRIZE_e pstate ;      // 战利品
        MOVE_e mstate;     // 是否可以移动
        LPDIRECTDRAWSURFACE7 boxSuf; // 盒子画面
        LPDIRECTDRAWSURFACE7 prizeSuf; //奖品画面
        } OBJ, *OBJ_PTR;

typedef enum
{
 e_null = 0;
 e_spower = 1;
 e_bpower = 2;
 e_sshoes = 3;
 e_bshoes = 4;
 e_sbubble = 5;
 e_bbubble = 6;
 
} PRIZE_e;

typedef enum
{
 e_exist = 0;
 e_die= 1;
 e_active = 2;
} STATE_e;

typedef enum
{
 e_move = 0;
 e_nomove= 1;
 e_adom = 2; // 无法炸掉
} MOVE_e;
typedef enum
{
 e_commonBox;
 e_superbBox;

} OBJECT_e; 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值