1 /* 2000-08-13T15:29:40Z
3 * handle input from x11 and keyboard and joystick
17 struct LevelInfo_EM native_em_level;
19 unsigned short **Boom;
20 unsigned short **Cave;
21 unsigned short **Next;
22 unsigned short **Draw;
24 static unsigned short *Index[4][HEIGHT];
25 static unsigned short Array[4][HEIGHT][WIDTH];
27 void game_init_vars(void)
33 for (y = 0; y < HEIGHT; y++)
34 for (x = 0; x < WIDTH; x++)
35 Array[0][y][x] = ZBORDER;
36 for (y = 0; y < HEIGHT; y++)
37 for (x = 0; x < WIDTH; x++)
38 Array[1][y][x] = ZBORDER;
39 for (y = 0; y < HEIGHT; y++)
40 for (x = 0; x < WIDTH; x++)
41 Array[2][y][x] = ZBORDER;
42 for (y = 0; y < HEIGHT; y++)
43 for (x = 0; x < WIDTH; x++)
44 Array[3][y][x] = Xblank;
46 for (y = 0; y < HEIGHT; y++)
47 Index[0][y] = Array[0][y];
48 for (y = 0; y < HEIGHT; y++)
49 Index[1][y] = Array[1][y];
50 for (y = 0; y < HEIGHT; y++)
51 Index[2][y] = Array[2][y];
52 for (y = 0; y < HEIGHT; y++)
53 Index[3][y] = Array[3][y];
61 void InitGameEngine_EM()
69 void GameActions_EM(byte action)
71 static unsigned long game_frame_delay = 0;
72 unsigned long game_frame_delay_value = getGameFrameDelay_EM(25);
75 /* this is done in screens.c/HandleGameActions() by calling BackToFront() */
76 XSync(display, False); /* block until all graphics are drawn */
79 WaitUntilDelayReached(&game_frame_delay, game_frame_delay_value);
83 Random = Random * 129 + 1;
85 frame = (frame - 1) & 7;
100 DrawGameDoorValues_EM(lev.required, ply1.dynamite, lev.score,
106 /* read input device for players */
108 void readjoy(byte action)
110 unsigned int north = 0, east = 0, south = 0, west = 0, fire = 0;
112 if (action & JOY_LEFT)
115 if (action & JOY_RIGHT)
121 if (action & JOY_DOWN)
124 if (action & JOY_BUTTON_1)
127 ply1.joy_fire = fire;
128 if (ply1.joy_stick || (north | east | south | west))