Procházet zdrojové kódy

~ 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 <almamu@almamu.com>

Alexis Maiquez před 7 roky
rodič
revize
e285b313e0
2 změnil soubory, kde provedl 5 přidání a 5 odebrání
  1. 2 2
      main.cpp
  2. 3 3
      src/WallpaperEngine/Render/CCamera.cpp

+ 2 - 2
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 ();
             }

+ 3 - 3
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);