MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / SetDate

Method SetDate

engine/Poseidon/World/WorldSetup.cpp:1319–1335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1317}
1318
1319void World::SetDate(int year, int month, int day, int hour, int minute)
1320{
1321 day--;
1322 for (int m = 0; m < month - 1; m++)
1323 {
1324 day += Poseidon::GetDaysInMonth(year, m);
1325 }
1326 float time = day * OneDay + hour * OneHour + minute * OneMinute + 0.5 * OneSecond;
1327
1328 Glob.clock.SetTimeInYear(time);
1329 Glob.clock.SetTimeOfDay(hour, minute);
1330 Glob.clock.SetYear(year);
1331
1332 LightSun* sun = _scene.MainLight();
1333 sun->Recalculate(this);
1334 _scene.MainLightChanged();
1335}
1336
1337void World::ProcessNetwork()
1338{

Callers 1

SetDateFunction · 0.80

Calls 7

GetDaysInMonthFunction · 0.85
SetTimeInYearMethod · 0.80
SetTimeOfDayMethod · 0.80
SetYearMethod · 0.80
MainLightMethod · 0.80
MainLightChangedMethod · 0.80
RecalculateMethod · 0.45

Tested by

no test coverage detected