summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-12 16:18:13 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-12 16:18:13 +0000
commit197b684831c9701635fd140bbb06a6c2b3f0fcc7 (patch)
tree035d637cba6634d9195094213d80679838fd925e /src/gui/gui.cpp
parent72d8e5065d6c2bdb4c941e91d4280b48afc6d602 (diff)
downloadmana-197b684831c9701635fd140bbb06a6c2b3f0fcc7.tar.gz
mana-197b684831c9701635fd140bbb06a6c2b3f0fcc7.tar.bz2
mana-197b684831c9701635fd140bbb06a6c2b3f0fcc7.tar.xz
mana-197b684831c9701635fd140bbb06a6c2b3f0fcc7.zip
Chat input field to Guichan.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index b9dcf923..b20d2e1d 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -57,13 +57,13 @@ int (*gui__external_slider_callback)(void *, int);
int reroute_slider_proc(void *dp3, int d2);
// Guichan Allegro stuff
-gcn::AllegroInput* input; // Input driver
-gcn::AllegroGraphics* graphics; // Graphics driver
+gcn::AllegroInput* guiInput; // Input driver
+gcn::AllegroGraphics* guiGraphics; // Graphics driver
gcn::AllegroImageLoader* imageLoader; // For loading images
// Guichan stuff
gcn::Gui* gui; // A Gui object - binds it all together
-gcn::Container* guitop; // The top container
+gcn::Container* guiTop; // The top container
gcn::ImageFont* guiFont; // A font
@@ -74,19 +74,19 @@ void init_gui(BITMAP *bitmap, const char *skin) {
imageLoader = new gcn::AllegroImageLoader();
gcn::Image::setImageLoader(imageLoader);
- graphics = new gcn::AllegroGraphics();
- graphics->setTarget(bitmap);
+ guiGraphics = new gcn::AllegroGraphics();
+ guiGraphics->setTarget(bitmap);
- input = new gcn::AllegroInput();
+ guiInput = new gcn::AllegroInput();
- guitop = new gcn::Container();
- guitop->setDimension(gcn::Rectangle(0, 0, SCREEN_W, SCREEN_H));
- guitop->setOpaque(false);
+ guiTop = new gcn::Container();
+ guiTop->setDimension(gcn::Rectangle(0, 0, SCREEN_W, SCREEN_H));
+ guiTop->setOpaque(false);
gui = new gcn::Gui();
- gui->setGraphics(graphics);
- gui->setInput(input);
- gui->setTop(guitop);
+ gui->setGraphics(guiGraphics);
+ gui->setInput(guiInput);
+ gui->setTop(guiTop);
guiFont = new gcn::ImageFont("./data/graphic/fixedfont.bmp",
" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
gcn::Widget::setGlobalFont(guiFont);
@@ -102,14 +102,18 @@ void init_gui(BITMAP *bitmap, const char *skin) {
}
int gui_update(DIALOG_PLAYER *player) {
- int ret;
- gui->logic();
- gui->draw();
+ int ret = 0;
if (player) {
+ // Update Allegro dialog (to be replaced)
dialog_message(player->dialog, MSG_DRAW, 0, 0);
ret = update_dialog(player);
}
+ else {
+ // Update new GUI system using Guichan
+ gui->logic();
+ gui->draw();
+ }
// Draw the mouse
draw_sprite(gui_bitmap, mouse_sprite, mouse_x, mouse_y);
@@ -458,11 +462,11 @@ int gui_load_skin(const char* skinname) {
void gui_exit() {
delete guiFont;
- delete guitop;
+ delete guiTop;
delete gui;
- delete input;
- delete graphics;
+ delete guiInput;
+ delete guiGraphics;
delete imageLoader;
//alfont_destroy_font(gui_font);