-
Notifications
You must be signed in to change notification settings - Fork 3
Big Endian Support + NiDataStream Fixes #8
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: main
Are you sure you want to change the base?
Conversation
ousnius
left a comment
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 contribution. The tests seem to be passing.
Do you think you can add a new test for reading and writing a big endian file? Please don't include proprietary assets/meshes, though.
| } | ||
| } | ||
| } | ||
| } No newline at end of file |
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.
Remove unnecessary file edit.
| buffer[1] = buffer[6]; | ||
| buffer[2] = buffer[5]; | ||
| buffer[3] = buffer[4]; | ||
| buffer[4] = buffer[3]; |
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 doesn't work for reversing values. Either use buffer.AsSpan(0, 8).Reverse(); or Array.Reverse or use temporary variables.
| return 1; | ||
| } | ||
|
|
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.
Remove unnecessary file edit NifFile.cs.
| using NiflySharp.Stream; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Diagnostics; |
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.
Remove using.
Replaces the old binary reader/writer with a custom implementation that supports switching between endianess on the fly.