X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fpacman.h;h=a5b91dcd0163c9c3363c874375da149e33537c04;hb=78add6e627ee5f10e1fa6f3852602ea5066eee5a;hp=5028caa0949804b3be776c7236db9a7efdddfd11;hpb=447db08c956099b3b183886729108bf5b364c4b8;p=xscreensaver diff --git a/hacks/pacman.h b/hacks/pacman.h index 5028caa0..a5b91dcd 100644 --- a/hacks/pacman.h +++ b/hacks/pacman.h @@ -25,31 +25,26 @@ #ifndef __PACMAN_H__ #define __PACMAN_H__ -#include "config.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include "xlockmoreI.h" -#if defined(HAVE_GDK_PIXBUF) || defined(HAVE_XPM) -#define USE_PIXMAP -#include "xpm-pixmap.h" -#else -#if defined(USE_PIXMAP) -#undef USE_PIXMAP -#endif -#endif +#include "ximage-loader.h" #define LEVHEIGHT 32U #define LEVWIDTH 40U +#define TILEWIDTH 5U +#define TILEHEIGHT 5U + #define GETNB(n) ((1 << (n)) - 1) #define TESTNB(v, n) (((1 << (n)) & v) != 0x00) #define SNB(v, n) ((v) |= (1 << (n))) #define UNSNB(v, n) ((v) &= ~(1 << (n))) #define GHOSTS 4U -#if defined(USE_PIXMAP) #define MAXMOUTH 3 -#else -#define MAXMOUTH 11 -#endif #define MAXGPOS 2 #define MAXGDIR 4 #define MAXGWAG 2 @@ -77,6 +72,9 @@ #define GHOST_TRACE ( LEVWIDTH * LEVHEIGHT ) +#define DIRVECS 4 +#define NUM_BONUS_DOTS 4 + typedef struct { int vx, vy; @@ -143,6 +141,22 @@ typedef struct int init_row; } pacmanstruct; + +typedef struct +{ + unsigned int x, y; + int eaten; +} bonus_dot; + + +/* This are tiles which can be placed to create a level. */ +struct tiles { + char block[TILEWIDTH * TILEHEIGHT + 1]; + unsigned dirvec[4]; + unsigned ndirs; + unsigned simular_to; +}; + typedef struct { unsigned short width, height; @@ -169,15 +183,38 @@ typedef struct GameState gamestate; unsigned int timeleft; -} pacmangamestruct; -#define DIRVECS 4 + char last_pac_stat[1024]; -extern pacmangamestruct *pacmangames; -extern Bool trackmouse; + /* draw_pacman_sprite */ + int pm_mouth; + int pm_mouth_delay; + int pm_open_mouth; + int pm_death_frame; + int pm_death_delay; -typedef char lev_t[LEVHEIGHT][LEVWIDTH + 1]; + /* draw_ghost_sprite */ + int gh_wag; + int gh_wag_count; -#define NUM_BONUS_DOTS 4 + /* flash_bonus_dots */ + int bd_flash_count; + int bd_on; + + /* pacman_tick */ + int ghost_scared_timer; + int flash_timer; + PacmanState old_pac_state; + + /* pacman_level.c */ + bonus_dot bonus_dots[NUM_BONUS_DOTS]; + struct tiles *tiles; + +} pacmangamestruct; + +extern pacmangamestruct *pacman_games; +extern Bool pacman_trackmouse; + +typedef char lev_t[LEVHEIGHT][LEVWIDTH + 1]; #endif /* __PACMAN_H__ */