Skip to content

Commit

Permalink
Fixed code that broke due to changes to Rectf and Sizef
Browse files Browse the repository at this point in the history
  • Loading branch information
Grumbel committed Aug 16, 2014
1 parent 42b9e6d commit f2ffe3e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/object/bicycle_platform.cpp
Expand Up @@ -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) {
Expand All @@ -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<float>(-128*M_PI*elapsed_time)), static_cast<float>(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;
Expand Down
2 changes: 1 addition & 1 deletion src/object/bonus_block.cpp
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/object/moving_sprite.cpp
Expand Up @@ -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
Expand Down

0 comments on commit f2ffe3e

Please sign in to comment.