Skip to content

Commit

Permalink
tilemap version config
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan-MV committed Apr 2, 2024
1 parent 8ccbc04 commit e12f923
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
16 changes: 13 additions & 3 deletions binding/binding-mri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,23 @@ static void mriBindingInit() {
spriteBindingInit();
viewportBindingInit();
planeBindingInit();


if (shState->config().tilemapVersion == 1) {
tilemapBindingInit();
} else if (shState->config().tilemapVersion == 2) {
tilemapVXBindingInit();
} else {
if (rgssVer == 1) {
tilemapBindingInit();
} else {
tilemapVXBindingInit();
}
}

if (rgssVer == 1) {
windowBindingInit();
tilemapBindingInit();
} else {
windowVXBindingInit();
tilemapVXBindingInit();
}

inputBindingInit();
Expand Down
9 changes: 9 additions & 0 deletions mkxp.json
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,15 @@
// }


// Use alternate tilemap class independent of RGSS version. Default: 0
// 0 - Match RGSS version
// 1 - RMXP Tilemap
// 2 - VX/Ace tilemap
// (default: 0)
//
// "tilemapVersion": 0


// Dump tile atlas (for debugging purposes)
// (default: false)
//
Expand Down
2 changes: 2 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ void Config::read(int argc, char *argv[]) {
{"JITMaxCache", 100},
{"JITMinCalls", 10000},
{"YJITEnable", false},
{"tilemapVersion", 0},
{"dumpAtlas", false},
{"bindingNames", json::object({
{"a", "A"},
Expand Down Expand Up @@ -305,6 +306,7 @@ try { exp } catch (...) {}
SET_OPT_CUSTOMKEY(BGM.trackCount, BGMTrackCount, integer);
SET_STRINGOPT(customScript, customScript);
SET_OPT(useScriptNames, boolean);
SET_OPT(tilemapVersion, integer);
SET_OPT(dumpAtlas, boolean);

fillStringVec(opts["preloadScript"], preloadScripts);
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ struct Config {
bool enabled;
} yjit;

int tilemapVersion;
bool dumpAtlas;

// Keybinding action name mappings
Expand Down

0 comments on commit e12f923

Please sign in to comment.