projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20020417-1-src
[rocksndiamonds.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index c497116ed6adb55b420a9718af18abd0be2e9820..f67bc13ecac7dc8bb5d3aed4e151383cea5b7439 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-176,6
+176,16
@@
void ClearEventQueue()
}
}
}
}
+void ClearPlayerAction()
+{
+ int i;
+
+ /* simulate key release events for still pressed keys */
+ key_joystick_mapping = 0;
+ for (i=0; i<MAX_PLAYERS; i++)
+ stored_player[i].action = 0;
+}
+
void SleepWhileUnmapped()
{
boolean window_unmapped = TRUE;
void SleepWhileUnmapped()
{
boolean window_unmapped = TRUE;
@@
-269,16
+279,11
@@
void HandleFocusEvent(FocusChangeEvent *event)
if (event->type == EVENT_FOCUSOUT)
{
if (event->type == EVENT_FOCUSOUT)
{
- int i;
-
KeyboardAutoRepeatOn();
old_joystick_status = joystick.status;
joystick.status = JOYSTICK_NOT_AVAILABLE;
KeyboardAutoRepeatOn();
old_joystick_status = joystick.status;
joystick.status = JOYSTICK_NOT_AVAILABLE;
- /* simulate key release events for still pressed keys */
- key_joystick_mapping = 0;
- for (i=0; i<MAX_PLAYERS; i++)
- stored_player[i].action = 0;
+ ClearPlayerAction();
}
else if (event->type == EVENT_FOCUSIN)
{
}
else if (event->type == EVENT_FOCUSIN)
{
@@
-477,6
+482,7
@@
void HandleKey(Key key, int key_status)
/* allow quick escape to the main menu with the Escape key */
if (key == KSYM_Escape &&
game_status != MAINMENU &&
/* allow quick escape to the main menu with the Escape key */
if (key == KSYM_Escape &&
game_status != MAINMENU &&
+ game_status != PLAYING &&
game_status != LEVELED &&
game_status != CHOOSELEVEL &&
game_status != SETUP)
game_status != LEVELED &&
game_status != CHOOSELEVEL &&
game_status != SETUP)
@@
-489,9
+495,9
@@
void HandleKey(Key key, int key_status)
/* special shortcuts for quick game tape saving and loading */
if (game_status == MAINMENU || game_status == PLAYING)
{
/* special shortcuts for quick game tape saving and loading */
if (game_status == MAINMENU || game_status == PLAYING)
{
- if (key ==
KSYM_F1) /* save game */
+ if (key ==
setup.shortcut.save_game)
TapeQuickSave();
TapeQuickSave();
- else if (key ==
KSYM_F2) /* load game */
+ else if (key ==
setup.shortcut.load_game)
TapeQuickLoad();
}
TapeQuickLoad();
}
@@
-592,6
+598,9
@@
void HandleKey(Key key, int key_status)
{
switch(key)
{
{
switch(key)
{
+ case KSYM_Escape:
+ RequestQuitGame(setup.ask_on_escape);
+ break;
#ifdef DEBUG
case KSYM_0:
#ifdef DEBUG
case KSYM_0:
@@
-767,11
+776,9
@@
static int HandleJoystickForAllPlayers()
joy_action = Joystick(i);
result |= joy_action;
joy_action = Joystick(i);
result |= joy_action;
-
if (!setup.input[i].use_joystick)
continue;
if (!setup.input[i].use_joystick)
continue;
-
stored_player[i].action = joy_action;
}
stored_player[i].action = joy_action;
}