Skip to content

Commit

Permalink
Bump to KRKG version 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
vabold committed Apr 3, 2024
1 parent 92baea3 commit 99aab5a
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
Binary file modified samples/rmc3-rta-1-17-843.krkg
Binary file not shown.
8 changes: 8 additions & 0 deletions source/game/kart/KartObjectProxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ const EGG::Quatf &KartObjectProxy::fullRot() const {
return dynamics()->fullRot();
}

const EGG::Vector3f &KartObjectProxy::extVel() const {
return dynamics()->extVel();
}

const EGG::Vector3f &KartObjectProxy::intVel() const {
return dynamics()->intVel();
}

bool KartObjectProxy::isBike() const {
return param()->isBike();
}
Expand Down
2 changes: 2 additions & 0 deletions source/game/kart/KartObjectProxy.hh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public:

const EGG::Vector3f &pos() const;
const EGG::Quatf &fullRot() const;
const EGG::Vector3f &extVel() const;
const EGG::Vector3f &intVel() const;
bool isBike() const;
u16 suspCount() const;
u16 tireCount() const;
Expand Down
10 changes: 10 additions & 0 deletions source/test/Test.hh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

namespace Test {

enum Changelog {
INITIAL = 1,
ADDED_EXT_VEL = 2,
ADDED_INT_VEL = 3,
};

struct TestHeader {
u32 signature;
u16 byteOrderMark;
Expand All @@ -16,6 +22,10 @@ struct TestHeader {
struct TestData {
EGG::Vector3f pos;
EGG::Quatf fullRot;
// Added in maj0 min2
EGG::Vector3f extVel;
// Added in maj0 min3
EGG::Vector3f intVel;
};

} // namespace Test
28 changes: 28 additions & 0 deletions source/test/TestDirector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,22 @@ bool TestDirector::test(const TestData &data) {
return false;
}

if (m_versionMinor >= ADDED_EXT_VEL) {
const auto &extVel = object->extVel();
if (data.extVel != extVel) {
logVectorDesync(data.extVel, extVel, "extVel");
return false;
}
}

if (m_versionMinor >= ADDED_INT_VEL) {
const auto &intVel = object->intVel();
if (data.intVel != intVel) {
logVectorDesync(data.intVel, intVel, "intVel");
return false;
}
}

return true;
}

Expand All @@ -159,12 +175,24 @@ void TestDirector::writeTestOutput() const {
TestData TestDirector::findNextEntry() {
EGG::Vector3f pos;
EGG::Quatf fullRot;
EGG::Vector3f extVel;
EGG::Vector3f intVel;
pos.read(m_stream);
fullRot.read(m_stream);

if (m_versionMinor >= ADDED_EXT_VEL) {
extVel.read(m_stream);
}

if (m_versionMinor >= ADDED_INT_VEL) {
intVel.read(m_stream);
}

TestData data;
data.pos = pos;
data.fullRot = fullRot;
data.extVel = extVel;
data.intVel = intVel;
return data;
}

Expand Down

0 comments on commit 99aab5a

Please sign in to comment.