From 040459dcaab5ce412b606b1ddfe7bfaf5d5f4499 Mon Sep 17 00:00:00 2001 From: fledge68 Date: Thu, 3 Oct 2013 11:50:34 +0000 Subject: [PATCH] -added a couple screensaver options under "GENERAL" section of wiiflow.ini screensaver_idle_seconds = number of seconds before showing screensaver (default = 60) screensaver_disabled = turn off screensaver (default = no) --- source/gui/video.cpp | 4 ++-- source/gui/video.hpp | 2 +- source/menu/menu.cpp | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/gui/video.cpp b/source/gui/video.cpp index 4b38c982..b202d7dc 100644 --- a/source/gui/video.cpp +++ b/source/gui/video.cpp @@ -726,14 +726,14 @@ void DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color) GX_SetTevOp(GX_TEVSTAGE0, GX_MODULATE); } -void CVideo::screensaver(u32 no_input) +void CVideo::screensaver(u32 no_input, u32 max_no_input) { if(no_input == 0) { m_screensaver_alpha = 0; return; } - if(no_input > 60) + if(no_input > max_no_input) { DrawRectangle(0, 0, 640, 480, (GXColor){0,0,0,m_screensaver_alpha}); if(m_screensaver_alpha < 150) diff --git a/source/gui/video.hpp b/source/gui/video.hpp index 8a9d4491..534a6ee4 100644 --- a/source/gui/video.hpp +++ b/source/gui/video.hpp @@ -54,7 +54,7 @@ public: void renderToTexture(TexData &tex, bool clear); void cleanup(void); void setup2DProjection(bool setViewPort = true, bool noScale = false); - void screensaver(u32 no_input); + void screensaver(u32 no_input, u32 max_no_input); u32 width(void) const { return m_rmode->fbWidth; } u32 height(void) const { return m_rmode->efbHeight; } GXRModeObj *vid_mode(void) const { return m_rmode; } diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 76d39028..7e937b28 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -1882,7 +1882,8 @@ void CMenu::_mainLoopCommon(bool withCF, bool adjusting) ScanInput(); if(!m_vid.showingWaitMessage()) { - m_vid.screensaver(NoInputTime()); + if(!m_cfg.getBool("GENERAL", "screensaver_disabled", false)) + m_vid.screensaver(NoInputTime(), m_cfg.getInt("GENERAL", "screensaver_idle_seconds", 60)); m_vid.render(); } if(Sys_Exiting())