home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume6
/
sun-tetris2
/
defs.h
< prev
next >
Wrap
C/C++ Source or Header
|
1989-07-06
|
2KB
|
91 lines
#include <stdio.h>
#include <sys/time.h>
#include <suntool/sunview.h>
#include <suntool/panel.h>
#include <suntool/canvas.h>
#include <sunwindow/notify.h>
#include <pixrect/pixrect_hs.h>
#define UWIDTH 10 /* canvas size in units */
#define UHEIGHT 30
#define UNIT 20 /* 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 ITIMER_NULL ((struct itimerval *)0)
#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
#define OP (PIX_SRC | PIX_COLOR(col))
#define CLR (PIX_SRC | PIX_COLOR(WHITE))
Frame frame, score_frame;
Panel panel, score_panel;
Canvas canvas;
Pixwin *pw;
Panel_item high_score_item[HIGH_TABLE_SIZE+1], score_item, level_item, rows_item, game_over;
Pixrect *pr;
int end_of_game, score_position;
int shape_no, xpos, ypos, rot, score, rows;
int next_no, next_rot;
char *name;
int monochrome;
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;
int my_client_object;
Notify_client *me;
void print_high_scores(), done_proc(), quit_proc(), start_proc(), pause_proc(), restart_proc();
void canvas_event_proc();
Notify_value drop_block();