summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-03 12:42:21 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-03 12:42:21 +0000
commitdf5ee2a5c32258e0d993c7d7c917c75299ee9ae4 (patch)
tree8303eec548a78ae1f8b543aea8658d37321e772b /src/gui
parentdbda6463fd8a9c3136daf64e79b5515812a2e40f (diff)
downloadmana-df5ee2a5c32258e0d993c7d7c917c75299ee9ae4.tar.gz
mana-df5ee2a5c32258e0d993c7d7c917c75299ee9ae4.tar.bz2
mana-df5ee2a5c32258e0d993c7d7c917c75299ee9ae4.tar.xz
mana-df5ee2a5c32258e0d993c7d7c917c75299ee9ae4.zip
Separated graphic/graphic.cpp into graphics.cpp and engine.cpp.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/button.cpp1
-rw-r--r--src/gui/button.h2
-rw-r--r--src/gui/buy.cpp1
-rw-r--r--src/gui/buysell.cpp1
-rw-r--r--src/gui/char_select.cpp2
-rw-r--r--src/gui/char_server.cpp2
-rw-r--r--src/gui/chargedialog.cpp2
-rw-r--r--src/gui/chat.cpp2
-rw-r--r--src/gui/checkbox.cpp2
-rw-r--r--src/gui/equipment.cpp2
-rw-r--r--src/gui/gui.h3
-rw-r--r--src/gui/inventory.cpp2
-rw-r--r--src/gui/itemcontainer.cpp3
-rw-r--r--src/gui/login.cpp3
-rw-r--r--src/gui/npc.cpp1
-rw-r--r--src/gui/npc_text.cpp1
-rw-r--r--src/gui/playerbox.cpp1
-rw-r--r--src/gui/playerbox.h2
-rw-r--r--src/gui/scrollarea.cpp2
-rw-r--r--src/gui/scrollarea.h2
-rw-r--r--src/gui/sell.cpp4
-rw-r--r--src/gui/skill.cpp1
-rw-r--r--src/gui/slider.cpp2
-rw-r--r--src/gui/status.cpp1
-rw-r--r--src/gui/textfield.h2
-rw-r--r--src/gui/window.cpp40
-rw-r--r--src/gui/window.h7
27 files changed, 45 insertions, 49 deletions
diff --git a/src/gui/button.cpp b/src/gui/button.cpp
index 71fac17e..c508afe2 100644
--- a/src/gui/button.cpp
+++ b/src/gui/button.cpp
@@ -22,6 +22,7 @@
*/
#include "button.h"
+#include "../resources/resourcemanager.h"
Button::Button(const std::string& caption):
gcn::Button(caption)
diff --git a/src/gui/button.h b/src/gui/button.h
index eb6495c1..a9ddd3fa 100644
--- a/src/gui/button.h
+++ b/src/gui/button.h
@@ -26,7 +26,7 @@
#include <guichan.hpp>
#include <string>
-#include "../graphic/graphic.h"
+#include "../graphics.h"
/**
* Button widget. Same as the Guichan button but with custom look.
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp
index ab350363..de2593d1 100644
--- a/src/gui/buy.cpp
+++ b/src/gui/buy.cpp
@@ -27,6 +27,7 @@
#include "scrollarea.h"
#include "listbox.h"
#include "../game.h"
+#include "../net/network.h"
#include <sstream>
diff --git a/src/gui/buysell.cpp b/src/gui/buysell.cpp
index 29010afc..cc9cbcc6 100644
--- a/src/gui/buysell.cpp
+++ b/src/gui/buysell.cpp
@@ -24,6 +24,7 @@
#include "buysell.h"
#include "button.h"
#include "../game.h"
+#include "../net/network.h"
BuySellDialog::BuySellDialog():
Window("Shop")
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index fa8d6f9e..d31713be 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -25,7 +25,7 @@
#include "textfield.h"
#include "button.h"
#include "ok_dialog.h"
-#include "../graphic/graphic.h"
+#include "../graphics.h"
#include <sstream>
#define NR_HAIR_STYLES 4
diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp
index 035f18fd..ec7eaefa 100644
--- a/src/gui/char_server.cpp
+++ b/src/gui/char_server.cpp
@@ -22,7 +22,7 @@
*/
#include "char_server.h"
-#include "../graphic/graphic.h"
+#include "../graphics.h"
#include "button.h"
#include "window.h"
#include "scrollarea.h"
diff --git a/src/gui/chargedialog.cpp b/src/gui/chargedialog.cpp
index 0d65c6b3..71b0edaf 100644
--- a/src/gui/chargedialog.cpp
+++ b/src/gui/chargedialog.cpp
@@ -62,4 +62,4 @@ void ChargeDialog::draw(gcn::Graphics *graphics)
// reset the progress bar to display accurate time since attack
progBar->setProgress(char_info->lastAttackTime);
Window::draw(graphics);
-} \ No newline at end of file
+}
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 6e562017..5c947859 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -22,7 +22,7 @@
*/
#include "chat.h"
-#include "../graphic/graphic.h"
+#include "../graphics.h"
#include <iostream>
ChatBox::ChatBox(const char *logfile, int item_num)
diff --git a/src/gui/checkbox.cpp b/src/gui/checkbox.cpp
index 99367f18..88b3f975 100644
--- a/src/gui/checkbox.cpp
+++ b/src/gui/checkbox.cpp
@@ -23,7 +23,7 @@
#include "checkbox.h"
#include "../resources/resourcemanager.h"
-#include "../graphic/graphic.h"
+#include "../graphics.h"
CheckBox::CheckBox(const std::string& caption, bool marked):
gcn::CheckBox(caption, marked)
diff --git a/src/gui/equipment.cpp b/src/gui/equipment.cpp
index c7507475..410be42b 100644
--- a/src/gui/equipment.cpp
+++ b/src/gui/equipment.cpp
@@ -21,7 +21,7 @@
* $Id$
*/
-#include "../graphic/graphic.h"
+#include "../graphics.h"
#include "equipment.h"
#include "../resources/resourcemanager.h"
#include "../resources/image.h"
diff --git a/src/gui/gui.h b/src/gui/gui.h
index 6b678396..1c50a2f6 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -26,9 +26,8 @@
#include <guichan.hpp>
#include <guichan/sdl.hpp>
-#include <string.h>
#include "windowcontainer.h"
-#include "../graphic/graphic.h"
+#include "../graphics.h"
/**
* \defgroup GUI GUI related classes
diff --git a/src/gui/inventory.cpp b/src/gui/inventory.cpp
index 6dfbff69..326a8e70 100644
--- a/src/gui/inventory.cpp
+++ b/src/gui/inventory.cpp
@@ -21,7 +21,7 @@
* $Id$
*/
-#include "../graphic/graphic.h"
+#include "../graphics.h"
#include "inventory.h"
#include "../resources/resourcemanager.h"
#include "../resources/image.h"
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp
index 49a6278b..30d6bde3 100644
--- a/src/gui/itemcontainer.cpp
+++ b/src/gui/itemcontainer.cpp
@@ -22,8 +22,9 @@
*/
#include "itemcontainer.h"
-#include "../graphic/graphic.h"
+#include "../graphics.h"
#include "../resources/resourcemanager.h"
+#include <sstream>
ItemContainer::ItemContainer()
{
diff --git a/src/gui/login.cpp b/src/gui/login.cpp
index e5861a9b..6dc2597c 100644
--- a/src/gui/login.cpp
+++ b/src/gui/login.cpp
@@ -28,8 +28,9 @@
#include "textfield.h"
#include "passwordfield.h"
#include "ok_dialog.h"
-#include "../graphic/graphic.h"
+#include "../graphics.h"
#include "../main.h"
+#include "../net/network.h"
LoginDialog::LoginDialog():
Window("Login")
diff --git a/src/gui/npc.cpp b/src/gui/npc.cpp
index 4f0a7943..9b08fd35 100644
--- a/src/gui/npc.cpp
+++ b/src/gui/npc.cpp
@@ -26,6 +26,7 @@
#include "scrollarea.h"
#include "listbox.h"
#include "../game.h"
+#include "../net/network.h"
NpcListDialog::NpcListDialog():
Window("NPC")
diff --git a/src/gui/npc_text.cpp b/src/gui/npc_text.cpp
index e81d51a8..1aaebd45 100644
--- a/src/gui/npc_text.cpp
+++ b/src/gui/npc_text.cpp
@@ -26,6 +26,7 @@
#include "button.h"
#include "textbox.h"
#include "../game.h"
+#include "../net/network.h"
NpcTextDialog::NpcTextDialog():
Window("NPC")
diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp
index 1abeaaa2..09691b82 100644
--- a/src/gui/playerbox.cpp
+++ b/src/gui/playerbox.cpp
@@ -24,6 +24,7 @@
#include "playerbox.h"
#include "gui.h"
#include "../main.h"
+#include "../resources/resourcemanager.h"
PlayerBox::PlayerBox():
hairColor(0),
diff --git a/src/gui/playerbox.h b/src/gui/playerbox.h
index 9cb64b84..cf7c3995 100644
--- a/src/gui/playerbox.h
+++ b/src/gui/playerbox.h
@@ -25,7 +25,7 @@
#define __TMW_PLAYERBOX_H__
#include <guichan.hpp>
-#include "../graphic/graphic.h"
+#include "../graphics.h"
/**
* A box showing a player. Draws the various hair styles a player can have
diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp
index 664630c3..9bbdf797 100644
--- a/src/gui/scrollarea.cpp
+++ b/src/gui/scrollarea.cpp
@@ -23,7 +23,7 @@
#include "scrollarea.h"
#include "gui.h"
-
+#include "../resources/resourcemanager.h"
ScrollArea::ScrollArea():
gcn::ScrollArea()
diff --git a/src/gui/scrollarea.h b/src/gui/scrollarea.h
index c77cf4b1..304e5b89 100644
--- a/src/gui/scrollarea.h
+++ b/src/gui/scrollarea.h
@@ -25,7 +25,7 @@
#define __TMW_SCROLLAREA_H__
#include <guichan.hpp>
-#include "../graphic/graphic.h"
+#include "../graphics.h"
/**
* A scroll area.
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp
index bcb72590..fe2cd960 100644
--- a/src/gui/sell.cpp
+++ b/src/gui/sell.cpp
@@ -26,8 +26,10 @@
#include "slider.h"
#include "scrollarea.h"
#include "listbox.h"
-#include "../graphic/graphic.h"
+#include "../graphics.h"
#include "../game.h"
+#include "../engine.h"
+#include "../net/network.h"
#include <sstream>
diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp
index 4c3feedf..1d4bc7e4 100644
--- a/src/gui/skill.cpp
+++ b/src/gui/skill.cpp
@@ -26,6 +26,7 @@
#include "scrollarea.h"
#include "button.h"
#include "../main.h"
+#include "../net/network.h"
char *skill_db[] = {
// 0-99
diff --git a/src/gui/slider.cpp b/src/gui/slider.cpp
index d99b777f..c0f494c4 100644
--- a/src/gui/slider.cpp
+++ b/src/gui/slider.cpp
@@ -23,7 +23,7 @@
#include "slider.h"
#include "../resources/resourcemanager.h"
-#include "../graphic/graphic.h"
+#include "../graphics.h"
Slider::Slider(double scaleEnd):
gcn::Slider(scaleEnd)
diff --git a/src/gui/status.cpp b/src/gui/status.cpp
index b31ef4e8..a515b6c5 100644
--- a/src/gui/status.cpp
+++ b/src/gui/status.cpp
@@ -24,6 +24,7 @@
#include "status.h"
#include "../main.h"
#include "button.h"
+#include "../engine.h"
StatusWindow::StatusWindow():
Window("%s Lvl: % 2i Job: % 2i")
diff --git a/src/gui/textfield.h b/src/gui/textfield.h
index 145daae6..a9be41e7 100644
--- a/src/gui/textfield.h
+++ b/src/gui/textfield.h
@@ -25,7 +25,7 @@
#define __TMW_TEXTFIELD_H__
#include <guichan.hpp>
-#include "../graphic/graphic.h"
+#include "../graphics.h"
/**
* A text field.
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index c32b6dfc..1532d218 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -22,8 +22,8 @@
*/
#include "window.h"
-#include "../graphic/graphic.h"
#include "../resources/resourcemanager.h"
+#include "../log.h"
WindowContainer *Window::windowContainer = NULL;
@@ -51,10 +51,15 @@ Window::Window(const std::string& text, bool modal, Window *parent):
dBorders = resman->getImage("core/graphics/gui/vscroll_grey.png");
dBackground = resman->getImage("core/graphics/gui/bg_quad_dis.png");
- dUpperBorder = dBorders->getSubImage(4, 0, 3, 4);
- dLeftBorder = dBorders->getSubImage(0, 4, 4, 10);
- dRightBorder = dBorders->getSubImage(7, 4, 4, 10);
- dLowerBorder = dBorders->getSubImage(4, 15, 3, 4);
+ border.grid[0] = dBorders->getSubImage(0, 0, 4, 4);
+ border.grid[1] = dBorders->getSubImage(4, 0, 3, 4);
+ border.grid[2] = dBorders->getSubImage(7, 0, 4, 4);
+ border.grid[3] = dBorders->getSubImage(0, 4, 4, 10);
+ border.grid[4] = resman->getImage("core/graphics/gui/bg_quad_dis.png");
+ border.grid[5] = dBorders->getSubImage(7, 4, 4, 10);
+ border.grid[6] = dBorders->getSubImage(7, 15, 4, 4);
+ border.grid[7] = dBorders->getSubImage(4, 15, 3, 4);
+ border.grid[8] = dBorders->getSubImage(0, 15, 4, 4);
// Register mouse listener
addMouseListener(this);
@@ -98,28 +103,9 @@ void Window::draw(gcn::Graphics* graphics)
dBackground->setAlpha(0.8f);
dBorders->setAlpha(0.8f);
- dUpperBorder->setAlpha(0.8f);
- dLeftBorder->setAlpha(0.8f);
- dRightBorder->setAlpha(0.8f);
- dLowerBorder->setAlpha(0.8f);
-
- // Draw the background
- dBackground->drawPattern(
- screen, x + 4, y + 4, getWidth() - 8, getHeight() - 8);
-
- // Draw the borders
- dBorders->draw(screen, 0, 0, x, y, 4, 4); // Top-Left
- dBorders->draw(screen, 7, 0, x + getWidth() - 4, y, 4, 4); // Top-Right
- dBorders->draw(screen, 7, 15,
- x + getWidth() - 4, y + getHeight() - 4, 4, 4); // Bottom-Right
- dBorders->draw(screen, 0, 15, x, y + getHeight() - 4, 4, 4); // Bottom-Left
-
- dUpperBorder->drawPattern(screen, x + 4, y, getWidth() - 8, 4);
- dLeftBorder->drawPattern(screen, x, y + 4, 4, getHeight() - 8);
- dRightBorder->drawPattern(
- screen, x + getWidth() - 4, y + 4, 4, getHeight() - 8);
- dLowerBorder->drawPattern(
- screen, x + 4, y + getHeight() - 4, getWidth() - 8, 4);
+
+ ((Graphics*)graphics)->drawImageRect(x, y, getWidth(), getHeight(),
+ border);
// Draw title
graphics->setFont(getFont());
diff --git a/src/gui/window.h b/src/gui/window.h
index c78de2f4..143c8235 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -28,6 +28,7 @@
#include <guichan.hpp>
#include "windowcontainer.h"
#include "../resources/image.h"
+#include "../graphics.h"
/**
* A window. This window can be dragged around and has a title bar.
@@ -52,10 +53,8 @@ class Window : public gcn::Container, public gcn::MouseListener
Image *dBackground; /**< Left side of title bar */
Image *dBorders; /**< Middle of title bar */
- Image *dUpperBorder; /**< Upper border */
- Image *dLowerBorder; /**< Lower Border */
- Image *dLeftBorder; /**< Left Border */
- Image *dRightBorder; /**< Right Border */
+
+ ImageRect border; /**< The window border */
/** The window container windows add themselves to. */
static WindowContainer* windowContainer;