Render polygon BEFORE collisions
This commit is contained in:
parent
bf0d08ae16
commit
94aed4cd02
@ -665,13 +665,13 @@ public:
|
||||
virtual void render() {
|
||||
if(texture != NULL && !getHidden())
|
||||
SDL_RenderCopy(renderer->getRendererPtr(), texture->getTexturePtr(), NULL, &rect);
|
||||
if(polygon) {
|
||||
polygon->render(*renderer);
|
||||
}
|
||||
if(hasCollisions() && renderer->getRenderColiders() && !getHidden()) {
|
||||
for(const auto &col : getCollisions())
|
||||
col->render(*renderer, colider_color);
|
||||
}
|
||||
if(polygon) {
|
||||
polygon->render(*renderer);
|
||||
}
|
||||
}
|
||||
virtual void move(int ticks) {
|
||||
if(permanent)
|
||||
@ -692,7 +692,7 @@ public:
|
||||
if(polygon)
|
||||
polygon->updateCollision(collisionPushX(), collisionPushY(), collisionWidth(), collisionHeight());
|
||||
}
|
||||
virtual void custom_move(int ticks) {}
|
||||
virtual void custom_move(int /*UNUSED*/) {}
|
||||
virtual std::pair<std::pair<double,double>,std::pair<double,double>> getDoubleRect() {
|
||||
return {{x_,y_}, {w_,h_}};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user