From 65c1d2b0b022de1340509738e65314474e2eb141 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Thu, 13 Jan 2005 23:38:31 +0000 Subject: Added heavily modified resource manager by zenogais that is currently using Allegro to load/draw images. Only the login wallpaper is currently loaded using the resource manager and the resource manager still waits with searching for available files until they are asked for instead of indexing what is available. --- src/main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 61de436f..663c2589 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,7 +28,7 @@ #include "gui/ok_dialog.h" #include "./sound/sound.h" #include "./graphic/graphic.h" - +#include "resources/resourcemanager.h" #include #ifdef __USE_UNIX98 @@ -77,7 +77,7 @@ SERVER_INFO *server_info; PLAYER_INFO *char_info = new PLAYER_INFO; Spriteset *hairset, *playerset; -BITMAP *login_wallpaper; +Image *login_wallpaper; char username[LEN_USERNAME]; char password[LEN_PASSWORD]; @@ -222,7 +222,6 @@ void init_engine() { config.setValue("keyboard", "en"); config.setValue("language", ""); config.setValue("core_version", CORE_VERSION); - config.setValue("host", "animesites.de"); config.setValue("port", 6901); config.setValue("screen", 1); @@ -294,7 +293,9 @@ void init_engine() { error("Not enough memory to create buffer"); } - login_wallpaper = load_bitmap("data/graphic/login.bmp", NULL); + ResourceManager *resman = ResourceManager::getInstance(); + + login_wallpaper = resman->createImage("graphic/login.bmp"); if (!login_wallpaper) error("Couldn't load login.bmp"); BITMAP *playerbitmap = load_bitmap("data/graphic/playerset.bmp", NULL); @@ -352,6 +353,7 @@ void exit_engine() { config.write(dir); delete dir; gui_exit(); + ResourceManager::deleteInstance(); destroy_bitmap(buffer); allegro_exit(); } @@ -390,7 +392,7 @@ int main() { break; case ERROR: // Redraw GUI - blit(login_wallpaper, buffer, 0, 0, 0, 0, 800, 600); + login_wallpaper->draw(buffer, 0, 0); guiGraphics->setTarget(buffer); gui->update(); blit(buffer, screen, 0, 0, 0, 0, 800, 600); -- cgit v1.2.3-70-g09d2