git repos / saland

commit 46654c2b

sago007 · 2017-08-27 11:18
46654c2bc14f42fdc29e96eb3f212c12d0a8fe03 patch · browse files
parent 365c126a4a2d6f43581c064bbededbc6962ff275

No longer treat human too special

Changed files

M src/saland/Game.cpp before
diff --git a/src/saland/Game.cpp b/src/saland/Game.cpp index ca43105..b9488c6 100644 --- a/src/saland/Game.cpp +++ b/src/saland/Game.cpp
@@ -105,6 +105,7 @@ Game::Game() {
barrel.get()->X = 100.0f;
barrel.get()->Y = 100.0f;
data->placeables.push_back(barrel);
+ data->placeables.push_back(data->human);
b2BodyDef myBodyDef;
@@ -199,12 +200,15 @@ void Game::Draw(SDL_Renderer* target) {
mousebox_x+32, mousebox_y+32, 255, 255, 0, 255);
//Draw human
- DrawHumanEntity(target, globalData.spriteHolder.get(), data->human.get(), SDL_GetTicks(), data->topx, data->topy, false);
for (const auto& p : data->placeables) {
MiscItem* m = dynamic_cast<MiscItem*>(p.get());
if (m) {
DrawMiscEntity(target, globalData.spriteHolder.get(), m, SDL_GetTicks(), data->topx, data->topy, false);
}
+ Human* h = dynamic_cast<Human*>(p.get());
+ if (h) {
+ DrawHumanEntity(target, globalData.spriteHolder.get(), h, SDL_GetTicks(), data->topx, data->topy, false);
+ }
}
}