From 6401c6612976ac1658c77a1a2b72de8429d6aea5 Mon Sep 17 00:00:00 2001 From: sukibaby <163092272+sukibaby@users.noreply.github.com> Date: Wed, 26 Mar 2025 09:16:06 -0700 Subject: [PATCH] Reorganize machine sync bias handing in Group constructor All logic is moved into one section now instead of being split between two places. This is a minor change, but I'd be more comfortable with this because it more explicitly defines the different possibilities for group/machine offset combinations than the existing code. Revert "Reorganize machine sync bias handing in Group constructor" This reverts commit b53d26df494aea9d7491d2410c214b146ab09034. Reorganize machine sync bias handing in Group constructor --- src/Group.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/Group.cpp b/src/Group.cpp index a32c312bdd..d61e050bc8 100644 --- a/src/Group.cpp +++ b/src/Group.cpp @@ -57,7 +57,7 @@ Group::Group(const RString& sDir, const RString& sGroupDirName, bool bFromProfil m_sSortTitle = m_sGroupName; m_sTranslitTitle = m_sGroupName; m_sSeries = ""; - m_fSyncOffset = PREFSMAN->m_DefaultSyncOffset == SyncOffset_NULL ? 0.0f : -0.009f; + m_fSyncOffset = 0.0f; m_bHasPackIni = false; m_iYearReleased = 0; m_sBannerPath = ""; @@ -102,13 +102,30 @@ Group::Group(const RString& sDir, const RString& sGroupDirName, bool bFromProfil RString sValue = ""; ini.GetValue("Group", "SyncOffset", sValue); Trim(sValue); + // Handle the group offset application. + // + // The goal of Pack.ini is to make everything NULL synced internally. + // + // The machine sync offset preference corresponds to what offset the user + // would like to assume as a "default" for packs without a Pack.ini. + // + // If the machine sync bias is set to ITG, we want to remove the 9ms ITG bias + // for all packs without a Pack.ini. + // + // If the Pack.ini is specified (regardless of the machine sync bias) with + // SyncOffset=ITG, we need to always remove the 9ms ITG bias. + // Otherwise, if SyncOffset=NULL, we don't need to do anything since it's + // already NULL synced. + m_fSyncOffset = (PREFSMAN->m_DefaultSyncOffset == SyncOffset_NULL) ? 0.0f : -0.009f; if (!sValue.empty()) { if (sValue == "NULL") { m_fSyncOffset = 0.0f; - } else if (sValue == "ITG") { + } + else if (sValue == "ITG") { m_fSyncOffset = -0.009f; - } else { - LOG->Warn("Group::Group: Invalid SyncOffset value: %s in Pack.ini. Valid values are NULL and ITG. Defaulting to NULL.", sValue.c_str()); + } + else { + LOG->Warn("Group::Group: Invalid SyncOffset value: %s in Pack.ini. Valid values are NULL and ITG. Using default value.", sValue.c_str()); } } @@ -201,4 +218,4 @@ public: LUA_REGISTER_CLASS(Group) -// lua end \ No newline at end of file +// lua end