From f25d2db63ce015299c70e3d1a46fc616885300da Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Tue, 15 Apr 2014 11:54:22 +0200 Subject: [PATCH] MRI-Binding: Add RGSS3 '__FILE__' variant --- binding-mri/binding-mri.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp index 34482df..a723727 100644 --- a/binding-mri/binding-mri.cpp +++ b/binding-mri/binding-mri.cpp @@ -210,6 +210,12 @@ static void runCustomScript(const std::string &filename) VALUE kernelLoadDataInt(const char *filename); +#ifdef RGSS3 +#define RGSS_SECTION_STR "{%04ld}" +#else +#define RGSS_SECTION_STR "Section%03ld" +#endif + static void runRMXPScripts() { const std::string &scriptPack = shState->rtData().config.game.scripts; @@ -303,7 +309,7 @@ static void runRMXPScripts() else { char buf[32]; - int len = snprintf(buf, sizeof(buf), "Section%03ld", i); + int len = snprintf(buf, sizeof(buf), RGSS_SECTION_STR, i); fname = newStringUTF8(buf, len); }