DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T d

⟦578d1ca06⟧ TextFile

    Length: 2317 (0x90d)
    Types: TextFile
    Names: »defs.h«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/Sun/Tetris/defs.h« 

TextFile

#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	"/ufs/play/lib.sun/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();