2023-08-22 03:19:51 +00:00
|
|
|
/* date = August 14th 2023 5:00 pm */
|
|
|
|
|
|
|
|
#ifndef VN_SCENE_VIEW_H
|
|
|
|
#define VN_SCENE_VIEW_H
|
|
|
|
|
|
|
|
struct textbox
|
|
|
|
{
|
|
|
|
string String;
|
|
|
|
s64 Capacity;
|
2023-10-29 10:00:34 +00:00
|
|
|
r32 CharsRevealedT;
|
2023-08-22 03:19:51 +00:00
|
|
|
r32 CharsRevealed;
|
|
|
|
};
|
|
|
|
|
2023-10-29 10:00:34 +00:00
|
|
|
struct scene_view_character_texture_info
|
|
|
|
{
|
|
|
|
render_handle Texture;
|
|
|
|
r32 Scale;
|
|
|
|
};
|
|
|
|
|
2023-10-04 17:21:15 +00:00
|
|
|
struct scene_view_character_data
|
|
|
|
{
|
|
|
|
string Name;
|
|
|
|
|
2023-10-29 10:00:34 +00:00
|
|
|
scene_view_character_texture_info Info;
|
2023-10-04 17:21:15 +00:00
|
|
|
|
2023-10-29 10:00:34 +00:00
|
|
|
b32 Active;
|
2023-10-04 17:21:15 +00:00
|
|
|
r32 ActiveT;
|
2023-10-29 10:00:34 +00:00
|
|
|
|
|
|
|
b32 Talking;
|
2023-10-04 17:21:15 +00:00
|
|
|
r32 TalkingT;
|
2023-10-29 10:00:34 +00:00
|
|
|
|
2023-10-04 17:21:15 +00:00
|
|
|
r32 PctP;
|
|
|
|
};
|
|
|
|
|
2023-12-07 15:50:57 +00:00
|
|
|
enum scene_nav_action_kind
|
|
|
|
{
|
|
|
|
S_NavAction_None,
|
|
|
|
S_NavAction_Proc,
|
|
|
|
S_NavAction_Scene,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct scene_nav_action
|
|
|
|
{
|
|
|
|
scene_nav_action_kind Kind;
|
|
|
|
string Content;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct scene_nav_item
|
|
|
|
{
|
|
|
|
asset_id TextureID;
|
|
|
|
r32 Scale;
|
|
|
|
v2_r32 Origin;
|
|
|
|
v2_r32 P;
|
|
|
|
string HoverText;
|
|
|
|
scene_nav_action Action;
|
|
|
|
};
|
|
|
|
|
|
|
|
global read_only scene_nav_item G_DefaultSceneNavItem =
|
|
|
|
{
|
|
|
|
AssetID_ArthurNormal,
|
|
|
|
0.01f,
|
|
|
|
V2R32(0.5f, 1.0f),
|
|
|
|
V2R32(0.0f, 0.0f),
|
|
|
|
StrLit(""),
|
|
|
|
S_NavAction_None
|
|
|
|
};
|
|
|
|
|
|
|
|
struct scene_nav
|
|
|
|
{
|
|
|
|
scene_nav_item *Items;
|
|
|
|
s32 ItemCount;
|
|
|
|
s32 ItemMax;
|
|
|
|
};
|
|
|
|
|
2023-08-22 03:19:51 +00:00
|
|
|
struct scene_view
|
|
|
|
{
|
2023-10-29 10:00:34 +00:00
|
|
|
arena *SceneArena;
|
2023-10-04 17:21:15 +00:00
|
|
|
|
2023-10-29 10:00:34 +00:00
|
|
|
//- sixten: state
|
2023-08-22 03:19:51 +00:00
|
|
|
scene_runtime Runtime;
|
|
|
|
textbox Textbox;
|
2023-10-04 17:21:15 +00:00
|
|
|
|
2023-10-29 10:00:34 +00:00
|
|
|
u8 LastTalkingCharacterBuffer[32];
|
|
|
|
string LastTalkingCharacter;
|
2023-10-04 17:21:15 +00:00
|
|
|
|
2023-10-29 10:00:34 +00:00
|
|
|
b32 CharacterIsTalking;
|
|
|
|
r32 CharacterIsTalkingT;
|
|
|
|
|
|
|
|
s32 OnscreenCharacterCount;
|
|
|
|
scene_view_character_data OnscreenCharacters[16];
|
|
|
|
|
|
|
|
//- sixten: input per frame
|
|
|
|
platform_event_list *EventList;
|
|
|
|
r32 dtForFrame;
|
|
|
|
|
|
|
|
//- sixten: temporary texture hub
|
|
|
|
render_handle BackgroundTexture;
|
2023-10-04 17:21:15 +00:00
|
|
|
render_handle TestHappy;
|
|
|
|
render_handle TestNormal;
|
2023-10-29 10:00:34 +00:00
|
|
|
render_handle MonikaLeaning;
|
2023-10-04 17:21:15 +00:00
|
|
|
|
2023-08-22 03:19:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static void SV_SetState(scene_view *View);
|
|
|
|
static scene_view *SV_GetState();
|
2023-10-29 10:00:34 +00:00
|
|
|
|
2023-10-04 17:21:15 +00:00
|
|
|
static void SV_NewFrame(scene_view *View, platform_event_list *EventList, r32 dtForFrame);
|
2023-10-29 10:00:34 +00:00
|
|
|
static void SV_Reset(void);
|
2023-08-22 03:19:51 +00:00
|
|
|
static void SV_SetCurrentSource(compiled_scene *Compiled);
|
2023-10-29 10:00:34 +00:00
|
|
|
static void SV_Init(scene_view *View, arena *TextboxArena);
|
|
|
|
|
|
|
|
static b32 SV_CurrentlyInProc(void);
|
|
|
|
|
2023-12-07 15:50:57 +00:00
|
|
|
static void SV_DrawBackground(scene_view *SceneView, ui_box *Box, render_group *Group);
|
|
|
|
|
|
|
|
static ui_signal SV_BuildNavItem(scene_nav_item * Item, r32 GlobalScale, v2_r32 GlobalDim);
|
2023-08-22 03:19:51 +00:00
|
|
|
static void SV_BuildSceneView(vn_input *Input);
|
2023-12-07 15:50:57 +00:00
|
|
|
|
2023-10-29 10:00:34 +00:00
|
|
|
static void SV_Update(arena *FrameArena);
|
2023-08-22 03:19:51 +00:00
|
|
|
|
|
|
|
#endif //VN_SCENE_VIEW_H
|