projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changed some EM engine game element names
[rocksndiamonds.git]
/
src
/
anim.c
diff --git
a/src/anim.c
b/src/anim.c
index 0aa1c0f4ff12a0970415d9c2b5f67f87429f8b04..3e2f1222ee1bc82b0ced39b0f20c0313cef0203a 100644
(file)
--- a/
src/anim.c
+++ b/
src/anim.c
@@
-242,6
+242,9
@@
int getAnimationFrame(int num_frames, int delay, int mode, int start_frame,
{
int frame = 0;
{
int frame = 0;
+ if (delay < 1) // delay must be at least 1
+ delay = 1;
+
sync_frame += start_frame * delay;
if (mode & ANIM_LOOP) // looping animation
sync_frame += start_frame * delay;
if (mode & ANIM_LOOP) // looping animation
@@
-1760,9
+1763,11
@@
static void InitGlobalAnim_Clickable(void)
static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event)
{
boolean click_consumed = FALSE;
static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event)
{
boolean click_consumed = FALSE;
+ boolean anything_clicked = FALSE;
boolean any_part_clicked = FALSE;
boolean any_event_action = FALSE;
int mode_nr;
boolean any_part_clicked = FALSE;
boolean any_event_action = FALSE;
int mode_nr;
+ int i;
// check game modes in reverse draw order (to stop when clicked)
for (mode_nr = NUM_GAME_MODES - 1; mode_nr >= 0; mode_nr--)
// check game modes in reverse draw order (to stop when clicked)
for (mode_nr = NUM_GAME_MODES - 1; mode_nr >= 0; mode_nr--)
@@
-1803,7
+1808,7
@@
static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event)
part->old_anim_nr + 1, part->old_nr + 1);
#endif
part->old_anim_nr + 1, part->old_nr + 1);
#endif
- part->clicked = TRUE;
+
anything_clicked =
part->clicked = TRUE;
click_consumed |= clickConsumed(part);
}
click_consumed |= clickConsumed(part);
}
@@
-1816,7
+1821,7
@@
static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event)
part->old_anim_nr + 1, part->old_nr + 1);
#endif
part->old_anim_nr + 1, part->old_nr + 1);
#endif
- part->clicked = TRUE;
+
anything_clicked =
part->clicked = TRUE;
click_consumed |= clickConsumed(part);
}
click_consumed |= clickConsumed(part);
}
@@
-1846,7
+1851,7
@@
static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event)
part->old_anim_nr + 1, part->old_nr + 1);
#endif
part->old_anim_nr + 1, part->old_nr + 1);
#endif
- part->clicked = TRUE;
+
anything_clicked =
part->clicked = TRUE;
click_consumed |= clickConsumed(part);
}
click_consumed |= clickConsumed(part);
}
@@
-1858,13
+1863,17
@@
static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event)
}
}
}
}
- if (
click_consum
ed)
+ if (
anything_click
ed)
{
handle_click = TRUE;
{
handle_click = TRUE;
- HandleGlobalAnim(ANIM_CONTINUE, game_status);
+ for (i = 0; i < NUM_GAME_MODES; i++)
+ HandleGlobalAnim(ANIM_CONTINUE, i);
handle_click = FALSE;
handle_click = FALSE;
+
+ // prevent ignoring release event if processed within same game frame
+ StopProcessingEvents();
}
return (click_consumed || any_event_action);
}
return (click_consumed || any_event_action);