diff --git a/source/code/main.cpp b/source/code/main.cpp index c510bcf..4b1e00f 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp @@ -267,10 +267,8 @@ void ResetFullscreen() { } void DrawBackground(SDL_Renderer* target) { - int w = 0; - int h = 0; - SDL_GetWindowSize(sdlWindow, &w, &h); - backgroundImage.DrawScaled(target, SDL_GetTicks(), 0, 0, w, h); + SDL_GetWindowSize(sdlWindow, &xsize, &ysize); + backgroundImage.DrawScaled(target, SDL_GetTicks(), 0, 0, xsize, ysize); } //The small things that are faaling when you clear something @@ -311,11 +309,9 @@ public: if (y<1.0) { velocityY=10.0; } - int h = 0; - SDL_GetWindowSize(sdlWindow, nullptr, &h); - if ((velocityY>minVelocity) && (y>(double)(h-ballSize)) && (yminVelocity) && (y>(ysize-ballSize)) && (yh+100 || ballArray[i].getX()>w || ballArray[i].getX()<-ballSize) { + if (ballArray[i].getY()>ysize+100 || ballArray[i].getX()>xsize || ballArray[i].getX()<-ballSize) { ballUsed[i] = false; } }