-
Notifications
You must be signed in to change notification settings - Fork 46
WIP mod support #1313
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
base: master
Are you sure you want to change the base?
WIP mod support #1313
Conversation
| @@ -0,0 +1,24 @@ | |||
| #ifndef MODMANAGER_H | |||
| #define MODMANAGER_H | |||
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.
modmanager seems unnecessarily long. Maybe just prefix with "mods_" ?
| #include "resources/af_move.h" | ||
| #include "resources/animation.h" | ||
| #include "resources/bk_info.h" | ||
| #include "utils/hashmap.h" |
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.
hashmap not used in header btw
38cfbe7 to
c95cddd
Compare
49fe496 to
b401e12
Compare
| } | ||
| } | ||
| #ifdef OPUSFILE_FOUND | ||
| } else if(strcmp(".ogg", str_c(&ext)) == 0) { |
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.
str_equals(&ext, ".ogg")
src/game/common_defines.c
Outdated
|
|
||
| for(int id = 0; id < num_hars; id++) { | ||
| if(strcasecmp(name, har_type_names[id]) == 0) { | ||
| if(omf_strncasecmp(name, har_type_names[id], strlen(har_type_names[id])) == 0) { |
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.
- if(strcasecmp(name, har_type_names[id]) == 0) {
+ if(omf_strncasecmp(name, har_type_names[id], strlen(har_type_names[id])) == 0) {these lines lines are not equivalent, as the latter is a "is har_type_names[id] a suffix of name?" test, wheres the former is an equality test.
Do not pass strlen into the length argument of strncasecmp, this is an anti-pattern.
Perhaps: omf_strncasecmp(name, har_type_names[id], SIZE_MAX), if you want to compare the whole strings? You could add this as a helper method, call it "omf_strcasecmp."
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.
correction: someone already added the omf_strcasecmp helper method, please use it.
openomf/src/utils/c_string_util.c
Line 55 in 5cf380f
| int omf_strcasecmp(char const *s1, char const *s2) { |
b50f862 to
7f414fd
Compare
Things to do:
Depends on #1312 to properly display high-res assets.