From 74667184205e9f1910f26c1896eabce1435b4610 Mon Sep 17 00:00:00 2001 From: rachytski Date: Sat, 2 Apr 2011 15:50:41 +0300 Subject: [PATCH] changed background color to "sandy". --- map/framework.hpp | 14 +++++++++++--- map/render_queue.cpp | 7 +++++-- map/render_queue.hpp | 3 ++- map/render_queue_routine.cpp | 10 ++++++---- map/render_queue_routine.hpp | 5 ++++- 5 files changed, 28 insertions(+), 11 deletions(-) diff --git a/map/framework.hpp b/map/framework.hpp index a333c9ab3a..cc1b331d2d 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -108,6 +108,8 @@ class FrameWork vector > m_benchmarks; unsigned m_currentBenchmark; + yg::Color m_bgColor; + RenderQueue m_renderQueue; shared_ptr m_resourceManager; InformationDisplay m_informationDisplay; @@ -165,12 +167,18 @@ public: m_isBenchmarking(GetPlatform().IsBenchmarking()), m_isBenchmarkInitialized(false), m_currentBenchmark(0), + m_bgColor(0xEE, 0xEE, 0xDD, 0xFF), +// m_bgColor(0xF4 / 17 * 17, 0xFC / 17 * 17, 0xE8 / 17 * 17, 0xFF), +// m_bgColor(0xF2 / 17 * 17, 0xF2 / 17 * 17, 0xEE / 17 * 17, 0xFF), +// m_bgColor(0xF1 / 17 * 17, 0xF2 / 17 * 17, 0xEB / 17 * 17, 0xFF), +// m_bgColor(187, 187, 187, 255), m_renderQueue(GetPlatform().SkinName(), GetPlatform().IsMultiSampled(), GetPlatform().DoPeriodicalUpdate(), GetPlatform().PeriodicalUpdateInterval(), GetPlatform().IsBenchmarking(), - GetPlatform().ScaleEtalonSize()), + GetPlatform().ScaleEtalonSize(), + m_bgColor), m_isRedrawEnabled(true), m_metresMinWidth(20), m_minRulerWidth(97), @@ -423,7 +431,7 @@ public: if (m_benchmarks.empty()) { e->drawer()->screen()->beginFrame(); - e->drawer()->screen()->clear(); + e->drawer()->screen()->clear(m_bgColor); m_informationDisplay.setDisplayRect(m2::RectI(0, 0, 100, 100)); m_informationDisplay.enableRuler(false); m_informationDisplay.doDraw(e->drawer().get()); @@ -441,7 +449,7 @@ public: m_currentBenchmark++; e->drawer()->screen()->beginFrame(); - e->drawer()->screen()->clear(); + e->drawer()->screen()->clear(m_bgColor); m2::PointD ptShift = m_renderQueue.renderState().coordSystemShift(false); diff --git a/map/render_queue.cpp b/map/render_queue.cpp index 56b63c5d6a..e8cd2f2655 100644 --- a/map/render_queue.cpp +++ b/map/render_queue.cpp @@ -11,7 +11,9 @@ RenderQueue::RenderQueue( bool doPeriodicalUpdate, double updateInterval, bool isBenchmarking, - unsigned scaleEtalonSize) + unsigned scaleEtalonSize, + yg::Color const & bgColor + ) : m_renderState(new yg::gl::RenderState()) { m_renderState->m_surfaceWidth = 100; @@ -27,7 +29,8 @@ RenderQueue::RenderQueue( doPeriodicalUpdate, updateInterval, isBenchmarking, - scaleEtalonSize); + scaleEtalonSize, + bgColor); } void RenderQueue::initializeGL(shared_ptr const & primaryContext, diff --git a/map/render_queue.hpp b/map/render_queue.hpp index 9ac5809a10..179334a8fb 100644 --- a/map/render_queue.hpp +++ b/map/render_queue.hpp @@ -36,7 +36,8 @@ public: bool doPeriodicalUpdate, double updateInterval, bool isBenchmarking, - unsigned scaleEtalonSize); + unsigned scaleEtalonSize, + yg::Color const & bgColor); /// destructor. ~RenderQueue(); /// set the primary context. it starts the rendering thread. diff --git a/map/render_queue_routine.cpp b/map/render_queue_routine.cpp index 1c1757426f..6a9b92025c 100644 --- a/map/render_queue_routine.cpp +++ b/map/render_queue_routine.cpp @@ -34,7 +34,8 @@ RenderQueueRoutine::RenderQueueRoutine(shared_ptr const & r bool doPeriodicalUpdate, double updateInterval, bool isBenchmarking, - unsigned scaleEtalonSize) + unsigned scaleEtalonSize, + yg::Color const & bgColor) { m_skinName = skinName; m_visualScale = 0; @@ -45,6 +46,7 @@ RenderQueueRoutine::RenderQueueRoutine(shared_ptr const & r m_updateInterval = updateInterval; m_isBenchmarking = isBenchmarking; m_scaleEtalonSize = scaleEtalonSize; + m_bgColor = bgColor; } void RenderQueueRoutine::Cancel() @@ -83,7 +85,7 @@ void RenderQueueRoutine::processResize(ScreenBase const & frameScreen) m_auxScreen->onSize(texW, texH); m_auxScreen->setRenderTarget(m_renderState->m_actualTarget); m_auxScreen->beginFrame(); - m_auxScreen->clear(); + m_auxScreen->clear(m_bgColor); if (oldActualTarget != 0) { @@ -101,7 +103,7 @@ void RenderQueueRoutine::processResize(ScreenBase const & frameScreen) m_renderState->m_backBufferLayers[i] = m_resourceManager->createRenderTarget(texW, texH); m_auxScreen->setRenderTarget(m_renderState->m_backBufferLayers[i]); m_auxScreen->beginFrame(); - m_auxScreen->clear(); + m_auxScreen->clear(m_bgColor); if (oldBackBuffer != 0) { @@ -372,7 +374,7 @@ void RenderQueueRoutine::Do() m_threadDrawer->screen()->enableClipRect(true); m_threadDrawer->screen()->setClipRect(textureRect); - m_threadDrawer->clear(); + m_threadDrawer->clear(m_bgColor); if ((isPanning) && (!doRedrawAll)) { diff --git a/map/render_queue_routine.hpp b/map/render_queue_routine.hpp index 1d9878dc74..0ae777bde9 100644 --- a/map/render_queue_routine.hpp +++ b/map/render_queue_routine.hpp @@ -8,6 +8,7 @@ #include "../std/list.hpp" #include "../std/function.hpp" #include "../yg/thread_renderer.hpp" +#include "../yg/color.hpp" class DrawerYG; @@ -79,6 +80,7 @@ private: string m_skinName; bool m_isBenchmarking; unsigned m_scaleEtalonSize; + yg::Color m_bgColor; void waitForRenderCommand(list > & cmdList, threads::ConditionGuard & guard); @@ -90,7 +92,8 @@ public: bool doPeriodicalUpdate, double updateInterval, bool isBenchmarking, - unsigned scaleEtalonSize); + unsigned scaleEtalonSize, + yg::Color const & bgColor); /// initialize GL rendering /// this function is called just before the thread starts. void initializeGL(shared_ptr const & renderContext,