summaryrefslogtreecommitdiff
path: root/ContentLoader.h
diff options
context:
space:
mode:
authorJapa2010-04-09 14:24:27 +0000
committerJapa2010-04-09 14:24:27 +0000
commit114df922d3073bd296b38cf522997f520fb17850 (patch)
treec4cf372825118c3663cd77e18c69a6c3b59d070f /ContentLoader.h
parent81aefc8e03ff3f647494012e18bcdc8f33f4de42 (diff)
downloadstonesense-114df922d3073bd296b38cf522997f520fb17850.tar.gz
stonesense-114df922d3073bd296b38cf522997f520fb17850.tar.bz2
stonesense-114df922d3073bd296b38cf522997f520fb17850.tar.xz
updated trunk to the new graphics engine, and the latest DFhack
Diffstat (limited to 'ContentLoader.h')
-rw-r--r--ContentLoader.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/ContentLoader.h b/ContentLoader.h
new file mode 100644
index 0000000..f59ae2a
--- /dev/null
+++ b/ContentLoader.h
@@ -0,0 +1,62 @@
+#pragma once
+#include "dfhack/depends/tinyxml/tinyxml.h"
+#include "BuildingConfiguration.h"
+#include "CreatureConfiguration.h"
+#include "VegetationConfiguration.h"
+#include "GroundMaterialConfiguration.h"
+#include "ColorConfiguration.h"
+
+class ContentLoader{
+private:
+ bool parseContentIndexFile( char* filepath );
+ bool parseContentXMLFile( char* filepath );
+ bool parseBuildingContent( TiXmlElement* elemRoot );
+ bool parseCreatureContent( TiXmlElement* elemRoot );
+ bool parseTerrainContent ( TiXmlElement* elemRoot );
+ bool parseTreeContent( TiXmlElement* elemRoot );
+ bool parseShrubContent( TiXmlElement* elemRoot );
+ bool parseColorContent( TiXmlElement* elemRoot );
+ void flushCreatureConfig();
+
+ bool translationComplete;
+public:
+ ContentLoader(void);
+ ~ContentLoader(void);
+
+ bool Load(API& DF);
+
+ vector<BuildingConfiguration> buildingConfigs;
+ vector<vector<CreatureConfiguration>*> creatureConfigs;
+ vector<VegetationConfiguration> treeConfigs;
+ vector<VegetationConfiguration> shrubConfigs;
+ vector<TerrainConfiguration*> terrainFloorConfigs;
+ vector<TerrainConfiguration*> terrainBlockConfigs;
+ vector<ColorConfiguration> colorConfigs;
+
+ vector<t_matgloss> inorganicMaterials;
+ vector<t_matgloss> organicMaterials;
+ vector<t_matgloss> woodMaterials;
+ vector<t_matgloss> plantMaterials;
+ vector<t_matgloss> creatureMaterials;
+
+ vector<string> classIdStrings;
+ memory_info *memoryInfo;
+};
+
+//singleton instance
+extern ContentLoader contentLoader;
+
+extern const char* getDocument(TiXmlNode* element);
+extern void contentError(const char* message, TiXmlNode* element);
+extern char getAnimFrames(const char* framestring);
+extern int loadConfigImgFile(const char* filename, TiXmlElement* referrer);
+int lookupMaterialType(const char* strValue);
+int lookupMaterialIndex(int matType, const char* strValue);
+int lookupIndexedType(const char* indexName, vector<t_matgloss>& typeVector);
+const char *lookupMaterialTypeName(int matType);
+const char *lookupMaterialName(int matType,int matIndex);
+uint8_t lookupMaterialFore(int matType,int matIndex);
+uint8_t lookupMaterialBack(int matType,int matIndex);
+uint8_t lookupMaterialBright(int matType,int matIndex);
+
+ALLEGRO_COLOR lookupMaterialColor(int matType,int matIndex); \ No newline at end of file