Remove unused CUTSCENE_SYSTEM.userData scratch buffer
Nothing ever wrote to it - it only ever passed its own address through to onComplete/CUTSCENE_CALLBACK/modal-option callbacks, so every call site now passes NULL directly and the 8KB buffer is gone. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
@@ -253,7 +253,6 @@ void cutsceneSystemNext() {
|
||||
// by this function's own cleanup running after it - same reentrancy
|
||||
// hazard as uiFocusPop, see src/dusk/ui/focus/uifocus.c.
|
||||
cutscenecallback_t onComplete = CUTSCENE_SYSTEM.onComplete;
|
||||
void *userData = CUTSCENE_SYSTEM.userData;
|
||||
|
||||
CUTSCENE_SYSTEM.scene = NULL;
|
||||
CUTSCENE_SYSTEM.currentItem = 0xFF;
|
||||
@@ -267,7 +266,7 @@ void cutsceneSystemNext() {
|
||||
CUTSCENE_SYSTEM.textCache[0] = '\0';
|
||||
CUTSCENE_SYSTEM.onComplete = NULL;
|
||||
|
||||
if(onComplete != NULL) onComplete(userData);
|
||||
if(onComplete != NULL) onComplete(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ typedef struct entity_s entity_t;
|
||||
#define CUTSCENE_AREA_LAST_CREATED ((uint8_t)0xFF)
|
||||
#define CUTSCENE_TEXT_MINI_LAST_CREATED ((uint8_t)0xFA)
|
||||
|
||||
#define CUTSCENE_SYSTEM_SIZE_MAX 8192
|
||||
#define CUTSCENE_TEXT_CACHE_MAX 64
|
||||
#define CUTSCENE_LOADED_ITEMS_MAX 128
|
||||
|
||||
@@ -48,16 +47,9 @@ typedef struct {
|
||||
// Runtime data for the current item.
|
||||
cutsceneitemdata_t data;
|
||||
|
||||
// Custom user data for the running cutscene.
|
||||
uint8_t userData[CUTSCENE_SYSTEM_SIZE_MAX];
|
||||
|
||||
// See cutsceneSystemSetOnComplete.
|
||||
cutscenecallback_t onComplete;
|
||||
|
||||
// The fixed buffer/scene pair cutsceneSystemLoad/cutsceneCutsceneResolve
|
||||
// parse a JSON-authored cutscene into - see CUTSCENE_LOADED_ITEMS_MAX
|
||||
// above. loadedScene.items always points at loadedItems; loadedScene's
|
||||
// itemCount/itemsMax/pause are overwritten on each load.
|
||||
cutsceneitem_t loadedItems[CUTSCENE_LOADED_ITEMS_MAX];
|
||||
cutscene_t loadedScene;
|
||||
} cutscenesystem_t;
|
||||
@@ -139,7 +131,7 @@ void cutsceneSystemStartCutsceneAndGoToMarker(
|
||||
* Then immediately advances into the first inserted item (see
|
||||
* cutsceneSystemNext), so the splice takes effect within this same call.
|
||||
* Deliberately does not touch pause flags, interact entities, "last
|
||||
* created" state, the text cache or userData - those all keep whatever the
|
||||
* created" state, or the text cache - those all keep whatever the
|
||||
* outer cutscene set, since this is meant to feel like pasting cutscene's
|
||||
* items in place rather than starting an independent cutscene. Because of
|
||||
* this, cutscene's own .pause is ignored. Asserts if no cutscene is
|
||||
@@ -194,7 +186,7 @@ void cutsceneRestart(void);
|
||||
* call this again after starting a new cutscene to arm it - but
|
||||
* cutsceneRestart() preserves whatever was armed, since a restart (e.g.
|
||||
* retrying a failed check) is the same logical run trying again, not a new
|
||||
* one. Invoked with CUTSCENE_SYSTEM.userData, same as CUTSCENE_CALLBACK.
|
||||
* one. Invoked with NULL, same as CUTSCENE_CALLBACK.
|
||||
*
|
||||
* Exists so a runtime-loaded cutscene file (which can't store a native
|
||||
* function pointer) can still hand off to native code once it's done,
|
||||
|
||||
@@ -12,7 +12,7 @@ void cutsceneCallbackStart(
|
||||
const cutsceneitem_t *item,
|
||||
cutsceneitemdata_t *data
|
||||
) {
|
||||
if(item->callback != NULL) item->callback(CUTSCENE_SYSTEM.userData);
|
||||
if(item->callback != NULL) item->callback(NULL);
|
||||
}
|
||||
|
||||
bool_t cutsceneCallbackUpdate(
|
||||
|
||||
@@ -28,7 +28,7 @@ void cutsceneModalStart(
|
||||
modal->optionCount,
|
||||
modal->callback,
|
||||
NULL,
|
||||
CUTSCENE_SYSTEM.userData
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
* (see uiMenuSetDisableBack), so it must be dismissed by picking one.
|
||||
*
|
||||
* @param optionIndex Index into the options array that was selected.
|
||||
* @param userData CUTSCENE_SYSTEM.userData for the running cutscene.
|
||||
* @param userData Unused - always NULL. Required by uiModalOpen's
|
||||
* callback signature.
|
||||
*/
|
||||
typedef void (*cutscenemodaloptioncallback_t)(
|
||||
const uint8_t optionIndex, void *userData
|
||||
|
||||
@@ -47,7 +47,7 @@ void cutsceneModalOptionsMarkersStart(
|
||||
options->optionCount,
|
||||
cutsceneModalOptionsMarkersCallback,
|
||||
NULL,
|
||||
CUTSCENE_SYSTEM.userData
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user