From aa8e731eb93906c6c069fbf530b70ae5e8e147b3 Mon Sep 17 00:00:00 2001 From: AllyTally Date: Mon, 22 May 2023 16:26:24 -0300 Subject: [PATCH] Fix a couple issues --- desktop_version/src/Graphics.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 0707153a..dbdaf385 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -47,7 +47,8 @@ void Graphics::init(void) // Initialize backgrounds for (int i = 0; i < numstars; i++) { - stars[i] = {(int) (fRandom() * 320), (int) (fRandom() * 240), 2, 2}; + const SDL_Rect star = {(int) (fRandom() * 320), (int) (fRandom() * 240), 2, 2}; + stars[i] = star; starsspeed[i] = 4 + (fRandom() * 4); } @@ -547,7 +548,7 @@ int Graphics::fill_rect(const SDL_Rect* rect) int Graphics::fill_rect(const int x, const int y, const int w, const int h) { - SDL_Rect rect = {x, y, w, h}; + const SDL_Rect rect = {x, y, w, h}; return fill_rect(&rect); } @@ -610,7 +611,7 @@ int Graphics::draw_rect(const SDL_Rect* rect) int Graphics::draw_rect(const int x, const int y, const int w, const int h) { - SDL_Rect rect{ x, y, w, h }; + const SDL_Rect rect = {x, y, w, h}; return draw_rect(&rect); }