X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FFrame.cpp;h=14856071662a8ba80494c6b536c4b1cc71e9fbf8;hb=4bc4ae3e73ea6c7cc43464470204801e7721a2e8;hp=a152ee76c8efa152825dc514938e100df97c3736;hpb=8e0746ace8c76025faad3259a819d57610407bb8;p=l2e.git diff --git a/src/graphics/Frame.cpp b/src/graphics/Frame.cpp index a152ee7..1485607 100644 --- a/src/graphics/Frame.cpp +++ b/src/graphics/Frame.cpp @@ -13,6 +13,15 @@ namespace graphics { // TODO: maybe create a cache for frames? void Frame::Draw(SDL_Surface *dest, const Vector &position, int width, int height) const { + if (!surface) { + SDL_Rect rect; + rect.x = position.X(); + rect.y = position.Y(); + rect.w = width; + rect.h = height; + SDL_FillRect(dest, &rect, SDL_MapRGB(dest->format, 0xFF, 0x00, 0x00)); + return; + } // top-left corner SDL_Rect srcRect; srcRect.x = offset.X();