#include "joystick.h"
#include "network.h"
+/* values for key_status */
+#define KEY_NOT_PRESSED FALSE
+#define KEY_RELEASED FALSE
+#define KEY_PRESSED TRUE
+
void EventLoop(void)
{
while(1)
void HandleClientMessageEvent(XClientMessageEvent *event)
{
+#ifndef MSDOS
if ((event->window == window) &&
(event->data.l[0] == XInternAtom(display, "WM_DELETE_WINDOW", FALSE)))
CloseAllAndExit(0);
+#endif
}
void HandleButton(int mx, int my, int button)
return;
}
+
+
+#ifndef DEBUG
+
if (game_status == PLAYING && (tape.playing || tape.pausing))
return;
+#endif
+
+
+
switch(game_status)
{
case TYPENAME:
case XK_8:
case XK_9:
if (key == XK_0)
- GameFrameDelay = 500;
+ {
+ if (GameFrameDelay == 500)
+ GameFrameDelay = GAME_FRAME_DELAY;
+ else
+ GameFrameDelay = 500;
+ }
else
GameFrameDelay = (key - XK_0) * 10;
printf("Game speed == %d%% (%d ms delay between two frames)\n",
return;
}
+#ifndef MSDOS
if (options.network)
HandleNetworking();
+#endif
HandleJoystick();
{
byte joy_action = 0;
+ /*
if (!setup.input[i].use_joystick)
continue;
+ */
joy_action = Joystick(i);
result |= joy_action;
+
+ if (!setup.input[i].use_joystick)
+ continue;
+
+
stored_player[i].action = joy_action;
}
case SETUP:
case SETUPINPUT:
{
- static long joystickmove_delay = 0;
+ static unsigned long joystickmove_delay = 0;
- if (joystick && !button && !DelayReached(&joystickmove_delay,150))
+ if (joystick && !button && !DelayReached(&joystickmove_delay, 150))
newbutton = dx = dy = 0;
if (game_status==MAINMENU)