Fix rain continuing on main menu. Added comment about screen flags

This commit is contained in:
Duncan Frost 2014-12-14 21:02:38 +00:00
parent 83a7dd5095
commit 86b6d8083e
2 changed files with 14 additions and 1 deletions

View File

@ -104,6 +104,8 @@ typedef void (EMPTY_ARGS_VOID_POINTER)();
typedef unsigned short rct_string_id;
enum {
// Although this is labeled a flag it actually means when
// zero the screen is in playing mode.
SCREEN_FLAGS_PLAYING = 0,
SCREEN_FLAGS_TITLE_DEMO = 1,
SCREEN_FLAGS_SCENARIO_EDITOR = 2,

View File

@ -103,6 +103,17 @@ void climate_reset(int climate)
_lightningTimer = 0;
_thunderTimer = 0;
if (_rainVolume != 1){
#ifdef USE_MIXER
if (_rainSoundChannel) {
Mixer_Stop_Channel(_rainSoundChannel);
_rainSoundChannel = 0;
}
#else
sound_stop(&_rainSoundInstance);
#endif
_rainVolume = 1;
}
climate_determine_future_weather();
}
@ -229,7 +240,7 @@ void climate_update_sound()
return;
if (!(RCT2_GLOBAL(0x009AF59D, uint8) & 1))
return;
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (1<<SCREEN_FLAGS_PLAYING))
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TITLE_DEMO)
return;
climate_update_rain_sound();