From 61148c757a1f742ff09e40e5347e74e638c7371c Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sun, 22 Dec 2024 12:32:22 +0100 Subject: update clang-format options --- mwe/events/src/event.cpp | 5 +++-- mwe/events/src/eventManager.cpp | 5 +++-- mwe/events/src/loopManager.cpp | 6 ++++-- mwe/events/src/uiObject.cpp | 6 +++--- mwe/events/src/window.cpp | 6 ++++-- 5 files changed, 17 insertions(+), 11 deletions(-) (limited to 'mwe/events/src') diff --git a/mwe/events/src/event.cpp b/mwe/events/src/event.cpp index 0040c73..5177199 100644 --- a/mwe/events/src/event.cpp +++ b/mwe/events/src/event.cpp @@ -3,8 +3,9 @@ // Event class methods Event::Event(std::string eventType) { eventData["eventType"] = eventType; } -void Event::addArgument(const std::string & key, - const std::variant & value) { +void Event::addArgument( + const std::string & key, const std::variant & value +) { eventData[key] = value; } diff --git a/mwe/events/src/eventManager.cpp b/mwe/events/src/eventManager.cpp index 9e7d880..b77a0a3 100644 --- a/mwe/events/src/eventManager.cpp +++ b/mwe/events/src/eventManager.cpp @@ -2,8 +2,9 @@ void EventManager::shutdown() { subscribers.clear(); } -void EventManager::subscribe(int eventType, std::unique_ptr && handler, - int eventId) { +void EventManager::subscribe( + int eventType, std::unique_ptr && handler, int eventId +) { if (eventId) { std::unordered_map< int, std::unordered_map>>>:: diff --git a/mwe/events/src/loopManager.cpp b/mwe/events/src/loopManager.cpp index c58a5e7..7be10df 100644 --- a/mwe/events/src/loopManager.cpp +++ b/mwe/events/src/loopManager.cpp @@ -51,8 +51,10 @@ void onKey(const KeyPressedEvent & e) { std::cout << "keycode pressed: " << keyCode << std::endl; } void onMouse(const MousePressedEvent & e) { - fprintf(stderr, "mouse Position X: %d Y: %d\n", e.getMousePosition().first, - e.getMousePosition().second); + fprintf( + stderr, "mouse Position X: %d Y: %d\n", e.getMousePosition().first, + e.getMousePosition().second + ); } void LoopManager::setup() { gameRunning = window.initWindow(); diff --git a/mwe/events/src/uiObject.cpp b/mwe/events/src/uiObject.cpp index 947d1a2..6b5b326 100644 --- a/mwe/events/src/uiObject.cpp +++ b/mwe/events/src/uiObject.cpp @@ -10,7 +10,7 @@ Text::Text(int width, int height) : UIObject(width, height), size(12), font(nullptr), - color{255, 255, 255} { // Default size and color + color {255, 255, 255} { // Default size and color alignment.horizontal = Alignment::Horizontal::CENTER; alignment.vertical = Alignment::Vertical::MIDDLE; alignment.mode = Alignment::PositioningMode::RELATIVE; @@ -21,8 +21,8 @@ TextInput::TextInput(int width, int height) textBuffer(""), placeholder(""), isActive(false), - textColor{255, 255, 255}, - backgroundColor{0, 0, 0}, + textColor {255, 255, 255}, + backgroundColor {0, 0, 0}, maxLength(100), font(nullptr) { alignment.horizontal = Alignment::Horizontal::LEFT; diff --git a/mwe/events/src/window.cpp b/mwe/events/src/window.cpp index af2b627..5cdd425 100644 --- a/mwe/events/src/window.cpp +++ b/mwe/events/src/window.cpp @@ -11,8 +11,10 @@ bool WindowManager::initWindow() { return false; } - window = SDL_CreateWindow("SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, - SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN); + window = SDL_CreateWindow( + "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, + SCREEN_HEIGHT, SDL_WINDOW_SHOWN + ); if (!window) { std::cerr << "Error creating SDL Window.\n"; return false; -- cgit v1.2.3