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

Flags: Do not hardcode one Flag field per class #492

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Ghabry
Copy link
Member

@Ghabry Ghabry commented Feb 12, 2025

This is an alternative approach for #491

Instead of a single variable it uses our Flag feature to provide bool variables. This reduces the need for bitmasking.

Problem was that our code always hardcoded StructName_Flags for Flags. This restriction is now lifted and multiple Structs can have the same flags and a struct can have multiple flags.

Don't merge, Player build failure because classes are renamed

Ghabry and others added 6 commits February 12, 2025 12:41
This was hardcoded to one Flag per struct.
The generator is now smarter and you can specify multiple flags which are resolved by their flag name.
…ify which enum names are considered to be "scoped" ('class' enums in C++)
… determine if an event has been created by EasyRPGs new "CloneMapEvent" command
@Ghabry Ghabry marked this pull request as draft March 5, 2025 16:10
@Ghabry
Copy link
Member Author

Ghabry commented Mar 8, 2025

@florianessl this should be okay now?

Ghabry and others added 2 commits March 8, 2025 18:23
…preter related SaveState structures (SaveEventExecState, SaveEventExecFrame & SaveMapEventBase)

Co-Authored-By: florianessl <[email protected]>
@Ghabry Ghabry marked this pull request as ready for review March 8, 2025 17:49
std::array<bool, 20> flags;
};
EasyRpgStateRuntime_Flags() noexcept
{}
Copy link
Member

Choose a reason for hiding this comment

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

Oh, another thing. Sorry for missing that when I first reviewed this:
These flag structures don't seem to be properly initialized. So whenever a flag field is accessed on a newly created SaveEventExecState, there is just garbage data here. :/

Maybe just append a line in the constructor here?
flags.fill(false);

Copy link
Member Author

Choose a reason for hiding this comment

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

Hu. I think you found a general bug applicable to all flags 😅.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants