|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T t
Length: 3167 (0xc5f) Types: TextFile Names: »tetris.h«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/General/Tetris/tetris.h«
/* ** written by adam margulies vespa@ssyx.ucsc.edu ** {...}!ucbvax!ucscc!ssyx!vespa ** ** permission is granted to freely distribute this code provided that you: ** ** 1) don't charge for it ** 2) leave my name and header on it ** 3) clearly document your changes and place your name on them ** */ /* Tetris: tetris.h */ /* */ /* this is the header file, it does all the necessary includes, defines */ /* the necessary macros, and contains a lot of needed runtime data. */ #include <sys/file.h> #include <sys/time.h> #include <sys/types.h> #include <sys/stat.h> #include <pwd.h> #include <signal.h> #include <stdio.h> #include <utmp.h> #include "csr.h" #define LASTDATE "2/23/89" #define VERSION 13 #define HIGHSCOREFILE "/usr/games/lib/tetris/score.tetris" #define MONITORFILE "/dev/null" #define HELPFILE "/usr/games/lib/tetris/help.tetris" #define MASTERUID 0 #define DIFFICULTY 10 #define NUMOFCOLORS 9 /* number of 'colors' available */ #define xoffset (current->offset & pow(2, 6 - (current->rot *2))) #define yoffset (current->offset & pow(2, 7 - (current->rot *2))) #define MASK(sig) (1 << ((sig) - 1)) #define SIGHOLD(signo) (sigblock(MASK(signo))) #define SIGRELSE(signo) (sigsetmask(sigblock(0) &~ MASK(signo))) char keystr[10]; int addict; int rubble; int version; int disp_next; /* flag for the display next block feature (bug?)*/ int disp_tomb; /* flag for the display tombstone feature (bug?)*/ int disp_high; /* flag for the display high score feature (bug?)*/ int disp_open; /* flag for the display open screen feature (bug?)*/ int shadow; /* flag for the shadowing feature (bug?)*/ int nowrite; /* flag for nowrite option */ struct stat *ttystat; /* this hold the file perms of the user's tty */ int curx, cury; /* current block's x,y coords */ int points, level; /* current score and level */ int current_high; /* current high score */ char rcd_file[255]; /* path to rc file */ int lines; /* number of lines eaten */ int dropped_from; /* flag to tell score function where fast drop came from */ int fast_drop; /* flag for dropping blocks fast */ char *user; int high_score[15]; char high_user[15][8]; char high_name[15][255]; char username[100]; struct shape_table { /* this structure holds all the block defins */ int table[4][4]; int width; int height; int offset; int pointv[4]; char color; } shape[7]; struct shape { /* these are for quick reference */ int shape; /* do I know what I am doing? Nah.... */ int rot; int width; int height; int offset; int pointv; char color; int was_shown; int was_shadowed; } *current, *next; struct keystr { char left; char right; char rotleft; char rotright; char drop; char togdisp; char togshad; } *key; struct itimerval timer, otimer; /* these are for the interrupt timing */ struct passwd *user_info; /* user info (tricky names aren't they?) */