mirror of
https://github.com/red031000/nitrogfx.git
synced 2025-06-18 21:25:38 -04:00
undo changes to animationElement/animationType fields
This commit is contained in:
parent
4433b68feb
commit
4d1609732b
16
gfx.c
16
gfx.c
@ -1327,8 +1327,8 @@ void ReadNtrAnimation(char *path, struct JsonToAnimationOptions *options)
|
||||
{
|
||||
options->sequenceData[i]->frameCount = data[offset] | (data[offset + 1] << 8);
|
||||
options->sequenceData[i]->loopStartFrame = data[offset + 2] | (data[offset + 3] << 8);
|
||||
options->sequenceData[i]->animationType = data[offset + 4] | (data[offset + 5] << 8);
|
||||
options->sequenceData[i]->animationType2 = data[offset + 6] | (data[offset + 7] << 8);
|
||||
options->sequenceData[i]->animationElement = data[offset + 4] | (data[offset + 5] << 8);
|
||||
options->sequenceData[i]->animationType = data[offset + 6] | (data[offset + 7] << 8);
|
||||
options->sequenceData[i]->playbackMode = data[offset + 8] | (data[offset + 9] << 8) | (data[offset + 10] << 16) | (data[offset + 11] << 24);
|
||||
frameOffsets[i] = data[offset + 12] | (data[offset + 13] << 8) | (data[offset + 14] << 16) | (data[offset + 15] << 24);
|
||||
|
||||
@ -1402,12 +1402,12 @@ void ReadNtrAnimation(char *path, struct JsonToAnimationOptions *options)
|
||||
options->animationResults[i] = malloc(sizeof(struct AnimationResults));
|
||||
}
|
||||
|
||||
// store the animationType of the corresponding sequence as this result's resultType
|
||||
// store the animationElement of the corresponding sequence as this result's resultType
|
||||
for (int i = 0; i < options->sequenceCount; i++)
|
||||
{
|
||||
for (int j = 0; j < options->sequenceData[i]->frameCount; j++)
|
||||
{
|
||||
options->animationResults[options->sequenceData[i]->frameData[j]->resultId]->resultType = options->sequenceData[i]->animationType;
|
||||
options->animationResults[options->sequenceData[i]->frameData[j]->resultId]->resultType = options->sequenceData[i]->animationElement;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1612,10 +1612,10 @@ void WriteNtrAnimation(char *path, struct JsonToAnimationOptions *options)
|
||||
KBNAContents[i + 1] = options->sequenceData[i / 0x10]->frameCount >> 8;
|
||||
KBNAContents[i + 2] = options->sequenceData[i / 0x10]->loopStartFrame & 0xff;
|
||||
KBNAContents[i + 3] = options->sequenceData[i / 0x10]->loopStartFrame >> 8;
|
||||
KBNAContents[i + 4] = options->sequenceData[i / 0x10]->animationType & 0xff;
|
||||
KBNAContents[i + 5] = (options->sequenceData[i / 0x10]->animationType >> 8) & 0xff;
|
||||
KBNAContents[i + 6] = options->sequenceData[i / 0x10]->animationType2 & 0xff;
|
||||
KBNAContents[i + 7] = (options->sequenceData[i / 0x10]->animationType2 >> 8) & 0xff;
|
||||
KBNAContents[i + 4] = options->sequenceData[i / 0x10]->animationElement & 0xff;
|
||||
KBNAContents[i + 5] = (options->sequenceData[i / 0x10]->animationElement >> 8) & 0xff;
|
||||
KBNAContents[i + 6] = options->sequenceData[i / 0x10]->animationType & 0xff;
|
||||
KBNAContents[i + 7] = (options->sequenceData[i / 0x10]->animationType >> 8) & 0xff;
|
||||
KBNAContents[i + 8] = options->sequenceData[i / 0x10]->playbackMode & 0xff;
|
||||
KBNAContents[i + 9] = (options->sequenceData[i / 0x10]->playbackMode >> 8) & 0xff;
|
||||
KBNAContents[i + 10] = (options->sequenceData[i / 0x10]->playbackMode >> 16) & 0xff;
|
||||
|
6
json.c
6
json.c
@ -376,14 +376,14 @@ struct JsonToAnimationOptions *ParseNANRJson(char *path)
|
||||
|
||||
cJSON *frameCount = cJSON_GetObjectItemCaseSensitive(sequence, "frameCount");
|
||||
cJSON *loopStartFrame = cJSON_GetObjectItemCaseSensitive(sequence, "loopStartFrame");
|
||||
cJSON *animationElement = cJSON_GetObjectItemCaseSensitive(sequence, "animationElement");
|
||||
cJSON *animationType = cJSON_GetObjectItemCaseSensitive(sequence, "animationType");
|
||||
cJSON *animationType2 = cJSON_GetObjectItemCaseSensitive(sequence, "animationType2");
|
||||
cJSON *playbackMode = cJSON_GetObjectItemCaseSensitive(sequence, "playbackMode");
|
||||
|
||||
options->sequenceData[i]->frameCount = GetInt(frameCount);
|
||||
options->sequenceData[i]->loopStartFrame = GetInt(loopStartFrame);
|
||||
options->sequenceData[i]->animationElement = GetInt(animationElement);
|
||||
options->sequenceData[i]->animationType = GetInt(animationType);
|
||||
options->sequenceData[i]->animationType2 = GetInt(animationType2);
|
||||
options->sequenceData[i]->playbackMode = GetInt(playbackMode);
|
||||
|
||||
options->sequenceData[i]->frameData = malloc(sizeof(struct FrameData *) * options->sequenceData[i]->frameCount);
|
||||
@ -521,8 +521,8 @@ char *GetNANRJson(struct JsonToAnimationOptions *options)
|
||||
cJSON *sequence = cJSON_CreateObject();
|
||||
cJSON_AddNumberToObject(sequence, "frameCount", options->sequenceData[i]->frameCount);
|
||||
cJSON_AddNumberToObject(sequence, "loopStartFrame", options->sequenceData[i]->loopStartFrame);
|
||||
cJSON_AddNumberToObject(sequence, "animationElement", options->sequenceData[i]->animationElement);
|
||||
cJSON_AddNumberToObject(sequence, "animationType", options->sequenceData[i]->animationType);
|
||||
cJSON_AddNumberToObject(sequence, "animationType2", options->sequenceData[i]->animationType2);
|
||||
cJSON_AddNumberToObject(sequence, "playbackMode", options->sequenceData[i]->playbackMode);
|
||||
|
||||
cJSON *frameData = cJSON_AddArrayToObject(sequence, "frameData");
|
||||
|
Loading…
Reference in New Issue
Block a user