From 07fbb21f3bd0761d476f653ff8030f032816d8ef Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Mon, 9 Jul 2012 20:06:53 +0000 Subject: [PATCH] -if in game settings, dont display game banner with the full brightness, otherwise its not easy to read the settings for some games --- source/banner/BannerWindow.cpp | 12 ++++++++++-- source/banner/BannerWindow.hpp | 3 ++- source/menu/menu_game.cpp | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/source/banner/BannerWindow.cpp b/source/banner/BannerWindow.cpp index 4bf313c1..deb48f8c 100644 --- a/source/banner/BannerWindow.cpp +++ b/source/banner/BannerWindow.cpp @@ -43,6 +43,7 @@ void BannerWindow::Init(CVideo *vid, u8 *font1, u8 *font2) AnimPosX = 0.5f * (ScreenProps.x - fIconWidth); AnimPosY = 0.5f * (ScreenProps.y - fIconHeight); AnimationRunning = false; + Brightness = 0.f; gameBanner->Clear(); if(!FontLoaded) @@ -217,8 +218,15 @@ void BannerWindow::Draw(void) // Clear and back to previous projection video->setup2DProjection(); - GX_InvVtxCache(); - GX_InvalidateTexAll(); + + // If wanted + if(Brightness > 1.f) + DrawRectangle(0.0f, 0.0f, video->width(), video->height(), (GXColor) {0, 0, 0, Brightness}); +} + +void BannerWindow::SetBrightness(float b) +{ + Brightness = b; } void BannerWindow::DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color) diff --git a/source/banner/BannerWindow.hpp b/source/banner/BannerWindow.hpp index e9737345..a6e4cfa1 100644 --- a/source/banner/BannerWindow.hpp +++ b/source/banner/BannerWindow.hpp @@ -54,6 +54,7 @@ class BannerWindow void CreateGCBanner(u8 *bnr, CVideo *vid, u8 *font1, u8 *font2, const wchar_t *title); void Draw(void); bool ToogleZoom(void); + void SetBrightness(float b); protected: int MainLoop(); void Animate(void); @@ -72,7 +73,7 @@ class BannerWindow int returnVal; int gameSelected; dir_discHdr dvdheader; - + float Brightness; int MaxAnimSteps; int AnimStep; diff --git a/source/menu/menu_game.cpp b/source/menu/menu_game.cpp index 24f2b941..ce6d647f 100644 --- a/source/menu/menu_game.cpp +++ b/source/menu/menu_game.cpp @@ -521,7 +521,9 @@ void CMenu::_game(bool launch) m_gameSelected = true; m_banner->ToogleZoom(); + m_banner->SetBrightness(200.f); _gameSettings(); + m_banner->SetBrightness(0.f); m_banner->ToogleZoom(); _showGame();