summaryrefslogtreecommitdiff
path: root/ContentLoader.h
diff options
context:
space:
mode:
authorJapa Illo2012-03-08 09:37:54 +0530
committerJapa Illo2012-03-08 09:37:54 +0530
commit96bbfa604d1835df993602cbf46ca6bb0a28e6bd (patch)
tree38d46683531ef118bae33b244475e6203683c891 /ContentLoader.h
parent50bbecc544aa227fb7bfc4a5c90c6b27369d8bcd (diff)
downloadstonesense-96bbfa604d1835df993602cbf46ca6bb0a28e6bd.tar.gz
stonesense-96bbfa604d1835df993602cbf46ca6bb0a28e6bd.tar.bz2
stonesense-96bbfa604d1835df993602cbf46ca6bb0a28e6bd.tar.xz
Got rid of some warnings, cleaned up the sprite drawing routine, and added ability to select sprites according to individual items.
Todo: add ability to have a sprite according to just the item class. Signed-off-by: Japa Illo <japa.mala.illo@gmail.com>
Diffstat (limited to 'ContentLoader.h')
-rw-r--r--ContentLoader.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/ContentLoader.h b/ContentLoader.h
index 11f16e8..91c839d 100644
--- a/ContentLoader.h
+++ b/ContentLoader.h
@@ -84,6 +84,21 @@ int lookupIndexedType(const char* indexName, std::vector<T>& typeVector)
}
return INVALID_INDEX;
}
+template <typename T>
+int lookupIndexedPonterType(const char* indexName, std::vector<T*>& typeVector)
+{
+ if (indexName == NULL || indexName[0] == 0)
+ {
+ return INVALID_INDEX;
+ }
+ uint32_t vsize = (uint32_t)typeVector.size();
+ for(uint32_t i=0; i < vsize; i++)
+ {
+ if (typeVector[i]->id == indexName)
+ return i;
+ }
+ return INVALID_INDEX;
+}
const char *lookupMaterialTypeName(int matType);
const char *lookupMaterialName(int matType,int matIndex);
const char *lookupBuildingSubtype(int main_type, int i);