From: Matthias Braun Date: Sun, 3 Apr 2005 16:54:00 +0000 (+0000) Subject: make gradient parsing a bit more robust X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=84f81d92cda441c4bdca54b9a45a6a5f0226f59c;p=supertux.git make gradient parsing a bit more robust SVN-Revision: 2318 --- diff --git a/src/object/background.cpp b/src/object/background.cpp index 50b01d09a..b03b05f94 100644 --- a/src/object/background.cpp +++ b/src/object/background.cpp @@ -39,12 +39,12 @@ Background::Background(const lisp::Lisp& reader) if(reader.get("image", imagefile) && reader.get("speed", speed)) { set_image(imagefile, speed); + } else { + std::vector bkgd_top_color, bkgd_bottom_color; + if(reader.get_vector("top_color", bkgd_top_color) && + reader.get_vector("bottom_color", bkgd_bottom_color)) + set_gradient(Color(bkgd_top_color), Color(bkgd_bottom_color)); } - - std::vector bkgd_top_color, bkgd_bottom_color; - if(reader.get_vector("top_color", bkgd_top_color) && - reader.get_vector("bottom_color", bkgd_bottom_color)) - set_gradient(Color(bkgd_top_color), Color(bkgd_bottom_color)); } Background::~Background()