Changeset 2508 for code/trunk/src/core
- Timestamp:
- Dec 17, 2008, 8:43:19 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/LuaBind.cc
r2087 r2508 84 84 } 85 85 86 char line[1024 ];86 char line[1024*32]; 87 87 std::string levelString = ""; 88 88 89 89 while (file.good() && !file.eof()) 90 90 { 91 file.getline(line, 1024 );91 file.getline(line, 1024*32); 92 92 levelString += line; 93 93 levelString += "\n"; … … 97 97 //std::string output; 98 98 99 if (luaTags) luaSource_ = replaceLuaTags(levelString); 99 if (luaTags) 100 luaSource_ = replaceLuaTags(levelString); 101 else 102 luaSource_ = levelString; 100 103 COUT(5) << "ParsedSourceCode: " << luaSource_ << std::endl; 101 104 } … … 123 126 isRunning_ = true; 124 127 int error = 0; 125 std::string init = "local scr = orxonox.LuaBind:getInstance()\nlocal debug = print\nprint = function(s)\nscr:luaPrint(s)\nend\ninclude = function(f)\nfile = assert(io.open(\"" + this->includePath_ + "\"..\"/\"..f))\ncontent = file:read(\"*a\")\nfile:close()\nsource = scr:replaceLuaTags(content)\nassert(loadstring(source))()\nend\n"; 128 std::string init = 129 "local scr = orxonox.LuaBind:getInstance()\n \ 130 local debug = print\n \ 131 print = function(s)\n \ 132 scr:luaPrint(s)\n \ 133 end\n \ 134 include = function(f)\n \ 135 file = assert(io.open(\"" + this->includePath_ + "\"..\"/\"..f))\n \ 136 content = file:read(\"*a\")\n \ 137 file:close()\n \ 138 source = scr:replaceLuaTags(content)\n \ 139 assert(loadstring(source))()\n \ 140 end\n"; 126 141 init += luaSource_; 127 142 #if LUA_VERSION_NUM == 501
Note: See TracChangeset
for help on using the changeset viewer.