fix: server-independent dirty checking

This commit is contained in:
cha0s 2019-04-07 17:02:31 -04:00
parent f87e9145c5
commit bf05af3a0f

View File

@ -45,6 +45,7 @@ stage.addChild(roomView);
const worldTime = new WorldTime();
let lastWorldTime = worldTime.humanReadable();
// Synchronize state.
let state = undefined;
const stateSynchronizer = new StateSynchronizer({
room,
worldTime,
@ -160,6 +161,8 @@ const predictionHandle = setInterval(() => {
}
// Tick synchronized.
stateSynchronizer.tick(elapsed);
dirty = dirty || stateSynchronizer.state !== state;
state = stateSynchronizer.state;
// Apply environmental lighting.
stage.removeAllFilters();
let intensity = 0;