This commit is contained in:
Ciro Santilli 2016-12-09 16:27:13 +00:00
parent 4a7396b0d0
commit 05fdfba06a
2 changed files with 20 additions and 8 deletions

2
sdl/configure vendored
View File

@ -1,3 +1,3 @@
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get install -y libsdl2-dev
sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev

View File

@ -203,6 +203,7 @@ World::World(
createSolidTexture(COLOR_MAX, 0, 0, 0);
createSolidTexture(0, COLOR_MAX, 0, 0);
createSolidTexture(0, 0, COLOR_MAX, 0);
createSolidTexture(COLOR_MAX, 0, COLOR_MAX, 0);
}
this->initPhysics();
}
@ -261,13 +262,24 @@ void World::initPhysics() {
}
}
}
auto object = std::unique_ptr<Object>(new HumanPlayerObject(this->getWidth() / 2, this->getHeight() / 2));
if (display) {
drawableObjects.push_back(std::unique_ptr<DrawableObject>(
new SingleTextureDrawableObject(object.get(), this->textures[2])
));
}
this->addObject(std::move(object));
{
auto object = std::unique_ptr<Object>(new HumanPlayerObject(this->getWidth() / 2, this->getHeight() / 2));
if (display) {
drawableObjects.push_back(std::unique_ptr<DrawableObject>(
new SingleTextureDrawableObject(object.get(), this->textures[2])
));
}
this->addObject(std::move(object));
}
{
//auto object = std::unique_ptr<Object>(new HumanPlayerObject(this->getWidth() / 2, this->getHeight() / 2 + 1));
//if (display) {
//drawableObjects.push_back(std::unique_ptr<DrawableObject>(
//new SingleTextureDrawableObject(object.get(), this->textures[3])
//));
//}
//this->addObject(std::move(object));
}
}
void World::resetPhysics() {