Abstract add entity and animation into functions

This commit is contained in:
2016-07-08 17:44:41 +10:00
parent c9fc34aee1
commit fa7947fb90
3 changed files with 94 additions and 66 deletions
+2 -1
View File
@@ -83,10 +83,11 @@ void renderer_debugString(Renderer *const renderer, Font *const font,
void renderer_entity(Renderer *renderer, Entity *entity, f32 dt, f32 rotate,
v3 color)
{
// TODO(doyle): Batch into render groups
if ((entity->pos.x < renderer->size.w && entity->pos.x >= 0) &&
(entity->pos.y < renderer->size.h && entity->pos.y >= 0))
{
SpriteAnim *anim = &entity->anim[entity->currAnimIndex];
EntityAnim *anim = &entity->anim[entity->currAnimIndex];
v4 texRect = anim->rect[anim->currRectIndex];
anim->currDuration -= dt;