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/graphic/graphic.h | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) (limited to 'src/graphic/graphic.h') diff --git a/src/graphic/graphic.h b/src/graphic/graphic.h index 970b09c9..7de6bd3a 100644 --- a/src/graphic/graphic.h +++ b/src/graphic/graphic.h @@ -24,12 +24,12 @@ #ifndef _GRAPHIC_H #define _GRAPHIC_H -#include "../game.h" +class Graphics; + #include "../map.h" -#include "../being.h" -#include "../gui/buy.h" #include "../gui/npc.h" #include "../gui/npc_text.h" +#include "../gui/buy.h" #include "../gui/sell.h" #include "../gui/buysell.h" #include "../gui/chat.h" @@ -40,14 +40,15 @@ #include "../gui/npc.h" #include "../gui/status.h" #include "../gui/stats.h" +#include "../gui/skill.h" #include "../resources/resourcemanager.h" #include "spriteset.h" #include +#include #define TILE_SIZE 32 extern BITMAP *buffer; -extern int page_num; extern char speech[255]; extern char npc_text[1000]; extern char skill_points[10]; @@ -86,15 +87,40 @@ class BuySellListener : public gcn::ActionListener { void action(const std::string& eventId); }; -class GraphicEngine { +/** + * A central point of control for graphics. + */ +class Graphics : public gcn::AllegroGraphics { + public: + /** + * Constructor. + */ + Graphics(); + + /** + * Destructor. + */ + ~Graphics(); + + /** + * Updates the screen. This is done by either copying the buffer to the + * screen or swapping pages. + */ + void updateScreen(); +}; + +/** + * Game engine that does the main drawing. + */ +class Engine { private: Spriteset *tileset, *emotionset, *npcset, *monsterset; - BITMAP *buffer; - + public: - GraphicEngine(); - ~GraphicEngine(); - void refresh(); + Engine(); + ~Engine(); + + void draw(); }; #endif -- cgit v1.2.3-60-g2f50