2023-09-26 14:26:35 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "engine/engine.hpp"
|
|
|
|
|
2023-09-28 10:44:43 -07:00
|
|
|
#define NS_HANDMADE_BEGIN namespace hh {
|
2023-09-26 14:26:35 -07:00
|
|
|
#define NS_HANDMADE_END }
|
|
|
|
|
|
|
|
NS_HANDMADE_BEGIN
|
|
|
|
|
|
|
|
struct Memory
|
|
|
|
{
|
|
|
|
// Subscection of engine memory for the game to use.
|
|
|
|
|
|
|
|
void* Persistent;
|
|
|
|
u64 PersistentSize;
|
|
|
|
|
|
|
|
// void* Frame;
|
|
|
|
// u64 FrameSize;
|
|
|
|
|
|
|
|
void* Transient;
|
|
|
|
u64 TransientSize;
|
|
|
|
};
|
|
|
|
|
|
|
|
// We want a 'binding' to have multiple binds to active it (most likely)
|
|
|
|
struct Actionable
|
|
|
|
{
|
|
|
|
char const* Name;
|
|
|
|
engine::InputBindCallback* Binds;
|
|
|
|
s32 NumBinds;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ActionableMode
|
|
|
|
{
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
Platform Layer:
|
|
|
|
|
|
|
|
Controller : Keyboard & Mouse, XPad, DSPad
|
|
|
|
|
|
|
|
---VV---
|
|
|
|
|
|
|
|
Engine Layer:
|
|
|
|
|
|
|
|
InputBinding callbacks (per-game-logic frame basis)
|
|
|
|
Push/Pop input modes (binding sets)
|
|
|
|
|
|
|
|
---VV---
|
|
|
|
|
|
|
|
Game Layer:
|
|
|
|
|
|
|
|
Actionables : Binding Sets where a raw input, or input interpretation leads to an player action.
|
|
|
|
ActionSet : Actionables.Push/Pop -> Input.Push/Pop ?
|
|
|
|
Player : Controller, Actionables, ActionSets
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct Player
|
|
|
|
{
|
|
|
|
// So far just has an assigned controller.
|
|
|
|
engine::ControllerState* Controller;
|
|
|
|
|
|
|
|
// Possilby some other stuff in the future.
|
|
|
|
};
|
|
|
|
|
2023-09-28 10:44:43 -07:00
|
|
|
struct PlayerState
|
|
|
|
{
|
|
|
|
s32 Pos_X;
|
|
|
|
s32 Pos_Y;
|
|
|
|
|
|
|
|
b32 MidJump;
|
|
|
|
f32 JumpTime;
|
|
|
|
};
|
|
|
|
|
2023-09-26 14:26:35 -07:00
|
|
|
NS_HANDMADE_END
|