summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-15 17:49:01 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-15 17:49:01 +0000
commit8ed926ea15e8f151b8b81f93a5dccd0d53cf7ca1 (patch)
tree800d8d02db775b5f263eaee92c5cbf021d800e9f /src/gui/gui.cpp
parentc92d7c1188febd7c5af15fa710ab06c3af4dede5 (diff)
downloadmana-client-8ed926ea15e8f151b8b81f93a5dccd0d53cf7ca1.tar.gz
mana-client-8ed926ea15e8f151b8b81f93a5dccd0d53cf7ca1.tar.bz2
mana-client-8ed926ea15e8f151b8b81f93a5dccd0d53cf7ca1.tar.xz
mana-client-8ed926ea15e8f151b8b81f93a5dccd0d53cf7ca1.zip
Cleaned up includes, separated engine from graphics and single buffer now
used throughout application, cleaned up shop functions.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 14e76efd..eab34a4b 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -45,7 +45,6 @@ static BITMAP *gui__repository[GUI_BMP_COUNT];
// The currently active skin
LexSkin gui_skin;
-BITMAP *gui_bitmap;
DATAFILE *gui_gfx;
@@ -55,11 +54,10 @@ gcn::AllegroGraphics *guiGraphics; // Graphics driver
WindowContainer *guiTop; // The top container
-Gui::Gui(BITMAP *screen)
+Gui::Gui(Graphics *graphics)
{
// Set graphics
- guiGraphics = new gcn::AllegroGraphics();
- guiGraphics->setTarget(screen);
+ guiGraphics = graphics;
// Set input
guiInput = new AllegroInput();
@@ -96,15 +94,6 @@ Gui::~Gui()
delete focusHandler;
}
-void Gui::update()
-{
- logic();
- draw();
-
- // Draw the mouse
- draw_sprite(gui_bitmap, mouse_sprite, mouse_x, mouse_y);
-}
-
void Gui::logic()
{
guiInput->_pollInput();
@@ -190,6 +179,9 @@ void Gui::draw()
guiTop->draw(guiGraphics);
guiGraphics->popClipArea();
+ // Draw the mouse
+ draw_sprite(buffer, mouse_sprite, mouse_x, mouse_y);
+
guiGraphics->_endDraw();
}
@@ -199,12 +191,11 @@ void Gui::focusNone()
}
-void init_gui(BITMAP *bitmap, const char *skin) {
- gui = new Gui(bitmap);
+void init_gui(Graphics *graphics) {
+ gui = new Gui(graphics);
- gui_bitmap = bitmap;
- gui_load_skin(skin);
- show_mouse(NULL);
+ // TODO: Remove Allegro config file usage from GUI look
+ gui_load_skin("data/Skin/aqua.skin");
}