Files
PuzGame/src/game/Instance.h
2025-05-25 13:19:50 +02:00

79 lines
1.8 KiB
C++

#pragma once
#include "Level.h"
#include <cstdint>
namespace Game
{
enum class CameraMode
{
Walk,
Freefly,
};
enum class InputMode
{
UI,
Game,
};
enum class InteractionMode
{
Walk,
ReadTablet,
};
struct Time
{
double Now = 0.0;
double Delta = 0.0;
int64_t NowHP = 0;
int64_t DeltaHP = 1000;
int64_t StartTime = 0;
};
struct PlayerData
{
Gen::Transform PlayerCamTransform;
Gen::Transform FreeflyCamTransform;
Gen::Mat4 Projection;
Gen::Mat4 ProjectionInverse;
float FreeflyXRot = 0.0f;
float FreeflyYRot = 0.0f;
float WalkXRot = 0.0f;
float WalkYRot = 0.0f;
CameraMode CameraM = CameraMode::Walk;
InputMode InputM = InputMode::Game;
InteractionMode InteractionM = InteractionMode::Walk;
float MouseSensitivity = 1.0f;
float MovementSpeed = 10.0f;
Gen::SavedPlayerConfig Config;
};
struct InstanceDebugData
{
static constexpr uint32_t MaxAssets = 128;
uint16_t SelectedDebugLevel = 0;
uint64_t ImguiIniSize = 0;
char ImguiIni[4096]{0};
uint32_t AssetCount = 0;
Gen::AssetHandle AssetHandles[MaxAssets]{0};
char AssetHandlePaths[MaxAssets][128];
bool ShowImguiDemo = false;
uint8_t DebugCardRotation = 0;
bool ShortenLogFileNames = true;
bool ShowStats = true;
bool ShowArenaUsage = false;
};
struct GameInstance
{
bool IsInitialized = false;
uint64_t Size = sizeof(GameInstance);
Time Time;
PlayerData Player;
Level GameLevel;
InstanceDebugData DebugData;
};
} // namespace Game