-// $Id: main.cpp 3275 2006-04-09 00:32:34Z sommer $
-//
+// $Id$
+//
// SuperTux
-// Copyright (C) 2005 Matthias Braun <matze@braunis.de>
+// Copyright (C) 2006 Matthias Braun <matze@braunis.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-//
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#include "timer.hpp"
#include "console.hpp"
+#include "log.hpp"
#include "scripting/wrapper.hpp"
#include "scripting/wrapper_util.hpp"
#include "scripting/squirrel_error.hpp"
sq_setprintfunc(vm, printfunc);
// register default error handlers
sqstd_seterrorhandlers(vm);
+
+ // try to load default script
+ try {
+ std::string filename = "scripts/default.nut";
+ IFileStream stream(filename);
+ Scripting::compile_and_run(vm, stream, filename);
+ } catch(std::exception& e) {
+ log_warning << "Couldn't load default.nut: " << e.what() << std::endl;
+ }
}
ScriptManager::ScriptManager(ScriptManager* parent)