entity->spriteTileSize, entity->spriteIndex

This commit is contained in:
theo3 2020-07-15 20:49:59 -07:00
parent d49545317a
commit 75223bab24
4 changed files with 10 additions and 10 deletions

View File

@ -50,7 +50,7 @@ typedef struct Entity {
/*0x10*/ u8 flags;
/*0x11*/ u8 scriptedScene : 4;
/* */ u8 scriptedScene2 : 4;
/*0x12*/ s16 spriteTileSize;
/*0x12*/ s16 spriteIndex;
/*0x14*/ u8 animationState;
/*0x15*/ u8 direction;
/*0x16*/ u8 possibleBool;

View File

@ -18,7 +18,7 @@ void sub_08077DF4(Entity *ent, u32 arg1)
if ((arg1 & 0xff) > 0xb8) {
arg1 += (ent->entityType).form >> 1;
}
gLinkEntity.spriteTileSize = (short)(arg1 >> 8);
gLinkEntity.spriteIndex = (short)(arg1 >> 8);
InitAnimationForceUpdate(&gLinkEntity, (u8)arg1);
sub_08077E54(ent);
}
@ -38,7 +38,7 @@ void sub_08077E3C(Entity *ent)
void sub_08077E54(Entity *ent)
{
ent->action = gLinkEntity.animIndex;
*(u8 *)&ent->spriteTileSize = gLinkEntity.frameIndex;
*(u8 *)&ent->spriteIndex = gLinkEntity.frameIndex;
ent->previousActionFlag = gLinkEntity.frameDuration;
ent->actionDelay = gLinkEntity.frames.all;
}

View File

@ -56,7 +56,7 @@ void sub_08018CBC(Entity *this)
}
this->action = 2;
this->spriteSettings.b.draw = 1;
this->spriteTileSize = 0xa6;
this->spriteIndex = 0xa6;
this->palette = 0x33;
this->spriteVramOffset = 0;
(this->entityType).form = gLinkState.field_0x1d[0] - 1;

View File

@ -192,7 +192,7 @@ void sub_08061E90(Entity* this, Entity* arg1) {
if (arg1->spriteSettings.raw == 0) {
arg1->spriteSettings.raw++;
arg1->spriteTileSize = (Random() & 0x3f) + 0x20;
arg1->spriteIndex = (Random() & 0x3f) + 0x20;
animIndex = Random() & 0x18;
switch (this->direction) {
case 0x0:
@ -227,23 +227,23 @@ void sub_08061E90(Entity* this, Entity* arg1) {
iVar4 = this->x.HALF.HI - *(s16*)&this->field_0x6a.HWORD;
if (0x10 < iVar4) {
this->x.HALF.HI = this->field_0x6a.HWORD + 0x10;
arg1->spriteTileSize = 1;
arg1->spriteIndex = 1;
}
if (iVar4 < -0x10) {
this->x.HALF.HI = *(s16*)&this->field_0x6a.HWORD - 0x10;
arg1->spriteTileSize = 1;
arg1->spriteIndex = 1;
}
iVar4 = this->y.HALF.HI - *(s16*)&this->field_0x6c;
if (0x10 < iVar4) {
this->y.HALF.HI = *(s16*)&this->field_0x6c + 0x10;
arg1->spriteTileSize = 1;
arg1->spriteIndex = 1;
}
if (iVar4 < -0x10) {
this->y.HALF.HI = *(s16*)&this->field_0x6c - 0x10;
arg1->spriteTileSize = 1;
arg1->spriteIndex = 1;
}
if (--arg1->spriteTileSize != 0) {
if (--arg1->spriteIndex != 0) {
gUnk_02033280[6] = 0;
}
}