Changeset 5660 for code/branches/resource2/src/core/Loader.cc
- Timestamp:
- Aug 18, 2009, 12:06:41 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource2/src/core/Loader.cc
r5654 r5660 122 122 Loader::currentMask_s = file->getMask() * mask; 123 123 124 // Use the LuaState to replace the XML tags (calls our function) 125 scoped_ptr<LuaState> luaState(new LuaState()); 126 luaState->setIncludeParser(&Loader::replaceLuaTags); 127 luaState->includeFile(file->getFilename(), file->getResourceGroup(), false); 128 //luaState->doString(luaInput); 124 std::string xmlInput; 125 if (file->getLuaSupport()) 126 { 127 // Use the LuaState to replace the XML tags (calls our function) 128 scoped_ptr<LuaState> luaState(new LuaState()); 129 luaState->setIncludeParser(&Loader::replaceLuaTags); 130 luaState->includeFile(file->getFilename(), file->getResourceGroup(), false); 131 xmlInput = luaState->getOutput().str(); 132 } 133 else 134 { 135 shared_ptr<ResourceInfo> info = Resource::getInfo(file->getFilename(), file->getResourceGroup()); 136 if (info == NULL) 137 { 138 COUT(1) << "Error: Could not find XML file '" << file->getFilename() << "'." << std::endl; 139 return false; 140 } 141 xmlInput = Resource::open(file->getFilename(), file->getResourceGroup())->getAsString(); 142 } 129 143 130 144 try … … 134 148 135 149 ticpp::Document xmlfile(file->getFilename()); 136 xmlfile.Parse( luaState->getOutput().str(), true);150 xmlfile.Parse(xmlInput, true); 137 151 138 152 ticpp::Element rootElement;
Note: See TracChangeset
for help on using the changeset viewer.