Remove per-item cutscene authoring macros

Every CUTSCENE_XXX(...) shorthand (CUTSCENE_WAIT, CUTSCENE_TEXT,
CUTSCENE_ENTITY_WALK_TO, etc.) existed to build a cutsceneitem_t literal
in C; real cutscenes are now authored exclusively as .jsonc files, and
the only other users were test fixtures. Deletes all ~55 of these
macros (and the shared CUTSCENE_ITEM(...) helper they built on) along
with their doc comments, leaving each item's struct/enum/Start/Update/
Load declarations untouched.

test_battle.c, test_cutscenecontrol.c, test_cutscenemaparea.c,
test_cutscenesystem.c and test_entityinteract.c now build their
cutsceneitem_t fixtures as plain struct literals instead.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
2026-09-14 11:20:58 -05:00
co-authored by Claude Sonnet 5
parent 1646e964b5
commit 68cebce04a
48 changed files with 117 additions and 812 deletions
+44 -14
View File
@@ -12,7 +12,7 @@
static void test_cutsceneWaitCompletesAfterItsDuration(void **state) {
cutsceneitem_t item = CUTSCENE_WAIT(1.0f);
cutsceneitem_t item = { .type = CUTSCENE_ITEM_TYPE_WAIT, .wait = 1.0f };
cutsceneitemdata_t data;
memoryZero(&data, sizeof(data));
@@ -38,7 +38,8 @@ static void test_cutsceneCallbackFiresOnStartWithUserData(void **state) {
callbackCallCount = 0;
lastUserData = NULL;
cutsceneitem_t item = CUTSCENE_CALLBACK(recordCallback);
cutsceneitem_t item =
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordCallback };
cutsceneitemdata_t data;
cutsceneCallbackStart(&item, &data);
@@ -65,8 +66,10 @@ static void test_cutsceneCallbackNullIsNoop(void **state) {
static void test_cutsceneSetPauseAppliesImmediately(void **state) {
CUTSCENE_SYSTEM.pause = CUTSCENE_PAUSE_NONE;
cutsceneitem_t item =
CUTSCENE_SET_PAUSE(CUTSCENE_PAUSE_NPC | CUTSCENE_PAUSE_BATTLE);
cutsceneitem_t item = {
.type = CUTSCENE_ITEM_TYPE_SET_PAUSE,
.setPause = CUTSCENE_PAUSE_NPC | CUTSCENE_PAUSE_BATTLE
};
cutsceneitemdata_t data;
cutsceneSetPauseStart(&item, &data);
@@ -78,10 +81,16 @@ static void test_cutsceneSetPauseAppliesImmediately(void **state) {
static void test_cutsceneConcurrentCompletesOnceAllChildrenDo(void **state) {
cutsceneitem_t item = CUTSCENE_CONCURRENT(
CUTSCENE_WAIT(0.2f),
CUTSCENE_WAIT(0.5f)
);
cutsceneitem_t item = {
.type = CUTSCENE_ITEM_TYPE_CONCURRENT,
.concurrent = {
.items = (const cutsceneitem_t[]){
{ .type = CUTSCENE_ITEM_TYPE_WAIT, .wait = 0.2f },
{ .type = CUTSCENE_ITEM_TYPE_WAIT, .wait = 0.5f }
},
.count = 2
}
};
cutsceneitemdata_t data;
memoryZero(&data, sizeof(data));
@@ -100,10 +109,16 @@ static void test_cutsceneConcurrentDoesNotReUpdateFinishedChildren(
void **state
) {
cutsceneitem_t item = CUTSCENE_CONCURRENT(
CUTSCENE_WAIT(0.1f),
CUTSCENE_WAIT(10.0f)
);
cutsceneitem_t item = {
.type = CUTSCENE_ITEM_TYPE_CONCURRENT,
.concurrent = {
.items = (const cutsceneitem_t[]){
{ .type = CUTSCENE_ITEM_TYPE_WAIT, .wait = 0.1f },
{ .type = CUTSCENE_ITEM_TYPE_WAIT, .wait = 10.0f }
},
.count = 2
}
};
cutsceneitemdata_t data;
memoryZero(&data, sizeof(data));
@@ -121,8 +136,23 @@ static void test_cutsceneConcurrentDoesNotReUpdateFinishedChildren(
static void test_cutsceneConcurrentCannotNest(void **state) {
cutsceneitem_t outer =
CUTSCENE_CONCURRENT(CUTSCENE_CONCURRENT(CUTSCENE_WAIT(1.0f)));
cutsceneitem_t outer = {
.type = CUTSCENE_ITEM_TYPE_CONCURRENT,
.concurrent = {
.items = (const cutsceneitem_t[]){
{
.type = CUTSCENE_ITEM_TYPE_CONCURRENT,
.concurrent = {
.items = (const cutsceneitem_t[]){
{ .type = CUTSCENE_ITEM_TYPE_WAIT, .wait = 1.0f }
},
.count = 1
}
}
},
.count = 1
}
};
cutsceneitemdata_t data;
expect_assert_failure(cutsceneConcurrentStart(&outer, &data));