Browse Source

Replace hardcoded frame number in plDTProgressMgr.

This was overlooked when the consolidation was done in 3027e0605c.
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.
Joseph Davies 11 years ago
parent
commit
77266066ff
  1. 2
      Sources/Plasma/PubUtilLib/plPipeline/plDTProgressMgr.cpp
  2. 5
      Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp
  3. 1
      Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h

2
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;

5
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];

1
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 ) { }

Loading…
Cancel
Save