FieldObjectHandleDynamicGraphicsId

This commit is contained in:
scnorton 2017-09-08 14:20:13 -04:00
parent e0b2e6cdbf
commit 511474cc15
2 changed files with 9 additions and 20 deletions

View file

@ -5,25 +5,6 @@
.text .text
thumb_func_start FieldObjectHandleDynamicGraphicsId
@ void FieldObjectHandleDynamicGraphicsId(struct npc_state *fieldObject)
FieldObjectHandleDynamicGraphicsId: @ 808E6DC
push {r4,lr}
adds r4, r0, 0
ldrb r0, [r4, 0x5]
cmp r0, 0xEF
bls _0808E6F2
adds r0, 0x10
lsls r0, 24
lsrs r0, 24
bl VarGetFieldObjectGraphicsId
strb r0, [r4, 0x5]
_0808E6F2:
pop {r4}
pop {r0}
bx r0
thumb_func_end FieldObjectHandleDynamicGraphicsId
thumb_func_start npc_by_local_id_and_map_set_field_1_bit_x20 thumb_func_start npc_by_local_id_and_map_set_field_1_bit_x20
npc_by_local_id_and_map_set_field_1_bit_x20: @ 808E6F8 npc_by_local_id_and_map_set_field_1_bit_x20: @ 808E6F8
push {r4,lr} push {r4,lr}

View file

@ -27,7 +27,7 @@ static void sub_808D450(void);
static u8 GetFieldObjectIdByLocalId(u8); static u8 GetFieldObjectIdByLocalId(u8);
static u8 GetFieldObjectIdByLocalIdAndMapInternal(u8, u8, u8); static u8 GetFieldObjectIdByLocalIdAndMapInternal(u8, u8, u8);
static bool8 GetAvailableFieldObjectSlot(u16, u8, u8, u8 *); static bool8 GetAvailableFieldObjectSlot(u16, u8, u8, u8 *);
/*static*/ void FieldObjectHandleDynamicGraphicsId(struct MapObject *); static void FieldObjectHandleDynamicGraphicsId(struct MapObject *);
static void RemoveFieldObjectInternal (struct MapObject *); static void RemoveFieldObjectInternal (struct MapObject *);
/*static*/ u16 GetFieldObjectFlagIdByFieldObjectId(u8); /*static*/ u16 GetFieldObjectFlagIdByFieldObjectId(u8);
/*static*/ const struct MapObjectGraphicsInfo *GetFieldObjectGraphicsInfo(u8); /*static*/ const struct MapObjectGraphicsInfo *GetFieldObjectGraphicsInfo(u8);
@ -1027,3 +1027,11 @@ const struct MapObjectGraphicsInfo *GetFieldObjectGraphicsInfo(u8 graphicsId)
} }
return gFieldObjectGraphicsInfoPointers[graphicsId]; return gFieldObjectGraphicsInfoPointers[graphicsId];
} }
static void FieldObjectHandleDynamicGraphicsId(struct MapObject *mapObject)
{
if (mapObject->graphicsId >= SPRITE_VAR)
{
mapObject->graphicsId = VarGetFieldObjectGraphicsId(mapObject->graphicsId - SPRITE_VAR);
}
}