From c9bbc8948d027d994e5f30a635cdd1eb5a8d0e8f Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 5 Jan 2024 19:36:08 -0500 Subject: [PATCH] Rename list functions --- LEGO1/legovideomanager.cpp | 2 +- LEGO1/mxlist.h | 48 ++++++++++++++++----------------- LEGO1/mxloopingsmkpresenter.cpp | 2 +- LEGO1/mxregion.cpp | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/LEGO1/legovideomanager.cpp b/LEGO1/legovideomanager.cpp index 9224ba8e..6f10b8a8 100644 --- a/LEGO1/legovideomanager.cpp +++ b/LEGO1/legovideomanager.cpp @@ -288,7 +288,7 @@ MxResult LegoVideoManager::Tickle() m_3dManager->GetLego3DView()->GetDevice()->Update(); } - cursor.Retreat(); + cursor.Prev(); while (cursor.Next(presenter)) presenter->PutData(); diff --git a/LEGO1/mxlist.h b/LEGO1/mxlist.h index f0e3c216..33fbbcd0 100644 --- a/LEGO1/mxlist.h +++ b/LEGO1/mxlist.h @@ -91,13 +91,13 @@ class MxListCursor : public MxCore { MxBool Find(T p_obj); void Detach(); void Destroy(); + MxBool Next(); MxBool Next(T& p_obj); + MxBool Prev(); MxBool Prev(T& p_obj); MxBool Current(T& p_obj); MxBool First(T& p_obj); MxBool Last(T& p_obj); - MxBool Advance(); - MxBool Retreat(); MxBool HasMatch() { return m_match != NULL; } void SetValue(T p_obj); MxBool Head() @@ -223,6 +223,17 @@ inline void MxListCursor::Destroy() } } +template +inline MxBool MxListCursor::Next() +{ + if (!m_match) + m_match = m_list->m_first; + else + m_match = m_match->GetNext(); + + return m_match != NULL; +} + template inline MxBool MxListCursor::Next(T& p_obj) { @@ -237,6 +248,17 @@ inline MxBool MxListCursor::Next(T& p_obj) return m_match != NULL; } +template +inline MxBool MxListCursor::Prev() +{ + if (!m_match) + m_match = m_list->m_last; + else + m_match = m_match->GetPrev(); + + return m_match != NULL; +} + template inline MxBool MxListCursor::Prev(T& p_obj) { @@ -280,28 +302,6 @@ inline MxBool MxListCursor::Last(T& p_obj) return m_match != NULL; } -template -inline MxBool MxListCursor::Advance() -{ - if (!m_match) - m_match = m_list->m_first; - else - m_match = m_match->GetNext(); - - return m_match != NULL; -} - -template -inline MxBool MxListCursor::Retreat() -{ - if (!m_match) - m_match = m_list->m_last; - else - m_match = m_match->GetPrev(); - - return m_match != NULL; -} - template inline void MxListCursor::SetValue(T p_obj) { diff --git a/LEGO1/mxloopingsmkpresenter.cpp b/LEGO1/mxloopingsmkpresenter.cpp index 11ab8388..8d0f4d00 100644 --- a/LEGO1/mxloopingsmkpresenter.cpp +++ b/LEGO1/mxloopingsmkpresenter.cpp @@ -99,7 +99,7 @@ void MxLoopingSmkPresenter::RepeatingTickle() while (cursor.Next(chunk)) chunk->SetTime(chunk->GetTime() + time); - m_cursor->Advance(); + m_cursor->Next(); } MxStreamChunk* chunk; diff --git a/LEGO1/mxregion.cpp b/LEGO1/mxregion.cpp index d21b9fdb..ea7fab55 100644 --- a/LEGO1/mxregion.cpp +++ b/LEGO1/mxregion.cpp @@ -146,7 +146,7 @@ void MxRegionTopBottom::FUN_100c5280(MxS32 p_left, MxS32 p_right) p_right = leftRight->GetRight(); b = a; - b.Advance(); + b.Next(); a.Destroy(); if (!b.Current(leftRight))