-
Notifications
You must be signed in to change notification settings - Fork 60
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
base: master
Are you sure you want to change the base?
Conversation
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
@florianessl this should be okay now? |
…preter related SaveState structures (SaveEventExecState, SaveEventExecFrame & SaveMapEventBase) Co-Authored-By: florianessl <[email protected]>
std::array<bool, 20> flags; | ||
}; | ||
EasyRpgStateRuntime_Flags() noexcept | ||
{} |
There was a problem hiding this comment.
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);
There was a problem hiding this comment.
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 😅.
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