projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1638f68
)
fixed problem with global animations being restarted if screen changes to same game...
author
Holger Schemel
<info@artsoft.org>
Tue, 10 Oct 2017 21:25:18 +0000
(23:25 +0200)
committer
Holger Schemel
<info@artsoft.org>
Tue, 10 Oct 2017 21:25:18 +0000
(23:25 +0200)
src/anim.c
patch
|
blob
|
history
diff --git
a/src/anim.c
b/src/anim.c
index 37c7193c21c8745069ed60ce585928f6de14da56..83be4309ed11acca1b86846d43447afd5e65f5ff 100644
(file)
--- a/
src/anim.c
+++ b/
src/anim.c
@@
-206,6
+206,7
@@
static unsigned int anim_sync_frame = 0;
static int game_mode_anim_classes[NUM_GAME_MODES];
static int anim_class_game_modes[NUM_ANIM_CLASSES];
static int game_mode_anim_classes[NUM_GAME_MODES];
static int anim_class_game_modes[NUM_ANIM_CLASSES];
+static int anim_status_last_before_fading = GAME_MODE_DEFAULT;
static int anim_status_last = GAME_MODE_DEFAULT;
static int anim_classes_last = ANIM_CLASS_NONE;
static int anim_status_last = GAME_MODE_DEFAULT;
static int anim_classes_last = ANIM_CLASS_NONE;
@@
-560,6
+561,7
@@
void InitGlobalAnimControls()
anim_class_game_modes[anim_class_game_modes_list[i].class_bit] =
anim_class_game_modes_list[i].game_mode;
anim_class_game_modes[anim_class_game_modes_list[i].class_bit] =
anim_class_game_modes_list[i].game_mode;
+ anim_status_last_before_fading = GAME_MODE_LOADING;
anim_status_last = GAME_MODE_LOADING;
anim_classes_last = ANIM_CLASS_NONE;
}
anim_status_last = GAME_MODE_LOADING;
anim_classes_last = ANIM_CLASS_NONE;
}
@@
-602,11
+604,14
@@
void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage)
// start or stop global animations by change of game mode
// (special handling of animations for "current screen" and "all screens")
// start or stop global animations by change of game mode
// (special handling of animations for "current screen" and "all screens")
- // stop animations for last screen
- game_mode_anim_action[anim_status_last] = ANIM_STOP;
+ if (global.anim_status_next != anim_status_last_before_fading)
+ {
+ // stop animations for last screen before fading to new screen
+ game_mode_anim_action[anim_status_last] = ANIM_STOP;
- // start animations for current screen
- game_mode_anim_action[global.anim_status] = ANIM_START;
+ // start animations for current screen after fading to new screen
+ game_mode_anim_action[global.anim_status] = ANIM_START;
+ }
// start animations for all screens after loading new artwork set
if (anim_status_last == GAME_MODE_LOADING)
// start animations for all screens after loading new artwork set
if (anim_status_last == GAME_MODE_LOADING)
@@
-635,7
+640,10
@@
void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage)
if (drawing_target == DRAW_TO_SCREEN)
{
if (after_fading)
if (drawing_target == DRAW_TO_SCREEN)
{
if (after_fading)
+ {
anim_classes_last = anim_classes_next;
anim_classes_last = anim_classes_next;
+ anim_status_last_before_fading = global.anim_status;
+ }
anim_status_last = global.anim_status;
anim_status_last = global.anim_status;