⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sprite.h

📁 数据挖掘中de一个算法 hamster的实例
💻 H
字号:
/*----------------------------------------------------------------------  File    : sprite.h  Contents: sprite management (Microsoft Windows Version)  Author  : Christian Borgelt  History : 15.10.1997 file created            31.10.1997 field hdc_win added to SPRITE structure----------------------------------------------------------------------*/#ifndef __SPRITE__#define __SPRITE__#include <limits.h>#include <windows.h>/*----------------------------------------------------------------------  Type Definitions----------------------------------------------------------------------*/typedef struct {                /* --- sprite --- */  int     xext, yext;           /* x- and y-extension of sprite */  int     xoff, yoff;           /* x- and y-offset to current image */  int     xnew, ynew;           /* x- and y-offset to new image */  int     xpos, ypos;           /* current position of sprite */  int     drawn;                /* flag whether sprite is drawn */  HWND    hwnd;                 /* window handle */  HDC     hdc_win;              /* handle of window device context */  HDC     hdc_bmp;              /* handle of sprite device context */  HBITMAP bitmap;               /* handle of sprite bitmap */  HDC     hdc_msk;              /* handle of mask device context */  HBITMAP mask;                 /* handle of mask bitmap */  HDC     hdc_buf;              /* handle of buffer device context */  HBITMAP buffer;               /* handle of background buffer */} SPRITE;                       /* (sprite) *//*----------------------------------------------------------------------  Functions----------------------------------------------------------------------*/extern SPRITE* spr_create (HWND hwnd, int xext, int yext,                           HBITMAP bitmap, HBITMAP mask);extern void    spr_delete (SPRITE *spr, int del);extern void    spr_pos    (SPRITE *spr, int *x, int *y);extern void    spr_select (SPRITE *spr, int series, int index);extern int     spr_draw   (SPRITE *spr, int x, int y);extern int     spr_undraw (SPRITE *spr);extern int     spr_move   (SPRITE *spr, int dx, int dy, int di,                           int cnt, float delay);/*----------------------------------------------------------------------  Preprocessor Definitions----------------------------------------------------------------------*/#define spr_pos(s,x,y)    (*(x) = (s)->xpos, *(y) = (s)->ypos)#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -