diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-17 15:11:19 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-17 15:11:19 +0000 |
commit | d0c97b98e477cfdf46ed7f36fd16c64f7943d551 (patch) | |
tree | 156acefaae842888432f923257b76bad12a16672 /src/gui/char_select.cpp | |
parent | d9593657605b2e286b478718c89bcbe7cd341c43 (diff) | |
download | mana-d0c97b98e477cfdf46ed7f36fd16c64f7943d551.tar.gz mana-d0c97b98e477cfdf46ed7f36fd16c64f7943d551.tar.bz2 mana-d0c97b98e477cfdf46ed7f36fd16c64f7943d551.tar.xz mana-d0c97b98e477cfdf46ed7f36fd16c64f7943d551.zip |
Committing Allegro -> SDL switch, hugely breaking the game.
Diffstat (limited to 'src/gui/char_select.cpp')
-rw-r--r-- | src/gui/char_select.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index ac644f3a..3e509727 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -222,7 +222,8 @@ void CharSelectDialog::serverCharSelect() } char_ID = RFIFOL(2); memset(map_path, '\0', 480); - append_filename(map_path, "./data/map/", RFIFOP(6), 480); + strcat(map_path, "./data/map/"); + strncat(map_path, RFIFOP(6), 479 - strlen(map_path)); map_address = RFIFOL(22); map_port = RFIFOW(26); state = GAME; @@ -430,20 +431,32 @@ void charSelect() state = CHAR_SELECT; - while (!key[KEY_ESC] && !key[KEY_ENTER] && state == CHAR_SELECT) + while (/*!key[KEY_ESC] && !key[KEY_ENTER] &&*/ state == CHAR_SELECT) { + // Handle SDL events + SDL_Event event; + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_QUIT: + state = EXIT; + break; + } + + guiInput->pushInput(event); + } + if (n_character > 0) { sel->setPlayerInfo(char_info); } // Draw background - login_wallpaper->draw(buffer, 0, 0); + login_wallpaper->draw(screen, 0, 0); gui->logic(); gui->draw(); // Draw to screen - blit(buffer, screen, 0, 0, 0, 0, 800, 600); + guiGraphics->updateScreen(); } delete sel; |