-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructure stonesense state and configuration stores #155
Conversation
Phase 1: Ensure that every setting in the configuration file corresponds to a variable in `GameConfiguration`, and segregate the variables in `GameConfiguration` that are set from the configuration file from the other stuff in the structure
derived from the settings in the standard `init.txt`
a branch update will solve the docs build failure -- I merged the relocating of the keybinds file |
now instead of updating the "live" config while parsing the config, the config is parsed in full, generating a new config, and the generated config applied in place of the existing one after parsing is complete
I think this is ready to go; the next phase is to convert the loader to use TOML, which should be in a separate PR. |
Config.cpp
Outdated
@@ -5,7 +5,7 @@ | |||
#include "common.h" | |||
#include "commonTypes.h" | |||
#include "Config.h" | |||
#include "GameConfiguration.h" | |||
#include "Config.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
snarf?
Config.h
Outdated
constexpr int DEFAULT_SIZE = /*20*/ 70; | ||
constexpr int DEFAULT_SIZE_Z = /*6*/ 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed: these are better defaults. can remove commented values?
Config.h
Outdated
constexpr int DEFAULT_SIZE_Z = /*6*/ 4; | ||
|
||
class Config { | ||
// constexpr auto GFXMODE = GFX_AUTODETECT_WINDOWED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it's a relic of days gone by, if someone wants to find it there's always git history
Config.h
Outdated
TRACKING_NONE, | ||
TRACKING_CENTER, | ||
TRACKING_FOCUS, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's how it was in the original 🤷♀️
bool names_use_nick = true; | ||
bool names_use_species = true; | ||
bool show_osd = false; | ||
bool cache_images = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this matches the default config, but I wonder why cache_images
is off by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because Stonesense was written in 2012 when the average graphics card had maybe 2 GB of VRAM and a lot of DF players were likely using GPUs with less than 1GB of VRAM, often much less, and using the image cache on such systems would make the baby GPU cry sadly for mercy.
I'm leery of turning it on by default simply because it's been off by default for so long and so the caching code hasn't been very well tested as a result.
The purpose of this PR is to arrange the internal state in Stonesense so that the user-controlled configuration is clearly delineated from other tool state, in order to facilitate switching to a better approach for handling persistent user configuration