diff options
| author | Kris Parker | 2009-11-28 15:57:26 +0000 |
|---|---|---|
| committer | Kris Parker | 2009-11-28 15:57:26 +0000 |
| commit | 6834db4a8355069602b3b388b5595c4fe3baa284 (patch) | |
| tree | d568653b04bfade4757cdc2091afa410eafec37b /ContentBuildingReader.cpp | |
| parent | b161fc12356907c7465d62832322df06b2722feb (diff) | |
| download | stonesense-6834db4a8355069602b3b388b5595c4fe3baa284.tar.gz stonesense-6834db4a8355069602b3b388b5595c4fe3baa284.tar.bz2 stonesense-6834db4a8355069602b3b388b5595c4fe3baa284.tar.xz | |
Creature node now supports file attribute to alter source image file
Diffstat (limited to 'ContentBuildingReader.cpp')
| -rw-r--r-- | ContentBuildingReader.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ContentBuildingReader.cpp b/ContentBuildingReader.cpp index e4c99fb..7b2dc37 100644 --- a/ContentBuildingReader.cpp +++ b/ContentBuildingReader.cpp @@ -217,18 +217,17 @@ inline bool readNode(SpriteNode* node, TiXmlElement* elemNode, TiXmlElement* ele sprite->sprite.x = (strOffsetX != 0 ? atoi(strOffsetX) : 0);
sprite->sprite.y = (strOffsetY != 0 ? atoi(strOffsetY) : 0);
sprite->sprite.fileIndex = -1;
- if (filename != NULL)
+ if (filename != NULL && filename[0] != 0)
{
- if (strcmp(filename, "") != 0)
sprite->sprite.fileIndex = loadImgFile((char*)filename);
}
else
{
const char* pfilename = elemParent->Attribute("file");
- if (pfilename)
- {
- sprite->sprite.fileIndex = loadImgFile((char*)pfilename);
- }
+ if (pfilename != NULL && pfilename[0] != 0)
+ {
+ sprite->sprite.fileIndex = loadImgFile((char*)pfilename);
+ }
}
node->addChild(sprite);
}
|
