From e285b313e06b8ee39809b1a0846b4328c796cf0b Mon Sep 17 00:00:00 2001 From: Alexis Maiquez Date: Mon, 9 Sep 2019 09:46:29 +0200 Subject: [PATCH] ~ use clearcolor from scene instead of using black ~ camera should use it's own getters, not access the m_camera object directly Signed-off-by: Alexis Maiquez --- main.cpp | 4 ++-- src/WallpaperEngine/Render/CCamera.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index bfd0a3a..8146fd0 100644 --- a/main.cpp +++ b/main.cpp @@ -319,14 +319,14 @@ int main (int argc, char* argv[]) // change viewport to render to the correct portion of the display IrrlichtContext->getDevice ()->getVideoDriver ()->setViewPort (*cur); - IrrlichtContext->getDevice ()->getVideoDriver ()->beginScene (false, true, irr::video::SColor(0, 0, 0, 0)); + IrrlichtContext->getDevice ()->getVideoDriver ()->beginScene (false, true, sceneRender->getScene ()->getClearColor ().toSColor()); IrrlichtContext->getDevice ()->getSceneManager ()->drawAll (); IrrlichtContext->getDevice ()->getVideoDriver ()->endScene (); } } else { - IrrlichtContext->getDevice ()->getVideoDriver ()->beginScene (true, true, irr::video::SColor(0, 0, 0, 0)); + IrrlichtContext->getDevice ()->getVideoDriver ()->beginScene (true, true, sceneRender->getScene ()->getClearColor ().toSColor()); IrrlichtContext->getDevice ()->getSceneManager ()->drawAll (); IrrlichtContext->getDevice ()->getVideoDriver ()->endScene (); } diff --git a/src/WallpaperEngine/Render/CCamera.cpp b/src/WallpaperEngine/Render/CCamera.cpp index 6744c45..a337df7 100644 --- a/src/WallpaperEngine/Render/CCamera.cpp +++ b/src/WallpaperEngine/Render/CCamera.cpp @@ -8,7 +8,7 @@ CCamera::CCamera (CScene* scene, Core::Scenes::CCamera* camera) : m_scene (scene) { this->m_sceneCamera = scene->getContext ()->getDevice ()->getSceneManager ()->addCameraSceneNode ( - scene, *this->m_camera->getCenter (), *this->m_camera->getEye (), scene->nextId () + scene, *this->getCenter (), *this->getEye (), scene->nextId () ); } @@ -37,8 +37,8 @@ void CCamera::setOrthogonalProjection (irr::f32 width, irr::f32 height) irr::core::matrix4 identity; identity.makeIdentity (); irr::core::matrix4 orthogonalProjection; orthogonalProjection.buildProjectionMatrixOrthoLH ( width, height, - 0.0f, - this->m_camera->getUp ()->Y + this->getEye ()->Z, + this->getCenter ()->Z ); this->m_sceneCamera->setProjectionMatrix (orthogonalProjection);