projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed obsolete code for single-tile playfield redraw
[rocksndiamonds.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index 7a366aa7fc4e24b7f121fd7a7f41df31ae168923..42277b02e6c1947d5e0176b11657638aa68a7e49 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-108,9
+108,8
@@
boolean SkipPressedMouseMotionEvent(const Event *event)
if (event->type != EVENT_MOTIONNOTIFY)
return FALSE;
if (event->type != EVENT_MOTIONNOTIFY)
return FALSE;
- /* only skip motion events with pressed button outside level editor */
- if (button_status == MB_RELEASED ||
- game_status == GAME_MODE_EDITOR || game_status == GAME_MODE_PLAYING)
+ /* only skip motion events with pressed button outside the game */
+ if (button_status == MB_RELEASED || game_status == GAME_MODE_PLAYING)
return FALSE;
if (PendingEvent())
return FALSE;
if (PendingEvent())
@@
-131,7
+130,7
@@
boolean SkipPressedMouseMotionEvent(const Event *event)
when using SDL with properly installed event filter, this function can be
replaced with a simple "NextEvent()" call, but it doesn't hurt either */
when using SDL with properly installed event filter, this function can be
replaced with a simple "NextEvent()" call, but it doesn't hurt either */
-
static
boolean NextValidEvent(Event *event)
+boolean NextValidEvent(Event *event)
{
while (PendingEvent())
{
{
while (PendingEvent())
{
@@
-933,12
+932,14
@@
void HandleWindowManagerEvent(Event *event)
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;
+ boolean button_hold = FALSE;
if (button < 0)
{
mx = old_mx;
my = old_my;
button = -button;
if (button < 0)
{
mx = old_mx;
my = old_my;
button = -button;
+ button_hold = TRUE;
}
else
{
}
else
{
@@
-947,6
+948,7
@@
void HandleButton(int mx, int my, int button, int button_nr)
}
#if defined(PLATFORM_ANDROID)
}
#if defined(PLATFORM_ANDROID)
+ // !!! for now, do not handle gadgets when playing -- maybe fix this !!!
if (game_status != GAME_MODE_PLAYING &&
HandleGadgets(mx, my, button))
{
if (game_status != GAME_MODE_PLAYING &&
HandleGadgets(mx, my, button))
{
@@
-961,6
+963,9
@@
void HandleButton(int mx, int my, int button, int button_nr)
}
#endif
}
#endif
+ if (button_hold && game_status == GAME_MODE_PLAYING && tape.pausing)
+ return;
+
/* do not use scroll wheel button events for anything other than gadgets */
if (IS_WHEEL_BUTTON(button_nr))
return;
/* do not use scroll wheel button events for anything other than gadgets */
if (IS_WHEEL_BUTTON(button_nr))
return;
@@
-1596,7
+1601,8
@@
void HandleKey(Key key, int key_status)
void HandleNoEvent()
{
void HandleNoEvent()
{
- if (button_status && game_status != GAME_MODE_PLAYING)
+ // if (button_status && game_status != GAME_MODE_PLAYING)
+ if (button_status && (game_status != GAME_MODE_PLAYING || tape.pausing))
{
HandleButton(0, 0, -button_status, button_status);
}
{
HandleButton(0, 0, -button_status, button_status);
}