MRI-Binding: Add RGSS3 '__FILE__' variant

This commit is contained in:
Jonas Kulla 2014-04-15 11:54:22 +02:00
parent 711060db8f
commit f25d2db63c
1 changed files with 7 additions and 1 deletions

View File

@ -210,6 +210,12 @@ static void runCustomScript(const std::string &filename)
VALUE kernelLoadDataInt(const char *filename); VALUE kernelLoadDataInt(const char *filename);
#ifdef RGSS3
#define RGSS_SECTION_STR "{%04ld}"
#else
#define RGSS_SECTION_STR "Section%03ld"
#endif
static void runRMXPScripts() static void runRMXPScripts()
{ {
const std::string &scriptPack = shState->rtData().config.game.scripts; const std::string &scriptPack = shState->rtData().config.game.scripts;
@ -303,7 +309,7 @@ static void runRMXPScripts()
else else
{ {
char buf[32]; 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); fname = newStringUTF8(buf, len);
} }