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:
@@ -21,7 +21,7 @@ static void recordCallback(void *userData) {
|
||||
// replaces CUTSCENE_SYSTEM.scene outright, and the callback item's effect
|
||||
// fires in Start, not Update, so it fires the same frame the jump happens.
|
||||
static const cutsceneitem_t CUTSCENE_TEST_INNER_ITEMS[] = {
|
||||
CUTSCENE_CALLBACK(recordCallback)
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordCallback }
|
||||
};
|
||||
static const cutscene_t CUTSCENE_TEST_INNER = {
|
||||
.items = CUTSCENE_TEST_INNER_ITEMS,
|
||||
@@ -30,7 +30,7 @@ static const cutscene_t CUTSCENE_TEST_INNER = {
|
||||
};
|
||||
|
||||
static const cutsceneitem_t CUTSCENE_TEST_OUTER_ITEMS[] = {
|
||||
CUTSCENE_WAIT(0.5f),
|
||||
{ .type = CUTSCENE_ITEM_TYPE_WAIT, .wait = 0.5f },
|
||||
{
|
||||
.type = CUTSCENE_ITEM_TYPE_CUTSCENE,
|
||||
.cutsceneRef = { .cutscene = &CUTSCENE_TEST_INNER, .name = NULL }
|
||||
@@ -89,7 +89,7 @@ static void test_cutsceneSystemUpdateIsNoopWithNoActiveCutscene(void **state) {
|
||||
}
|
||||
|
||||
static const cutsceneitem_t CUTSCENE_TEST_SINGLE_WAIT_ITEMS[] = {
|
||||
CUTSCENE_WAIT(1.0f)
|
||||
{ .type = CUTSCENE_ITEM_TYPE_WAIT, .wait = 1.0f }
|
||||
};
|
||||
static const cutscene_t CUTSCENE_TEST_SINGLE_WAIT = {
|
||||
.items = CUTSCENE_TEST_SINGLE_WAIT_ITEMS,
|
||||
@@ -207,9 +207,9 @@ static void recordOrderA(void *userData) { insertOrderLog[insertOrderLogCount++]
|
||||
static void recordOrderB(void *userData) { insertOrderLog[insertOrderLogCount++] = 4; }
|
||||
|
||||
static const cutsceneitem_t CUTSCENE_TEST_INSERT_SNIPPET_ITEMS[] = {
|
||||
CUTSCENE_CALLBACK(recordOrderA),
|
||||
CUTSCENE_WAIT(2.0f),
|
||||
CUTSCENE_CALLBACK(recordOrderB)
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordOrderA },
|
||||
{ .type = CUTSCENE_ITEM_TYPE_WAIT, .wait = 2.0f },
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordOrderB }
|
||||
};
|
||||
static const cutscene_t CUTSCENE_TEST_INSERT_SNIPPET = {
|
||||
.items = CUTSCENE_TEST_INSERT_SNIPPET_ITEMS,
|
||||
@@ -219,14 +219,14 @@ static const cutscene_t CUTSCENE_TEST_INSERT_SNIPPET = {
|
||||
};
|
||||
|
||||
static const cutsceneitem_t CUTSCENE_TEST_INSERT_OUTER_ITEMS[] = {
|
||||
CUTSCENE_CALLBACK(recordOrder0),
|
||||
CUTSCENE_WAIT(1.0f),
|
||||
CUTSCENE_CALLBACK(recordOrder1),
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordOrder0 },
|
||||
{ .type = CUTSCENE_ITEM_TYPE_WAIT, .wait = 1.0f },
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordOrder1 },
|
||||
{
|
||||
.type = CUTSCENE_ITEM_TYPE_INSERT,
|
||||
.insert = { .cutscene = &CUTSCENE_TEST_INSERT_SNIPPET, .name = NULL }
|
||||
},
|
||||
CUTSCENE_CALLBACK(recordOrder2)
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordOrder2 }
|
||||
};
|
||||
static const cutscene_t CUTSCENE_TEST_INSERT_OUTER = {
|
||||
.items = CUTSCENE_TEST_INSERT_OUTER_ITEMS,
|
||||
@@ -264,7 +264,7 @@ static void test_cutsceneInsertSplicesItemsInPlaceThenResumes(void **state) {
|
||||
}
|
||||
|
||||
static const cutsceneitem_t CUTSCENE_TEST_INSERT_AS_LAST_ITEM_SNIPPET_ITEMS[] = {
|
||||
CUTSCENE_CALLBACK(recordOrderA)
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordOrderA }
|
||||
};
|
||||
static const cutscene_t CUTSCENE_TEST_INSERT_AS_LAST_ITEM_SNIPPET = {
|
||||
.items = CUTSCENE_TEST_INSERT_AS_LAST_ITEM_SNIPPET_ITEMS,
|
||||
@@ -274,7 +274,7 @@ static const cutscene_t CUTSCENE_TEST_INSERT_AS_LAST_ITEM_SNIPPET = {
|
||||
};
|
||||
|
||||
static const cutsceneitem_t CUTSCENE_TEST_INSERT_AS_LAST_ITEM_OUTER_ITEMS[] = {
|
||||
CUTSCENE_CALLBACK(recordOrder0),
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordOrder0 },
|
||||
{
|
||||
.type = CUTSCENE_ITEM_TYPE_INSERT,
|
||||
.insert = {
|
||||
@@ -314,7 +314,7 @@ static void test_cutsceneInsertAsLastItemEndsCutsceneNaturally(
|
||||
}
|
||||
|
||||
static const cutsceneitem_t CUTSCENE_TEST_INSERT_NESTED_INNER_ITEMS[] = {
|
||||
CUTSCENE_CALLBACK(recordOrderA)
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordOrderA }
|
||||
};
|
||||
static const cutscene_t CUTSCENE_TEST_INSERT_NESTED_INNER = {
|
||||
.items = CUTSCENE_TEST_INSERT_NESTED_INNER_ITEMS,
|
||||
@@ -331,7 +331,7 @@ static const cutsceneitem_t CUTSCENE_TEST_INSERT_NESTED_MID_ITEMS[] = {
|
||||
.type = CUTSCENE_ITEM_TYPE_INSERT,
|
||||
.insert = { .cutscene = &CUTSCENE_TEST_INSERT_NESTED_INNER, .name = NULL }
|
||||
},
|
||||
CUTSCENE_CALLBACK(recordOrderB)
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordOrderB }
|
||||
};
|
||||
static const cutscene_t CUTSCENE_TEST_INSERT_NESTED_MID = {
|
||||
.items = CUTSCENE_TEST_INSERT_NESTED_MID_ITEMS,
|
||||
@@ -341,12 +341,12 @@ static const cutscene_t CUTSCENE_TEST_INSERT_NESTED_MID = {
|
||||
};
|
||||
|
||||
static const cutsceneitem_t CUTSCENE_TEST_INSERT_NESTED_OUTER_ITEMS[] = {
|
||||
CUTSCENE_CALLBACK(recordOrder0),
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordOrder0 },
|
||||
{
|
||||
.type = CUTSCENE_ITEM_TYPE_INSERT,
|
||||
.insert = { .cutscene = &CUTSCENE_TEST_INSERT_NESTED_MID, .name = NULL }
|
||||
},
|
||||
CUTSCENE_CALLBACK(recordOrder2)
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordOrder2 }
|
||||
};
|
||||
static const cutscene_t CUTSCENE_TEST_INSERT_NESTED_OUTER = {
|
||||
.items = CUTSCENE_TEST_INSERT_NESTED_OUTER_ITEMS,
|
||||
@@ -381,7 +381,7 @@ static void test_cutsceneInsertNestsThroughMultipleLevels(void **state) {
|
||||
}
|
||||
|
||||
static const cutsceneitem_t CUTSCENE_TEST_INSERT_OVERFLOW_LEVEL5_ITEMS[] = {
|
||||
CUTSCENE_CALLBACK(recordOrderA)
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = recordOrderA }
|
||||
};
|
||||
static const cutscene_t CUTSCENE_TEST_INSERT_OVERFLOW_LEVEL5 = {
|
||||
.items = CUTSCENE_TEST_INSERT_OVERFLOW_LEVEL5_ITEMS,
|
||||
@@ -467,7 +467,7 @@ static void test_cutsceneInsertAssertsWhenNestingExceedsStackMax(
|
||||
static void noopInsertCallback(void *userData) {}
|
||||
|
||||
static const cutsceneitem_t CUTSCENE_TEST_INSERT_PERSIST_SNIPPET_ITEMS[] = {
|
||||
CUTSCENE_CALLBACK(noopInsertCallback)
|
||||
{ .type = CUTSCENE_ITEM_TYPE_CALLBACK, .callback = noopInsertCallback }
|
||||
};
|
||||
static const cutscene_t CUTSCENE_TEST_INSERT_PERSIST_SNIPPET = {
|
||||
.items = CUTSCENE_TEST_INSERT_PERSIST_SNIPPET_ITEMS,
|
||||
|
||||
Reference in New Issue
Block a user