group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
user_settings Namespace Reference

User-settings persistence helpers. More...

Functions

std::string getPath ()
 Return the full path to the per-user settings TOML file.
UserSettings load (const std::string &path)
 Load settings from disk, falling back to defaults for missing or invalid values.
bool save (const std::string &path, const UserSettings &settings)
 Save settings to disk.

Variables

constexpr float kReferenceMouseDpi = 800.0f
 Reference mouse hardware used to map default sensitivity to cm/360.
constexpr float kDefaultMouseCmPer360 = 30.0f
 Default mouse travel for one full turn at the reference DPI.
constexpr float kPi = 3.14159265358979323846f
constexpr float kDefaultMouseSensitivity = (2.0f * kPi) / ((kDefaultMouseCmPer360 / 2.54f) * kReferenceMouseDpi)
 Mouse-look sensitivity in radians per SDL relative mouse unit.
constexpr float kMinMouseSensitivity = 0.0001f
 Settings-slider minimum. The maximum is mirrored so default sits centered.
constexpr float kMaxMouseSensitivity = 2.0f * kDefaultMouseSensitivity - kMinMouseSensitivity
constexpr float kMouseSensitivityDisplayScale = 1000.0f
 UI scale for displaying tiny rad/pixel sensitivity values legibly.

Detailed Description

User-settings persistence helpers.

Function Documentation

◆ getPath()

std::string user_settings::getPath ( )

Return the full path to the per-user settings TOML file.

Here is the caller graph for this function:

◆ load()

UserSettings user_settings::load ( const std::string & path)

Load settings from disk, falling back to defaults for missing or invalid values.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save()

bool user_settings::save ( const std::string & path,
const UserSettings & settings )

Save settings to disk.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ kDefaultMouseCmPer360

float user_settings::kDefaultMouseCmPer360 = 30.0f
inlineconstexpr

Default mouse travel for one full turn at the reference DPI.

◆ kDefaultMouseSensitivity

float user_settings::kDefaultMouseSensitivity = (2.0f * kPi) / ((kDefaultMouseCmPer360 / 2.54f) * kReferenceMouseDpi)
inlineconstexpr

Mouse-look sensitivity in radians per SDL relative mouse unit.

◆ kMaxMouseSensitivity

float user_settings::kMaxMouseSensitivity = 2.0f * kDefaultMouseSensitivity - kMinMouseSensitivity
inlineconstexpr

◆ kMinMouseSensitivity

float user_settings::kMinMouseSensitivity = 0.0001f
inlineconstexpr

Settings-slider minimum. The maximum is mirrored so default sits centered.

◆ kMouseSensitivityDisplayScale

float user_settings::kMouseSensitivityDisplayScale = 1000.0f
inlineconstexpr

UI scale for displaying tiny rad/pixel sensitivity values legibly.

◆ kPi

float user_settings::kPi = 3.14159265358979323846f
inlineconstexpr

◆ kReferenceMouseDpi

float user_settings::kReferenceMouseDpi = 800.0f
inlineconstexpr

Reference mouse hardware used to map default sensitivity to cm/360.