diff options
| author | Petr Mrázek | 2011-08-06 22:49:48 +0000 |
|---|---|---|
| committer | Petr Mrázek | 2011-08-06 22:49:48 +0000 |
| commit | d841ba0fee6e1f98e414c52dd07b44b981bc05fe (patch) | |
| tree | a1b55757266b42cbab74c5166e7240fde2fb60b8 /ContentLoader.h | |
| parent | 4f8e62eef15fd23e984af3716cba37afe2134d5c (diff) | |
| download | stonesense-d841ba0fee6e1f98e414c52dd07b44b981bc05fe.tar.gz stonesense-d841ba0fee6e1f98e414c52dd07b44b981bc05fe.tar.bz2 stonesense-d841ba0fee6e1f98e414c52dd07b44b981bc05fe.tar.xz | |
some derp changes, mostly to make things compile
Diffstat (limited to 'ContentLoader.h')
| -rw-r--r-- | ContentLoader.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ContentLoader.h b/ContentLoader.h index 640da32..12044e8 100644 --- a/ContentLoader.h +++ b/ContentLoader.h @@ -77,7 +77,20 @@ extern int loadConfigImgFile(const char* filename, TiXmlElement* referrer); int lookupMaterialType(const char* strValue);
int lookupMaterialIndex(int matType, const char* strValue);
template <typename T>
-int lookupIndexedType(const char* indexName, vector<T>& typeVector);
+int lookupIndexedType(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);
uint8_t lookupMaterialFore(int matType,int matIndex);
|
