#include "asset.h" #include "components.h" #include "render.h" #include "world.h" void sprite_system(const World* world) { int i; unsigned bits; const CSprite* sprite; const CPosition* pos; const Bitmap* b; for (i = 0; i < world->entity_count; i++) { bits = world->bitmask[i]; if ((bits & ctype_position) && (bits & ctype_sprite)) { pos = &world->positions[i]; sprite = &world->sprites[i]; b = get_bitmap(sprite->id); render_bitmap(b, pos->x, pos->y, &sprite->rect); } } }