projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-19981204-2
[rocksndiamonds.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index f6bf55914775d87984939f4c9022d1c66714a714..2d8eca3e861657b6442169036ac88d5395f08934 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-22,6
+22,11
@@
#include "joystick.h"
#include "network.h"
#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 EventLoop(void)
{
while(1)
@@
-253,9
+258,11
@@
void HandleFocusEvent(XFocusChangeEvent *event)
void HandleClientMessageEvent(XClientMessageEvent *event)
{
void HandleClientMessageEvent(XClientMessageEvent *event)
{
+#ifndef MSDOS
if ((event->window == window) &&
(event->data.l[0] == XInternAtom(display, "WM_DELETE_WINDOW", FALSE)))
CloseAllAndExit(0);
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)
}
void HandleButton(int mx, int my, int button)
@@
-595,8
+602,10
@@
void HandleNoXEvent()
return;
}
return;
}
+#ifndef MSDOS
if (options.network)
HandleNetworking();
if (options.network)
HandleNetworking();
+#endif
HandleJoystick();
HandleJoystick();
@@
-613,12
+622,19
@@
static int HandleJoystickForAllPlayers()
{
byte joy_action = 0;
{
byte joy_action = 0;
+ /*
if (!setup.input[i].use_joystick)
continue;
if (!setup.input[i].use_joystick)
continue;
+ */
joy_action = Joystick(i);
result |= joy_action;
joy_action = Joystick(i);
result |= joy_action;
+
+ if (!setup.input[i].use_joystick)
+ continue;
+
+
stored_player[i].action = joy_action;
}
stored_player[i].action = joy_action;
}
@@
-646,7
+662,7
@@
void HandleJoystick()
case SETUP:
case SETUPINPUT:
{
case SETUP:
case SETUPINPUT:
{
- static long joystickmove_delay = 0;
+ static
unsigned
long joystickmove_delay = 0;
if (joystick && !button && !DelayReached(&joystickmove_delay, 150))
newbutton = dx = dy = 0;
if (joystick && !button && !DelayReached(&joystickmove_delay, 150))
newbutton = dx = dy = 0;