From d604eceb3880a86adc4b741288e35027d8fe23a6 Mon Sep 17 00:00:00 2001
From: Joakim Hunskaar <joakim.borge.hunskar@gmail.com>
Date: Tue, 11 Jun 2024 18:22:10 +0200
Subject: [PATCH] colour is now color, getters for dimensions are now const and
 renamed

---
 .../animationwindow/include/AnimationWindow.h        |  8 ++++----
 .../animationwindow/src/AnimationWindow.cpp          | 12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/dependencies/subprojects/animationwindow/include/AnimationWindow.h b/dependencies/subprojects/animationwindow/include/AnimationWindow.h
index a3811ae..89d692c 100644
--- a/dependencies/subprojects/animationwindow/include/AnimationWindow.h
+++ b/dependencies/subprojects/animationwindow/include/AnimationWindow.h
@@ -41,7 +41,7 @@ class AnimationWindow {
    private:
     void show_frame();
     void update_gui();
-    TDT4102::Point getWindowDimensions();
+    TDT4102::Point getWindowDimensions() const;
     void startNuklearDraw(TDT4102::Point location, std::string uniqueWindowName, unsigned int width = 0, unsigned int height = 0);
     void endNuklearDraw();
     void destroy();
@@ -54,7 +54,7 @@ class AnimationWindow {
 
     std::vector<std::reference_wrapper<TDT4102::Widget>> widgets;
 
-    TDT4102::Color backgroundColour = TDT4102::Color::white;
+    TDT4102::Color backgroundColor = TDT4102::Color::white;
 
     // SDL related context
     SDL_Window* windowHandle = nullptr;
@@ -120,8 +120,8 @@ class AnimationWindow {
     void show_error_dialog(const std::string& message) const;
 
     // Getters for the window dimensions
-    int windowWidth() const;
-    int windowHeight() const;
+    int get_width() const;
+    int get_height() const;
 
     void setBackgroundColor(TDT4102::Color newBackgroundColor);
 
diff --git a/dependencies/subprojects/animationwindow/src/AnimationWindow.cpp b/dependencies/subprojects/animationwindow/src/AnimationWindow.cpp
index 2e09093..cea352b 100644
--- a/dependencies/subprojects/animationwindow/src/AnimationWindow.cpp
+++ b/dependencies/subprojects/animationwindow/src/AnimationWindow.cpp
@@ -41,7 +41,7 @@ TDT4102::AnimationWindow::AnimationWindow(int x, int y, int width, int height, c
     }
 
     // Default window background colour
-    SDL_SetRenderDrawColor(rendererHandle, backgroundColour.redChannel, backgroundColour.greenChannel, backgroundColour.blueChannel, backgroundColour.alphaChannel);
+    SDL_SetRenderDrawColor(rendererHandle, backgroundColor.redChannel, backgroundColor.greenChannel, backgroundColor.blueChannel, backgroundColor.alphaChannel);
     SDL_RenderClear(rendererHandle);
 
     SDL_RendererInfo rendererInfo;
@@ -131,7 +131,7 @@ void TDT4102::AnimationWindow::next_frame() {
 
     // Colour must be reset as a previously drawn element may have changed the current colour
     if (!keepPreviousFrame) {
-        SDL_SetRenderDrawColor(rendererHandle, backgroundColour.redChannel, backgroundColour.greenChannel, backgroundColour.blueChannel, backgroundColour.alphaChannel);
+        SDL_SetRenderDrawColor(rendererHandle, backgroundColor.redChannel, backgroundColor.greenChannel, backgroundColor.blueChannel, backgroundColor.alphaChannel);
         SDL_RenderClear(rendererHandle);
     }
 
@@ -331,17 +331,17 @@ void TDT4102::AnimationWindow::show_error_dialog(const std::string& message) con
     SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", message.c_str(), windowHandle);
 }
 
-TDT4102::Point TDT4102::AnimationWindow::getWindowDimensions() {
+TDT4102::Point TDT4102::AnimationWindow::getWindowDimensions() const {
     TDT4102::Point dimensions;
     SDL_GetRendererOutputSize(rendererHandle, &dimensions.x, &dimensions.y);
     return dimensions;
 }
 
-int TDT4102::AnimationWindow::windowWidth() const {
+int TDT4102::AnimationWindow::get_width() const {
     return getWindowDimensions().x;
 }
 
-int TDT4102::AnimationWindow::windowHeight() const {
+int TDT4102::AnimationWindow::get_height() const {
     return getWindowDimensions().y;
 }
 
@@ -397,5 +397,5 @@ void TDT4102::AnimationWindow::endNuklearDraw() {
 }
 
 void TDT4102::AnimationWindow::setBackgroundColor(TDT4102::Color newBackgroundColor) {
-    backgroundColour = newBackgroundColor;
+    backgroundColor = newBackgroundColor;
 }
-- 
GitLab