- Timestamp:
- Mar 28, 2010, 3:21:44 PM (15 years ago)
- Location:
- code/branches/gamestate/src/libraries/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gamestate/src/libraries/core/LuaState.cc
r6417 r6625 134 134 sourceFileInfo_ = sourceFileInfo; 135 135 136 std::string chunkname; 137 if (sourceFileInfo != NULL && !sourceFileInfo->fileSystemPath.empty()) 138 { 139 // Provide lua_load with the filename for debug purposes 140 // The '@' is a Lua convention to identify the chunk name as filename 141 chunkname = '@' + sourceFileInfo->fileSystemPath; 142 } 143 else 144 { 145 // Use the beginning of the code string to identify the chunk 146 chunkname = code.substr(0, 80); 147 } 148 136 149 int error = 0; 137 150 #if LUA_VERSION_NUM != 501 … … 139 152 ls.s = code.c_str(); 140 153 ls.size = code.size(); 141 error = lua_load(luaState_, &orxonox::LuaState::lua_Chunkreader, &ls, c ode.c_str());154 error = lua_load(luaState_, &orxonox::LuaState::lua_Chunkreader, &ls, chunkname.c_str()); 142 155 #else 143 error = luaL_load string(luaState_, code.c_str());156 error = luaL_loadbuffer(luaState_, code.c_str(), code.size(), chunkname.c_str()); 144 157 #endif 145 158 -
code/branches/gamestate/src/libraries/core/Resource.cc
r6417 r6625 29 29 #include "Resource.h" 30 30 31 #include <boost/filesystem/path.hpp> 31 32 #include <OgreException.h> 33 #include <OgreFileSystem.h> 32 34 #include <OgreResourceGroupManager.h> 33 35 … … 89 91 ptr->group = group; 90 92 ptr->size = it->uncompressedSize; 93 if (dynamic_cast<Ogre::FileSystemArchive*>(it->archive) != NULL) 94 { 95 boost::filesystem::path base(it->archive->getName()); 96 base /= it->filename; 97 ptr->fileSystemPath = base.string(); 98 } 91 99 return ptr; 92 100 } -
code/branches/gamestate/src/libraries/core/Resource.h
r6417 r6625 57 57 //! Uncompressed size 58 58 size_t size; 59 //! Absolute file path ("" for files not on filesystem) 60 std::string fileSystemPath; 59 61 }; 60 62
Note: See TracChangeset
for help on using the changeset viewer.