From 77266066ffd0fd0133c9b9a393f4a115cfe185e7 Mon Sep 17 00:00:00 2001 From: Joseph Davies Date: Fri, 20 Dec 2013 08:11:49 -0800 Subject: [PATCH] Replace hardcoded frame number in plDTProgressMgr. This was overlooked when the consolidation was done in 3027e0605c2. With this fix, the number of frames to be loaded is entirely defined in a single place. This also prepares the code for a future commit to remove the necessity of the compile-time definition entirely. --- Sources/Plasma/PubUtilLib/plPipeline/plDTProgressMgr.cpp | 2 +- Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp | 5 +++++ Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plDTProgressMgr.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plDTProgressMgr.cpp index 0aec3e13..c130625d 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plDTProgressMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plDTProgressMgr.cpp @@ -157,7 +157,7 @@ void plDTProgressMgr::Draw( plPipeline *p ) if ((currentMs - fLastDraw) > 30) { fCurrentImage++; - if (fCurrentImage >= 18) + if (fCurrentImage >= plProgressMgr::NumLoadingFrames()) fCurrentImage = 0; fLastDraw = currentMs; diff --git a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp index 363cc764..63fd75ed 100644 --- a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp @@ -246,6 +246,11 @@ char* plProgressMgr::GetLoadingFrameID(int index) return fImageRotation[0]; } +uint32_t plProgressMgr::NumLoadingFrames() const +{ + return LOADING_RES_COUNT; +} + const char* plProgressMgr::GetStaticTextID(StaticText staticTextType) { return fStaticTextIDs[staticTextType]; diff --git a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h index 4fc07eb7..7e3cfeac 100644 --- a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h +++ b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h @@ -236,6 +236,7 @@ class plProgressMgr static plProgressMgr* GetInstance() { return fManager; } static char* GetLoadingFrameID(int index); + uint32_t plProgressMgr::NumLoadingFrames() const; static const char* GetStaticTextID(StaticText staticTextType); virtual void Draw( plPipeline *p ) { }