projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20081103-1-src
[rocksndiamonds.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index c0bfafa156abe3914bc2363e6e8e9ec00b0c1ed2..278704e6763f9924142f2a6cc4c74c00f055773a 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-1,7
+1,7
@@
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-200
2
Artsoft Entertainment *
+* (c) 1995-200
6
Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
@@
-127,7
+127,7
@@
void EventLoop(void)
while (NextValidEvent(&event))
{
while (NextValidEvent(&event))
{
- switch(event.type)
+ switch
(event.type)
{
case EVENT_BUTTONPRESS:
case EVENT_BUTTONRELEASE:
{
case EVENT_BUTTONPRESS:
case EVENT_BUTTONRELEASE:
@@
-194,7
+194,7
@@
void EventLoop(void)
void HandleOtherEvents(Event *event)
{
void HandleOtherEvents(Event *event)
{
- switch(event->type)
+ switch
(event->type)
{
case EVENT_EXPOSE:
HandleExposeEvent((ExposeEvent *) event);
{
case EVENT_EXPOSE:
HandleExposeEvent((ExposeEvent *) event);
@@
-223,6
+223,10
@@
void HandleOtherEvents(Event *event)
case SDL_JOYBUTTONUP:
HandleJoystickEvent(event);
break;
case SDL_JOYBUTTONUP:
HandleJoystickEvent(event);
break;
+
+ case SDL_SYSWMEVENT:
+ HandleWindowManagerEvent(event);
+ break;
#endif
default:
#endif
default:
@@
-238,14
+242,18
@@
void ClearEventQueue()
NextEvent(&event);
NextEvent(&event);
- switch(event.type)
+ switch
(event.type)
{
case EVENT_BUTTONRELEASE:
button_status = MB_RELEASED;
break;
case EVENT_KEYRELEASE:
{
case EVENT_BUTTONRELEASE:
button_status = MB_RELEASED;
break;
case EVENT_KEYRELEASE:
+#if 1
+ ClearPlayerAction();
+#else
key_joystick_mapping = 0;
key_joystick_mapping = 0;
+#endif
break;
default:
break;
default:
@@
-277,7
+285,7
@@
void SleepWhileUnmapped()
NextEvent(&event);
NextEvent(&event);
- switch(event.type)
+ switch
(event.type)
{
case EVENT_BUTTONRELEASE:
button_status = MB_RELEASED;
{
case EVENT_BUTTONRELEASE:
button_status = MB_RELEASED;
@@
-409,6
+417,13
@@
void HandleClientMessageEvent(ClientMessageEvent *event)
CloseAllAndExit(0);
}
CloseAllAndExit(0);
}
+void HandleWindowManagerEvent(Event *event)
+{
+#if defined(TARGET_SDL)
+ SDLHandleWindowManagerEvent(event);
+#endif
+}
+
void HandleButton(int mx, int my, int button, int button_nr)
{
static int old_mx = 0, old_my = 0;
void HandleButton(int mx, int my, int button, int button_nr)
{
static int old_mx = 0, old_my = 0;
@@
-663,8
+678,18
@@
void HandleKey(Key key, int key_status)
element_dropped[pnr] = FALSE;
}
}
element_dropped[pnr] = FALSE;
}
}
+#if 1
+ else if (tape.recording && tape.pausing)
+ {
+ /* prevent key release events from un-pausing a paused game */
+ if (key_status == KEY_PRESSED &&
+ (key_action & KEY_ACTION))
+ TapeTogglePause(TAPE_TOGGLE_MANUAL);
+ }
+#else
else if (tape.recording && tape.pausing && (key_action & KEY_ACTION))
TapeTogglePause(TAPE_TOGGLE_MANUAL);
else if (tape.recording && tape.pausing && (key_action & KEY_ACTION))
TapeTogglePause(TAPE_TOGGLE_MANUAL);
+#endif
}
}
else
}
}
else
@@
-697,11
+722,19
@@
void HandleKey(Key key, int key_status)
ToggleFullscreenIfNeeded();
ToggleFullscreenIfNeeded();
+ if (game_status == GAME_MODE_SETUP)
+ RedrawSetupScreenAfterFullscreenToggle();
+
return;
}
return;
}
+#if 0
+ if (game_status == GAME_MODE_PLAYING && local_player->LevelSolved_GameEnd &&
+ (key == KSYM_Return || key == setup.shortcut.toggle_pause))
+#else
if (game_status == GAME_MODE_PLAYING && AllPlayersGone &&
(key == KSYM_Return || key == setup.shortcut.toggle_pause))
if (game_status == GAME_MODE_PLAYING && AllPlayersGone &&
(key == KSYM_Return || key == setup.shortcut.toggle_pause))
+#endif
{
GameEnd();
{
GameEnd();
@@
-711,7
+744,7
@@
void HandleKey(Key key, int key_status)
if (game_status == GAME_MODE_MAIN &&
(key == setup.shortcut.toggle_pause || key == KSYM_space))
{
if (game_status == GAME_MODE_MAIN &&
(key == setup.shortcut.toggle_pause || key == KSYM_space))
{
- StartGameActions(options.network, setup.autorecord,
NEW_RANDOMIZE
);
+ StartGameActions(options.network, setup.autorecord,
level.random_seed
);
return;
}
return;
}
@@
-758,7
+791,7
@@
void HandleKey(Key key, int key_status)
key = KSYM_UNDEFINED;
}
key = KSYM_UNDEFINED;
}
- switch(game_status)
+ switch
(game_status)
{
case GAME_MODE_PSEUDO_TYPENAME:
HandleTypeName(0, key);
{
case GAME_MODE_PSEUDO_TYPENAME:
HandleTypeName(0, key);
@@
-770,7
+803,7
@@
void HandleKey(Key key, int key_status)
case GAME_MODE_SETUP:
case GAME_MODE_INFO:
case GAME_MODE_SCORES:
case GAME_MODE_SETUP:
case GAME_MODE_INFO:
case GAME_MODE_SCORES:
- switch(key)
+ switch
(key)
{
case KSYM_space:
case KSYM_Return:
{
case KSYM_space:
case KSYM_Return:
@@
-789,6
+822,9
@@
void HandleKey(Key key, int key_status)
break;
case KSYM_Escape:
break;
case KSYM_Escape:
+ if (game_status != GAME_MODE_MAIN)
+ FadeSkipNextFadeIn();
+
if (game_status == GAME_MODE_TITLE)
HandleTitleScreen(0, 0, 0, 0, MB_MENU_LEAVE);
else if (game_status == GAME_MODE_LEVELS)
if (game_status == GAME_MODE_TITLE)
HandleTitleScreen(0, 0, 0, 0, MB_MENU_LEAVE);
else if (game_status == GAME_MODE_LEVELS)
@@
-841,7
+877,7
@@
void HandleKey(Key key, int key_status)
case GAME_MODE_PLAYING:
{
case GAME_MODE_PLAYING:
{
- switch(key)
+ switch
(key)
{
case KSYM_Escape:
RequestQuitGame(setup.ask_on_escape);
{
case KSYM_Escape:
RequestQuitGame(setup.ask_on_escape);
@@
-1006,7
+1042,7
@@
void HandleJoystick()
int dx = (left ? -1 : right ? 1 : 0);
int dy = (up ? -1 : down ? 1 : 0);
int dx = (left ? -1 : right ? 1 : 0);
int dy = (up ? -1 : down ? 1 : 0);
- switch(game_status)
+ switch
(game_status)
{
case GAME_MODE_TITLE:
case GAME_MODE_MAIN:
{
case GAME_MODE_TITLE:
case GAME_MODE_MAIN:
@@
-1045,7
+1081,11
@@
void HandleJoystick()
if (tape.playing || keyboard)
newbutton = ((joy & JOY_BUTTON) != 0);
if (tape.playing || keyboard)
newbutton = ((joy & JOY_BUTTON) != 0);
+#if 0
+ if (local_player->LevelSolved_GameEnd && newbutton)
+#else
if (AllPlayersGone && newbutton)
if (AllPlayersGone && newbutton)
+#endif
{
GameEnd();
{
GameEnd();