diff options
| author | Petr Mrázek | 2011-08-07 04:28:51 +0000 |
|---|---|---|
| committer | Petr Mrázek | 2011-08-07 04:28:51 +0000 |
| commit | 9c99824a023a959bb9ff908b2f434e02b8289351 (patch) | |
| tree | 609ee50e778bae6b2eb10f68bf36e8b96752f3e5 /ContentBuildingReader.cpp | |
| parent | 4064cf25797462fc6ac61f578b7e4b6bd31bf6b6 (diff) | |
| download | stonesense-9c99824a023a959bb9ff908b2f434e02b8289351.tar.gz stonesense-9c99824a023a959bb9ff908b2f434e02b8289351.tar.bz2 stonesense-9c99824a023a959bb9ff908b2f434e02b8289351.tar.xz | |
Make stonesense use DF/stonesense for all resources.
Diffstat (limited to 'ContentBuildingReader.cpp')
| -rw-r--r-- | ContentBuildingReader.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ContentBuildingReader.cpp b/ContentBuildingReader.cpp index 4b3b8b3..026c2ec 100644 --- a/ContentBuildingReader.cpp +++ b/ContentBuildingReader.cpp @@ -206,17 +206,25 @@ inline bool readNode(SpriteNode* node, TiXmlElement* elemNode, TiXmlElement* ele bool includeFile(SpriteNode* node, TiXmlElement* includeNode, SpriteBlock* &oldSibling)
{
- string filenameStr("buildings/include/");
- filenameStr.append(includeNode->Attribute("file"));
+ // get path... ugly
+ char configfilepath[FILENAME_BUFFERSIZE] = {0};
+ const char* documentRef = getDocument(includeNode);
- TiXmlDocument doc( filenameStr.c_str() );
+ if (!getLocalFilename(configfilepath,includeNode->Attribute("file"),documentRef))
+ {
+ return false;
+ }
+ ALLEGRO_PATH * incpath = al_create_path(configfilepath);
+ al_append_path_component(incpath, "include");
+ TiXmlDocument doc( al_path_cstr(incpath, ALLEGRO_NATIVE_PATH_SEP) );
+ al_destroy_path(incpath);
bool loadOkay = doc.LoadFile();
TiXmlHandle hDoc(&doc);
TiXmlElement* elemParent;
if(!loadOkay)
{
contentError("Include failed",includeNode);
- WriteErr("File load failed: %s\n",filenameStr.c_str());
+ WriteErr("File load failed: %s\n",configfilepath);
WriteErr("Line %d: %s\n",doc.ErrorRow(),doc.ErrorDesc());
return false;
}
|
