#include <loadscreen.hpp>
Public Member Functions | |
loadscreen (CVideo &screen, const int &percent=0) | |
~loadscreen () | |
void | set_progress (const int percentage=0, const std::string &text="", const bool commit=true) |
Function to display a load progress bar. | |
void | increment_progress (const int percentage=1, const std::string &text="", const bool commit=true) |
Function to increment the progress bar. | |
void | clear_screen (const bool commit=true) |
Function to draw a blank screen. | |
Public Attributes | |
int | filesystem_counter |
int | binarywml_counter |
int | setconfig_counter |
int | parser_counter |
Static Public Attributes | |
static loadscreen * | global_loadscreen = 0 |
A global loadscreen instance that can be used to avoid passing it on to functions that are many levels deep. | |
Private Member Functions | |
loadscreen () | |
Private Attributes | |
CVideo & | screen_ |
SDL_Rect | textarea_ |
SDL_Surface * | logo_surface_ |
bool | logo_drawn_ |
int | pby_offset_ |
int | prcnt_ |
Classes | |
struct | global_loadscreen_manager |
Definition at line 32 of file loadscreen.hpp.
loadscreen::loadscreen | ( | CVideo & | screen, | |
const int & | percent = 0 | |||
) | [explicit] |
Definition at line 48 of file loadscreen.cpp.
References get_binary_file_location(), logo_surface_, game_config::path, and textarea_.
loadscreen::~loadscreen | ( | ) | [inline] |
Definition at line 39 of file loadscreen.hpp.
References binarywml_counter, filesystem_counter, logo_surface_, parser_counter, and setconfig_counter.
loadscreen::loadscreen | ( | ) | [private] |
void loadscreen::set_progress | ( | const int | percentage = 0 , |
|
const std::string & | text = "" , |
|||
const bool | commit = true | |||
) |
Function to display a load progress bar.
Saturate percentage.
< Border width.
< Border inner spacing width.
< Available width.
< Available height.
< Used width.
< Used heigth.
Definition at line 65 of file loadscreen.cpp.
References font::draw_text(), CVideo::getSurface(), CVideo::getx(), CVideo::gety(), font::line_size(), logo_drawn_, logo_surface_, MAX_PERCENTAGE, MIN_PERCENTAGE, font::NORMAL_COLOUR, pby_offset_, prcnt_, screen_, font::SIZE_NORMAL, and textarea_.
Referenced by increment_progress(), play_controller::init(), and play_game().
void loadscreen::increment_progress | ( | const int | percentage = 1 , |
|
const std::string & | text = "" , |
|||
const bool | commit = true | |||
) |
Function to increment the progress bar.
Definition at line 159 of file loadscreen.cpp.
References prcnt_, and set_progress().
Referenced by increment_binary_wml_progress(), increment_filesystem_progress(), increment_parser_progress(), increment_set_config_progress(), and play_game().
void loadscreen::clear_screen | ( | const bool | commit = true |
) |
Function to draw a blank screen.
< Screen width.
< Screen height.
Definition at line 163 of file loadscreen.cpp.
References preferences::disp, CVideo::getSurface(), CVideo::getx(), CVideo::gety(), and screen_.
Referenced by loadscreen::global_loadscreen_manager::global_loadscreen_manager(), play_game(), and loadscreen::global_loadscreen_manager::~global_loadscreen_manager().
Definition at line 58 of file loadscreen.hpp.
Referenced by increment_filesystem_progress(), and ~loadscreen().
Definition at line 59 of file loadscreen.hpp.
Referenced by increment_binary_wml_progress(), and ~loadscreen().
Definition at line 60 of file loadscreen.hpp.
Referenced by increment_set_config_progress(), and ~loadscreen().
Definition at line 61 of file loadscreen.hpp.
Referenced by increment_parser_progress(), and ~loadscreen().
loadscreen * loadscreen::global_loadscreen = 0 [static] |
A global loadscreen instance that can be used to avoid passing it on to functions that are many levels deep.
Definition at line 65 of file loadscreen.hpp.
Referenced by loadscreen::global_loadscreen_manager::global_loadscreen_manager(), play_controller::init(), play_game(), and loadscreen::global_loadscreen_manager::~global_loadscreen_manager().
CVideo& loadscreen::screen_ [private] |
SDL_Rect loadscreen::textarea_ [private] |
SDL_Surface* loadscreen::logo_surface_ [private] |
Definition at line 80 of file loadscreen.hpp.
Referenced by loadscreen(), set_progress(), and ~loadscreen().
bool loadscreen::logo_drawn_ [private] |
int loadscreen::pby_offset_ [private] |
int loadscreen::prcnt_ [private] |
Definition at line 83 of file loadscreen.hpp.
Referenced by increment_progress(), and set_progress().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |