X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgraphics%2FSprite.cpp;fp=src%2Fgraphics%2FSprite.cpp;h=5b974bd3817ed3ed97b89c1879fc0595ec80b78f;hb=4083783e857cd6f039af2faaef43a30788948a6b;hp=afd6209546c3a6bdcb8f359f43e89dd8c75ec8c5;hpb=bfcf2f4de43077249b82af03a0e1b8281b8490e3;p=l2e.git diff --git a/src/graphics/Sprite.cpp b/src/graphics/Sprite.cpp index afd6209..5b974bd 100644 --- a/src/graphics/Sprite.cpp +++ b/src/graphics/Sprite.cpp @@ -21,7 +21,19 @@ void Sprite::Draw(SDL_Surface *dest, Point position, int col, int row) cons destRect.y = position.Y(); destRect.w = Width(); destRect.h = Height(); - SDL_BlitSurface(surface, &srcRect, dest, &destRect); + if (surface) { + SDL_BlitSurface(surface, &srcRect, dest, &destRect); + } else { + bool red(true); + while (destRect.w > 1 && destRect.h > 1) { + SDL_FillRect(dest, &destRect, SDL_MapRGB(dest->format, red ? 0xFF : 0, 0, 0)); + ++destRect.x; + ++destRect.y; + destRect.w -= 2; + destRect.h -= 2; + red = !red; + } + } } }