Working on some visual novel elements

This commit is contained in:
2021-07-22 10:24:34 -07:00
parent eb9d512233
commit f738f9b83d
15 changed files with 288 additions and 112 deletions

View File

@ -58,6 +58,6 @@
#include "util/rand.h"
// Visual Novel Objects
#include "vn/conversation.h"
#include "vn/gui/vntextbox.h"
#include "vn/vncharacter.h"
#include "vn/vnconversation.h"
#include "vn/vntextbox.h"

View File

@ -1,22 +0,0 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../libs.h"
#define CONVERSATION_TEXT_COUNT_MAX 32
typedef struct {
char *text;
uint8_t speaker;
} conversationtext_t;
typedef struct {
conversationtext_t texts[CONVERSATION_TEXT_COUNT_MAX];
uint8_t textCount;
uint8_t textCurrent;
} conversation_t;

View File

@ -0,0 +1,31 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../libs.h"
#include "../display/texture.h"
#include "../display/primitive.h"
#include "../display/tileset.h"
#define VNCHARACTER_EMOTION_NEUTRAL 0x00
typedef struct {
float x, y, z;
float yaw, pitch, roll;
uint8_t emotion;
bool talking;
float t;
texture_t *textureEyes;
texture_t *textureBody;
texture_t *textureMouth;
texture_t *textureFace;
primitive_t primitive;
} vncharacter_t;

View File

@ -0,0 +1,37 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../libs.h"
#include "vntextbox.h"
#define VN_CONVERSATION_TEXT_COUNT_MAX 32
#define VN_CONVERSATION_TYPE_DELAY 0x01
#define VN_CONVERSATION_TYPE_TEXT 0x02
typedef struct {
/** Conversation Type to decide what this data is used for */
uint8_t type;
/** Pointer to the string for text to display */
char *text;
/** Time in seconds to delay if type is delay */
float delay;
} vnconversationtext_t;
typedef struct {
vntextbox_t textbox;
vnconversationtext_t texts[VN_CONVERSATION_TEXT_COUNT_MAX];
float timeline;
float delayStart;
uint8_t textCount;
uint8_t textCurrent;
} vnconversation_t;

View File

@ -6,14 +6,14 @@
*/
#pragma once
#include "../../libs.h"
#include "../../display/animation/timeline.h"
#include "../../display/gui/font.h"
#include "../libs.h"
#include "../display/animation/timeline.h"
#include "../display/gui/font.h"
/** Amount of characters scrolled, per second */
#define VN_TEXTBOX_SCROLL_SPEED 60
#define VN_BOX_STATE_CLOSED 0x01
#define VN_TEXTBOX_STATE_CLOSED 0x01
typedef struct {
/** Stores the maximum width that this textbox can take up */
@ -34,8 +34,6 @@ typedef struct {
/** Animation of the textbox */
float textScroll;
// timeline_t animTimeline;
// timelineaction_t animActions;
/** Information about the current rendered text */
fonttextinfo_t textInfo;