From 8daf0c49d3ce033a5ba8aaf94c19cbe003981ebb Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 23 May 2007 21:07:28 +0000 Subject: [PATCH] add ShowMasks --- stepmania/Themes/default/Languages/en.ini | 1 + stepmania/src/Actor.cpp | 6 +++++- stepmania/src/ScreenDebugOverlay.cpp | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/stepmania/Themes/default/Languages/en.ini b/stepmania/Themes/default/Languages/en.ini index 76a019f4e6..fdc8a953ba 100644 --- a/stepmania/Themes/default/Languages/en.ini +++ b/stepmania/Themes/default/Languages/en.ini @@ -1015,6 +1015,7 @@ Screen Test Mode=Screen Test Mode Send Off To Screen=Send Off To Screen Send On To Screen=Send On To Screen Send Notes Ended=Send Notes Ended +Show Masks=Show Masks Slow=Slow Song=Song Tempo=Tempo diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 9a44963801..97791d79fe 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -13,6 +13,9 @@ #include "MessageManager.h" #include "LightsManager.h" // for NUM_CabinetLight #include "ActorUtil.h" +#include "Preference.h" + +static Preference g_bShowMasks("ShowMasks", false); /* It's useful to be able to construct a basic Actor in XML, in * order to simply delay a Transition, or receive and send broadcasts. @@ -500,7 +503,8 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties void Actor::SetGlobalRenderStates() { // set Actor-defined render states - DISPLAY->SetBlendMode( m_BlendMode ); + if( !g_bShowMasks.Get() || m_BlendMode != BLEND_NO_EFFECT ) + DISPLAY->SetBlendMode( m_BlendMode ); DISPLAY->SetZWrite( m_bZWrite ); DISPLAY->SetZTestMode( m_ZTestMode ); diff --git a/stepmania/src/ScreenDebugOverlay.cpp b/stepmania/src/ScreenDebugOverlay.cpp index e7dbc04a7c..62a11fa16e 100644 --- a/stepmania/src/ScreenDebugOverlay.cpp +++ b/stepmania/src/ScreenDebugOverlay.cpp @@ -483,6 +483,7 @@ static LocalizedString RENDERING_STATS ( "ScreenDebugOverlay", "Rendering Stats static LocalizedString VSYNC ( "ScreenDebugOverlay", "Vsync" ); static LocalizedString MULTITEXTURE ( "ScreenDebugOverlay", "Multitexture" ); static LocalizedString SCREEN_TEST_MODE ( "ScreenDebugOverlay", "Screen Test Mode" ); +static LocalizedString SCREEN_SHOW_MASKS ( "ScreenDebugOverlay", "Show Masks" ); static LocalizedString PROFILE ( "ScreenDebugOverlay", "Profile" ); static LocalizedString CLEAR_PROFILE_STATS ( "ScreenDebugOverlay", "Clear Profile Stats" ); static LocalizedString FILL_PROFILE_STATS ( "ScreenDebugOverlay", "Fill Profile Stats" ); @@ -711,6 +712,27 @@ class DebugLineScreenTestMode : public IDebugLine } }; +class DebugLineShowMasks : public IDebugLine +{ + virtual RString GetDisplayTitle() { return SCREEN_SHOW_MASKS.GetValue(); } + virtual bool IsEnabled() { return GetPref()->Get(); } + virtual RString GetPageName() const { return "Theme"; } + virtual void DoAndMakeSystemMessage( RString &sMessageOut ) + { + GetPref()->Set( !GetPref()->Get() ); + IDebugLine::DoAndMakeSystemMessage( sMessageOut ); + } + + Preference *GetPref() + { + IPreference *pPref = IPreference::GetPreferenceByName("ShowMasks"); + ASSERT( pPref ); + Preference *pRet = dynamic_cast *>(pPref); + ASSERT( pRet ); + return pRet; + } +}; + static ProfileSlot g_ProfileSlot = ProfileSlot_Machine; static bool IsSelectProfilePersistent() { @@ -1072,6 +1094,7 @@ DECLARE_ONE( DebugLineStats ); DECLARE_ONE( DebugLineVsync ); DECLARE_ONE( DebugLineAllowMultitexture ); DECLARE_ONE( DebugLineScreenTestMode ); +DECLARE_ONE( DebugLineShowMasks ); DECLARE_ONE( DebugLineProfileSlot ); DECLARE_ONE( DebugLineClearProfileStats ); DECLARE_ONE( DebugLineFillProfileStats );