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 -15
View File
@@ -19,9 +19,14 @@ static void test_cutsceneMapAreaAddCreatesAreaAndStoresLastCreated(
) {
resetMapAreas();
cutsceneitem_t item = CUTSCENE_MAP_AREA_ADD(
0, 0, 0, 5, 5, 0, mapAreaNoopCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
);
cutsceneitem_t item = {
.type = CUTSCENE_ITEM_TYPE_MAP_AREA_ADD,
.mapAreaAdd = {
.min = { 0, 0, 0 }, .max = { 5, 5, 0 },
.callback = mapAreaNoopCallback,
.notify = MAP_AREA_NOTIFY_ALL, .trigger = MAP_TRIGGER_ALL
}
};
cutsceneitemdata_t data;
cutsceneMapAreaAddStart(&item, &data);
@@ -40,7 +45,10 @@ static void test_cutsceneMapAreaRemoveClearsSlot(void **state) {
mapAreaNoopCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
);
cutsceneitem_t item = CUTSCENE_MAP_AREA_REMOVE(id);
cutsceneitem_t item = {
.type = CUTSCENE_ITEM_TYPE_MAP_AREA_REMOVE,
.mapAreaRemove = { .areaId = id }
};
cutsceneitemdata_t data;
cutsceneMapAreaRemoveStart(&item, &data);
@@ -53,15 +61,22 @@ static void test_cutsceneMapAreaRemoveResolvesLastCreatedSentinel(
) {
resetMapAreas();
cutsceneitem_t addItem = CUTSCENE_MAP_AREA_ADD(
0, 0, 0, 5, 5, 0, mapAreaNoopCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
);
cutsceneitem_t addItem = {
.type = CUTSCENE_ITEM_TYPE_MAP_AREA_ADD,
.mapAreaAdd = {
.min = { 0, 0, 0 }, .max = { 5, 5, 0 },
.callback = mapAreaNoopCallback,
.notify = MAP_AREA_NOTIFY_ALL, .trigger = MAP_TRIGGER_ALL
}
};
cutsceneitemdata_t data;
cutsceneMapAreaAddStart(&addItem, &data);
uint8_t id = CUTSCENE_SYSTEM.areaLastCreated;
cutsceneitem_t removeItem =
CUTSCENE_MAP_AREA_REMOVE(CUTSCENE_AREA_LAST_CREATED);
cutsceneitem_t removeItem = {
.type = CUTSCENE_ITEM_TYPE_MAP_AREA_REMOVE,
.mapAreaRemove = { .areaId = CUTSCENE_AREA_LAST_CREATED }
};
cutsceneMapAreaRemoveStart(&removeItem, &data);
assert_null(MAP_AREAS[id].callback);
}
@@ -76,7 +91,10 @@ static void test_cutsceneMapAreaWaitCompletesWhenTriggerCountChanges(
mapAreaNoopCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
);
cutsceneitem_t item = CUTSCENE_MAP_AREA_WAIT(id);
cutsceneitem_t item = {
.type = CUTSCENE_ITEM_TYPE_MAP_AREA_WAIT,
.mapAreaWait = { .areaIds = { id }, .count = 1 }
};
cutsceneitemdata_t data;
cutsceneMapAreaWaitStart(&item, &data);
@@ -100,7 +118,10 @@ static void test_cutsceneMapAreaWaitCompletesWhenAnyWatchedAreaChanges(
mapAreaNoopCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
);
cutsceneitem_t item = CUTSCENE_MAP_AREA_WAIT(idA, idB);
cutsceneitem_t item = {
.type = CUTSCENE_ITEM_TYPE_MAP_AREA_WAIT,
.mapAreaWait = { .areaIds = { idA, idB }, .count = 2 }
};
cutsceneitemdata_t data;
cutsceneMapAreaWaitStart(&item, &data);
@@ -115,14 +136,22 @@ static void test_cutsceneMapAreaWaitResolvesLastCreatedSentinel(
) {
resetMapAreas();
cutsceneitem_t addItem = CUTSCENE_MAP_AREA_ADD(
0, 0, 0, 5, 5, 0, mapAreaNoopCallback, MAP_AREA_NOTIFY_ALL, MAP_TRIGGER_ALL
);
cutsceneitem_t addItem = {
.type = CUTSCENE_ITEM_TYPE_MAP_AREA_ADD,
.mapAreaAdd = {
.min = { 0, 0, 0 }, .max = { 5, 5, 0 },
.callback = mapAreaNoopCallback,
.notify = MAP_AREA_NOTIFY_ALL, .trigger = MAP_TRIGGER_ALL
}
};
cutsceneitemdata_t data;
cutsceneMapAreaAddStart(&addItem, &data);
uint8_t id = CUTSCENE_SYSTEM.areaLastCreated;
cutsceneitem_t waitItem = CUTSCENE_MAP_AREA_WAIT(CUTSCENE_AREA_LAST_CREATED);
cutsceneitem_t waitItem = {
.type = CUTSCENE_ITEM_TYPE_MAP_AREA_WAIT,
.mapAreaWait = { .areaIds = { CUTSCENE_AREA_LAST_CREATED }, .count = 1 }
};
cutsceneMapAreaWaitStart(&waitItem, &data);
assert_false(cutsceneMapAreaWaitUpdate(&waitItem, &data));