From 71ed1df5e6b62e2ad5c6641d504b8a97152478f2 Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Sun, 31 Aug 2014 17:17:48 -0600 Subject: [PATCH] Added FastNoteRendering preference. --- Themes/_fallback/Languages/en.ini | 3 +++ Themes/_fallback/metrics.ini | 6 ++++-- src/NoteField.cpp | 8 +++++++- src/PrefsManager.cpp | 1 + src/PrefsManager.h | 1 + src/ScreenOptionsMasterPrefs.cpp | 1 + 6 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index f1e4e8f607..6a8916b94a 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -392,6 +392,7 @@ Exit= Fail=Fail FastLoad=If enabled, don't check songs for changes on load. FastLoadAdditionalSongs=If enabled, don't check songs for changes to Additional Songs on load. +FastNoteRendering=If enabled, the z buffer is not cleared after every note. This causes 3d noteskins to collide, but substantially improves performance in gameplay. Fill Machine Stats= Game=Change the current game type with this option. GetRankingName=Determines if name entry should never be shown, always be shown, or shown when the course is listed on the high scores screen. @@ -668,6 +669,7 @@ Expand 2->3=Expand 2->3 Expand 2x=Expand 2x Expand 3->4=Expand 3->4 Fast=Fast +FastNoteRendering=Fast Note Rendering FitInside=Fit Inside FitInsideAvoidLetter=Avoid Letter FitInsideAvoidPillar=Avoid Pillar @@ -917,6 +919,7 @@ DisplayResolution=Display Resolution Duration seconds=Duration seconds EasterEggs=Easter Eggs Edit Songs/Steps=Edit Songs/Steps +FastNoteRendering=Fast Note Rendering Genre=Genre Practice Songs/Steps=Practice Songs/Steps Edit Courses=Edit Courses diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index e94fb0c093..b895462e8b 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -2894,12 +2894,13 @@ PrevScreen="ScreenOptionsService" Fallback="ScreenOptionsServiceChild" PrevScreen="ScreenOptionsService" NextScreen="ScreenOptionsService" -LineNames="1,2,3,4,5,6,7,8,9,FA,10,11,12,13,14,15,16,17,18,19,20,21,22" +LineNames="1,2,3,4,5,FNR,6,7,8,9,FA,10,11,12,13,14,15,16,17,18,19,20,21,22" Line1="conf,Windowed" Line2="conf,DisplayResolution" Line3="conf,DisplayAspectRatio" Line4="conf,HighResolutionTextures" Line5="conf,Vsync" +LineFNR="conf,FastNoteRendering" Line6="conf,SoundVolume" Line7="conf,TimingWindowScale" Line8="conf,LifeDifficulty" @@ -2923,7 +2924,7 @@ Line22="conf,EventMode" Fallback="ScreenOptionsServiceChild" NextScreen="ScreenOptionsService" PrevScreen="ScreenOptionsService" -LineNames="1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20" +LineNames="1,2,3,4,5,6,7,8,9,10,11,12,13,FNR,14,17,18,19,20" Line1="conf,Windowed" Line2="conf,DisplayResolution" Line3="conf,DisplayAspectRatio" @@ -2937,6 +2938,7 @@ Line10="conf,CelShadeModels" Line11="conf,DelayedTextureDelete" Line12="conf,RefreshRate" Line13="conf,Vsync" +LineFNR="conf,FastNoteRendering" Line14="conf,ShowStats" Line15="conf,ShowBanners" Line16="conf,AttractSoundFrequency" diff --git a/src/NoteField.cpp b/src/NoteField.cpp index 6bde0e551a..a3e438c19f 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -36,8 +36,11 @@ static ThemeMetric FADE_FAIL_TIME( "NoteField", "FadeFailTime" ); static RString RoutineNoteSkinName( size_t i ) { return ssprintf("RoutineNoteSkinP%i",int(i+1)); } static ThemeMetric1D ROUTINE_NOTESKIN( "NoteField", RoutineNoteSkinName, NUM_PLAYERS ); +static bool FAST_NOTE_RENDERING_PREF_CACHED= false; + NoteField::NoteField() { + FAST_NOTE_RENDERING_PREF_CACHED= PREFSMAN->m_FastNoteRendering; m_pNoteData = NULL; m_pCurDisplay = NULL; @@ -1355,7 +1358,10 @@ void NoteField::DrawPrimitives() bool bNoteIsUpcoming = NoteRowToBeat(q) > m_pPlayerState->GetDisplayedPosition().m_fSongBeat; bAnyUpcomingInThisCol |= bNoteIsUpcoming; - DISPLAY->ClearZBuffer(); + if(!FAST_NOTE_RENDERING_PREF_CACHED) + { + DISPLAY->ClearZBuffer(); + } } cur->m_ReceptorArrowRow.SetNoteUpcoming( c, bAnyUpcomingInThisCol ); diff --git a/src/PrefsManager.cpp b/src/PrefsManager.cpp index 64d742babc..ce98ad82ad 100644 --- a/src/PrefsManager.cpp +++ b/src/PrefsManager.cpp @@ -184,6 +184,7 @@ PrefsManager::PrefsManager() : m_bHiddenSongs ( "HiddenSongs", false ), m_bVsync ( "Vsync", true ), + m_FastNoteRendering("FastNoteRendering", false), m_bInterlaced ( "Interlaced", false ), m_bPAL ( "PAL", false ), m_bDelayedTextureDelete ( "DelayedTextureDelete", false ), diff --git a/src/PrefsManager.h b/src/PrefsManager.h index 4c34be5429..e27daf627e 100644 --- a/src/PrefsManager.h +++ b/src/PrefsManager.h @@ -175,6 +175,7 @@ public: Preference m_bHiddenSongs; Preference m_bVsync; + Preference m_FastNoteRendering; Preference m_bInterlaced; Preference m_bPAL; Preference m_bDelayedTextureDelete; diff --git a/src/ScreenOptionsMasterPrefs.cpp b/src/ScreenOptionsMasterPrefs.cpp index 0a64a4727f..a5b5c5a869 100644 --- a/src/ScreenOptionsMasterPrefs.cpp +++ b/src/ScreenOptionsMasterPrefs.cpp @@ -777,6 +777,7 @@ static void InitializeConfOptions() g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS; ADD( ConfOption( "Vsync", MovePref, "No", "Yes" ) ); g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS; + ADD( ConfOption( "FastNoteRendering", MovePref, "Off", "On")); ADD( ConfOption( "ShowStats", MovePref, "Off","On" ) ); ADD( ConfOption( "ShowBanners", MovePref, "Off","On" ) );