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

@@ -26,8 +26,8 @@ void Body::collide(WorldPlane &plane) {
}

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

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

@@ -34,7 +34,7 @@ void Chunk::draw(Win &win) {
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_);
}


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

@@ -56,11 +56,10 @@ Tile &WorldPlane::getTile(int x, int y) {
}

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

void WorldPlane::update(float dt) {

Loading…
Cancel
Save