1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

Add support for per-player FOV overrides and multipliers

This commit is contained in:
Anand S 2018-07-15 05:56:30 +05:30 committed by sfan5
parent 5c9983400f
commit 47da640d77
13 changed files with 168 additions and 62 deletions

View file

@ -32,6 +32,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define PLAYERNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
#define PLAYERNAME_ALLOWED_CHARS_USER_EXPL "'a' to 'z', 'A' to 'Z', '0' to '9', '-', '_'"
struct PlayerFovSpec
{
f32 fov;
bool is_multiplier;
};
struct PlayerControl
{
PlayerControl() = default;
@ -178,6 +184,16 @@ public:
void setWieldIndex(u16 index);
u16 getWieldIndex() const { return m_wield_index; }
void setFov(const PlayerFovSpec &spec)
{
m_fov_spec = spec;
}
const PlayerFovSpec &getFov() const
{
return m_fov_spec;
}
u32 keyPressed = 0;
HudElement* getHud(u32 id);
@ -187,10 +203,12 @@ public:
u32 hud_flags;
s32 hud_hotbar_itemcount;
protected:
char m_name[PLAYERNAME_SIZE];
v3f m_speed;
u16 m_wield_index = 0;
PlayerFovSpec m_fov_spec = { 0.0f, false };
std::vector<HudElement *> hud;
private: