home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume6 / sun-tetris2 / defs.h < prev    next >
C/C++ Source or Header  |  1989-07-06  |  2KB  |  91 lines

  1. #include <stdio.h>
  2. #include <sys/time.h>
  3. #include <suntool/sunview.h>
  4. #include <suntool/panel.h>
  5. #include <suntool/canvas.h>
  6. #include <sunwindow/notify.h>
  7. #include <pixrect/pixrect_hs.h>
  8.  
  9. #define UWIDTH          10      /* canvas size in units */
  10. #define UHEIGHT         30
  11.  
  12. #define UNIT            20      /* pixels in a unit */
  13. #define SHADOW_OFFSET   UNIT
  14. #define SHADOW_HEIGHT   (UNIT+SHADOW_OFFSET)    /* shadow area height in
  15.                                                  * pixels */
  16. #define NEXT_HEIGHT        (UNIT*5)    /* Height for next block */
  17.  
  18. #define HIGH_TABLE_SIZE 10      /* size of high score table */
  19. #ifndef HIGH_SCORE_TABLE
  20. #    define HIGH_SCORE_TABLE    "/usr/games/lib/tetris_scores"
  21. #endif
  22.  
  23. #define ITIMER_NULL     ((struct itimerval *)0)
  24.  
  25. #define       NO_COLS 16
  26.  
  27. #define       WHITE   0
  28. #define       RED     1
  29. #define       ORANGE  2
  30. #define       YELLOW  3
  31. #define       GREEN   4
  32. #define       BLUE    5
  33. #define       CYAN    6
  34. #define       VIOLET  7
  35. #define       BLACK   8
  36.  
  37. #define     OP        (PIX_SRC | PIX_COLOR(col))
  38. #define     CLR        (PIX_SRC | PIX_COLOR(WHITE))
  39.  
  40.  
  41. Frame   frame, score_frame;
  42. Panel   panel, score_panel;
  43. Canvas  canvas;
  44. Pixwin *pw;
  45. Panel_item high_score_item[HIGH_TABLE_SIZE+1], score_item, level_item, rows_item, game_over;
  46. Pixrect *pr;
  47.  
  48. int        end_of_game, score_position;
  49. int     shape_no, xpos, ypos, rot, score, rows;
  50. int        next_no, next_rot;
  51. char   *name;
  52. int     monochrome;
  53. unsigned char grid[UWIDTH][UHEIGHT];
  54.  
  55. struct score_table {
  56.         char    name[BUFSIZ];
  57.         int     score;
  58.         int     rows;
  59.         int     level;
  60.         char hostname[BUFSIZ];
  61.         char    date[BUFSIZ];
  62. }       high_scores[HIGH_TABLE_SIZE];
  63.  
  64. struct shape_table {
  65.         int     table[4][4];
  66.         int     width;
  67.         int     height;
  68.         int     offset;
  69.         int     pointv[4];
  70.         char    color;
  71. }       shape[7];
  72.  
  73. struct shape {
  74.         int     shape;
  75.         int     rot;
  76.         int     width;
  77.         int     height;
  78.         int     offset;
  79.         int     pointv;
  80.         char    color;
  81.         int     was_shown;
  82.         int     was_shadowed;
  83. }      *current, *next;
  84.  
  85. int     my_client_object;
  86. Notify_client *me;
  87.  
  88. void    print_high_scores(), done_proc(), quit_proc(), start_proc(), pause_proc(), restart_proc();
  89. void    canvas_event_proc();
  90. Notify_value drop_block();
  91.