Skip to content

Commit

Permalink
Fakematch d_ovlp_fade2 weak order
Browse files Browse the repository at this point in the history
fixes #667
  • Loading branch information
LagoLunatic committed Jul 14, 2024
1 parent c81caca commit 2a958f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def JSystemLib(lib_name, objects):
Object(NonMatching, "d/d_operate_wind.cpp"),
Object(Matching, "d/d_metronome.cpp"),
Object(Matching, "d/d_ovlp_fade.cpp"),
Object(NonMatching, "d/d_ovlp_fade2.cpp"),
Object(Matching, "d/d_ovlp_fade2.cpp"),
Object(NonMatching, "d/d_ovlp_fade3.cpp"),
Object(NonMatching, "d/d_ovlp_fade4.cpp"),
Object(NonMatching, "d/d_picture_box.cpp"),
Expand Down
11 changes: 11 additions & 0 deletions src/d/d_ovlp_fade2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@ static s32 dOvlpFd2_Create(void* i_this) {
return cPhs_COMPLEATE_e;
}

// Fakematch. Manually define this template function here to make it non-weak, fixing the weak function ordering.
template <>
s8 cLib_calcTimer<s8>(s8* value) {
if (*(s8*)value != 0) {
*value = *value - 1;
}
return *value;
}

overlap_method_class l_dOvlpFd2_Method = {
(process_method_func)dOvlpFd2_Create,
(process_method_func)dOvlpFd2_Delete,
Expand All @@ -258,6 +267,7 @@ overlap_process_profile_definition g_profile_OVERLAP2 = {
&l_dOvlpFd2_Method,
};

#if VERSION != VERSION_JPN
overlap_process_profile_definition g_profile_OVERLAP3 = {
fpcLy_ROOT_e,
2,
Expand All @@ -271,3 +281,4 @@ overlap_process_profile_definition g_profile_OVERLAP3 = {
0x1E4,
&l_dOvlpFd2_Method,
};
#endif

0 comments on commit 2a958f1

Please sign in to comment.