From 8323639e4f75f50325f40b7f49a63b503341319f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Fri, 21 May 2021 16:30:53 +0200 Subject: [PATCH] resetting getter not const (due to poor lib design) --- lib/Ray/sources/Drawables/2D/Circle.cpp | 2 +- lib/Ray/sources/Drawables/Image.cpp | 2 +- lib/Ray/sources/Drawables/Image.hpp | 2 +- lib/Ray/sources/Window.cpp | 2 +- lib/Ray/sources/Window.hpp | 2 +- sources/main.cpp | 1 - 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/Ray/sources/Drawables/2D/Circle.cpp b/lib/Ray/sources/Drawables/2D/Circle.cpp index 4404773f..00056e36 100644 --- a/lib/Ray/sources/Drawables/2D/Circle.cpp +++ b/lib/Ray/sources/Drawables/2D/Circle.cpp @@ -39,4 +39,4 @@ void RAY::Drawables::Drawables2D::Circle::drawOn(RAY::Window &window) void RAY::Drawables::Drawables2D::Circle::drawOn(RAY::Image &image) { ImageDrawCircleV(&(image.getImage()), this->_position, this->_radius, this->_color.getColor()); -} +} \ No newline at end of file diff --git a/lib/Ray/sources/Drawables/Image.cpp b/lib/Ray/sources/Drawables/Image.cpp index 70b96e0d..ee7e5be8 100644 --- a/lib/Ray/sources/Drawables/Image.cpp +++ b/lib/Ray/sources/Drawables/Image.cpp @@ -40,7 +40,7 @@ bool RAY::Image::unload() return true; } -const ::Image &RAY::Image::getImage(void) const +::Image &RAY::Image::getImage(void) { return _image; } \ No newline at end of file diff --git a/lib/Ray/sources/Drawables/Image.hpp b/lib/Ray/sources/Drawables/Image.hpp index fb70112e..e0e81efc 100644 --- a/lib/Ray/sources/Drawables/Image.hpp +++ b/lib/Ray/sources/Drawables/Image.hpp @@ -49,7 +49,7 @@ namespace RAY bool unload() override; //! @brief get image - const ::Image &getImage(void) const; + ::Image &getImage(void); //! @brief draw drawable void draw(Drawables::ADrawable2D &); diff --git a/lib/Ray/sources/Window.cpp b/lib/Ray/sources/Window.cpp index 112462d2..f9475bc9 100644 --- a/lib/Ray/sources/Window.cpp +++ b/lib/Ray/sources/Window.cpp @@ -143,7 +143,7 @@ void RAY::Window::draw(const Mesh &mesh, const Material &material, const Matrix DrawMesh(mesh, material, transform); } -void RAY::Window::setIcon(const RAY::Image &img) +void RAY::Window::setIcon(RAY::Image &img) { SetWindowIcon(img.getImage()); } \ No newline at end of file diff --git a/lib/Ray/sources/Window.hpp b/lib/Ray/sources/Window.hpp index bb0b6c3c..e742084a 100644 --- a/lib/Ray/sources/Window.hpp +++ b/lib/Ray/sources/Window.hpp @@ -61,7 +61,7 @@ namespace RAY { bool cursorIsVisible(void) const; //! @brief set the window icon - void setIcon(const Image &img); + void setIcon(Image &img); //! @brief Get the cursor position Vector2 getCursorPosition() const; diff --git a/sources/main.cpp b/sources/main.cpp index 4a3e06cb..8f567072 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -30,7 +30,6 @@ int main() RAY::Drawables::Drawables3D::Grid grid(10, 5.0f); RAY::Drawables::Drawables3D::Cube cube({0}, {0}, {0}); - // Specify the amount of blocks in each direction const int numBlocks = 15;