diff options
author | madmaxoft <github@xoft.cz> | 2013-08-08 12:14:47 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-08-08 12:14:47 +0200 |
commit | ae9334bd9323ec7b21a77e33517a87c4a8a80580 (patch) | |
tree | b91554553a2b5c674e87af5e812b99dcab222fa3 /source/squirrelbindings/SquirrelFunctions.cpp | |
parent | Merge pull request #50 from ravenscroftj/feature/drowning (diff) | |
parent | Removed squirrel mentions from makefile (diff) | |
download | cuberite-ae9334bd9323ec7b21a77e33517a87c4a8a80580.tar cuberite-ae9334bd9323ec7b21a77e33517a87c4a8a80580.tar.gz cuberite-ae9334bd9323ec7b21a77e33517a87c4a8a80580.tar.bz2 cuberite-ae9334bd9323ec7b21a77e33517a87c4a8a80580.tar.lz cuberite-ae9334bd9323ec7b21a77e33517a87c4a8a80580.tar.xz cuberite-ae9334bd9323ec7b21a77e33517a87c4a8a80580.tar.zst cuberite-ae9334bd9323ec7b21a77e33517a87c4a8a80580.zip |
Diffstat (limited to 'source/squirrelbindings/SquirrelFunctions.cpp')
-rw-r--r-- | source/squirrelbindings/SquirrelFunctions.cpp | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/source/squirrelbindings/SquirrelFunctions.cpp b/source/squirrelbindings/SquirrelFunctions.cpp deleted file mode 100644 index 9407670d4..000000000 --- a/source/squirrelbindings/SquirrelFunctions.cpp +++ /dev/null @@ -1,94 +0,0 @@ - -#include "Globals.h" - - - - - -#ifdef USE_SQUIRREL - - - - - -#include "SquirrelFunctions.h" -#include "SquirrelBindings.h" - - - - - -static HSQUIRRELVM squirrelvm = NULL; - - - - - -SQInteger runtimeErrorHandler(HSQUIRRELVM a_VM) -{ - const SQChar *sErr = 0; - if(sq_gettop(a_VM) >= 1) - { - if(SQ_SUCCEEDED(sq_getstring(a_VM, 2, &sErr))) - { - LOGERROR("Squirrel Error: %s", sErr); - } - else - { - LOGERROR("Squirrel Error: Unknown Error"); - } - } - return 0; -} - -void compilerErrorHandler(HSQUIRRELVM v, - const SQChar* a_Desc, - const SQChar* a_Source, - SQInteger a_Line, - SQInteger a_Column) -{ - - LOGERROR("Squirrel Error: %s (%d:%d) %s", a_Source, a_Line, a_Column, a_Desc); -} - -HSQUIRRELVM OpenSquirrelVM() -{ - if(!squirrelvm) - { - squirrelvm = sq_open(1024); - Sqrat::DefaultVM::Set(squirrelvm); - - sq_newclosure(squirrelvm, runtimeErrorHandler, 0); - sq_seterrorhandler(squirrelvm); - - sq_setcompilererrorhandler(squirrelvm, compilerErrorHandler); - - BindSquirrel(squirrelvm); - } - return squirrelvm; -} - -void CloseSquirrelVM() -{ - if(squirrelvm) - { - sq_close(squirrelvm); - squirrelvm = NULL; - } -} - - -void sqPrint(SQChar * text) -{ - LOGINFO("%s", text); -} - - - - - -#endif // USE_SQUIRREL - - - - |