taisei/src/dialog.h

58 lines
1.1 KiB
C
Raw Normal View History

/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
2018-01-04 18:14:31 +01:00
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
*/
2017-09-27 14:14:53 +02:00
#pragma once
#include "taisei.h"
#include "resource/sprite.h"
struct DialogMessage;
struct DialogSpeaker;
typedef enum {
Right,
2017-01-24 14:40:57 +01:00
Left,
BGM
} Side;
typedef struct DialogMessage {
Side side;
char *msg;
2017-11-12 18:16:15 +01:00
int timeout;
} DialogMessage;
typedef struct Dialog {
DialogMessage *messages;
Sprite *images[2];
int count;
int pos;
int page_time;
int birthtime;
} Dialog;
Dialog *create_dialog(const char *left, const char *right)
attr_returns_nonnull attr_nodiscard;
void dset_image(Dialog *d, Side side, const char *name)
attr_nonnull(1, 3);
DialogMessage* dadd_msg(Dialog *d, Side side, const char *msg)
attr_nonnull(1, 3);
void delete_dialog(Dialog *d)
attr_nonnull(1);
void draw_dialog(Dialog *dialog)
attr_nonnull(1);
bool page_dialog(Dialog **d) attr_nonnull(1);
void process_dialog(Dialog **d) attr_nonnull(1);