loadscreen Class Reference

#include <loadscreen.hpp>

Collaboration diagram for loadscreen:

Collaboration graph
[legend]

List of all members.

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 loadscreenglobal_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

CVideoscreen_
SDL_Rect textarea_
SDL_Surface * logo_surface_
bool logo_drawn_
int pby_offset_
int prcnt_

Classes

struct  global_loadscreen_manager


Detailed Description

Definition at line 32 of file loadscreen.hpp.


Constructor & Destructor Documentation

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]

loadscreen::loadscreen (  )  [private]


Member Function Documentation

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  ) 


Member Data Documentation

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().

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().

Definition at line 78 of file loadscreen.hpp.

Referenced by clear_screen(), and set_progress().

SDL_Rect loadscreen::textarea_ [private]

Definition at line 79 of file loadscreen.hpp.

Referenced by loadscreen(), and set_progress().

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]

Definition at line 81 of file loadscreen.hpp.

Referenced by set_progress().

int loadscreen::pby_offset_ [private]

Definition at line 82 of file loadscreen.hpp.

Referenced by set_progress().

int loadscreen::prcnt_ [private]

Definition at line 83 of file loadscreen.hpp.

Referenced by increment_progress(), and set_progress().


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

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs