X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fscripting%2Fscripting.cpp;h=b19c13b6b2fb0216a1131c313a73fccff262e65a;hb=c0b5cfa3eadebef8101f87cd593eb221bdef9280;hp=71645ab38575c777f99c3b6bcf5936b4bc90152c;hpb=5c7020e504303cf18e472283ab614ef08ad43b2c;p=supertux.git diff --git a/src/scripting/scripting.cpp b/src/scripting/scripting.cpp index 71645ab38..b19c13b6b 100644 --- a/src/scripting/scripting.cpp +++ b/src/scripting/scripting.cpp @@ -23,7 +23,7 @@ #include #include -#include "physfs/ifile_stream.hpp" +#include "physfs/buffered_ifile_stream.hpp" #include "scripting/squirrel_error.hpp" #include "scripting/wrapper.hpp" #include "squirrel_util.hpp" @@ -48,7 +48,7 @@ void printfunc(HSQUIRRELVM, const char* fmt, ...) va_list arglist; va_start(arglist, fmt); vsnprintf(buf, sizeof(buf), fmt, arglist); - ConsoleBuffer::output << (const char*) buf << std::flush; + ConsoleBuffer::output << "[SQUIRREL] " << (const char*) buf << std::flush; va_end(arglist); } @@ -106,8 +106,9 @@ Scripting::Scripting(bool enable_debugger) // try to load default script try { std::string filename = "scripts/default.nut"; - IFileStream stream(filename); - scripting::compile_and_run(global_vm, stream, filename); + BufferedIFileStream* buffered_stream = new BufferedIFileStream(filename); + IFileStream* stream = buffered_stream->get_stream(); + scripting::compile_and_run(global_vm, *stream, filename); } catch(std::exception& e) { log_warning << "Couldn't load default.nut: " << e.what() << std::endl; }