From f25bdc56537ae2d69d598a42cfcfa52c2d4ae4c8 Mon Sep 17 00:00:00 2001 From: Deve Date: Wed, 3 Apr 2019 23:06:13 +0200 Subject: [PATCH] Revert "Always use current window size." This reverts commit f974c9200c7dda01d16ba60c5193c2ebe7ca5292. --- src/graphics/irr_driver.cpp | 6 ++++-- src/graphics/irr_driver.hpp | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index cb0c21391..599e55df6 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -581,6 +581,8 @@ void IrrDriver::initDevice() m_scene_manager->addExternalMeshLoader(spml); spml->drop(); + m_actual_screen_size = m_video_driver->getCurrentRenderTargetSize(); + #ifdef ENABLE_RECORDER ogrRegGeneralCallback(OGR_CBT_START_RECORDING, [] (void* user_data) { MessageQueue::add @@ -599,8 +601,8 @@ void IrrDriver::initDevice() RecorderConfig cfg; cfg.m_triple_buffering = 1; cfg.m_record_audio = 1; - cfg.m_width = getActualScreenSize().Width; - cfg.m_height = getActualScreenSize().Height; + cfg.m_width = m_actual_screen_size.Width; + cfg.m_height = m_actual_screen_size.Height; int vf = UserConfigParams::m_video_format; cfg.m_video_format = (VideoFormat)vf; cfg.m_audio_format = OGR_AF_VORBIS; diff --git a/src/graphics/irr_driver.hpp b/src/graphics/irr_driver.hpp index b6456682d..e1d8f2c5a 100644 --- a/src/graphics/irr_driver.hpp +++ b/src/graphics/irr_driver.hpp @@ -101,6 +101,8 @@ private: /** Wind. */ Wind *m_wind; + core::dimension2du m_actual_screen_size; + /** The main MRT setup. */ core::array m_mrt; @@ -467,9 +469,8 @@ public: } // ------------------------------------------------------------------------ const core::dimension2du getActualScreenSize() const - { - assert(m_video_driver != NULL); - return m_video_driver->getCurrentRenderTargetSize(); + { + return m_actual_screen_size; } // ------------------------------------------------------------------------ float getSSAORadius() const