Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PINK: Use the actual target when searching for saves #4154

Merged
merged 1 commit into from Aug 4, 2022

Conversation

henke37
Copy link
Contributor

@henke37 henke37 commented Aug 3, 2022

This ensures consistent behavior between listing and loading of saves.

I was getting strange results with my localized version, seems like i have saves using both the peril and peril-se prefixes. With this change both listing and loading uses the new peril-se prefix.

@@ -146,10 +146,9 @@ struct SaveStateDescriptorTimeComparator {
}
};

static SaveStateList listSaves(bool isPeril) {
Copy link
Member

@lephilousophe lephilousophe Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of removing static, you can pass the targetName as an argument in place of the boolean.

Copy link
Contributor Author

@henke37 henke37 Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, the implicit this argument is just as expensive to pass, if not cheaper.

Copy link
Member

@lephilousophe lephilousophe Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still need to access the _targetName member... So that's equivalent.
And by passing the target name by reference it's like passing a pointer.
This minimizes the changeset.

Copy link
Contributor Author

@henke37 henke37 Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I need two members from the class. It's now less params to pass.

engines/pink/gui.cpp Outdated Show resolved Hide resolved
This ensures consistent behavior between listing and loading of saves
@sev-
Copy link
Member

@sev- sev- commented Aug 4, 2022

Thanks

@sev- sev- merged commit bd7f77e into scummvm:master Aug 4, 2022
8 checks passed
@henke37 henke37 deleted the pink-patternfix branch Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants