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

ENGINE: Suppress autosave overwrite warning when description is empty #3561

Merged
merged 1 commit into from Nov 24, 2021

Conversation

@orgads
Copy link
Contributor

@orgads orgads commented Nov 23, 2021

Some engines (like kyra) return a SaveStateDescriptor with slot assigned,
even when the slot is free. The indication for an empty save is empty
description on these cases.

@orgads orgads force-pushed the empty-autosave-warn branch from d3870dc to a24b69a Nov 23, 2021
@athrxx
Copy link
Member

@athrxx athrxx commented Nov 23, 2021

Thanks for updating this.

However, the issue that this is difficult to understand still remains: It is not obvious to anyone else who looks at that code for the first time why a slot of -1 or an empty slot name would mean that there is no file.

The comment for int getSaveSlot() const { return _slot; } says:
@return The saveslot id, as it would be passed to the "-x" command line switch.
There is no indication that a value of -1 would have a special meaning. Same for the empty description name.

Why not add a property _fileExists or similiar and a corresponding query function to SaveStateDescriptor? (unless you don't have the time of course :-) )

Loading

@orgads
Copy link
Contributor Author

@orgads orgads commented Nov 23, 2021

You looked at the wrong function. Search for getAutosaveSlot in engines/metaengine.h.

Loading

@orgads
Copy link
Contributor Author

@orgads orgads commented Nov 23, 2021

Loading

@athrxx
Copy link
Member

@athrxx athrxx commented Nov 23, 2021

Okay, that function (MetaEngine::getAutosaveSlot) is supposed to return -1 if autosaving is not supported. I did see that. But here (from Engine::warnBeforeOverwritingAutosave() your check is: desc.getSaveSlot() == -1. That's the method from SaveStateDescriptor. Also, "autosaving not being supported" and "autosaving being supported, but a certain save file not existing" are two different things.

Just to clarify: I am not against merging the PR. I would just prefer clearing this up a bit... But that might happen (or not) at a later point...

Loading

Some engines (like kyra) return a SaveStateDescriptor with slot assigned,
even when the slot is free. The indication for an empty save is empty
description on these cases.
@orgads orgads force-pushed the empty-autosave-warn branch from a24b69a to 26a2a86 Nov 23, 2021
@orgads
Copy link
Contributor Author

@orgads orgads commented Nov 23, 2021

Better now?

Loading

@athrxx
Copy link
Member

@athrxx athrxx commented Nov 23, 2021

Yes :-)

Loading

@bluegr
Copy link
Member

@bluegr bluegr commented Nov 23, 2021

Looks good to me now as well

Loading

@orgads orgads merged commit aa8cabd into scummvm:master Nov 24, 2021
8 checks passed
Loading
@orgads orgads deleted the empty-autosave-warn branch Nov 24, 2021
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