-
Notifications
You must be signed in to change notification settings - Fork 129
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
Adaptive delta animations #152
Conversation
Codecov Report
@@ Coverage Diff @@
## master #152 +/- ##
=========================================
- Coverage 9.21% 9.16% -0.05%
=========================================
Files 798 801 +3
Lines 27589 27710 +121
=========================================
Hits 2541 2541
- Misses 25048 25169 +121
Continue to review full report at Codecov.
|
Fixed all the remaining bugs. Ready for review/merge |
private static AnimationClip CreateAnimationClip(W3dCompressedAnimation w3dAnimation, W3dMotionChannel w3dChannel) | ||
{ | ||
var bone = w3dChannel.Pivot; | ||
var data = w3dChannel.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.
Unused variable.
@@ -542,5 +542,17 @@ public static Matrix2x2 ReadMatrix2x2(this BinaryReader reader) | |||
M22 = reader.ReadSingle() | |||
}; | |||
} | |||
|
|||
public static float[] ReadSingleArray(this BinaryReader reader, int len) |
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 is never used.
{ | ||
class W3dAdaptiveDelta | ||
{ | ||
private static float[] Table = CalculateTable(); |
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.
Mark this as readonly
.
} | ||
else if (nBits == 8) | ||
{ | ||
var val = (byte)deltaBytes[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.
Nitpick: space between cast and value.
result.Scale, | ||
nBits); | ||
|
||
reader.ReadBytes(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.
Replace with reader.BaseStream.Seek(3, SeekOrigin.Current);
to remove an unnecessary array allocation.
Could you add a comment why you're skipping 3 bytes?
@@ -49,12 +49,12 @@ public static W3dMotionChannel Parse(BinaryReader reader, uint chunkSize) | |||
|
|||
case W3dMotionChannelDeltaType.Delta4: | |||
// TODO |
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.
Are these 2 still TODO if we can now decode them?
@@ -0,0 +1,34 @@ | |||
using System; |
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 unused usings.
Working for some BFME II models. Need to get some issues resolved before merging this.