X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fbackground.cpp;h=a3537632740069f67affdc4f7630075eb7326723;hb=954adaf2af9284945185e58d8017041ea1ff4868;hp=b03b05f94ffd5d717add385e991dc6ad75c3183f;hpb=84f81d92cda441c4bdca54b9a45a6a5f0226f59c;p=supertux.git diff --git a/src/object/background.cpp b/src/object/background.cpp index b03b05f94..a35376327 100644 --- a/src/object/background.cpp +++ b/src/object/background.cpp @@ -16,16 +16,16 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - #include #include "background.h" -#include "app/globals.h" #include "camera.h" #include "video/drawing_context.h" #include "lisp/lisp.h" #include "lisp/writer.h" #include "object_factory.h" +#include "resources.h" +#include "main.h" Background::Background() : type(INVALID), layer(LAYER_BACKGROUND0), image(0) @@ -80,7 +80,7 @@ Background::write(lisp::Writer& writer) } void -Background::action(float) +Background::update(float) { } @@ -103,7 +103,7 @@ Background::set_gradient(Color top, Color bottom) gradient_bottom = bottom; delete image; - image = new Surface(top, bottom, screen->w, screen->h); + image = new Surface(top, bottom, SCREEN_WIDTH, SCREEN_HEIGHT); } void @@ -122,8 +122,8 @@ Background::draw(DrawingContext& context) int sy = int(-context.get_translation().y * speed) % image->h - image->h; context.push_transform(); context.set_translation(Vector(0, 0)); - for(int x = sx; x < screen->w; x += image->w) - for(int y = sy; y < screen->h; y += image->h) + for(int x = sx; x < SCREEN_WIDTH; x += image->w) + for(int y = sy; y < SCREEN_HEIGHT; y += image->h) context.draw_surface(image, Vector(x, y), layer); context.pop_transform(); }