|
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 d
Length: 2238 (0x8be) Types: TextFile Names: »defs.h«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/X/Xtetris/defs.h«
#include <stdio.h> #include <X11/Xlib.h> #include <X11/Intrinsic.h> #include <X11/StringDefs.h> #include <X11/Shell.h> #include <Xw/Xw.h> #define UWIDTH 10 /* canvas size in units */ #define UHEIGHT 30 #define UNIT 19 /* pixels in a unit */ #define SHADOW_OFFSET UNIT #define SHADOW_HEIGHT (UNIT+SHADOW_OFFSET) /* shadow area height in * pixels */ #define NEXT_HEIGHT (UNIT*5) /* Height for next block */ #define HIGH_TABLE_SIZE 10 /* size of high score table */ #ifndef HIGH_SCORE_TABLE #define HIGH_SCORE_TABLE "/usr/games/lib/tetris_scores" #endif #define NO_COLS 16 #define WHITE 0 #define RED 1 #define ORANGE 2 #define YELLOW 3 #define GREEN 4 #define BLUE 5 #define CYAN 6 #define VIOLET 7 #define BLACK 8 static Arg args[20]; Widget toplevel; Widget frame, score_frame; Widget panel, score_panel; Widget sub1_panel, sub2_panel; Widget canvas; Widget high_score_item[HIGH_TABLE_SIZE+1], score_item, level_item, rows_item, game_over; Widget tbar, start_bt, pause_bt, newgame_bt, scores_bt, quit_bt, done_bt; GC gc; Pixmap tetris_icon; int end_of_game, score_position; int shape_no, xpos, ypos, rot, score, rows; int next_no, next_rot; char *name; unsigned char grid[UWIDTH][UHEIGHT]; struct score_table { char name[BUFSIZ]; int score; int rows; int level; char hostname[BUFSIZ]; char date[BUFSIZ]; } high_scores[HIGH_TABLE_SIZE]; struct shape_table { int table[4][4]; int width; int height; int offset; int pointv[4]; char color; } shape[7]; struct shape { int shape; int rot; int width; int height; int offset; int pointv; char color; int was_shown; int was_shadowed; } *current, *next; void print_high_scores(), done_proc(), quit_proc(), start_proc(), pause_proc(), restart_proc(); void canvas_event_proc(); void drop_block(); void restore_canvas();