diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-13 23:38:31 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-13 23:38:31 +0000 |
commit | 65c1d2b0b022de1340509738e65314474e2eb141 (patch) | |
tree | 2bbda5306b2a03d1e68455456fe1e65edd4e157e /src/main.cpp | |
parent | 0b6e2b1e4a256da0c2418af63df1c90e9a120690 (diff) | |
download | mana-client-65c1d2b0b022de1340509738e65314474e2eb141.tar.gz mana-client-65c1d2b0b022de1340509738e65314474e2eb141.tar.bz2 mana-client-65c1d2b0b022de1340509738e65314474e2eb141.tar.xz mana-client-65c1d2b0b022de1340509738e65314474e2eb141.zip |
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.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
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 <iostream> #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); |