cutsceneitemtype_t moves from cutsceneitem.h into cutsceneitembase.h, alongside a new CUTSCENE_ITEM(TYPE, UNION_NAME, ...) shorthand that fills in a cutsceneitem_t literal's .type and union member together. Every CUTSCENE_* authoring macro (CUTSCENE_WAIT, CUTSCENE_TEXT, CUTSCENE_AUDIO_PLAY, etc.) moves out of the single, ever-growing cutscene.h into the header of the item type it actually authors, built on top of CUTSCENE_ITEM. cutscene.h now only holds cutscene_t itself plus the CUTSCENE/CUTSCENE_REFERENCE/CUTSCENE_CUTSCENE macros, which aren't tied to any one item type. Every relocated macro also gained a proper JSDoc-style comment block with @param tags. Co-Authored-By: Claude Sonnet 5 <[email protected]>
63 lines
1.5 KiB
C
63 lines
1.5 KiB
C
/**
|
|
* Copyright (c) 2026 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#pragma once
|
|
#include "rpg/cutscene/item/cutsceneitembase.h"
|
|
|
|
typedef struct {
|
|
uint8_t index;
|
|
} cutscenetextminihide_t;
|
|
|
|
/**
|
|
* Closes a mini textbox immediately.
|
|
*
|
|
* @param INDEX Mini textbox index to close.
|
|
*/
|
|
#define CUTSCENE_TEXT_MINI_HIDE(INDEX) \
|
|
CUTSCENE_ITEM(CUTSCENE_ITEM_TYPE_TEXT_MINI_HIDE, textMiniHide, { \
|
|
.index = INDEX \
|
|
})
|
|
|
|
/**
|
|
* Starts a mini text hide step (closes the mini textbox immediately).
|
|
*
|
|
* @param item The cutscene item.
|
|
* @param data Runtime data storage.
|
|
*/
|
|
void cutsceneTextMiniHideStart(
|
|
const cutsceneitem_t *item,
|
|
cutsceneitemdata_t *data
|
|
);
|
|
|
|
/**
|
|
* Updates a mini text hide step (always completes immediately).
|
|
*
|
|
* @param item The cutscene item.
|
|
* @param data Runtime data storage.
|
|
* @returns true always.
|
|
*/
|
|
bool_t cutsceneTextMiniHideUpdate(
|
|
const cutsceneitem_t *item,
|
|
cutsceneitemdata_t *data
|
|
);
|
|
|
|
/**
|
|
* Parses a TEXT_MINI_HIDE 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 (TEXT_MINI_HIDE needs no pool storage).
|
|
* @param poolOffset Unused (TEXT_MINI_HIDE needs no pool storage).
|
|
* @return Error code indicating success or failure of the parse.
|
|
*/
|
|
errorret_t cutsceneTextMiniHideLoad(
|
|
yyjson_val *itemObj,
|
|
cutsceneitem_t *item,
|
|
uint8_t *pool,
|
|
size_t *poolOffset
|
|
);
|