Switch entity anims to use references to assets

This commit is contained in:
2016-07-19 03:47:32 +10:00
parent fff9e6e5b2
commit b8b76cecd3
6 changed files with 181 additions and 142 deletions
+4 -2
View File
@@ -227,8 +227,10 @@ void renderer_entity(Renderer *renderer, v4 cameraBounds, Entity *entity,
if ((leftAlignedP.x < cameraBounds.z && rightAlignedP.x >= cameraBounds.x) &&
(leftAlignedP.y < cameraBounds.y && rightAlignedP.y >= cameraBounds.w))
{
EntityAnim *anim = &entity->anim[entity->currAnimId];
v4 animTexRect = anim->rect[anim->currRectIndex];
EntityAnim_ *entityAnim = &entity->anim[entity->currAnimId];
Animation *anim = entityAnim->anim;
i32 atlasIndex = anim->atlasIndexes[entityAnim->currFrame];
v4 animTexRect = anim->atlas->texRect[atlasIndex];
if (entity->direction == direction_east)
{