-static SQInteger camera_wrapper(HSQUIRRELVM vm)
-{
- (void) vm;
-
- try {
- Scripting::camera();
-
- return 0;
-
- } catch(std::exception& e) {
- sq_throwerror(vm, e.what());
- return SQ_ERROR;
- } catch(...) {
- sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
- return SQ_ERROR;
- }
-
-}
-
-static SQInteger set_gamma_wrapper(HSQUIRRELVM vm)
-{
- SQFloat arg0;
- if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
- sq_throwerror(vm, _SC("Argument 1 not a float"));
- return SQ_ERROR;
- }
-
- try {
- Scripting::set_gamma(static_cast<float> (arg0));
-
- return 0;
-
- } catch(std::exception& e) {
- sq_throwerror(vm, e.what());
- return SQ_ERROR;
- } catch(...) {
- sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_gamma'"));
- return SQ_ERROR;
- }
-
-}
-
-static SQInteger quit_wrapper(HSQUIRRELVM vm)
-{
- (void) vm;
-
- try {
- Scripting::quit();
-
- return 0;
-
- } catch(std::exception& e) {
- sq_throwerror(vm, e.what());
- return SQ_ERROR;
- } catch(...) {
- sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
- return SQ_ERROR;
- }
-
-}
-
-static SQInteger rand_wrapper(HSQUIRRELVM vm)
-{
-
- try {
- int return_value = Scripting::rand();
-
- sq_pushinteger(vm, return_value);
- return 1;
-
- } catch(std::exception& e) {
- sq_throwerror(vm, e.what());
- return SQ_ERROR;
- } catch(...) {
- sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
- return SQ_ERROR;
- }
-
-}
-
-static SQInteger record_demo_wrapper(HSQUIRRELVM vm)
-{
- const SQChar* arg0;
- if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
- sq_throwerror(vm, _SC("Argument 1 not a string"));
- return SQ_ERROR;
- }
-
- try {
- Scripting::record_demo(arg0);
-
- return 0;
-
- } catch(std::exception& e) {
- sq_throwerror(vm, e.what());
- return SQ_ERROR;
- } catch(...) {
- sq_throwerror(vm, _SC("Unexpected exception while executing function 'record_demo'"));
- return SQ_ERROR;
- }
-
-}
-
-static SQInteger play_demo_wrapper(HSQUIRRELVM vm)
-{
- const SQChar* arg0;
- if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
- sq_throwerror(vm, _SC("Argument 1 not a string"));
- return SQ_ERROR;
- }
-
- try {
- Scripting::play_demo(arg0);
-
- return 0;
-
- } catch(std::exception& e) {
- sq_throwerror(vm, e.what());
- return SQ_ERROR;
- } catch(...) {
- sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_demo'"));
- return SQ_ERROR;
- }
-
-}
-
-} // end of namespace Wrapper
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
-{
- using namespace Wrapper;
-
- sq_pushroottable(v);
- sq_pushstring(v, "DisplayEffect", -1);
- if(SQ_FAILED(sq_get(v, -2))) {
- std::ostringstream msg;
- msg << "Couldn't resolved squirrel type 'DisplayEffect'";
- throw SquirrelError(v, msg.str());
- }
-
- if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
- std::ostringstream msg;
- msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
- throw SquirrelError(v, msg.str());
- }
- sq_remove(v, -2); // remove object name
-
- if(setup_releasehook) {
- sq_setreleasehook(v, -1, DisplayEffect_release_hook);
- }
-
- sq_remove(v, -2); // remove root table
-}
-
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)