53 lines
1.2 KiB
C
53 lines
1.2 KiB
C
/**
|
|
* Copyright (c) 2025 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#pragma once
|
|
#include "cutscenewait.h"
|
|
#include "cutscenecallback.h"
|
|
#include "cutscenetext.h"
|
|
|
|
typedef struct cutscene_s cutscene_t;
|
|
|
|
typedef enum {
|
|
CUTSCENE_ITEM_TYPE_NULL,
|
|
CUTSCENE_ITEM_TYPE_TEXT,
|
|
CUTSCENE_ITEM_TYPE_CALLBACK,
|
|
CUTSCENE_ITEM_TYPE_WAIT,
|
|
CUTSCENE_ITEM_TYPE_CUTSCENE
|
|
} cutsceneitemtype_t;
|
|
|
|
typedef struct cutsceneitem_s {
|
|
cutsceneitemtype_t type;
|
|
|
|
// Arguments/Data that will be used when this item is invoked.
|
|
union {
|
|
cutscenetext_t text;
|
|
cutscenecallback_t callback;
|
|
cutscenewait_t wait;
|
|
const cutscene_t *cutscene;
|
|
};
|
|
} cutsceneitem_t;
|
|
|
|
typedef union {
|
|
cutscenewaitdata_t wait;
|
|
} cutsceneitemdata_t;
|
|
|
|
/**
|
|
* Start the given cutscene item.
|
|
*
|
|
* @param item The cutscene item to start.
|
|
* @param data The cutscene item data storage.
|
|
*/
|
|
void cutsceneItemStart(const cutsceneitem_t *item, cutsceneitemdata_t *data);
|
|
|
|
/**
|
|
* Tick the given cutscene item (one frame).
|
|
*
|
|
* @param item The cutscene item to tick.
|
|
* @param data The cutscene item data storage.
|
|
*/
|
|
void cutsceneItemUpdate(const cutsceneitem_t *item, cutsceneitemdata_t *data); |