mirror of https://github.com/OpenRCT2/OpenRCT2.git
fix day / night cycle for title sequence
This commit is contained in:
parent
08504257ad
commit
fe69ad6d53
|
@ -571,29 +571,28 @@ static void scenario_update_daynight_cycle()
|
||||||
**/
|
**/
|
||||||
void scenario_update()
|
void scenario_update()
|
||||||
{
|
{
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & ~SCREEN_FLAGS_PLAYING)
|
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & ~SCREEN_FLAGS_PLAYING)) {
|
||||||
return;
|
uint32 currentMonthTick = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, uint16);
|
||||||
|
uint32 nextMonthTick = currentMonthTick + 4;
|
||||||
|
uint8 currentMonth = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16) & 7;
|
||||||
|
uint8 currentDaysInMonth = (uint8)days_in_month[currentMonth];
|
||||||
|
|
||||||
uint32 currentMonthTick = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, uint16);
|
scenario_autosave_check();
|
||||||
uint32 nextMonthTick = currentMonthTick + 4;
|
if ((currentDaysInMonth * nextMonthTick) >> 16 != (currentDaysInMonth * currentMonthTick) >> 16) {
|
||||||
uint8 currentMonth = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16) & 7;
|
scenario_day_update();
|
||||||
uint8 currentDaysInMonth = (uint8)days_in_month[currentMonth];
|
}
|
||||||
|
if (nextMonthTick % 0x4000 == 0) {
|
||||||
|
scenario_week_update();
|
||||||
|
}
|
||||||
|
if (nextMonthTick % 0x8000 == 0) {
|
||||||
|
scenario_fortnight_update();
|
||||||
|
}
|
||||||
|
|
||||||
scenario_autosave_check();
|
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, uint16) = (uint16)nextMonthTick;
|
||||||
if ((currentDaysInMonth * nextMonthTick) >> 16 != (currentDaysInMonth * currentMonthTick) >> 16) {
|
if (nextMonthTick >= 0x10000) {
|
||||||
scenario_day_update();
|
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16)++;
|
||||||
}
|
scenario_month_update();
|
||||||
if (nextMonthTick % 0x4000 == 0) {
|
}
|
||||||
scenario_week_update();
|
|
||||||
}
|
|
||||||
if (nextMonthTick % 0x8000 == 0) {
|
|
||||||
scenario_fortnight_update();
|
|
||||||
}
|
|
||||||
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, uint16) = (uint16)nextMonthTick;
|
|
||||||
if (nextMonthTick >= 0x10000) {
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16)++;
|
|
||||||
scenario_month_update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scenario_update_daynight_cycle();
|
scenario_update_daynight_cycle();
|
||||||
|
|
Loading…
Reference in New Issue