15 lines
493 B
C
15 lines
493 B
C
#include "systems.h"
|
|
|
|
void renderEntities(ecs_iter_t *it) {
|
|
Position *p = ecs_field(it, Position, 1);
|
|
Size *s = ecs_field(it, Size, 2);
|
|
Rotation *r = ecs_field(it, Rotation, 3);
|
|
TextureRegion *t = ecs_field(it, TextureRegion, 4);
|
|
|
|
for (i32 i = 0; i < it->count; i++) {
|
|
Rectangle dst = {p[i].x, p[i].y, s[i].x, s[i].y};
|
|
Vector2 origin = {dst.width * 0.5f, dst.height * 0.5f};
|
|
DrawTexturePro(t[i].texture, t[i].rec, dst, origin, r[i], WHITE);
|
|
}
|
|
}
|