Merge pull request #59 from cremno/mri-add-global-function-rgss_stop

MRI: add global function rgss_stop
This commit is contained in:
Jonas Kulla 2014-08-29 22:15:31 +02:00
commit 3cdbf2b035
1 changed files with 13 additions and 0 deletions

View File

@ -26,6 +26,7 @@
#include "filesystem.h"
#include "util.h"
#include "debugwriter.h"
#include "graphics.h"
#include <ruby.h>
#include <ruby/encoding.h>
@ -75,6 +76,7 @@ RB_METHOD(mriDataDirectory);
RB_METHOD(mkxpPuts);
RB_METHOD(mriRgssMain);
RB_METHOD(mriRgssStop);
RB_METHOD(_kernelCaller);
static void mriBindingInit()
@ -107,6 +109,7 @@ static void mriBindingInit()
if (rgssVer >= 3)
{
_rb_define_module_function(rb_mKernel, "rgss_main", mriRgssMain);
_rb_define_module_function(rb_mKernel, "rgss_stop", mriRgssStop);
_rb_define_module_function(rb_mKernel, "msgbox", mriPrint);
_rb_define_module_function(rb_mKernel, "msgbox_p", mriP);
@ -217,6 +220,16 @@ RB_METHOD(mriRgssMain)
return Qnil;
}
RB_METHOD(mriRgssStop)
{
RB_UNUSED_PARAM;
while (true)
shState->graphics().update();
return Qnil;
}
RB_METHOD(_kernelCaller)
{
RB_UNUSED_PARAM;