From: Ingo Ruhnke Date: Sat, 16 Aug 2014 19:52:34 +0000 (+0200) Subject: Fixed code that broke due to changes to Rectf and Sizef X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f2ffe3ee4a4955232ac311c661f98e11d2daa155;p=supertux.git Fixed code that broke due to changes to Rectf and Sizef --- diff --git a/src/object/bicycle_platform.cpp b/src/object/bicycle_platform.cpp index 76388e21f..5c0927b07 100644 --- a/src/object/bicycle_platform.cpp +++ b/src/object/bicycle_platform.cpp @@ -102,7 +102,7 @@ BicyclePlatform::update(float elapsed_time) angle = master->angle + M_PI; while (angle < 0) { angle += 2*M_PI; } while (angle > 2*M_PI) { angle -= 2*M_PI; } - Vector dest = center + Vector(cosf(angle), sinf(angle)) * radius - (bbox.get_size() * 0.5); + Vector dest = center + Vector(cosf(angle), sinf(angle)) * radius - (bbox.get_size().as_vector() * 0.5); movement = dest - get_pos(); } if (this == master) { @@ -118,7 +118,7 @@ BicyclePlatform::update(float elapsed_time) while (angle < 0) { angle += 2*M_PI; } while (angle > 2*M_PI) { angle -= 2*M_PI; } angular_speed = std::min(std::max(angular_speed, static_cast(-128*M_PI*elapsed_time)), static_cast(128*M_PI*elapsed_time)); - Vector dest = center + Vector(cosf(angle), sinf(angle)) * radius - (bbox.get_size() * 0.5); + Vector dest = center + Vector(cosf(angle), sinf(angle)) * radius - (bbox.get_size().as_vector() * 0.5); movement = dest - get_pos(); center += Vector(angular_speed, 0) * elapsed_time * 32; diff --git a/src/object/bonus_block.cpp b/src/object/bonus_block.cpp index 2b03e5c5e..e93ddbd4f 100644 --- a/src/object/bonus_block.cpp +++ b/src/object/bonus_block.cpp @@ -474,7 +474,7 @@ BonusBlock::draw(DrawingContext& context){ Block::draw(context); // then Draw the light if on. if(sprite->get_action() == "on") { - Vector pos = get_pos() + (bbox.get_size() - lightsprite->get_size()) / 2; + Vector pos = get_pos() + (Vector(bbox.get_size().as_vector()) - lightsprite->get_size()) / 2; context.push_target(); context.set_target(DrawingContext::LIGHTMAP); context.draw_surface(lightsprite, pos, 10); diff --git a/src/object/moving_sprite.cpp b/src/object/moving_sprite.cpp index a512d9a0a..6f354898c 100644 --- a/src/object/moving_sprite.cpp +++ b/src/object/moving_sprite.cpp @@ -124,10 +124,10 @@ MovingSprite::set_action(const std::string& action, int loops) void MovingSprite::set_action_centered(const std::string& action, int loops) { - Vector old_size = bbox.get_size(); + Vector old_size = bbox.get_size().as_vector(); sprite->set_action(action, loops); set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); - set_pos(get_pos() - (bbox.get_size() - old_size) / 2); + set_pos(get_pos() - (Vector(bbox.get_size().as_vector()) - old_size) / 2); } void