Skip to content

Commit

Permalink
Config: Add setting for view bobbing
Browse files Browse the repository at this point in the history
  • Loading branch information
dscharrer committed May 30, 2020
1 parent 2a5119d commit 7698ffe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/Config.cpp
Expand Up @@ -82,6 +82,7 @@ const int

const bool
fullscreen = true,
viewBobbing = true,
showCrosshair = true,
antialiasing = true,
colorkeyAntialiasing = true,
Expand Down Expand Up @@ -199,6 +200,7 @@ const std::string
vsync = "vsync",
fpsLimit = "fps_limit",
fov = "fov",
viewBobbing = "view_bobbing",
antialiasing = "antialiasing",
maxAnisotropicFiltering = "max_anisotropic_filtering",
colorkeyAntialiasing = "colorkey_antialiasing",
Expand Down Expand Up @@ -452,6 +454,7 @@ bool Config::save() {
writer.writeKey(Key::vsync, video.vsync);
writer.writeKey(Key::fpsLimit, video.fpsLimit);
writer.writeKey(Key::fov, video.fov);
writer.writeKey(Key::viewBobbing, video.viewBobbing);
writer.writeKey(Key::antialiasing, video.antialiasing);
writer.writeKey(Key::maxAnisotropicFiltering, video.maxAnisotropicFiltering);
writer.writeKey(Key::colorkeyAntialiasing, video.colorkeyAntialiasing);
Expand Down Expand Up @@ -598,6 +601,7 @@ bool Config::init(const fs::path & file) {
video.fpsLimit = std::max(fpsLimit, -1);
float fov = reader.getKey(Section::Video, Key::fov, Default::fov);
video.fov = std::max(fov, 60.f);
video.viewBobbing = reader.getKey(Section::Video, Key::viewBobbing, Default::viewBobbing);
video.antialiasing = reader.getKey(Section::Video, Key::antialiasing, Default::antialiasing);
int anisoFiltering = reader.getKey(Section::Video, Key::maxAnisotropicFiltering, Default::maxAnisotropicFiltering);
video.maxAnisotropicFiltering = std::max(anisoFiltering, 1);
Expand Down
1 change: 1 addition & 0 deletions src/core/Config.h
Expand Up @@ -139,6 +139,7 @@ class Config {
int fpsLimit;

float fov;
bool viewBobbing;

int levelOfDetail;
float fogDistance;
Expand Down

0 comments on commit 7698ffe

Please sign in to comment.