summaryrefslogtreecommitdiff
path: root/ZAPD/ZPlayerAnimationData.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ZAPD/ZPlayerAnimationData.cpp')
-rw-r--r--ZAPD/ZPlayerAnimationData.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/ZAPD/ZPlayerAnimationData.cpp b/ZAPD/ZPlayerAnimationData.cpp
index a96604f..ce5425d 100644
--- a/ZAPD/ZPlayerAnimationData.cpp
+++ b/ZAPD/ZPlayerAnimationData.cpp
@@ -32,7 +32,7 @@ void ZPlayerAnimationData::ParseRawData()
for (size_t i = 0; i < totalSize; i += 2)
{
- limbRotData.push_back(BitConverter::ToUInt16BE(rawData, rawDataIndex + i));
+ limbRotData.push_back(BitConverter::ToInt16BE(rawData, rawDataIndex + i));
}
}
@@ -55,14 +55,21 @@ std::string ZPlayerAnimationData::GetBodySourceCode() const
std::string declaration = "";
size_t index = 0;
- for (const auto& entry : limbRotData)
+ for (const auto entry : limbRotData)
{
if (index % 8 == 0)
{
declaration += "\t";
}
- declaration += StringHelper::Sprintf("0x%04X, ", entry);
+ if (entry < 0)
+ {
+ declaration += StringHelper::Sprintf("-0x%04X, ", -entry);
+ }
+ else
+ {
+ declaration += StringHelper::Sprintf("0x%04X, ", entry);
+ }
if ((index + 1) % 8 == 0)
{