From 8ed926ea15e8f151b8b81f93a5dccd0d53cf7ca1 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 15 Jan 2005 17:49:01 +0000 Subject: Cleaned up includes, separated engine from graphics and single buffer now used throughout application, cleaned up shop functions. --- src/gui/gui.cpp | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'src/gui/gui.cpp') 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"); } -- cgit v1.2.3-70-g09d2