vn/code/vn_scene_view.h

120 lines
2.2 KiB
C
Raw Normal View History

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 scene_view_character_texture_info
{
2023-12-23 07:27:22 +00:00
render_handle Texture;
r32 Scale;
};
2023-10-04 17:21:15 +00:00
struct scene_view_character_data
{
2023-12-23 07:27:22 +00:00
string Name;
scene_view_character_texture_info Info;
b32 Active;
r32 ActiveT;
b32 Talking;
r32 TalkingT;
r32 PctP;
2023-10-04 17:21:15 +00:00
};
enum scene_nav_action_kind
{
2023-12-23 07:27:22 +00:00
S_NavAction_None,
S_NavAction_Proc,
S_NavAction_Scene,
};
struct scene_nav_action
{
2023-12-23 07:27:22 +00:00
scene_nav_action_kind Kind;
string Content;
};
struct scene_nav_item
{
2023-12-23 07:27:22 +00:00
asset_id TextureID;
r32 Scale;
v2_r32 Origin;
v2_r32 P;
string HoverText;
scene_nav_action Action;
};
2023-12-23 07:27:22 +00:00
typedef u8 scene_nav_item_op;
enum
{
2023-12-23 07:27:22 +00:00
S_NavItemOp_None = 0,
S_NavItemOp_TextureID,
S_NavItemOp_Scale,
S_NavItemOp_Origin,
S_NavItemOp_P,
S_NavItemOp_HoverText,
S_NavItemOp_Action,
};
struct scene_nav
{
2023-12-23 07:27:22 +00:00
scene_nav_item *Items;
s32 ItemCount;
s32 ItemMax;
};
2023-08-22 03:19:51 +00:00
struct scene_view
{
2023-12-23 07:27:22 +00:00
arena *SceneArena;
2024-01-20 11:18:57 +00:00
2023-12-23 07:27:22 +00:00
//- sixten: state
2024-01-20 11:18:57 +00:00
scene2_runtime Runtime;
compiled_scene2 Compiled;
//- sixten: messages
arena *MessageArena;
scene2_message_list Messages;
//- sixten: textbox
char TextboxData[1024];
u64 TextboxUsed;
r32 TextboxRevealed;
//- sixten: characters
2023-12-23 07:27:22 +00:00
scene_view_character_data Characters[16];
2024-01-20 11:18:57 +00:00
u64 CharactersUsed;
2023-12-23 07:27:22 +00:00
//- sixten: nav items
scene_nav_item *NavItems;
u64 NavItemCount;
//- sixten: input per frame
platform_event_list *EventList;
r32 dtForFrame;
2023-08-22 03:19:51 +00:00
};
static void SV_SetState(scene_view *View);
static scene_view *SV_GetState();
2023-10-04 17:21:15 +00:00
static void SV_NewFrame(scene_view *View, platform_event_list *EventList, r32 dtForFrame);
static void SV_Reset(void);
2024-01-20 11:18:57 +00:00
static void SV_SetCurrentSource(compiled_scene2 *Compiled);
static void SV_Init(scene_view *View);
static b32 SV_CurrentlyInProc(void);
2023-12-23 07:27:22 +00:00
static scene_view_character_data *SV_FindTalkingCharacter(void);
static string SV_DisplayNameFromCharacter(scene_view_character_data *Character);
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);
static void SV_Update(arena *FrameArena);
2023-08-22 03:19:51 +00:00
#endif //VN_SCENE_VIEW_H