summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-13 11:36:36 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-13 11:36:36 +0000
commitafc770043be553998555e9ac1cffca68dc482d48 (patch)
tree60e99ade9464b0a1de2ec246724a7bfe0957eec4 /src/engine.cpp
parentcfcc1bc3a756185bd39dd858ebbe69b5916ac11b (diff)
downloadmana-afc770043be553998555e9ac1cffca68dc482d48.tar.gz
mana-afc770043be553998555e9ac1cffca68dc482d48.tar.bz2
mana-afc770043be553998555e9ac1cffca68dc482d48.tar.xz
mana-afc770043be553998555e9ac1cffca68dc482d48.zip
Merged cleanups and content changes from the trunk. Also fixed compiling with
OpenGL enabled.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index c6a4e55c..84574b26 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -25,7 +25,6 @@
#include <list>
-#include "animation.h"
#include "being.h"
#include "beingmanager.h"
#include "flooritemmanager.h"
@@ -34,7 +33,6 @@
#include "main.h"
#include "localplayer.h"
#include "log.h"
-#include "main.h"
#include "map.h"
#include "sound.h"
@@ -63,8 +61,6 @@ Spriteset *itemset;
Spriteset *emotionset;
Spriteset *npcset;
std::vector<Spriteset *> weaponset;
-AnimatedSprite *animatedSprite;
-
Engine::Engine(Network *network):
mShowDebugPath(false),
@@ -104,16 +100,11 @@ Engine::~Engine()
emotionset->decRef();
itemset->decRef();
- std::vector<Spriteset *>::iterator iter;
- for (iter = weaponset.begin(); iter != weaponset.end(); ++iter)
- {
- (*iter)->decRef();
- }
+ std::for_each(weaponset.begin(), weaponset.end(),
+ std::mem_fun(&Spriteset::decRef));
weaponset.clear();
delete itemDb;
-
- delete animatedSprite;
}
void Engine::changeMap(const std::string &mapPath)
@@ -219,12 +210,12 @@ void Engine::draw(Graphics *graphics)
player_node->mX, player_node->mY,
mouseTileX, mouseTileY);
+ graphics->setColor(gcn::Color(255, 0, 0));
for (PathIterator i = debugPath.begin(); i != debugPath.end(); i++)
{
int squareX = i->x * 32 - map_x + 12;
int squareY = i->y * 32 - map_y + 12;
- graphics->setColor(gcn::Color(255, 0, 0));
graphics->fillRectangle(gcn::Rectangle(squareX, squareY, 8, 8));
graphics->drawText(
toString(mCurrentMap->getMetaTile(i->x, i->y)->Gcost),