Skip to content

Commit 00791ac

Browse files
committed
utils: Buildfixes for FACT internal changes
1 parent 5024578 commit 00791ac

File tree

2 files changed

+71
-45
lines changed

2 files changed

+71
-45
lines changed

utils/facttool/facttool.cpp

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ void FAudioTool_Update()
570570
);
571571
ImGui::Text(
572572
"RPC Code Count: %d",
573-
soundBanks[i]->sounds[j].rpcCodeCount
573+
soundBanks[i]->sounds[j].rpc_codes.count
574574
);
575575
ImGui::Text(
576576
"DSP Preset Code Count: %d",
@@ -582,11 +582,11 @@ void FAudioTool_Update()
582582
);
583583
if (ImGui::TreeNode("RPC Codes"))
584584
{
585-
for (uint8_t k = 0; k < soundBanks[i]->sounds[j].rpcCodeCount; k += 1)
585+
for (uint8_t k = 0; k < soundBanks[i]->sounds[j].rpc_codes.count; k += 1)
586586
{
587587
ImGui::Text(
588588
"%d",
589-
soundBanks[i]->sounds[j].rpcCodes[k]
589+
soundBanks[i]->sounds[j].rpc_codes.codes[k]
590590
);
591591
}
592592
ImGui::TreePop();
@@ -602,7 +602,7 @@ void FAudioTool_Update()
602602
}
603603
ImGui::TreePop();
604604
}
605-
if (ImGui::TreeNode("Tracks"))
605+
if (ImGui::TreeNode("Waves"))
606606
{
607607
for (uint8_t k = 0; k < soundBanks[i]->sounds[j].trackCount; k += 1)
608608
if (ImGui::TreeNode(
@@ -628,19 +628,19 @@ void FAudioTool_Update()
628628
);
629629
ImGui::Text(
630630
"RPC Code Count: %d",
631-
soundBanks[i]->sounds[j].tracks[k].rpcCodeCount
631+
soundBanks[i]->sounds[j].tracks[k].rpc_codes.count
632632
);
633633
ImGui::Text(
634634
"Event Count: %d",
635635
soundBanks[i]->sounds[j].tracks[k].eventCount
636636
);
637637
if (ImGui::TreeNode("RPC Codes"))
638638
{
639-
for (uint8_t l = 0; l < soundBanks[i]->sounds[j].tracks[k].rpcCodeCount; l += 1)
639+
for (uint8_t l = 0; l < soundBanks[i]->sounds[j].tracks[k].rpc_codes.count; l += 1)
640640
{
641641
ImGui::Text(
642642
"%d",
643-
soundBanks[i]->sounds[j].tracks[k].rpcCodes[l]
643+
soundBanks[i]->sounds[j].tracks[k].rpc_codes.codes[l]
644644
);
645645
}
646646
ImGui::TreePop();
@@ -697,24 +697,24 @@ void FAudioTool_Update()
697697
if (evt->wave.isComplex)
698698
{
699699
ImGui::Text(
700-
"Track Variation Type: %d",
700+
"Wave Variation Type: %d",
701701
evt->wave.complex.variation_type
702702
);
703703
ImGui::Text(
704-
"Track Count: %d",
705-
evt->wave.complex.trackCount
704+
"Wave Count: %d",
705+
evt->wave.complex.wave_count
706706
);
707-
if (ImGui::TreeNode("Tracks"))
707+
if (ImGui::TreeNode("Waves"))
708708
{
709-
for (uint16_t m = 0; m < evt->wave.complex.trackCount; m += 1)
709+
for (uint16_t m = 0; m < evt->wave.complex.wave_count; m += 1)
710710
if (ImGui::TreeNode(
711711
(void*) (intptr_t) m,
712712
"Track #%d",
713713
m
714714
)) {
715715
ImGui::Text(
716-
"Track Index: %d",
717-
evt->wave.complex.tracks[m]
716+
"Wave Index: %d",
717+
evt->wave.complex.wave_indices[m]
718718
);
719719
ImGui::Text(
720720
"WaveBank Index: %d",
@@ -732,8 +732,8 @@ void FAudioTool_Update()
732732
else
733733
{
734734
ImGui::Text(
735-
"Track Index: %d",
736-
evt->wave.simple.track
735+
"Wave Index: %d",
736+
evt->wave.simple.wave_index
737737
);
738738
ImGui::Text(
739739
"WaveBank Index: %d",
@@ -877,7 +877,7 @@ void FAudioTool_Update()
877877
if (ImGui::TreeNode(
878878
(void*) (intptr_t) j,
879879
"Code #%d",
880-
soundBanks[i]->variationCodes[j]
880+
soundBanks[i]->variations[j].code
881881
)) {
882882
ImGui::Text(
883883
"Type: %X",
@@ -919,14 +919,28 @@ void FAudioTool_Update()
919919
soundBanks[i]->variations[j].entries[k].simple.wavebank
920920
);
921921
}
922-
ImGui::Text(
923-
"Min Weight: %f",
924-
soundBanks[i]->variations[j].entries[k].minWeight
925-
);
926-
ImGui::Text(
927-
"Max Weight: %f",
928-
soundBanks[i]->variations[j].entries[k].maxWeight
929-
);
922+
if (soundBanks[i]->variations[j].type == VARIATION_TABLE_TYPE_INTERACTIVE)
923+
{
924+
ImGui::Text(
925+
"Min Range: %f",
926+
soundBanks[i]->variations[j].entries[k].interactive.var_min
927+
);
928+
ImGui::Text(
929+
"Max Range: %f",
930+
soundBanks[i]->variations[j].entries[k].interactive.var_max
931+
);
932+
}
933+
else
934+
{
935+
ImGui::Text(
936+
"Min Weight: %f",
937+
soundBanks[i]->variations[j].entries[k].noninteractive.weight_min
938+
);
939+
ImGui::Text(
940+
"Max Weight: %f",
941+
soundBanks[i]->variations[j].entries[k].noninteractive.weight_max
942+
);
943+
}
930944
ImGui::TreePop();
931945
}
932946
ImGui::TreePop();

utils/testparse/testparse.c

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ static void print_soundbank(FACTAudioEngine *engine, uint8_t *buf, size_t len)
8686
sb->sounds[i].priority
8787
);
8888
printf("\t\tRPC Codes:");
89-
for (j = 0; j < sb->sounds[i].rpcCodeCount; j += 1)
89+
for (j = 0; j < sb->sounds[i].rpc_codes.count; j += 1)
9090
{
91-
printf(" %d", sb->sounds[i].rpcCodes[j]);
91+
printf(" %d", sb->sounds[i].rpc_codes.codes[j]);
9292
}
9393
printf("\n");
9494
printf("\t\tDSP Preset Codes:");
@@ -113,11 +113,11 @@ static void print_soundbank(FACTAudioEngine *engine, uint8_t *buf, size_t len)
113113
sb->sounds[i].tracks[j].frequency
114114
);
115115
printf("\t\t\t\tRPC Codes:");
116-
for (k = 0; k < sb->sounds[i].tracks[j].rpcCodeCount; k += 1)
116+
for (k = 0; k < sb->sounds[i].tracks[j].rpc_codes.count; k += 1)
117117
{
118118
printf(
119119
" %d",
120-
sb->sounds[i].tracks[j].rpcCodes[k]
120+
sb->sounds[i].tracks[j].rpc_codes.codes[k]
121121
);
122122
}
123123
printf("\n");
@@ -163,20 +163,20 @@ static void print_soundbank(FACTAudioEngine *engine, uint8_t *buf, size_t len)
163163
if (evt->wave.isComplex)
164164
{
165165
printf(
166-
"\t\t\t\t\t\tTrack Variation Type: %d\n"
167-
"\t\t\t\t\t\tTrack Count: %d\n",
166+
"\t\t\t\t\t\tWave Variation Type: %d\n"
167+
"\t\t\t\t\t\twave Count: %d\n",
168168
evt->wave.complex.variation_type,
169-
evt->wave.complex.trackCount
169+
evt->wave.complex.wave_count
170170
);
171-
for (l = 0; l < evt->wave.complex.trackCount; l += 1)
171+
for (l = 0; l < evt->wave.complex.wave_count; l += 1)
172172
{
173173
printf(
174-
"\t\t\t\t\t\t\tTrack %d:\n"
175-
"\t\t\t\t\t\t\t\tTrack Index: %d\n"
174+
"\t\t\t\t\t\t\tWave %d:\n"
175+
"\t\t\t\t\t\t\t\tWave Index: %d\n"
176176
"\t\t\t\t\t\t\t\tWaveBank Index: %d\n"
177177
"\t\t\t\t\t\t\t\tWeight: %d\n",
178178
l,
179-
evt->wave.complex.tracks[l],
179+
evt->wave.complex.wave_indices[l],
180180
evt->wave.complex.wavebanks[l],
181181
evt->wave.complex.weights[l]
182182
);
@@ -185,9 +185,9 @@ static void print_soundbank(FACTAudioEngine *engine, uint8_t *buf, size_t len)
185185
else
186186
{
187187
printf(
188-
"\t\t\t\t\t\tTrack Index: %d\n"
188+
"\t\t\t\t\t\tWave Index: %d\n"
189189
"\t\t\t\t\t\tWaveBank Index: %d\n",
190-
evt->wave.simple.track,
190+
evt->wave.simple.wave_index,
191191
evt->wave.simple.wavebank
192192
);
193193
}
@@ -302,7 +302,7 @@ static void print_soundbank(FACTAudioEngine *engine, uint8_t *buf, size_t len)
302302
"\t\tInteractive Variable Index: %d\n"
303303
"\t\tEntry Count: %d\n",
304304
i,
305-
sb->variationCodes[i],
305+
sb->variations[i].code,
306306
sb->variations[i].type,
307307
sb->variations[i].variable,
308308
sb->variations[i].entryCount
@@ -329,12 +329,24 @@ static void print_soundbank(FACTAudioEngine *engine, uint8_t *buf, size_t len)
329329
sb->variations[i].entries[j].simple.wavebank
330330
);
331331
}
332-
printf(
333-
"\t\t\t\tMin Weight: %f\n"
334-
"\t\t\t\tMax Weight: %f\n",
335-
sb->variations[i].entries[j].minWeight,
336-
sb->variations[i].entries[j].maxWeight
337-
);
332+
if (sb->variations[i].type == VARIATION_TABLE_TYPE_INTERACTIVE)
333+
{
334+
printf(
335+
"\t\t\t\tMin Range: %f\n"
336+
"\t\t\t\tMax Range: %f\n",
337+
sb->variations[i].entries[j].interactive.var_min,
338+
sb->variations[i].entries[j].interactive.var_max
339+
);
340+
}
341+
else
342+
{
343+
printf(
344+
"\t\t\t\tMin Weight: %f\n"
345+
"\t\t\t\tMax Weight: %f\n",
346+
sb->variations[i].entries[j].noninteractive.weight_min,
347+
sb->variations[i].entries[j].noninteractive.weight_max
348+
);
349+
}
338350
}
339351
}
340352
for (i = 0; i < sb->transitionCount; i += 1)

0 commit comments

Comments
 (0)