From 4920931d33e39211b35334db0c685d695b7b05ce Mon Sep 17 00:00:00 2001 From: cremno Date: Fri, 29 Aug 2014 14:28:23 +0200 Subject: [PATCH] add global function rgss_stop It's only useful for testing code. Also RGSS3's rgss_stop (and rgss_main) is written in Ruby and not in C++. But I doubt someone relies on that. --- binding-mri/binding-mri.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp index 07168d7..c7f3229 100644 --- a/binding-mri/binding-mri.cpp +++ b/binding-mri/binding-mri.cpp @@ -26,6 +26,7 @@ #include "filesystem.h" #include "util.h" #include "debugwriter.h" +#include "graphics.h" #include #include @@ -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; -- 2.43.0