From 9998fb8e715112bf2ecd981a9df5fbabb6fd3676 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Tue, 18 Jul 2006 21:27:45 +0000 Subject: [PATCH] Fun stuff SVN-Revision: 4048 --- data/levels/test/risinglava.stl | 47 ++++++++++++++++++++++++++++ src/flip_level_transformer.cpp | 2 +- src/object/camera.cpp | 6 ++-- src/object/player.cpp | 2 +- src/object/tilemap.cpp | 38 +++++++++++------------ src/object/tilemap.hpp | 14 +++++++++ src/scripting/functions.cpp | 2 +- src/sector.cpp | 68 +++++++++++++++++++++-------------------- src/sector.hpp | 8 ++--- src/title.cpp | 2 +- 10 files changed, 126 insertions(+), 63 deletions(-) create mode 100644 data/levels/test/risinglava.stl diff --git a/data/levels/test/risinglava.stl b/data/levels/test/risinglava.stl new file mode 100644 index 000000000..dcd3a12fc --- /dev/null +++ b/data/levels/test/risinglava.stl @@ -0,0 +1,47 @@ +(supertux-level + (version 2) + (name (_ "Rising Lava Test")) + (author "Christoph Sommer") + (sector + (name "main") + (music "music/bossattack.ogg") + (background + (y -200) + (speed 0.5) + (image "images/background/arctis_dark.jpg") + ) + (tilemap + (z-pos -100) + (solid #f) + (speed 1) + (width 30) + (height 64) + (tiles 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) + ) + (tilemap + (z-pos 0) + (solid #t) + (speed 1) + (width 30) + (height 64) + (tiles 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 44 44 0 0 44 0 44 0 44 44 44 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 44 0 44 0 44 0 44 0 44 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 44 44 0 0 0 44 0 0 44 44 44 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 44 0 44 0 0 44 0 0 44 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 44 44 0 0 0 44 0 0 44 44 44 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 313 314 0 0 0 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 1708 315 316 1708 1708 1708 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1705 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1705 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1705 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1705 1700 1700 1700 1700 1700 1700 1700 1700 1700 1705 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1705 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1705 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1705 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1705 1700 1700 1700 1700 1700 1700 1700 1705 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1705 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1705 1700 1700 1700 1700 1700 1700 1700 1705 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1705 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700 1700) + ) + (camera + (mode "normal") + ) + (spawnpoint + (name "main") + (x 64) + (y 608) + ) + ) +) diff --git a/src/flip_level_transformer.cpp b/src/flip_level_transformer.cpp index 12a75639c..0baa38863 100644 --- a/src/flip_level_transformer.cpp +++ b/src/flip_level_transformer.cpp @@ -30,7 +30,7 @@ void FlipLevelTransformer::transform_sector(Sector* sector) { - float height = sector->get_height() * 32; + float height = sector->get_height(); for(Sector::GameObjects::iterator i = sector->gameobjects.begin(); i != sector->gameobjects.end(); ++i) { diff --git a/src/object/camera.cpp b/src/object/camera.cpp index 023a26281..7f836b57a 100644 --- a/src/object/camera.cpp +++ b/src/object/camera.cpp @@ -171,8 +171,8 @@ Camera::update(float elapsed_time) void Camera::keep_in_bounds(Vector& translation) { - float width = sector->get_width() * 32; - float height = sector->get_height() * 32; + float width = sector->get_width(); + float height = sector->get_height(); // don't scroll before the start or after the level's end if(translation.y > height - SCREEN_HEIGHT) @@ -207,7 +207,7 @@ Camera::update_scroll_normal(float elapsed_time) /****** Vertical Scrolling part ******/ bool do_y_scrolling = true; - if(player->is_dying() || sector->get_height() == 19) + if(player->is_dying() || sector->get_height() == 19*32) do_y_scrolling = false; if(do_y_scrolling) { diff --git a/src/object/player.cpp b/src/object/player.cpp index d0ee80674..093e12e41 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -1086,7 +1086,7 @@ Player::check_bounds(Camera* camera) } /* Keep in-bounds, vertically: */ - if (get_pos().y > Sector::current()->get_height() * 32) { + if (get_pos().y > Sector::current()->get_height()) { kill(true); return; } diff --git a/src/object/tilemap.cpp b/src/object/tilemap.cpp index c574befbb..d9712820e 100644 --- a/src/object/tilemap.cpp +++ b/src/object/tilemap.cpp @@ -38,7 +38,7 @@ #include "log.hpp" TileMap::TileMap() - : solid(false), speed(1), width(0), height(0), z_pos(0), + : solid(false), speed(1), width(0), height(0), z_pos(0), x_offset(0), y_offset(0), drawing_effect(NO_EFFECT) { tilemanager = tile_manager; @@ -48,7 +48,7 @@ TileMap::TileMap() } TileMap::TileMap(const lisp::Lisp& reader, TileManager* new_tile_manager) - : solid(false), speed(1), width(-1), height(-1), z_pos(0), + : solid(false), speed(1), width(-1), height(-1), z_pos(0), x_offset(0), y_offset(0), drawing_effect(NO_EFFECT) { tilemanager = new_tile_manager; @@ -86,7 +86,7 @@ TileMap::TileMap(const lisp::Lisp& reader, TileManager* new_tile_manager) TileMap::TileMap(std::string name, int z_pos, bool solid, size_t width, size_t height) : name(name), solid(solid), speed(1), width(0), height(0), z_pos(z_pos), - drawing_effect(NO_EFFECT) + x_offset(0), y_offset(0), drawing_effect(NO_EFFECT) { tilemanager = tile_manager; @@ -119,6 +119,12 @@ TileMap::write(lisp::Writer& writer) void TileMap::update(float ) { + // FIXME: testing only + static int step = 0; + if (step++ > 10) { + step = 0; + if (name == "risinglava") set_y_offset(get_y_offset() - 1); + } } void @@ -126,31 +132,25 @@ TileMap::draw(DrawingContext& context) { context.push_transform(); - if(drawing_effect != 0) - context.set_drawing_effect(drawing_effect); + if(drawing_effect != 0) context.set_drawing_effect(drawing_effect); float trans_x = roundf(context.get_translation().x); float trans_y = roundf(context.get_translation().y); context.set_translation(Vector(trans_x * speed, trans_y * speed)); /** if we don't round here, we'll have a 1 pixel gap on screen sometimes. * I have no idea why */ - float start_x = roundf(context.get_translation().x); - if(start_x < 0) - start_x = 0; - float start_y = roundf(context.get_translation().y); - if(start_y < 0) - start_y = 0; - float end_x = std::min(start_x + SCREEN_WIDTH, float(width * 32)); - float end_y = std::min(start_y + SCREEN_HEIGHT, float(height * 32)); - start_x -= int(start_x) % 32; - start_y -= int(start_y) % 32; - int tsx = int(start_x / 32); // tilestartindex x - int tsy = int(start_y / 32); // tilestartindex y + float start_x = ((int)((roundf(context.get_translation().x) - x_offset) / 32)) * 32 + x_offset; + float start_y = ((int)((roundf(context.get_translation().y) - y_offset) / 32)) * 32 + y_offset; + float end_x = std::min(start_x + SCREEN_WIDTH + 32, float(width * 32 + x_offset)); + float end_y = std::min(start_y + SCREEN_HEIGHT + 32, float(height * 32 + y_offset)); + int tsx = int((start_x - x_offset) / 32); // tilestartindex x + int tsy = int((start_y - y_offset) / 32); // tilestartindex y Vector pos; int tx, ty; for(pos.x = start_x, tx = tsx; pos.x < end_x; pos.x += 32, ++tx) { for(pos.y = start_y, ty = tsy; pos.y < end_y; pos.y += 32, ++ty) { + if ((tx < 0) || (ty < 0)) continue; const Tile* tile = tilemanager->get(tiles[ty*width + tx]); assert(tile != 0); tile->draw(context, pos, z_pos); @@ -229,7 +229,7 @@ TileMap::get_tile(int x, int y) const const Tile* TileMap::get_tile_at(const Vector& pos) const { - return get_tile(int(pos.x)/32, int(pos.y)/32); + return get_tile(int(pos.x - x_offset)/32, int(pos.y - y_offset)/32); } void @@ -242,7 +242,7 @@ TileMap::change(int x, int y, uint32_t newtile) void TileMap::change_at(const Vector& pos, uint32_t newtile) { - change(int(pos.x)/32, int(pos.y)/32, newtile); + change(int(pos.x - x_offset)/32, int(pos.y - y_offset)/32, newtile); } void diff --git a/src/object/tilemap.hpp b/src/object/tilemap.hpp index deb1dbb26..981749309 100644 --- a/src/object/tilemap.hpp +++ b/src/object/tilemap.hpp @@ -66,6 +66,18 @@ public: size_t get_height() const { return height; } + + float get_x_offset() const + { return x_offset; } + + float get_y_offset() const + { return y_offset; } + + void set_x_offset(float x_offset) + { this->x_offset = x_offset; } + + void set_y_offset(float y_offset) + { this->y_offset = y_offset; } int get_layer() const { return z_pos; } @@ -111,6 +123,8 @@ private: float speed; int width, height; int z_pos; + float x_offset; + float y_offset; DrawingEffect drawing_effect; }; diff --git a/src/scripting/functions.cpp b/src/scripting/functions.cpp index ff0687fe0..5dd10ed71 100644 --- a/src/scripting/functions.cpp +++ b/src/scripting/functions.cpp @@ -250,7 +250,7 @@ void gotoend() if (!validate_sector_player()) return; ::Player* tux = Sector::current()->player; tux->move(Vector( - (Sector::current()->get_width()*32) - (SCREEN_WIDTH*2), 0)); + (Sector::current()->get_width()) - (SCREEN_WIDTH*2), 0)); Sector::current()->camera->reset( Vector(tux->get_pos().x, tux->get_pos().y)); } diff --git a/src/sector.cpp b/src/sector.cpp index 5432d9813..5d98d0c56 100644 --- a/src/sector.cpp +++ b/src/sector.cpp @@ -347,7 +347,7 @@ Sector::fix_old_tiles() for(size_t x=0; x < solids->get_width(); ++x) { for(size_t y=0; y < solids->get_height(); ++y) { const Tile* tile = solids->get_tile(x, y); - Vector pos(x*32, y*32); + Vector pos(solids->get_x_offset() + x*32, solids->get_y_offset() + y*32); if(tile->getID() == 112) { add_object(new InvisibleBlock(pos)); @@ -813,15 +813,15 @@ Sector::collision_tilemap(collision::Constraints* constraints, float y1 = dest.get_top(); float y2 = dest.get_bottom(); - // test with all tiles in this rectangle - int starttilex = int(x1) / 32; - int starttiley = int(y1) / 32; - int max_x = int(x2); - int max_y = int(y2+1); - - for(std::list::const_iterator i = solid_tilemaps.begin(); i != solid_tilemaps.end(); i++) { TileMap* solids = *i; + + // test with all tiles in this rectangle + int starttilex = int(x1 - solids->get_x_offset()) / 32; + int starttiley = int(y1 - solids->get_y_offset()) / 32; + int max_x = int(x2 - solids->get_x_offset()); + int max_y = int(y2+1 - solids->get_y_offset()); + for(int x = starttilex; x*32 < max_x; ++x) { for(int y = starttiley; y*32 < max_y; ++y) { const Tile* tile = solids->get_tile(x, y); @@ -839,13 +839,13 @@ Sector::collision_tilemap(collision::Constraints* constraints, if(tile->getAttributes() & Tile::SLOPE) { // slope tile AATriangle triangle; - Vector p1(x*32, y*32); - Vector p2((x+1)*32, (y+1)*32); + Vector p1(x*32 + solids->get_x_offset(), y*32 + solids->get_y_offset()); + Vector p2((x+1)*32 + solids->get_x_offset(), (y+1)*32 + solids->get_y_offset()); triangle = AATriangle(p1, p2, tile->getData()); collision::rectangle_aatriangle(constraints, dest, triangle); } else { // normal rectangular tile - Rect rect(x*32, y*32, (x+1)*32, (y+1)*32); + Rect rect(x*32 + solids->get_x_offset(), y*32 + solids->get_y_offset(), (x+1)*32 + solids->get_x_offset(), (y+1)*32 + solids->get_y_offset()); check_collisions(constraints, movement, dest, rect); } } @@ -861,15 +861,16 @@ Sector::collision_tile_attributes(const Rect& dest) const float x2 = dest.p2.x; float y2 = dest.p2.y; - // test with all tiles in this rectangle - int starttilex = int(x1) / 32; - int starttiley = int(y1) / 32; - int max_x = int(x2); - int max_y = int(y2); - uint32_t result = 0; for(std::list::const_iterator i = solid_tilemaps.begin(); i != solid_tilemaps.end(); i++) { TileMap* solids = *i; + + // test with all tiles in this rectangle + int starttilex = int(x1 - solids->get_x_offset()) / 32; + int starttiley = int(y1 - solids->get_y_offset()) / 32; + int max_x = int(x2 - solids->get_x_offset()); + int max_y = int(y2+1 - solids->get_y_offset()); + for(int x = starttilex; x*32 < max_x; ++x) { for(int y = starttiley; y*32 < max_y; ++y) { const Tile* tile = solids->get_tile(x, y); @@ -1161,22 +1162,23 @@ Sector::is_free_space(const Rect& rect) const { using namespace collision; - // test with all tiles in this rectangle - int starttilex = int(rect.p1.x) / 32; - int starttiley = int(rect.p1.y) / 32; - int max_x = int(rect.p2.x); - int max_y = int(rect.p2.y); - for(std::list::const_iterator i = solid_tilemaps.begin(); i != solid_tilemaps.end(); i++) { TileMap* solids = *i; + + // test with all tiles in this rectangle + int starttilex = int(rect.p1.x - solids->get_x_offset()) / 32; + int starttiley = int(rect.p1.y - solids->get_y_offset()) / 32; + int max_x = int(rect.p2.x - solids->get_x_offset()); + int max_y = int(rect.p2.y - solids->get_y_offset()); + for(int x = starttilex; x*32 <= max_x; ++x) { for(int y = starttiley; y*32 <= max_y; ++y) { const Tile* tile = solids->get_tile(x, y); if(!tile) continue; if(tile->getAttributes() & Tile::SLOPE) { AATriangle triangle; - Vector p1(x*32, y*32); - Vector p2((x+1)*32, (y+1)*32); + Vector p1(x*32 + solids->get_x_offset(), y*32 + solids->get_y_offset()); + Vector p2((x+1)*32 + solids->get_x_offset(), (y+1)*32 + solids->get_y_offset()); triangle = AATriangle(p1, p2, tile->getData()); Constraints constraints; return collision::rectangle_aatriangle(&constraints, rect, triangle); @@ -1268,31 +1270,31 @@ Sector::inside(const Rect& rect) const { for(std::list::const_iterator i = solid_tilemaps.begin(); i != solid_tilemaps.end(); i++) { TileMap* solids = *i; - bool horizontally = ((rect.p2.x >= 0) && (rect.p1.x <= solids->get_width() * 32)); - bool vertically = (rect.p1.y <= solids->get_height() * 32); + bool horizontally = ((rect.p2.x >= 0 + solids->get_x_offset()) && (rect.p1.x <= solids->get_width() * 32 + solids->get_x_offset())); + bool vertically = (rect.p1.y <= solids->get_height() * 32 + solids->get_y_offset()); if (horizontally && vertically) return true; } return false; } -size_t +float Sector::get_width() const { - size_t width = 0; + float width = 0; for(std::list::const_iterator i = solid_tilemaps.begin(); i != solid_tilemaps.end(); i++) { TileMap* solids = *i; - if (solids->get_width() > width) width = solids->get_width(); + if ((solids->get_width() * 32 + solids->get_x_offset()) > width) width = (solids->get_width() * 32 + solids->get_x_offset()); } return width; } -size_t +float Sector::get_height() const { - size_t height = 0; + float height = 0; for(std::list::const_iterator i = solid_tilemaps.begin(); i != solid_tilemaps.end(); i++) { TileMap* solids = *i; - if (solids->get_height() > height) height = solids->get_height(); + if ((solids->get_height() * 32 + solids->get_y_offset()) > height) height = (solids->get_height() * 32 + solids->get_y_offset()); } return height; } diff --git a/src/sector.hpp b/src/sector.hpp index b08552dfb..00b4ff640 100644 --- a/src/sector.hpp +++ b/src/sector.hpp @@ -147,14 +147,14 @@ public: Rect get_active_region(); /** - * returns the width (in tiles) of a sector) + * returns the width (in px) of a sector) */ - size_t get_width() const; + float get_width() const; /** - * returns the height (in tiles) of a sector) + * returns the height (in px) of a sector) */ - size_t get_height() const; + float get_height() const; /** * globally changes solid tilemaps' tile ids diff --git a/src/title.cpp b/src/title.cpp index 019837c6e..395836a90 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -254,7 +254,7 @@ TitleScreen::make_tux_jump() last_tux_y_pos = tux->get_pos().y; // Wrap around at the end of the level back to the beginnig - if(sector->get_width() * 32 - 320 < tux->get_pos().x) { + if(sector->get_width() - 320 < tux->get_pos().x) { sector->activate("main"); sector->camera->reset(tux->get_pos()); } -- 2.11.0