TWINE: Model helper functions

This commit is contained in:
Martin Gerhardy 2020-12-13 22:25:50 +01:00
parent c95ae66847
commit b6841dbc25

View File

@ -145,8 +145,8 @@ struct Model {
return getBonesData(bodyPtr) + 2;
}
static const uint8* getBonesBaseData(const uint8 *bodyPtr) {
return getBonesData(bodyPtr) + 2;
static const uint8* getBonesBaseData(const uint8 *bodyPtr, int boneIdx = 0) {
return getBonesData(bodyPtr) + 2 + (boneIdx * 38);
}
static int16 getNumBones(const uint8 *bodyPtr) {
@ -179,6 +179,10 @@ struct Model {
return getShadesData(bodyPtr) + 2 + (shadeIdx * 8);
}
static const BodyShade* getShadesBaseData(const BodyData &bodyPtr, int16 shadeIdx = 0) {
return bodyPtr.getShade(shadeIdx);
}
static const uint8* getShadesData(const uint8 *bodyPtr) {
const uint8 *bonesBase = getBonesBaseData(bodyPtr);
const int16 numBones = getNumBones(bodyPtr);