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

📄 gaimfive.h

📁 可以移植到带有FB的任何嵌入式平台下的小游戏
💻 H
字号:
#ifndef	 __GAIMFIVE_H__#define  __GAIMFIVE_H__#include    <linux/fb.h>#include    <sys/ioctl.h>#include    <sys/mman.h>#include    <unistd.h>#include    <fcntl.h>#include    <stdio.h>#include    <stdlib.h>#include    <string.h>#include	<assert.h>typedef     int     BOOL;typedef 	enum ChessMan{    NoMan,    BlackMan,    WhiteMan}ChessMan;typedef enum DealDialog {	normal,	goon,	stop}DealDialog;typedef struct Setxy{    int x;    int y;}Setxy;typedef  struct BeforeBox{    Setxy player;    Setxy com;}BeforeBox;#define		FALSE			0#define		TRUE			1#define		LEVEL_EASE		1#define		LEVEL_NORMAL	2#define		LEVEL_HARD		3Setxy		Getxy(int x,int y);void		IniHtGame();BOOL		OppositeRecycle(BOOL style);BOOL		CheckFive(int it,int jt);int			GetManNum(ChessMan style,int it,int jt);Setxy		GetMaxMan(ChessMan man);void		user_play(int x, int y);void		computer_play();void		redraw_gui();void		background_init();void 		Savedat();BOOL 		Loaddat();int				openfb(char *dev_name);void 			get_fb_var_screeninfo(int fhandle, struct fb_var_screeninfo *fb_var);void			set_fb_var_screeninfo(int fhandle, struct fb_var_screeninfo *fb_var);void			get_fb_fix_screeninfo(int fhandle, struct fb_fix_screeninfo *fb_fix);unsigned char 	make8color(unsigned char r, unsigned char g, unsigned char b);unsigned short 	make15color(unsigned char r, unsigned char g, unsigned char b);unsigned short 	make16color(unsigned char r, unsigned char g, unsigned char b);void 			set8map(int fh, struct fb_cmap *map);void 			get8map(int fh, struct fb_cmap *map);void 			make332map(struct fb_cmap *map);void 			set332map(int fh);void			get_fb_var_var_bp(struct fb_var_screeninfo *fb_var);void			*convertRGB_fb(unsigned char *rgb, int bpp);void			*RGB_convert_fbuffer(unsigned char *rgb, int bpp);void			fb_mmap_buffer();void 			fb_draw_point(unsigned char *color, unsigned int pos_x, unsigned pos_y);void 			fb_draw_horizontal_line(unsigned char *color, unsigned int pos_x, unsigned pos_y, unsigned int lenght, unsigned int widht);void 			fb_draw_vertical_line(unsigned char *color, unsigned int pos_x, unsigned pos_y, unsigned int lenght, unsigned int widht);void			fb_draw_rect(unsigned char *color, unsigned int width, unsigned int height, unsigned int x, unsigned int y);void			fb_draw_chess(unsigned char *color, unsigned int x, unsigned int y);#endif

⌨️ 快捷键说明

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