Skip to content

Commit

Permalink
misc: fixed building alignment issues
Browse files Browse the repository at this point in the history
  • Loading branch information
inakoll committed Nov 9, 2014
1 parent 122281f commit 382ca0c
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions cpp/terrain/terrain_object.cpp
Expand Up @@ -187,19 +187,16 @@ bool TerrainObject::fits(Terrain *terrain, coord::tile pos) {

void TerrainObject::set_position(coord::tile pos) {

this->start_pos = pos;
this->start_pos = pos;
this->end_pos = this->start_pos + this->size;

this->end_pos = this->start_pos;
this->end_pos.ne += this->size.ne;
this->end_pos.se += this->size.se;
// TODO temporary hacky solution until openage::coord has been properly fixed.
coord::phys2 draw_pos = this->start_pos.to_phys2();

coord::tile drawpos_tile = this->start_pos;

drawpos_tile.ne += this->size.ne / 2;
drawpos_tile.se += this->size.se / 2;

this->draw_pos = drawpos_tile.to_phys2().to_phys3();
draw_pos.ne += ((this->size.ne - 1) * coord::settings::phys_per_tile) / 2;
draw_pos.se += ((this->size.se - 1) * coord::settings::phys_per_tile) / 2;

this->draw_pos = draw_pos.to_phys3();
}


Expand Down

0 comments on commit 382ca0c

Please sign in to comment.