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

TINSEL: Implement a solution for INV_OBJECT being different in Noir, and add basic support for menus. #3866

Merged
merged 3 commits into from May 11, 2022

Conversation

somaen
Copy link
Member

@somaen somaen commented May 8, 2022

This adds a (slightly over-engineered) way to resolve the size difference between INV_OBJECT in Noir and before, and relies on inheritance to provide the new fields.

Also this adds very basic menu support (save/load menus work, the options menu itself works, but the actual sub menus are not fully implemented yet).

To provide the mapping, the way the versioning is handled for the menu tables has been modified slightly, to avoid nesting ternaries.

Hence I think it's worthwhile to get this reviewed before pushing it, in case I've misunderstood something about the engine.

@somaen somaen requested a review from bluegr May 8, 2022
@somaen somaen changed the title Implement a solution for INV_OBJECT being different in Noir, and add basic support for menus. TINSEL: Implement a solution for INV_OBJECT being different in Noir, and add basic support for menus. May 8, 2022
engines/tinsel/inv_objects.cpp Outdated Show resolved Hide resolved
engines/tinsel/inv_objects.cpp Outdated Show resolved Hide resolved
engines/tinsel/inv_objects.cpp Outdated Show resolved Hide resolved
engines/tinsel/inv_objects.cpp Outdated Show resolved Hide resolved
engines/tinsel/inv_objects.cpp Outdated Show resolved Hide resolved
engines/tinsel/inv_objects.cpp Outdated Show resolved Hide resolved
engines/tinsel/inv_objects.cpp Outdated Show resolved Hide resolved
engines/tinsel/multiobj.cpp Outdated Show resolved Hide resolved
engines/tinsel/multiobj.cpp Outdated Show resolved Hide resolved
engines/tinsel/multiobj.cpp Outdated Show resolved Hide resolved
engines/tinsel/inv_objects.cpp Outdated Show resolved Hide resolved
engines/tinsel/dialogs.cpp Outdated Show resolved Hide resolved
@bluegr
Copy link
Member

@bluegr bluegr commented May 8, 2022

Great and clean approach!
It would be great if we could have a variant of InstantiateInventoryObjects() for Tinsel V0 too.

somaen added 3 commits May 9, 2022
This way we encapsulate the iteration, thus making sure that
the appropriate stride is used (Noir has more fields).
@bluegr
Copy link
Member

@bluegr bluegr commented May 11, 2022

Excellent work!
Just tried this with DW0, DW1 and DW2, and everything seems to be working as expected.
Any further work on this can be done in-tree.
Merging

@bluegr bluegr merged commit 757aea8 into scummvm:master May 11, 2022
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants