#include <loading_screen.h>
Collaboration diagram for LoadingScreen:
Public Member Functions | |
~LoadingScreen () | |
void | DrawBackground () |
void | StartLoading (uint nb, std::string resource, std::string label) |
Static Public Member Functions | |
static LoadingScreen * | GetInstance () |
Private Member Functions | |
LoadingScreen () | |
Private Attributes | |
Profile * | res |
Sprite * | loading_bg |
Static Private Attributes | |
static LoadingScreen * | singleton = NULL |
Definition at line 29 of file loading_screen.h.
LoadingScreen::LoadingScreen | ( | ) | [private] |
Definition at line 30 of file loading_screen.cpp.
00031 { 00032 // Get the background image 00033 Config * config = Config::GetInstance(); 00034 AppWormux * app = AppWormux::GetInstance(); 00035 00036 loading_bg = new Sprite(Surface(( 00037 config->GetDataDir() + PATH_SEPARATOR 00038 + "menu" + PATH_SEPARATOR 00039 + "img" + PATH_SEPARATOR 00040 + "loading.png").c_str())); 00041 loading_bg->cache.EnableLastFrameCache(); 00042 loading_bg->ScaleSize(app->video.window.GetWidth(), app->video.window.GetHeight()); 00043 00044 // Get profile from resource manager 00045 res = resource_manager.LoadXMLProfile( "graphism.xml", false); 00046 }
Here is the call graph for this function:
Here is the caller graph for this function:
LoadingScreen::~LoadingScreen | ( | ) |
Definition at line 48 of file loading_screen.cpp.
00049 { 00050 delete loading_bg; 00051 resource_manager.UnLoadXMLProfile(res); 00052 }
Here is the call graph for this function:
void LoadingScreen::DrawBackground | ( | ) |
Definition at line 63 of file loading_screen.cpp.
00064 { 00065 loading_bg->ScaleSize(AppWormux::GetInstance()->video.window.GetWidth(), AppWormux::GetInstance()->video.window.GetHeight()); 00066 loading_bg->Blit( AppWormux::GetInstance()->video.window, 0, 0); 00067 AppWormux::GetInstance()->video.Flip(); 00068 }
Here is the call graph for this function:
Here is the caller graph for this function:
LoadingScreen * LoadingScreen::GetInstance | ( | ) | [static] |
Definition at line 55 of file loading_screen.cpp.
00056 { 00057 if (singleton == NULL) { 00058 singleton = new LoadingScreen(); 00059 } 00060 return singleton; 00061 }
Here is the call graph for this function:
Here is the caller graph for this function:
void LoadingScreen::StartLoading | ( | uint | nb, | |
std::string | resource, | |||
std::string | label | |||
) |
Definition at line 70 of file loading_screen.cpp.
00072 { 00073 Surface image = resource_manager.LoadImage(res, "loading_screen/"+resource); 00074 00075 int slot_margin_x = (120/2 - image.GetWidth()/2); 00076 int x = (AppWormux::GetInstance()->video.window.GetWidth()/2)- (3*120) + nb*120; 00077 int y = (AppWormux::GetInstance()->video.window.GetHeight()/2)+40; 00078 00079 Rectanglei dest ( x+slot_margin_x, 00080 y, 00081 image.GetWidth(), 00082 image.GetHeight() ); 00083 AppWormux::GetInstance()->video.window.Blit( image, dest.GetPosition()); 00084 00085 Font::GetInstance(Font::FONT_NORMAL)->WriteCenter(Point2i(x+120/2, y+80), label, white_color); 00086 00087 AppWormux::GetInstance()->video.Flip(); 00088 }
Here is the call graph for this function:
Here is the caller graph for this function:
Sprite* LoadingScreen::loading_bg [private] |
Definition at line 35 of file loading_screen.h.
Profile* LoadingScreen::res [private] |
Definition at line 34 of file loading_screen.h.
LoadingScreen * LoadingScreen::singleton = NULL [static, private] |
Definition at line 32 of file loading_screen.h.