diff --git a/src/graphics.cpp b/src/graphics.cpp index 62870aa..be71e48 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -153,7 +153,7 @@ void addBuffer(int x, int y, int w, int h) void blit(SDL_Surface *image, int x, int y, SDL_Surface *dest) { // Exit early if image is not on dest at all - if(x + image->w < 0 || x >= dest->w || y + image->h < 0 || y >= dest->h) + if (x + image->w < 0 || x >= dest->w || y + image->h < 0 || y >= dest->h) return; // Set up a rectangle to draw to @@ -165,14 +165,14 @@ void blit(SDL_Surface *image, int x, int y, SDL_Surface *dest) blitRect.h = image->h; /* Blit onto the destination surface */ - if(SDL_BlitSurface(image, NULL, dest, &blitRect) < 0) + if (SDL_BlitSurface(image, NULL, dest, &blitRect) < 0) { printf("BlitSurface error: %s\n", SDL_GetError()); showErrorAndExit(2, ""); } // Only ff it is to the screen, mark the region as damaged - if(dest == screen) + if (dest == screen) addBuffer(blitRect.x, blitRect.y, blitRect.w, blitRect.h); }