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 <memory>
#include <string> #include <string>
#include "absl/container/flat_hash_map.h"
#include "absl/status/statusor.h" #include "absl/status/statusor.h"
#include "absl/strings/str_format.h" #include "absl/strings/str_format.h"
#include "absl/container/flat_hash_map.h"
namespace yaze { namespace yaze {
@@ -19,7 +19,6 @@ namespace yaze {
*/ */
namespace core { namespace core {
struct HexStringParams { struct HexStringParams {
enum class Prefix { kNone, kDollar, kHash, k0x } prefix = Prefix::kDollar; enum class Prefix { kNone, kDollar, kHash, k0x } prefix = Prefix::kDollar;
bool uppercase = true; bool uppercase = true;
@@ -43,11 +42,6 @@ public:
// Log instructions to the GUI debugger. // Log instructions to the GUI debugger.
bool kLogInstructions = true; 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. // Flag to enable the saving of all palettes to the Rom.
bool kSaveAllPalettes = false; bool kSaveAllPalettes = false;
@@ -121,9 +115,6 @@ public:
std::string result; std::string result;
result += result +=
"kLogInstructions: " + std::to_string(flags_->kLogInstructions) + "\n"; "kLogInstructions: " + std::to_string(flags_->kLogInstructions) + "\n";
result +=
"kUseNewImGuiInput: " + std::to_string(flags_->kUseNewImGuiInput) +
"\n";
result += result +=
"kSaveAllPalettes: " + std::to_string(flags_->kSaveAllPalettes) + "\n"; "kSaveAllPalettes: " + std::to_string(flags_->kSaveAllPalettes) + "\n";
result += result +=
@@ -163,7 +154,8 @@ private:
* @brief A class to manage a value that can be modified and notify when it * @brief A class to manage a value that can be modified and notify when it
* changes. * changes.
*/ */
template <typename T> class NotifyValue { template <typename T>
class NotifyValue {
public: public:
NotifyValue() : value_(), modified_(false), temp_value_() {} NotifyValue() : value_(), modified_(false), temp_value_() {}
NotifyValue(const T &value) NotifyValue(const T &value)
@@ -221,7 +213,8 @@ struct StructuredLog {
std::string category; 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> template <typename... Args>
static void logm(const std::string &category, static void logm(const std::string &category,

View File

@@ -141,9 +141,6 @@ void Controller::OnExit() {
absl::Status Controller::CreateWindow() { absl::Status Controller::CreateWindow() {
auto sdl_flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER; 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) { if (SDL_Init(sdl_flags) != 0) {
return absl::InternalError( return absl::InternalError(
@@ -181,9 +178,6 @@ absl::Status Controller::CreateGuiContext() {
ImGuiIO &io = ImGui::GetIO(); ImGuiIO &io = ImGui::GetIO();
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
if (flags()->kUseNewImGuiInput) {
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
}
// Initialize ImGui based on the backend // Initialize ImGui based on the backend
ImGui_ImplSDL2_InitForSDLRenderer(window_.get(), 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 All Palettes", &mutable_flags()->kSaveAllPalettes);
Checkbox("Save Gfx Groups", &mutable_flags()->kSaveGfxGroups); Checkbox("Save Gfx Groups", &mutable_flags()->kSaveGfxGroups);
Checkbox("Save Graphics Sheets", &mutable_flags()->kSaveGraphicsSheet); Checkbox("Save Graphics Sheets", &mutable_flags()->kSaveGraphicsSheet);
Checkbox("Use New ImGui Input", &mutable_flags()->kUseNewImGuiInput);
} }
}; };