#include <sqstdmath.h>
#include <sqstdstring.h>
+#include "msg.hpp"
#include "wrapper.hpp"
#include "wrapper_util.hpp"
#include "sector.hpp"
ScriptInterpreter* ScriptInterpreter::_current = 0;
ScriptInterpreter::ScriptInterpreter(const std::string& new_working_directory)
- : working_directory(new_working_directory), sound(0), level(0)
+ : working_directory(new_working_directory), sound(0), level(0), camera(0)
{
v = sq_open(1024);
if(v == 0)
Scripting::DisplayEffect* display_effect_api
= static_cast<Scripting::DisplayEffect*> (display_effect);
expose_object(display_effect_api, "DisplayEffect");
+
+ Scripting::Camera* camera = new Scripting::Camera(sector->camera);
+ expose_object(camera, "Camera");
}
ScriptInterpreter::~ScriptInterpreter()
sq_close(v);
delete sound;
delete level;
+ delete camera;
}
static SQInteger squirrel_read_char(SQUserPointer file)
interpreter->run_script(in, name);
sector->add_object(interpreter.release());
} catch(std::exception& e) {
- std::cerr << "Couldn't start '" << name << "' script: " << e.what() << "\n";
+ msg_warning("Couldn't start '" << name << "' script: " << e.what());
}
}