Use SyncEngine for synchronizing all synced state in RenderEngine

This commit is contained in:
Erik Broberg
2016-09-15 17:52:22 -04:00
parent ee0cc6d165
commit 9e59cd3b8d
4 changed files with 24 additions and 22 deletions

View File

@@ -526,20 +526,6 @@ void RenderEngine::setSceneGraph(Scene* sceneGraph) {
_sceneGraph = sceneGraph;
}
void RenderEngine::serialize(SyncBuffer* syncBuffer) {
syncBuffer->encode(_onScreenInformation._node);
syncBuffer->encode(_onScreenInformation._position.x);
syncBuffer->encode(_onScreenInformation._position.y);
syncBuffer->encode(_onScreenInformation._size);
}
void RenderEngine::deserialize(SyncBuffer* syncBuffer, bool useDoubleBuffering) {
syncBuffer->decode(_onScreenInformation._node);
syncBuffer->decode(_onScreenInformation._position.x);
syncBuffer->decode(_onScreenInformation._position.y);
syncBuffer->decode(_onScreenInformation._size);
}
Camera* RenderEngine::camera() const {
return _mainCamera;
}
@@ -1700,6 +1686,12 @@ void RenderEngine::renderScreenLog() {
}
}
std::vector<Syncable*> RenderEngine::getSyncables(){
std::vector<Syncable*> syncables = _mainCamera->getSyncables();
syncables.push_back(&_onScreenInformation);
return syncables;
}
void RenderEngine::sortScreenspaceRenderables() {
std::sort(
_screenSpaceRenderables.begin(),