1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <X11/Xlib.h> 4 #include <X11/xpm.h> 5 #include <X11/Xos.h> 6 #include <X11/extensions/shape.h> 7 #include <unistd.h> 8 #include <signal.h> 9 10 #define LEFT 0 11 #define RIGHT 1 12 #define ERASE 2 13 14 #define BLUE 0 15 #define GREEN 1 16 #define YELLOW 2 17 #define RED 3 18 #define WHITE 4 19 #define BLACK 5 20 21 #define MAXLINE 512 22 23 #define WRITE 1 24 #define READ 0 25 26 #define LTURN 0 27 #define FALL 1 28 #define RTURN 2 29 30 #include "xpm/back2.xpm" 31 #include "xpm/back4.xpm" 32 #include "xpm/back5.xpm" 33 34 #include "xpm/ball.xpm" 35 #include "xpm/mini-ball.xpm" 36 37 #include "xpm/title.xpm" 38 #include "xpm/title2.xpm" 39 40 #include "xpm/tama.xpm" 41 #include "xpm/tama1.xpm" 42 #include "xpm/tama2.xpm" 43 44 #include "xpm/grow1.xpm" 45 #include "xpm/grow2.xpm" 46 #include "xpm/grow3.xpm" 47 #include "xpm/grow4.xpm" 48 #include "xpm/grow5.xpm" 49 50 #include "xpm/white.xpm" 51 #include "xpm/black.xpm" 52 #include "xpm/Eblack.xpm" 53 #include "xpm/Bwhite.xpm" 54 55 56 #include "xpm/flush1.xpm" 57 #include "xpm/flush2.xpm" 58 #include "xpm/flush3.xpm" 59 60 #include "xpm/gameover.xbm" 61 #ifdef NET 62 #include "xpm/winner.xbm" 63 #include "xpm/loser.xbm" 64 #endif 65 66 #include "xpm/sl_attc" 67 #include "xpm/sl_scor" 68 #ifdef NET 69 #include "xpm/sl_taisen" 70 #endif 71 #include "xpm/sl_prac" 72 #include "xpm/sl_quit" 73 74 #include "xpm/cursor.xbm" 75 #include "xpm/number.xbm" 76 #define Byte 8 77 78 #include <sys/types.h> 79 #include <sys/socket.h> 80 81 void usage() , quit() , tama_title() , err_sys() , net_init() ; 82 int writen() ; 83 84 extern void CreatePixmapFromData( Display *dpy , Window win , Colormap cmap , char **xpmdata , Pixmap *pm1 , Pixmap *pm2 ); 85 86 Pixmap back_xpm , vmask[2] , titl_xpm , title_msk , ball[12] , 87 titl2_xpm , title2_msk , animation[5][5] , animation_mask[5] , 88 effect[4] , spa[4] , tama[4] , over[3] , pdemo[3] , 89 pdemo_mask[3] , sele_xpm[5] ,char_xpm , char_msk , 90 cursor_mask , cursor[5] , number[12] ; 91 92 93 Window frame , back , score , title2 , char_win , sele , vsback ; 94 95 Cursor setcursor[5] ; 96 97 Display *dpy ; 98 GC gc , gc2 , gc3 ; 99 100 Colormap cmap ; 101 unsigned long iro[12] ; 102 103 int map[8][19] , Score , tamakazu , rensa , Dairensa , level , 104 sockfd , erase , fdc , mode , mous[3] , crr ; 105 106 Bool gameover , practice , net , mouse ; 107 108 fd_set readfd ; 109 110