Remove ImGui input flag and related code from core and editor components

This commit is contained in:
scawful
2024-12-31 16:40:24 -05:00
parent 6d2de44b94
commit d47e8a8387
3 changed files with 10 additions and 24 deletions

View File

@@ -7,9 +7,9 @@
#include <memory>
#include <string>
#include "absl/container/flat_hash_map.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_format.h"
#include "absl/container/flat_hash_map.h"
namespace yaze {
@@ -19,7 +19,6 @@ namespace yaze {
*/
namespace core {
struct HexStringParams {
enum class Prefix { kNone, kDollar, kHash, k0x } prefix = Prefix::kDollar;
bool uppercase = true;
@@ -38,16 +37,11 @@ bool StringReplace(std::string &str, const std::string &from,
* @brief A class to manage experimental feature flags.
*/
class ExperimentFlags {
public:
public:
struct Flags {
// Log instructions to the GUI debugger.
bool kLogInstructions = true;
// Flag to enable ImGui input config flags. Currently is
// handled manually by controller class but should be
// ported away from that eventually.
bool kUseNewImGuiInput = false;
// Flag to enable the saving of all palettes to the Rom.
bool kSaveAllPalettes = false;
@@ -121,9 +115,6 @@ public:
std::string result;
result +=
"kLogInstructions: " + std::to_string(flags_->kLogInstructions) + "\n";
result +=
"kUseNewImGuiInput: " + std::to_string(flags_->kUseNewImGuiInput) +
"\n";
result +=
"kSaveAllPalettes: " + std::to_string(flags_->kSaveAllPalettes) + "\n";
result +=
@@ -154,7 +145,7 @@ public:
return result;
}
private:
private:
static std::shared_ptr<Flags> flags_;
};
@@ -163,8 +154,9 @@ private:
* @brief A class to manage a value that can be modified and notify when it
* changes.
*/
template <typename T> class NotifyValue {
public:
template <typename T>
class NotifyValue {
public:
NotifyValue() : value_(), modified_(false), temp_value_() {}
NotifyValue(const T &value)
: value_(value), modified_(false), temp_value_() {}
@@ -197,7 +189,7 @@ public:
bool modified() const { return modified_; }
private:
private:
T value_;
bool modified_;
T temp_value_;
@@ -221,7 +213,8 @@ struct StructuredLog {
std::string category;
};
static absl::flat_hash_map<std::string, std::vector<std::string>> log_categories;
static absl::flat_hash_map<std::string, std::vector<std::string>>
log_categories;
template <typename... Args>
static void logm(const std::string &category,
@@ -236,7 +229,7 @@ static void logm(const std::string &category,
}
class Logger {
public:
public:
static void log(std::string message) {
static std::ofstream fout(log_file_out, std::ios::out | std::ios::app);
fout << message << std::endl;

View File

@@ -141,9 +141,6 @@ void Controller::OnExit() {
absl::Status Controller::CreateWindow() {
auto sdl_flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER;
if (flags()->kUseNewImGuiInput) {
sdl_flags |= SDL_INIT_GAMECONTROLLER;
}
if (SDL_Init(sdl_flags) != 0) {
return absl::InternalError(
@@ -181,9 +178,6 @@ absl::Status Controller::CreateGuiContext() {
ImGuiIO &io = ImGui::GetIO();
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
if (flags()->kUseNewImGuiInput) {
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
}
// Initialize ImGui based on the backend
ImGui_ImplSDL2_InitForSDLRenderer(window_.get(),

View File

@@ -52,7 +52,6 @@ struct FlagsMenu : public core::ExperimentFlags {
Checkbox("Save All Palettes", &mutable_flags()->kSaveAllPalettes);
Checkbox("Save Gfx Groups", &mutable_flags()->kSaveGfxGroups);
Checkbox("Save Graphics Sheets", &mutable_flags()->kSaveGraphicsSheet);
Checkbox("Use New ImGui Input", &mutable_flags()->kUseNewImGuiInput);
}
};