summaryrefslogtreecommitdiff
path: root/ZAPD/ZPlayerAnimationData.cpp
diff options
context:
space:
mode:
authorlouist103 <35883445+louist103@users.noreply.github.com>2023-07-08 18:49:18 -0700
committerGitHub <noreply@github.com>2023-07-08 21:49:18 -0400
commitb62d38046dbc6618b5eb433a0a29560e02bf43a9 (patch)
tree6317e49433bdd6b154c935584511879f390de4cf /ZAPD/ZPlayerAnimationData.cpp
parentbd87285d719e738a8baee8f11d4d6ffce0ab24a0 (diff)
Sign player anim data (#296)
* Sign player anim data * Add comment * better way of getting negative values
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)
{