diff --git a/dependencies/subprojects/animationwindow/include/AnimationWindow.h b/dependencies/subprojects/animationwindow/include/AnimationWindow.h index a3811ae0e5e7620d0779c2ffc3fe2c4f0a00dbd5..89d692cf880a166c580d3507e4be23b81ddfebe1 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 2e09093a92cd0e12a5f051b8eb9066e2b6b86d8a..cea352b737acaa7b5b071492aeeadf09405eaf0d 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; }