projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-19981123-5
[rocksndiamonds.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index 15f7205117ff592c9fac0de054796a5f2ae2a5df..2ef8fd6d4991a974defc5cc03b9bdb795b635a45 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)
@@
-426,9
+431,17
@@
void HandleKey(KeySym key, int key_status)
return;
}
return;
}
+
+
+#ifndef DEBUG
+
if (game_status == PLAYING && (tape.playing || tape.pausing))
return;
if (game_status == PLAYING && (tape.playing || tape.pausing))
return;
+#endif
+
+
+
switch(game_status)
{
case TYPENAME:
switch(game_status)
{
case TYPENAME:
@@
-496,7
+509,12
@@
void HandleKey(KeySym key, int key_status)
case XK_8:
case XK_9:
if (key == XK_0)
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",
else
GameFrameDelay = (key - XK_0) * 10;
printf("Game speed == %d%% (%d ms delay between two frames)\n",
@@
-635,7
+653,7
@@
void HandleJoystick()
{
static long joystickmove_delay = 0;
{
static 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)
newbutton = dx = dy = 0;
if (game_status==MAINMENU)