Move cutscene item JSON parsing into per-item Load callbacks
Each cutscene item type now owns its own JSON parsing (a Load callback alongside its existing runtime callbacks), instead of one monolithic switch in assetcutsceneloader.c. Shared JSON field/enum decoding helpers move into a new rpg/cutscene/item/json/ module so per-type parsers stay small and colocated with the behavior they configure. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
@@ -7,9 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
#include "audio/mixer/audiomixerchannel.h"
|
||||
|
||||
typedef struct cutsceneitem_s cutsceneitem_t;
|
||||
typedef union cutsceneitemdata_u cutsceneitemdata_t;
|
||||
#include "rpg/cutscene/item/cutsceneitembase.h"
|
||||
|
||||
/**
|
||||
* Starts an audio resume step (resumes the channel immediately).
|
||||
@@ -33,3 +31,19 @@ bool_t cutsceneAudioResumeUpdate(
|
||||
const cutsceneitem_t *item,
|
||||
cutsceneitemdata_t *data
|
||||
);
|
||||
|
||||
/**
|
||||
* Parses an AUDIO_RESUME cutscene item's JSON fields into item.
|
||||
*
|
||||
* @param itemObj The item's JSON object.
|
||||
* @param item Destination item, already zeroed by the caller.
|
||||
* @param pool Unused (AUDIO_RESUME needs no pool storage).
|
||||
* @param poolOffset Unused (AUDIO_RESUME needs no pool storage).
|
||||
* @return Error code indicating success or failure of the parse.
|
||||
*/
|
||||
errorret_t cutsceneAudioResumeLoad(
|
||||
yyjson_val *itemObj,
|
||||
cutsceneitem_t *item,
|
||||
uint8_t *pool,
|
||||
size_t *poolOffset
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user