From 4b46d6e47da9923fb08ae265e25c8430c7d47b91 Mon Sep 17 00:00:00 2001 From: Struma Date: Mon, 4 Jul 2022 11:18:22 -0400 Subject: [PATCH] remove commonDataPath and update mkxp.json to match the actual behavior --- mkxp.json | 7 +++---- src/config.cpp | 2 -- src/config.h | 1 - src/display/graphics.cpp | 2 +- src/input/keybindings.cpp | 8 +------- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/mkxp.json b/mkxp.json index c1b740f..6cd7c61 100644 --- a/mkxp.json +++ b/mkxp.json @@ -210,10 +210,9 @@ // Organisation / company and application / game // name to build the directory path where mkxp // will store game specific data (eg. key bindings). - // If not specified, mkxp will save to a common - // directory shared by all games. Note that these - // are TWO individual config entries, and both need - // to be defined for this to take effect. + // If not specified, mkxp-z will use a folder based + // on the name of the game, if possible, defaulting + // to "." for Org and "mkxp-z" for App otherwise. // (default: none) // // "dataPathOrg": "mycompany", diff --git a/src/config.cpp b/src/config.cpp index 82344bc..467c4da 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -352,8 +352,6 @@ void Config::readGameINI() { customDataPath = prefPath(dataPathOrg.c_str(), dataPathApp.c_str()); - commonDataPath = prefPath(".", "mkxp-z"); - if (rgssVersion == 0) { /* Try to guess RGSS version based on Data/Scripts extension */ rgssVersion = 1; diff --git a/src/config.h b/src/config.h index 24c3b8a..8f16bbf 100644 --- a/src/config.h +++ b/src/config.h @@ -137,7 +137,6 @@ struct Config { /* Internal */ std::string customDataPath; - std::string commonDataPath; Config(); diff --git a/src/display/graphics.cpp b/src/display/graphics.cpp index d54b2bd..7fc59dd 100644 --- a/src/display/graphics.cpp +++ b/src/display/graphics.cpp @@ -808,7 +808,7 @@ struct GraphicsPrivate { ratio.x = (float)scRes.x / scSize.x * backingScaleFactor; ratio.y = (float)scRes.y / scSize.y * backingScaleFactor; - rtData->screenOffset = scOffset; + rtData->screenOffset = scOffset / backingScaleFactor; } /* Enforces fixed aspect ratio, if desired */ diff --git a/src/input/keybindings.cpp b/src/input/keybindings.cpp index dfec6c7..c9ff17e 100644 --- a/src/input/keybindings.cpp +++ b/src/input/keybindings.cpp @@ -212,10 +212,7 @@ static bool writeBindings(const BDescVec &d, const std::string &dir, void storeBindings(const BDescVec &d, const Config &conf) { - if (writeBindings(d, conf.customDataPath, conf.rgssVersion)) - return; - - writeBindings(d, conf.commonDataPath, conf.rgssVersion); + writeBindings(d, conf.customDataPath, conf.rgssVersion); } #define READ(ptr, size, n, f) if (fread(ptr, size, n, f) < n) return false @@ -312,8 +309,5 @@ BDescVec loadBindings(const Config &conf) if (readBindings(d, conf.customDataPath, conf.rgssVersion)) return d; - if (readBindings(d, conf.commonDataPath, conf.rgssVersion)) - return d; - return genDefaultBindings(conf); }