|
@@ -78,7 +78,7 @@ public:
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void debugRender(SDL_Renderer *renderer)
|
|
|
+ void debugRender(SDL_Renderer *renderer, SDL_Rect &camera)
|
|
|
{
|
|
|
for(auto entity: this->getSystemEntities())
|
|
|
{
|
|
@@ -86,10 +86,10 @@ public:
|
|
|
auto transform = entity.getComponent<TransformComponent>();
|
|
|
|
|
|
SDL_Rect rect;
|
|
|
- rect.x = static_cast<int>(transform.position.x + collider.offset.x);
|
|
|
- rect.y = static_cast<int>(transform.position.y + collider.offset.y);
|
|
|
- rect.w = static_cast<int>(collider.width);
|
|
|
- rect.h = static_cast<int>(collider.height);
|
|
|
+ rect.x = static_cast<int>(transform.position.x + collider.offset.x - camera.x);
|
|
|
+ rect.y = static_cast<int>(transform.position.y + collider.offset.y - camera.y);
|
|
|
+ rect.w = static_cast<int>(collider.width * transform.scale.x);
|
|
|
+ rect.h = static_cast<int>(collider.height * transform.scale.y);
|
|
|
|
|
|
if (collider.isColliding)
|
|
|
{
|