diff options
| author | Kris Parker | 2009-11-28 17:39:14 +0000 |
|---|---|---|
| committer | Kris Parker | 2009-11-28 17:39:14 +0000 |
| commit | 4e8e193d8301cf1e963e63c91276d50ae86f0b6e (patch) | |
| tree | 69462f3a68ac89d7e8738634cfc3bc90487b3010 /CreatureConfiguration.cpp | |
| parent | 14d183b033d273a87a5e83b549d029c66c1ffa88 (diff) | |
| download | stonesense-4e8e193d8301cf1e963e63c91276d50ae86f0b6e.tar.gz stonesense-4e8e193d8301cf1e963e63c91276d50ae86f0b6e.tar.bz2 stonesense-4e8e193d8301cf1e963e63c91276d50ae86f0b6e.tar.xz | |
First pass at critter animation
Diffstat (limited to 'CreatureConfiguration.cpp')
| -rw-r--r-- | CreatureConfiguration.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/CreatureConfiguration.cpp b/CreatureConfiguration.cpp index 452fa4d..d9041e7 100644 --- a/CreatureConfiguration.cpp +++ b/CreatureConfiguration.cpp @@ -3,6 +3,7 @@ #include "Creatures.h"
#include "MapLoading.h"
#include "GUI.h"
+#include "ContentLoader.h"
#include "dfhack/library/tinyxml/tinyxml.h"
@@ -95,7 +96,7 @@ bool addSingleCreatureConfig( TiXmlElement* elemCreature, vector<CreatureConfigu sprite.fileIndex=-1;
sprite.x=0;
sprite.y=0;
- char animFrames=ALL_FRAMES;
+ sprite.animFrames=ALL_FRAMES;
const char* filename = elemCreature->Attribute("file");
if (filename != NULL && filename[0] != 0)
{
@@ -121,6 +122,10 @@ bool addSingleCreatureConfig( TiXmlElement* elemCreature, vector<CreatureConfigu if(strcmp( specstr, "Zombie" ) == 0) crespec = eCSC_Zombie;
if(strcmp( specstr, "Skeleton" ) == 0) crespec = eCSC_Skeleton;
}
+ sprite.animFrames = getAnimFrames(elemProfession->Attribute("frames"));
+ if (sprite.animFrames == 0)
+ sprite.animFrames = ALL_FRAMES;
+
//create profession config
sprite.sheetIndex=atoi(sheetIndexStr);
CreatureConfiguration cre( (char*)name, ((customstr == 0)?(char*)professionstr:(char*)customstr), (customstr != 0), cresex, crespec, sprite );
@@ -132,6 +137,7 @@ bool addSingleCreatureConfig( TiXmlElement* elemCreature, vector<CreatureConfigu //create default config
sheetIndexStr = elemCreature->Attribute("sheetIndex");
+ sprite.animFrames = ALL_FRAMES;
if (sheetIndexStr)
{
CreatureConfiguration cre( (char*)name, "", false, eCreatureSex_NA, eCSC_Any, sprite );
|
