-
Notifications
You must be signed in to change notification settings - Fork 42
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
Adjust IW4 xmodel bones for shield hits #63
base: develop
Are you sure you want to change the base?
Conversation
@@ -153,9 +153,23 @@ namespace ZoneTool | |||
|
|||
if (data->partClassification) | |||
{ | |||
char *shieldAdjustedPartClassification = new char[data->numBones]; |
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 would like to point out that ZoneMemory class utilitiy is provided inside src\ZoneUtils\Zone
.
You could:
auto shieldAdjustedPartClassification = this->ManualAlloc<char>(data->numBones);
This has the advantage that the buffer is set to 0 using memset, then it will be automatically disposed of without you explicitly using the delete operator when the ZoneMemory object is deleted.
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.
Thanks for the feedback! I'd like to fix this at some point, but don't have the time to get into C++ as a language enough even. Especially as I'm not even sure if this should be part of zonetool in the place where it is. Might make this a bit nicer at some point, but can't right now.
Feel free to edit any of it if you are interested.
|
||
for (int i = 0; i < data->numBones; i++) | ||
{ | ||
uint16_t boneNameIndex = data->boneNames[i]; |
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.
Use std::uint16_t
like it's done throughout the repo or auto
I guess
You put the code in the write code. I don't think this would be the correct place to apply this logic in. |
I see what you mean, and just simply doing this there without telling the user is a shady side-effect imo. But I'm not sure where else to do it. Were I to do it on the export from a IW3 zone, that would mean the model might break when recompiled to IW3 I guess? Because only IW4 (probably IW5 uses the same bones but I don't know about that) needs this fix for models exported via CoD4 asset manager. Or are you simply talking about where I put it in the code, and not in which stage it happens logically? In that case, I can check the repo in more detail if I ever have the time/skills to actually contribute. |
Credit to @K0bin, who helped me scriptkiddie my way through C++.
This might suck but what it does is modify xmodels that when they are built into a fastfile for IW4, bones are mapped to the correct hit locations for riot shield hits.
Thanks to @Laupetin!