From: Ryan Flegel Date: Mon, 14 Jun 2004 22:13:50 +0000 (+0000) Subject: - fixed gradient crash bug X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c2a0343d166e426a6a24c97ce608dc5ac7f217de;p=supertux.git - fixed gradient crash bug SVN-Revision: 1489 --- diff --git a/src/screen/texture.cpp b/src/screen/texture.cpp index addc0e006..a4767f56d 100644 --- a/src/screen/texture.cpp +++ b/src/screen/texture.cpp @@ -170,9 +170,12 @@ Surface::Surface(const std::string& file, int x, int y, int w, int h, int use_al surfaces.push_back(this); } -Surface::Surface(Color top_background, Color bottom_background, int w, int h) - : data(top_background, bottom_background, w, h), w(0), h(0) +Surface::Surface(Color top_background, Color bottom_background, int w_, int h_) + : data(top_background, bottom_background, 0, 0), w(0), h(0) { + // FIXME: Gradient surfaces currently don't accept width/height + // If nonzero values are passed to data.create(), supertux + // crashes. impl = data.create(); if (impl) { diff --git a/src/screen/texture.h b/src/screen/texture.h index 6fe26e332..79899d94d 100644 --- a/src/screen/texture.h +++ b/src/screen/texture.h @@ -97,7 +97,7 @@ public: Surface(SDL_Surface* surf, int use_alpha); Surface(const std::string& file, int use_alpha); Surface(const std::string& file, int x, int y, int w, int h, int use_alpha); - Surface(Color top_gradient, Color bottom_gradient, int w, int h); + Surface(Color top_gradient, Color bottom_gradient, int w_, int h_); ~Surface(); /** Reload the surface, which is necesarry in case of a mode swich */