npc and bandit dressup, bits of UI added, WIP NPC interaction
This commit is contained in:
@@ -46,3 +46,23 @@ void UpdateNPC(F32 delta, NPC *npc, World *world) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void NPCDraw(D_Context *draw, NPC *npc)
|
||||
{
|
||||
G_Outfit *outfit = &npc->outfit;
|
||||
|
||||
R2f pframe = D_AnimationFrame(&outfit->state);
|
||||
|
||||
for (U32 it = 0; it < G_OUTFIT_COMPONENT_COUNT; ++it)
|
||||
{
|
||||
U32 flipped = (outfit->dir & G_OUTFIT_DIR_FLIPPED) != 0;
|
||||
U32 dir = (outfit->dir & ~G_OUTFIT_DIR_FLIPPED);
|
||||
|
||||
U32 tid = outfit->e[dir].e[it];
|
||||
if (tid != 0)
|
||||
{
|
||||
U32 flags = D_RECT_UV_ASPECT | (flipped ? D_RECT_FLIP_X : 0);
|
||||
D_Rect(draw, npc->collision.pos.x, npc->collision.pos.y, .texture = tid, .uv = pframe, .flags = flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user