From 35f9b7848178454a22285bb7803694763459491f Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Thu, 2 May 2013 22:06:23 -0400 Subject: [PATCH] Well...this works at least. --- src/ScreenDebugOverlay.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/ScreenDebugOverlay.cpp b/src/ScreenDebugOverlay.cpp index a870ac294b..8ab5df80ab 100644 --- a/src/ScreenDebugOverlay.cpp +++ b/src/ScreenDebugOverlay.cpp @@ -256,9 +256,10 @@ void ScreenDebugOverlay::Init() m_textHeader.SetText( DEBUG_MENU ); this->AddChild( &m_textHeader ); - FOREACH_CONST( RString, m_asPages, s ) + auto start = m_asPages.begin(); + for (vector::const_iterator s = m_asPages.begin(); s != m_asPages.end(); ++s) { - int iPage = s - m_asPages.begin(); + int iPage = s - start; DeviceInput di; bool b = GetKeyFromMap( g_Mappings.pageButton, iPage, di ); @@ -277,7 +278,7 @@ void ScreenDebugOverlay::Init() this->AddChild( p ); } - FOREACH_CONST( IDebugLine*, *g_pvpSubscribers, p ) + for (auto p = g_pvpSubscribers->begin(); p != g_pvpSubscribers->end(); ++p) { { BitmapText *bt = new BitmapText; @@ -350,19 +351,21 @@ void ScreenDebugOverlay::Update( float fDeltaTime ) void ScreenDebugOverlay::UpdateText() { - FOREACH_CONST( RString, m_asPages, s ) + auto start = m_asPages.begin(); + for (vector::const_iterator s = m_asPages.begin(); s != m_asPages.end(); ++s) { - int iPage = s - m_asPages.begin(); + int iPage = s - start; m_vptextPages[iPage]->PlayCommand( (iPage == m_iCurrentPage) ? "GainFocus" : "LoseFocus" ); } // todo: allow changing of various spacing/location things -aj int iOffset = 0; - FOREACH_CONST( IDebugLine*, *g_pvpSubscribers, p ) + auto subStart = g_pvpSubscribers->begin(); + for (vector::const_iterator p = subStart; p != g_pvpSubscribers->end(); ++p) { RString sPageName = (*p)->GetPageName(); - int i = p-g_pvpSubscribers->begin(); + int i = p - subStart; float fY = LINE_START_Y + iOffset * LINE_SPACING; @@ -453,11 +456,12 @@ bool ScreenDebugOverlay::Input( const InputEventPlus &input ) return true; } - FOREACH_CONST( IDebugLine*, *g_pvpSubscribers, p ) + auto start = g_pvpSubscribers->begin(); + for (vector::const_iterator p = start; p != g_pvpSubscribers->end(); ++p) { RString sPageName = (*p)->GetPageName(); - int i = p-g_pvpSubscribers->begin(); + int i = p - start; // Gameplay buttons are available only in gameplay. Non-gameplay buttons // are only available when the screen is displayed.