Browse Source

bug fixes

opengl-renderer-broken
Martin Dørum 4 years ago
parent
commit
1a8bb73ec8
3 changed files with 3 additions and 4 deletions
  1. 1
    1
      libswan/src/Body.cc
  2. 1
    1
      libswan/src/Chunk.cc
  3. 1
    2
      libswan/src/WorldPlane.cc

+ 1
- 1
libswan/src/Body.cc View File

} }


void Body::outline(Win &win) { void Body::outline(Win &win) {
win.setPos(pos_ * TILE_SIZE);
sf::RectangleShape rect(size_ * TILE_SIZE); sf::RectangleShape rect(size_ * TILE_SIZE);
rect.setPosition(pos_ * TILE_SIZE);
rect.setFillColor(sf::Color::Transparent); rect.setFillColor(sf::Color::Transparent);
rect.setOutlineColor(sf::Color(128, 128, 128)); rect.setOutlineColor(sf::Color(128, 128, 128));
rect.setOutlineThickness(2); rect.setOutlineThickness(2);

+ 1
- 1
libswan/src/Chunk.cc View File

dirty_ = false; dirty_ = false;
} }


win.setPos(Vec2(pos_.x_ * CHUNK_WIDTH, pos_.y_ * CHUNK_HEIGHT));
win.setPos(Vec2(pos_.x_ * CHUNK_WIDTH * TILE_SIZE, pos_.y_ * CHUNK_HEIGHT * TILE_SIZE));
win.draw(sprite_); win.draw(sprite_);
} }



+ 1
- 2
libswan/src/WorldPlane.cc View File

} }


void WorldPlane::draw(Win &win) { void WorldPlane::draw(Win &win) {
for (auto &p: chunks_) {
for (auto &p: chunks_)
p.second.draw(win); p.second.draw(win);
for (auto &ent: entities_) for (auto &ent: entities_)
ent->draw(win); ent->draw(win);
}
} }


void WorldPlane::update(float dt) { void WorldPlane::update(float dt) {

Loading…
Cancel
Save