]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/Frame.cpp
made Frame default constructible
[l2e.git] / src / graphics / Frame.cpp
index a152ee76c8efa152825dc514938e100df97c3736..14856071662a8ba80494c6b536c4b1cc71e9fbf8 100644 (file)
@@ -13,6 +13,15 @@ namespace graphics {
 
 // TODO: maybe create a cache for frames?
 void Frame::Draw(SDL_Surface *dest, const Vector<int> &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();