xoreos  0.0.5
Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Engines::LoadProgress Class Reference

#include <loadprogress.h>

Inheritance diagram for Engines::LoadProgress:
Inheritance graph
[legend]
Collaboration diagram for Engines::LoadProgress:
Collaboration graph
[legend]

Public Member Functions

 LoadProgress (size_t steps)
 Create a load progress display. More...
 
 ~LoadProgress ()
 
void step (const Common::UString &description)
 Take a step in advancing the progress. More...
 

Static Private Member Functions

static Common::UString createProgressbar (size_t length, double filled)
 
static Common::UString createProgressbarUpper (size_t length)
 
static Common::UString createProgressbarLower (size_t length)
 

Private Attributes

size_t _steps
 The number of total steps. More...
 
size_t _currentStep
 The current step we're on. More...
 
double _stepAmount
 The amount to step each time. More...
 
double _currentAmount
 The accumulated amount. More...
 
uint32 _startTime
 The timestamp the first step happened. More...
 
Common::ScopedPtr< Graphics::Aurora::Text_description
 The text containing the description of the current step. More...
 
Common::ScopedPtr< Graphics::Aurora::Text_barUpper
 The upper border of the progress bar. More...
 
Common::ScopedPtr< Graphics::Aurora::Text_barLower
 The lower border of the progress bar. More...
 
Common::ScopedPtr< Graphics::Aurora::Text_progressbar
 The actual progress bar. More...
 
Common::ScopedPtr< Graphics::Aurora::Text_percent
 The text containing the current percentage of done-ness. More...
 

Static Private Attributes

static const int kBarLength = 50
 The length of the progress bar in characters. More...
 

Detailed Description

Definition at line 41 of file loadprogress.h.

Constructor & Destructor Documentation

◆ LoadProgress()

Engines::LoadProgress::LoadProgress ( size_t  steps)

Create a load progress display.

steps specifies the number of steps that are gone through in the process of loading the game. The very first step is the 0% mark, the very last the 100% mark. Obviously, there needs to be at least two steps.

An example with five steps:

  • Step 0: 0%
  • Step 1: 25%
  • Step 2: 50%
  • Step 3: 75%
  • Step 4: 100%

Definition at line 41 of file loadprogress.cpp.

References _barLower, _barUpper, _currentAmount, _description, _percent, _progressbar, _stepAmount, _steps, createProgressbar(), createProgressbarLower(), createProgressbarUpper(), FontMan, Graphics::Aurora::FontHandle::getFont(), Graphics::Font::getHeight(), kBarLength, Graphics::Aurora::kHAlignCenter, Graphics::Aurora::kSystemFontMono, Graphics::Aurora::kVAlignBottom, Graphics::Aurora::kVAlignMiddle, Graphics::Aurora::kVAlignTop, Common::ScopedPtrBase< T, Deallocator >::reset(), and WindowMan.

Here is the call graph for this function:

◆ ~LoadProgress()

Engines::LoadProgress::~LoadProgress ( )

Definition at line 72 of file loadprogress.cpp.

Member Function Documentation

◆ createProgressbar()

Common::UString Engines::LoadProgress::createProgressbar ( size_t  length,
double  filled 
)
staticprivate

Definition at line 121 of file loadprogress.cpp.

Referenced by LoadProgress(), and step().

Here is the caller graph for this function:

◆ createProgressbarLower()

Common::UString Engines::LoadProgress::createProgressbarLower ( size_t  length)
staticprivate

Definition at line 143 of file loadprogress.cpp.

Referenced by LoadProgress().

Here is the caller graph for this function:

◆ createProgressbarUpper()

Common::UString Engines::LoadProgress::createProgressbarUpper ( size_t  length)
staticprivate

Definition at line 138 of file loadprogress.cpp.

Referenced by LoadProgress().

Here is the caller graph for this function:

◆ step()

void Engines::LoadProgress::step ( const Common::UString description)

Member Data Documentation

◆ _barLower

Common::ScopedPtr<Graphics::Aurora::Text> Engines::LoadProgress::_barLower
private

The lower border of the progress bar.

Definition at line 80 of file loadprogress.h.

Referenced by LoadProgress(), and step().

◆ _barUpper

Common::ScopedPtr<Graphics::Aurora::Text> Engines::LoadProgress::_barUpper
private

The upper border of the progress bar.

Definition at line 79 of file loadprogress.h.

Referenced by LoadProgress(), and step().

◆ _currentAmount

double Engines::LoadProgress::_currentAmount
private

The accumulated amount.

Definition at line 71 of file loadprogress.h.

Referenced by LoadProgress(), and step().

◆ _currentStep

size_t Engines::LoadProgress::_currentStep
private

The current step we're on.

Definition at line 68 of file loadprogress.h.

Referenced by step().

◆ _description

Common::ScopedPtr<Graphics::Aurora::Text> Engines::LoadProgress::_description
private

The text containing the description of the current step.

Definition at line 76 of file loadprogress.h.

Referenced by LoadProgress(), and step().

◆ _percent

Common::ScopedPtr<Graphics::Aurora::Text> Engines::LoadProgress::_percent
private

The text containing the current percentage of done-ness.

Definition at line 84 of file loadprogress.h.

Referenced by LoadProgress(), and step().

◆ _progressbar

Common::ScopedPtr<Graphics::Aurora::Text> Engines::LoadProgress::_progressbar
private

The actual progress bar.

Definition at line 81 of file loadprogress.h.

Referenced by LoadProgress(), and step().

◆ _startTime

uint32 Engines::LoadProgress::_startTime
private

The timestamp the first step happened.

Definition at line 73 of file loadprogress.h.

Referenced by step().

◆ _stepAmount

double Engines::LoadProgress::_stepAmount
private

The amount to step each time.

Definition at line 70 of file loadprogress.h.

Referenced by LoadProgress(), and step().

◆ _steps

size_t Engines::LoadProgress::_steps
private

The number of total steps.

Definition at line 67 of file loadprogress.h.

Referenced by LoadProgress(), and step().

◆ kBarLength

const int Engines::LoadProgress::kBarLength = 50
staticprivate

The length of the progress bar in characters.

Definition at line 65 of file loadprogress.h.

Referenced by LoadProgress(), and step().


The documentation for this class was generated from the following files: