Decompile colourTween

This commit is contained in:
Ryan Dwyer 2021-02-28 21:50:34 +10:00
parent edc06d3bad
commit a7e772d278
4 changed files with 19 additions and 24 deletions

View File

@ -5511,7 +5511,7 @@ glabel var7f1a87d8
/* f024224: 260400f8 */ addiu $a0,$s0,0xf8
/* f024228: 11a00003 */ beqz $t5,.L0f024238
/* f02422c: 00000000 */ nop
/* f024230: 0fc1a5c4 */ jal func0f069710
/* f024230: 0fc1a5c4 */ jal colourTween
/* f024234: 260500fc */ addiu $a1,$s0,0xfc
.L0f024238:
/* f024238: 0c006a7a */ jal func0001a9e8

View File

@ -20653,7 +20653,7 @@ void currentPlayerTickInventory(bool triggeron)
} else {
u8 shadecol[4];
func0f069144(g_Vars.currentplayer->prop, shadecol, player->floorcol);
func0f069710(player->gunshadecol, shadecol);
colourTween(player->gunshadecol, shadecol);
}
invIncrementHeldTime(handGetWeaponNum(HAND_RIGHT), handGetWeaponNum(HAND_LEFT));

View File

@ -3996,26 +3996,21 @@ glabel func0f069630
/* f06970c: 00000000 */ nop
);
GLOBAL_ASM(
glabel func0f069710
/* f069710: 00001025 */ or $v0,$zero,$zero
/* f069714: 00a03025 */ or $a2,$a1,$zero
/* f069718: 00803825 */ or $a3,$a0,$zero
/* f06971c: 24080004 */ addiu $t0,$zero,0x4
.L0f069720:
/* f069720: 90e40000 */ lbu $a0,0x0($a3)
/* f069724: 90ce0000 */ lbu $t6,0x0($a2)
/* f069728: 24420001 */ addiu $v0,$v0,0x1
/* f06972c: 24c60001 */ addiu $a2,$a2,0x1
/* f069730: 01c41823 */ subu $v1,$t6,$a0
/* f069734: 00037843 */ sra $t7,$v1,0x1
/* f069738: 008f2821 */ addu $a1,$a0,$t7
/* f06973c: 24e70001 */ addiu $a3,$a3,0x1
/* f069740: 1448fff7 */ bne $v0,$t0,.L0f069720
/* f069744: a0e5ffff */ sb $a1,-0x1($a3)
/* f069748: 03e00008 */ jr $ra
/* f06974c: 00000000 */ nop
);
/**
* Shift shadecol to be closer to nextcol.
*
* It works by moving halfway towards the nextcol colour each time it's called.
*/
void colourTween(u8 *col, u8 *nextcol)
{
s32 i;
for (i = 0; i < 4; i++) {
s32 remaining = nextcol[i] - col[i];
s32 newcol = col[i] + (remaining >> 1);
col[i] = newcol;
}
}
GLOBAL_ASM(
glabel func0f069750
@ -27444,7 +27439,7 @@ s32 objTick(struct prop *prop)
if (sp572) {
if (prop->flags & PROPFLAG_80) {
func0f069710(obj->shadecol, obj->nextcol);
colourTween(obj->shadecol, obj->nextcol);
} else {
obj->shadecol[0] = obj->nextcol[0];
obj->shadecol[1] = obj->nextcol[1];

View File

@ -88,7 +88,7 @@ u32 func0f068c04(void);
s32 func0f068fc8(struct prop *prop, bool arg1);
void func0f069144(struct prop *prop, u8 *nextcol, u16 floorcol);
void func0f069630(struct prop *prop, u8 *nextcol, u16 floorcol);
void func0f069710(u8 *shadecol, u8 *nextcol);
void colourTween(u8 *col, u8 *nextcol);
void func0f069750(s32 *arg0, s32 arg1, f32 *arg2);
void func0f069850(struct defaultobj *obj, struct coord *pos, f32 *realrot, struct tiletype3 *geo);
void func0f069b4c(struct defaultobj *obj);