-
Notifications
You must be signed in to change notification settings - Fork 89
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
d_a_tag_myna_light OK #1954
d_a_tag_myna_light OK #1954
Conversation
inline bool checkTurnOnOffChange() { | ||
bool var1 = mTurnOnFlag - field_0x578; | ||
return var1 & 0xFF; | ||
} |
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.
for inlines defined within the class, you can remove the inline keyword
} | ||
|
||
if (field_0x56c >= 0.000001f) { | ||
*(u32*)&color = *(u32*)color_data; |
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.
can this function be changed to initialize the GXColor here like GXColor color = {0xBC, 0x66, 0x42, 0xFF}
? or does it not match like that
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.
Huh, I swear I tried this before and it didn't work. Must have been doing something wrong though as it's working now, looks much cleaner!
static void daTag_MynaLight_Create(daTag_MynaLight_c* i_this) { | ||
i_this->create(); |
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.
this applies to all actor methods (Create, Execute, Draw, Delete, IsDelete), they should all have an int return type and usually return the value of the function its calling. so like here it'd be like
static int daTag_MynaLight_Create(void* i_this) {
return static_cast<daTag_MynaLight_c*>(i_this)->create();
}
static void daTag_MynaLight_Create(daTag_MynaLight_c* i_this) { | ||
i_this->create(); |
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.
i notice you changed the parameter types in the method functions, but the name mangling from the symbol map confirms that void* was what was used originally. the symbol map should be followed as closely as possible where possible. in these cases, you can just use a cast to the correct actor type, like
static_cast<ActorType*>(i_this)->
or ((ActorType*)i_this)->
a39fe30
to
49c86e2
Compare
(force push above was to amend the first commit with the correct email so it can be linked to my GitHub user) |
Resolves #1170