summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-02-23 16:02:00 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-02-23 16:02:00 +0000
commit05a12d5568111fa13759026442ed358605bf9a28 (patch)
tree9948a2351c846dee1b36f25a90d1429aa78dda23 /src/gui
parent3737fb9fd3ff6072f83bdc514f88ad0fdbf4da6c (diff)
downloadmana-client-05a12d5568111fa13759026442ed358605bf9a28.tar.gz
mana-client-05a12d5568111fa13759026442ed358605bf9a28.tar.bz2
mana-client-05a12d5568111fa13759026442ed358605bf9a28.tar.xz
mana-client-05a12d5568111fa13759026442ed358605bf9a28.zip
A bunch of mostly cosmetic cleanups.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/equipmentwindow.h3
-rw-r--r--src/gui/minimap.cpp23
-rw-r--r--src/gui/minimap.h5
-rw-r--r--src/gui/windowcontainer.cpp12
-rw-r--r--src/gui/windowcontainer.h11
5 files changed, 16 insertions, 38 deletions
diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h
index 651c593a..d55adb16 100644
--- a/src/gui/equipmentwindow.h
+++ b/src/gui/equipmentwindow.h
@@ -22,7 +22,7 @@
*/
#ifndef _TMW_EQUIPMENT_H
-#define _TMW_EQUIPMENT_H
+#define _TMW_EQUIPMENT_H
#include "window.h"
@@ -56,7 +56,6 @@ class EquipmentWindow : public Window
Spriteset *itemset;
Equipment *mEquipment;
-
};
extern EquipmentWindow *equipmentWindow;
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index 1165d7bb..e19a8c62 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -26,10 +26,8 @@
#include "../being.h"
#include "../beingmanager.h"
#include "../graphics.h"
-#include "../map.h"
#include "../resources/image.h"
-#include "../resources/resourcemanager.h"
Minimap::Minimap():
Window("Map"),
@@ -48,32 +46,23 @@ Minimap::~Minimap()
}
}
-void Minimap::setMap(Map *map)
+void Minimap::setMapImage(Image *img)
{
if (mMapImage)
{
mMapImage->decRef();
}
- if (map->hasProperty("minimap"))
- {
- ResourceManager *resman = ResourceManager::getInstance();
- mMapImage = resman->getImage(map->getProperty("minimap"));
+ mMapImage = img;
- if (mMapImage != NULL)
- {
- setVisible(true);
- mMapImage->setAlpha(0.7);
- }
- else
- {
- setVisible(false);
- }
+ if (mMapImage)
+ {
+ setVisible(true);
+ mMapImage->setAlpha(0.7);
}
else
{
setVisible(false);
- mMapImage = NULL;
}
}
diff --git a/src/gui/minimap.h b/src/gui/minimap.h
index 14db195b..53b18630 100644
--- a/src/gui/minimap.h
+++ b/src/gui/minimap.h
@@ -26,7 +26,6 @@
#include "window.h"
-class Map;
class Image;
/**
@@ -48,9 +47,9 @@ class Minimap : public Window
~Minimap();
/**
- * Sets the map that should be displayed.
+ * Sets the map image that should be displayed.
*/
- void setMap(Map *map);
+ void setMapImage(Image *img);
/**
* Draws the minimap.
diff --git a/src/gui/windowcontainer.cpp b/src/gui/windowcontainer.cpp
index b79e39de..3803b652 100644
--- a/src/gui/windowcontainer.cpp
+++ b/src/gui/windowcontainer.cpp
@@ -23,23 +23,17 @@
#include "windowcontainer.h"
-WindowContainer::WindowContainer()
-{
-}
-
void WindowContainer::logic()
{
- std::list<gcn::Widget*>::iterator i = deathList.begin();
- for (i= deathList.begin(); i != deathList.end(); i++) {
+ for (WidgetIterator i = mDeathList.begin(); i != mDeathList.end(); i++) {
delete (*i);
}
-
- deathList.clear();
+ mDeathList.clear();
gcn::Container::logic();
}
void WindowContainer::scheduleDelete(gcn::Widget *widget)
{
- deathList.push_back(widget);
+ mDeathList.push_back(widget);
}
diff --git a/src/gui/windowcontainer.h b/src/gui/windowcontainer.h
index 533e42e4..b860fa3c 100644
--- a/src/gui/windowcontainer.h
+++ b/src/gui/windowcontainer.h
@@ -34,11 +34,6 @@
class WindowContainer : public gcn::Container {
public:
/**
- * Constructor.
- */
- WindowContainer();
-
- /**
* Do GUI logic. This functions adds automatic deletion of objects that
* volunteered to be deleted.
*/
@@ -50,11 +45,13 @@ class WindowContainer : public gcn::Container {
*/
void scheduleDelete(gcn::Widget *widget);
- protected:
+ private:
/**
* List of widgets that are scheduled to be deleted.
*/
- std::list<gcn::Widget*> deathList;
+ typedef std::list<gcn::Widget*> Widgets;
+ typedef Widgets::iterator WidgetIterator;
+ Widgets mDeathList;
};
#endif