diff --git a/src/filefinder.cpp b/src/filefinder.cpp index ffe879b761..fc4a6a3bf1 100644 --- a/src/filefinder.cpp +++ b/src/filefinder.cpp @@ -601,18 +601,18 @@ void FileFinder::InitRtpPaths(bool no_rtp, bool no_rtp_warnings) { read_rtp_registry("ASCII", product, "RuntimePackagePath"); read_rtp_registry("KADOKAWA", product, "RuntimePackagePath"); } - else if (Player::IsRPG2k3Legacy()) { + else if (Player::IsRPG2k3E()) { + // Prefer Kadokawa RTP over Enterbrain for new RPG2k3 + read_rtp_registry("KADOKAWA", product, "RuntimePackagePath"); + read_rtp_registry("Enterbrain", product, "RUNTIMEPACKAGEPATH"); + } + else if (Player::IsRPG2k3()) { // Original 2003 RTP installer registry key is upper case // and Wine registry is case insensitive but new 2k3v1.10 installer is not // Prefer Enterbrain RTP over Kadokawa for old RPG2k3 (search order) read_rtp_registry("Enterbrain", product, "RUNTIMEPACKAGEPATH"); read_rtp_registry("KADOKAWA", product, "RuntimePackagePath"); } - else if (Player::IsRPG2k3E()) { - // Prefer Kadokawa RTP over Enterbrain for new RPG2k3 - read_rtp_registry("KADOKAWA", product, "RuntimePackagePath"); - read_rtp_registry("Enterbrain", product, "RUNTIMEPACKAGEPATH"); - } // Our RTP is for all engines read_rtp_registry("EasyRPG", "RTP", "path"); diff --git a/src/game_picture.cpp b/src/game_picture.cpp index 748b61f69c..1b92b93838 100644 --- a/src/game_picture.cpp +++ b/src/game_picture.cpp @@ -140,7 +140,7 @@ void Game_Picture::Show(const ShowParams& params) { data.name = params.name; data.use_transparent_color = params.use_transparent_color; data.fixed_to_map = params.fixed_to_map; - SetNonEffectParams(params); + SetNonEffectParams(params, true); data.effect_mode = params.effect_mode; if (data.effect_mode == RPG::SavePicture::Effect_none) { @@ -180,7 +180,9 @@ void Game_Picture::Show(const ShowParams& params) { void Game_Picture::Move(const MoveParams& params) { RPG::SavePicture& data = GetData(); - SetNonEffectParams(params); + const bool ignore_position = Player::IsLegacy() && data.fixed_to_map; + + SetNonEffectParams(params, !ignore_position); data.time_left = params.duration * DEFAULT_FPS / 10; // Note that data.effect_mode doesn't necessarily reflect the @@ -359,11 +361,13 @@ void Game_Picture::Update() { } } -void Game_Picture::SetNonEffectParams(const Params& params) { +void Game_Picture::SetNonEffectParams(const Params& params, bool set_positions) { RPG::SavePicture& data = GetData(); - data.finish_x = params.position_x; - data.finish_y = params.position_y; + if (set_positions) { + data.finish_x = params.position_x; + data.finish_y = params.position_y; + } data.finish_magnify = params.magnify; data.finish_top_trans = params.top_trans; data.finish_bot_trans = params.bottom_trans; diff --git a/src/game_picture.h b/src/game_picture.h index ddf6b5e5d8..48be90e7a8 100644 --- a/src/game_picture.h +++ b/src/game_picture.h @@ -81,7 +81,7 @@ class Game_Picture { int last_spritesheet_frame = 0; FileRequestBinding request_id; - void SetNonEffectParams(const Params& params); + void SetNonEffectParams(const Params& params, bool set_positions); void SyncCurrentToFinish(); void RequestPictureSprite(); void OnPictureSpriteReady(FileRequestResult*); diff --git a/src/game_screen.cpp b/src/game_screen.cpp index ef408171d9..47c3f10d53 100644 --- a/src/game_screen.cpp +++ b/src/game_screen.cpp @@ -37,14 +37,16 @@ static int GetDefaultNumberOfPictures() { if (Player::IsEnglish()) { return 1000; } - if (Player::IsMajorUpdatedVersion()) { + else if (Player::IsMajorUpdatedVersion()) { return 50; } - if (Player::IsRPG2k3()) { - // FIXME: Needs confirmation with 2k3 RPG_RT <= 1.0.4 + else if (Player::IsRPG2k3Legacy()) { return 40; } - return 20; + else if (Player::IsRPG2kLegacy()) { + return 20; + } + return 0; } Game_Screen::Game_Screen() : diff --git a/src/player.cpp b/src/player.cpp index 3840df7edb..52827c3999 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -727,7 +727,7 @@ void Player::CreateGameObjects() { } } } - Output::Debug("Engine configured as: 2k=%d 2k3=%d 2k3Legacy=%d MajorUpdated=%d Eng=%d", Player::IsRPG2k(), Player::IsRPG2k3(), Player::IsRPG2k3Legacy(), Player::IsMajorUpdatedVersion(), Player::IsEnglish()); + Output::Debug("Engine configured as: 2k=%d 2k3=%d MajorUpdated=%d Eng=%d", Player::IsRPG2k(), Player::IsRPG2k3(), Player::IsMajorUpdatedVersion(), Player::IsEnglish()); FileFinder::InitRtpPaths(no_rtp_flag, no_rtp_warning_flag); @@ -1135,34 +1135,6 @@ startup directory does not contain a valid game (and the game browser loads) Alex, EV0001 and the EasyRPG authors wish you a lot of fun!)" << std::endl; } -bool Player::IsRPG2k() { - return (engine & EngineRpg2k) == EngineRpg2k; -} - -bool Player::IsRPG2k3Legacy() { - return (engine == EngineRpg2k3 || engine == (EngineRpg2k3 | EngineMajorUpdated)); -} - -bool Player::IsRPG2k3() { - return (engine & EngineRpg2k3) == EngineRpg2k3; -} - -bool Player::IsMajorUpdatedVersion() { - return (engine & EngineMajorUpdated) == EngineMajorUpdated; -} - -bool Player::IsRPG2k3E() { - return (IsRPG2k3() && IsEnglish()); -} - -bool Player::IsRPG2kE() { - return (IsRPG2k() && IsEnglish()); -} - -bool Player::IsEnglish() { - return (engine & EngineEnglish) == EngineEnglish; -} - bool Player::IsCP932() { return (encoding == "ibm-943_P15A-2003" || encoding == "932"); } diff --git a/src/player.h b/src/player.h index 0ba7c51a57..a8c1d15c8c 100644 --- a/src/player.h +++ b/src/player.h @@ -148,30 +148,23 @@ namespace Player { */ std::string GetEncoding(); - /** - * @return Whether engine is RPG2k - */ + /** @return If engine is any version of RPG2k */ bool IsRPG2k(); - /** - * @return If engine is RPG2k3 v1.09a or older - */ - bool IsRPG2k3Legacy(); - - /** - * @return If engine is RPG2k3 - */ + /** @return If engine is any version of RPG2k3 */ bool IsRPG2k3(); - /** - * @return If engine is RPG2k v1.50 or newer, or RPG2k3 v1.05 or newer - */ - bool IsMajorUpdatedVersion(); + /** @return If engine is RPG2k <= 1.10 */ + bool IsRPG2kLegacy(); - /** - * @return If engine is the official English RM2k3 release (v1.10) or newer. - */ - bool IsRPG2k3E(); + /** @return If engine is RPG2k3 <= v1.04 */ + bool IsRPG2k3Legacy(); + + /** @return If engine is RPG2k >= 1.50 */ + bool IsRPG2kUpdated(); + + /** @return If engine is RPG2k3 >= 1.05 */ + bool IsRPG2k3Updated(); /** * @return If engine is the official English RM2k release v.1.61 or newer. @@ -179,6 +172,15 @@ namespace Player { */ bool IsRPG2kE(); + /** @return If engine is the official English RM2k3 release (v1.10) or newer. */ + bool IsRPG2k3E(); + + /** @return If engine is RPG2kLegacy() or RPG2k3Legacy() */ + bool IsLegacy(); + + /** @return If engine is RPG2kUpdated() or RPG2k3Updated() */ + bool IsMajorUpdatedVersion(); + /** * @return If engine is the official English release (and not RM2k v.1.60, * which is hard to detect). @@ -328,4 +330,48 @@ namespace Player { #endif } +inline bool Player::IsRPG2k() { + return (engine & EngineRpg2k) == EngineRpg2k; +} + +inline bool Player::IsRPG2k3() { + return (engine & EngineRpg2k3) == EngineRpg2k3; +} + +inline bool Player::IsRPG2kLegacy() { + return engine == EngineRpg2k; +} + +inline bool Player::IsRPG2k3Legacy() { + return engine == EngineRpg2k3; +} + +inline bool Player::IsLegacy() { + return IsRPG2kLegacy() || IsRPG2k3Legacy(); +} + +inline bool Player::IsMajorUpdatedVersion() { + return (engine & EngineMajorUpdated) == EngineMajorUpdated; +} + +inline bool Player::IsEnglish() { + return (engine & EngineEnglish) == EngineEnglish; +} + +inline bool Player::IsRPG2kUpdated() { + return (IsRPG2k() && IsMajorUpdatedVersion()); +} + +inline bool Player::IsRPG2k3Updated() { + return (IsRPG2k3() && IsMajorUpdatedVersion()); +} + +inline bool Player::IsRPG2kE() { + return (IsRPG2k() && IsEnglish()); +} + +inline bool Player::IsRPG2k3E() { + return (IsRPG2k3() && IsEnglish()); +} + #endif