Controller cleanup

This commit is contained in:
scawful
2023-11-25 20:52:09 -05:00
parent 16b865c328
commit 08090529ef
2 changed files with 6 additions and 9 deletions

View File

@@ -97,8 +97,6 @@ void HandleMouseMovement(int &wheel) {
} // namespace } // namespace
bool Controller::IsActive() const { return active_; }
absl::Status Controller::OnEntry() { absl::Status Controller::OnEntry() {
RETURN_IF_ERROR(CreateSDL_Window()) RETURN_IF_ERROR(CreateSDL_Window())
RETURN_IF_ERROR(CreateRenderer()) RETURN_IF_ERROR(CreateRenderer())
@@ -149,7 +147,7 @@ void Controller::OnInput() {
HandleMouseMovement(wheel); HandleMouseMovement(wheel);
} }
void Controller::OnLoad() { master_editor_.UpdateScreen(); } void Controller::OnLoad() { PRINT_IF_ERROR(master_editor_.Update()); }
void Controller::DoRender() const { void Controller::DoRender() const {
SDL_RenderClear(renderer_.get()); SDL_RenderClear(renderer_.get());
@@ -219,10 +217,8 @@ absl::Status Controller::CreateGuiContext() {
ImGuiIO &io = ImGui::GetIO(); ImGuiIO &io = ImGui::GetIO();
if (flags()->kUseNewImGuiInput) { if (flags()->kUseNewImGuiInput) {
io.ConfigFlags |= io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
io.ConfigFlags |=
ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
} }
// Initialize ImGui for SDL // Initialize ImGui for SDL
@@ -232,7 +228,7 @@ absl::Status Controller::CreateGuiContext() {
if (flags()->kLoadSystemFonts) { if (flags()->kLoadSystemFonts) {
LoadSystemFonts(); LoadSystemFonts();
} else { } else {
LoadFontFamilies(); RETURN_IF_ERROR(LoadFontFamilies());
} }
// Set the default style // Set the default style

View File

@@ -11,6 +11,7 @@
#include "absl/status/status.h" #include "absl/status/status.h"
#include "app/core/common.h" #include "app/core/common.h"
#include "app/core/editor.h"
#include "app/editor/master_editor.h" #include "app/editor/master_editor.h"
#include "app/gui/icons.h" #include "app/gui/icons.h"
#include "app/gui/style.h" #include "app/gui/style.h"
@@ -23,7 +24,7 @@ namespace core {
class Controller : public ExperimentFlags { class Controller : public ExperimentFlags {
public: public:
bool IsActive() const; bool IsActive() const { return active_; }
absl::Status OnEntry(); absl::Status OnEntry();
void OnInput(); void OnInput();
void OnLoad(); void OnLoad();