projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed linker flags when building for Emscripten platform
[rocksndiamonds.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index a5bbf458ccc3f91381023161f01d945b75bd819a..13723bfa514da9ff8f78e499946907ad7d4729bd 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-108,7
+108,7
@@
static int FilterEvents(const Event *event)
{
SetMouseCursor(CURSOR_DEFAULT);
{
SetMouseCursor(CURSOR_DEFAULT);
-
DelayReached(&special_cursor_delay, 0
);
+
ResetDelayCounter(&special_cursor_delay
);
cursor_mode_last = CURSOR_DEFAULT;
}
cursor_mode_last = CURSOR_DEFAULT;
}
@@
-214,6
+214,8
@@
static void HandleEvents(void)
while (NextValidEvent(&event))
{
while (NextValidEvent(&event))
{
+ int game_status_last = game_status;
+
switch (event.type)
{
case EVENT_BUTTONPRESS:
switch (event.type)
{
case EVENT_BUTTONPRESS:
@@
-264,6
+266,10
@@
static void HandleEvents(void)
break;
}
break;
}
+ // always handle events within delay period if game status has changed
+ if (game_status != game_status_last)
+ ResetDelayCounter(&event_frame_delay);
+
// do not handle events for longer than standard frame delay period
if (DelayReached(&event_frame_delay, event_frame_delay_value))
break;
// do not handle events for longer than standard frame delay period
if (DelayReached(&event_frame_delay, event_frame_delay_value))
break;
@@
-330,7
+336,7
@@
static void HandleMouseCursor(void)
// display normal pointer if mouse pressed
if (button_status != MB_RELEASED)
// display normal pointer if mouse pressed
if (button_status != MB_RELEASED)
-
DelayReached(&special_cursor_delay, 0
);
+
ResetDelayCounter(&special_cursor_delay
);
if (gfx.cursor_mode != CURSOR_PLAYFIELD &&
cursor_inside_playfield &&
if (gfx.cursor_mode != CURSOR_PLAYFIELD &&
cursor_inside_playfield &&
@@
-1470,7
+1476,7
@@
void HandleKeyEvent(KeyEvent *event)
if (key_status == KEY_PRESSED)
SetOverlayEnabled(!GetOverlayEnabled());
}
if (key_status == KEY_PRESSED)
SetOverlayEnabled(!GetOverlayEnabled());
}
- else
+ else
if (!textinput_status)
{
// for any other "real" key event, disable virtual buttons
SetOverlayEnabled(FALSE);
{
// for any other "real" key event, disable virtual buttons
SetOverlayEnabled(FALSE);
@@
-1749,6
+1755,7
@@
void HandleButton(int mx, int my, int button, int button_nr)
break;
case GAME_MODE_PSEUDO_TYPENAME:
break;
case GAME_MODE_PSEUDO_TYPENAME:
+ case GAME_MODE_PSEUDO_TYPENAMES:
HandleTypeName(KSYM_Return);
break;
HandleTypeName(KSYM_Return);
break;
@@
-2084,6
+2091,8
@@
void HandleKey(Key key, int key_status)
{
key_action |= key_info[i].action | JOY_BUTTON_SNAP;
key_snap_action |= key_info[i].action;
{
key_action |= key_info[i].action | JOY_BUTTON_SNAP;
key_snap_action |= key_info[i].action;
+
+ tape.property_bits |= TAPE_PROPERTY_TAS_KEYS;
}
}
}
}
}
}
@@
-2301,6
+2310,7
@@
void HandleKey(Key key, int key_status)
switch (game_status)
{
case GAME_MODE_PSEUDO_TYPENAME:
switch (game_status)
{
case GAME_MODE_PSEUDO_TYPENAME:
+ case GAME_MODE_PSEUDO_TYPENAMES:
HandleTypeName(key);
break;
HandleTypeName(key);
break;
@@
-2403,7
+2413,7
@@
void HandleKey(Key key, int key_status)
switch (key)
{
case KSYM_Escape:
switch (key)
{
case KSYM_Escape:
- RequestQuitGame(
setup.ask_on_escape
);
+ RequestQuitGame(
TRUE
);
break;
default:
break;
default: