projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed bug with comparing wrong viewport variables
[rocksndiamonds.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index 7e1f293f9b067cf5792ac4385f1e24a708a3e8b4..6fee5bbce8684de0badc8642ca52a9bfeeb76e68 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-1778,11
+1778,14
@@
static void HandleKeysSpecial(Key key)
}
}
}
}
-
void HandleKeysDebug(Key key
)
+
boolean HandleKeysDebug(Key key, int key_status
)
{
#ifdef DEBUG
int i;
{
#ifdef DEBUG
int i;
+ if (key_status != KEY_PRESSED)
+ return FALSE;
+
if (game_status == GAME_MODE_PLAYING || !setup.debug.frame_delay_game_only)
{
boolean mod_key_pressed = ((GetKeyModState() & KMOD_Valid) != KMOD_None);
if (game_status == GAME_MODE_PLAYING || !setup.debug.frame_delay_game_only)
{
boolean mod_key_pressed = ((GetKeyModState() & KMOD_Valid) != KMOD_None);
@@
-1809,7
+1812,7
@@
void HandleKeysDebug(Key key)
else
Error(ERR_DEBUG, "frame delay == 0 ms (maximum speed)");
else
Error(ERR_DEBUG, "frame delay == 0 ms (maximum speed)");
-
break
;
+
return TRUE
;
}
}
}
}
}
}
@@
-1822,13
+1825,19
@@
void HandleKeysDebug(Key key)
Error(ERR_DEBUG, "debug mode %s",
(options.debug ? "enabled" : "disabled"));
Error(ERR_DEBUG, "debug mode %s",
(options.debug ? "enabled" : "disabled"));
+
+ return TRUE;
}
else if (key == KSYM_v)
{
Error(ERR_DEBUG, "currently using game engine version %d",
game.engine_version);
}
else if (key == KSYM_v)
{
Error(ERR_DEBUG, "currently using game engine version %d",
game.engine_version);
+
+ return TRUE;
}
}
}
}
+
+ return FALSE;
#endif
}
#endif
}
@@
-1856,6
+1865,9
@@
void HandleKey(Key key, int key_status)
int joy = 0;
int i;
int joy = 0;
int i;
+ if (HandleKeysDebug(key, key_status))
+ return; // do not handle already processed keys again
+
// map special keys (media keys / remote control buttons) to default keys
if (key == KSYM_PlayPause)
key = KSYM_space;
// map special keys (media keys / remote control buttons) to default keys
if (key == KSYM_PlayPause)
key = KSYM_space;
@@
-2081,10
+2093,7
@@
void HandleKey(Key key, int key_status)
HandleKeysSpecial(key);
if (HandleGadgetsKeyInput(key))
HandleKeysSpecial(key);
if (HandleGadgetsKeyInput(key))
- {
- if (key != KSYM_Escape) // always allow ESC key to be handled
- key = KSYM_UNDEFINED;
- }
+ return; // do not handle already processed keys again
switch (game_status)
{
switch (game_status)
{
@@
-2201,8
+2210,6
@@
void HandleKey(Key key, int key_status)
return;
}
}
return;
}
}
-
- HandleKeysDebug(key);
}
void HandleNoEvent(void)
}
void HandleNoEvent(void)