summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/beinginfo.cpp4
-rw-r--r--src/resources/itemdb.cpp6
-rw-r--r--src/resources/monsterdb.cpp6
-rw-r--r--src/resources/npcdb.cpp6
-rw-r--r--src/resources/spritedef.cpp2
-rw-r--r--src/resources/spritedef.h12
6 files changed, 18 insertions, 18 deletions
diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp
index 62990392..bd7cc337 100644
--- a/src/resources/beinginfo.cpp
+++ b/src/resources/beinginfo.cpp
@@ -37,7 +37,9 @@ BeingInfo::BeingInfo():
mBlockType(Map::BLOCKTYPE_CHARACTER)
{
SpriteDisplay display;
- display.sprites.push_back(SpriteReference::Empty);
+
+ SpriteReference errorSprite(paths.getStringValue("spriteErrorFile"), 0);
+ display.sprites.push_back(errorSprite);
setDisplay(display);
}
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index b9dd8e83..1cdbdff2 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -163,9 +163,9 @@ void ItemDB::loadFloorSprite(SpriteDisplay *display, xmlNodePtr floorNode)
{
if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite"))
{
- SpriteReference *currentSprite = new SpriteReference;
- currentSprite->sprite = (const char*)spriteNode->xmlChildrenNode->content;
- currentSprite->variant = XML::getProperty(spriteNode, "variant", 0);
+ SpriteReference currentSprite;
+ currentSprite.sprite = (const char*)spriteNode->xmlChildrenNode->content;
+ currentSprite.variant = XML::getProperty(spriteNode, "variant", 0);
display->sprites.push_back(currentSprite);
}
else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx"))
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp
index 6d7fe9dc..4c22a1e5 100644
--- a/src/resources/monsterdb.cpp
+++ b/src/resources/monsterdb.cpp
@@ -86,9 +86,9 @@ void MonsterDB::load()
{
if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite"))
{
- SpriteReference *currentSprite = new SpriteReference;
- currentSprite->sprite = (const char*)spriteNode->xmlChildrenNode->content;
- currentSprite->variant = XML::getProperty(spriteNode, "variant", 0);
+ SpriteReference currentSprite;
+ currentSprite.sprite = (const char*)spriteNode->xmlChildrenNode->content;
+ currentSprite.variant = XML::getProperty(spriteNode, "variant", 0);
display.sprites.push_back(currentSprite);
}
else if (xmlStrEqual(spriteNode->name, BAD_CAST "sound"))
diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp
index ec22c225..44875655 100644
--- a/src/resources/npcdb.cpp
+++ b/src/resources/npcdb.cpp
@@ -73,9 +73,9 @@ void NPCDB::load()
{
if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite"))
{
- SpriteReference *currentSprite = new SpriteReference;
- currentSprite->sprite = (const char*)spriteNode->xmlChildrenNode->content;
- currentSprite->variant = XML::getProperty(spriteNode, "variant", 0);
+ SpriteReference currentSprite;
+ currentSprite.sprite = (const char*)spriteNode->xmlChildrenNode->content;
+ currentSprite.variant = XML::getProperty(spriteNode, "variant", 0);
display.sprites.push_back(currentSprite);
}
else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx"))
diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp
index e0cbfd1f..1eec3341 100644
--- a/src/resources/spritedef.cpp
+++ b/src/resources/spritedef.cpp
@@ -37,8 +37,6 @@
#include <set>
-SpriteReference *SpriteReference::Empty = new SpriteReference(
- paths.getStringValue("spriteErrorFile"), 0);
std::set<std::string> processedFiles;
Action *SpriteDef::getAction(const std::string &action) const
diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h
index cef158fa..89d2055f 100644
--- a/src/resources/spritedef.h
+++ b/src/resources/spritedef.h
@@ -35,12 +35,12 @@ class ImageSet;
struct SpriteReference
{
- static SpriteReference *Empty;
-
SpriteReference() {}
- SpriteReference(std::string sprite, int variant)
- { this->sprite = sprite; this->variant = variant; }
+ SpriteReference(std::string sprite, int variant):
+ sprite(sprite),
+ variant(variant)
+ {}
std::string sprite;
int variant;
@@ -49,11 +49,11 @@ struct SpriteReference
struct SpriteDisplay
{
std::string image;
- std::list<SpriteReference*> sprites;
+ std::list<SpriteReference> sprites;
std::list<std::string> particles;
};
-typedef std::list<SpriteReference*>::const_iterator SpriteRefs;
+typedef std::list<SpriteReference>::const_iterator SpriteRefs;
/*
* Remember those are the main action.