diff --git a/src/game/bondbike.c b/src/game/bondbike.c index 87a83d237..85d179bfb 100644 --- a/src/game/bondbike.c +++ b/src/game/bondbike.c @@ -95,9 +95,9 @@ void bbikeUpdateVehicleOffset(void) { struct defaultobj *hoverbike = g_Vars.currentplayer->hoverbike->obj; - g_Vars.currentplayer->bondvehicleoffset.x = 0.0f / hoverbike->model->unk14; - g_Vars.currentplayer->bondvehicleoffset.y = 80.0f / hoverbike->model->unk14; - g_Vars.currentplayer->bondvehicleoffset.z = -50.0f / hoverbike->model->unk14; + g_Vars.currentplayer->bondvehicleoffset.x = 0.0f / hoverbike->model->scale; + g_Vars.currentplayer->bondvehicleoffset.y = 80.0f / hoverbike->model->scale; + g_Vars.currentplayer->bondvehicleoffset.z = -50.0f / hoverbike->model->scale; } void bbikeTryDismountAngle(f32 relativeangle, f32 distance) @@ -172,8 +172,8 @@ void bbikeHandleActivate(void) struct hoverbikeobj *bike = (struct hoverbikeobj *)g_Vars.currentplayer->hoverbike->obj; struct model08thing *thing = func0f068af4(&bike->base); - f32 sidedist = thing->unk04[1] * bike->base.model->unk14; - f32 frontdist = thing->unk18 * bike->base.model->unk14; + f32 sidedist = thing->unk04[1] * bike->base.model->scale; + f32 frontdist = thing->unk18 * bike->base.model->scale; f32 diagdist = sqrtf(sidedist * sidedist + frontdist * frontdist); g_Vars.currentplayer->walkinitmove = false; @@ -1131,7 +1131,7 @@ s32 bbikeCalculateNewPosition(struct coord *vel, f32 angledelta) hoverpropSetTurnAngle(&bike->base, newangle); func00016374(newangle, &sp44); - func00015f04(bike->base.model->unk14, &sp44); + func00015f04(bike->base.model->scale, &sp44); func00015da0(&sp44, bike->base.realrot); } @@ -1685,7 +1685,7 @@ void bbikeTick(void) func000159fc(&sp124, &sp164); func00015d54(obj->realrot, &sp124); - func00015f04(1.0f / obj->model->unk14, &sp124); + func00015f04(1.0f / obj->model->scale, &sp124); func00016374(hoverpropGetTurnAngle(obj), &spe4); func0f097044(&spe4, spd4); func0f097044(&sp124, spc4); diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index 27e7abd40..99d583fca 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -13197,7 +13197,7 @@ void chrRenderAttachedObject(struct prop *prop, struct modelrenderdata *renderda } if (withalpha) { - func0f0c33f0(model->unk0c, model->filedata->unk0e); + func0f0c33f0(model->matrices, model->filedata->nummatrices); } } } @@ -13559,7 +13559,7 @@ Gfx *chrRender(struct prop *prop, Gfx *gdl, bool withalpha) } } - func0f0c33f0(model->unk0c, model->filedata->unk0e); + func0f0c33f0(model->matrices, model->filedata->nummatrices); if (!g_Vars.currentplayer->isdead && !g_InCutscene @@ -15365,7 +15365,7 @@ f32 func0f0278a4(struct chrdata *chr) for (i = 0; i < 2; i++) { if (chr->weapons_held[i]) { struct defaultobj *obj = chr->weapons_held[i]->obj; - f32 value = func0001af80(obj->model) * chr->model->unk14; + f32 value = func0001af80(obj->model) * chr->model->scale; if (value > highest) { highest = value; diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index 85cfc7360..465e12c94 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -18229,7 +18229,7 @@ f32 func0f0370a8(struct chrdata *chr) result = aibotCalculateMaxSpeed(chr); } else { s16 animnum = modelGetAnimNum(chr->model); - result = func0f02dff0(animnum) * (chr->model->unk14 * 9.999999f); + result = func0f02dff0(animnum) * (chr->model->scale * 9.999999f); } return result; @@ -21653,7 +21653,7 @@ bool chrDropItem(struct chrdata *chr, u32 modelnum, u32 weaponnum) weapon = func0f08b880(modelnum, (u8)weaponnum, chr); if (weapon && weapon->base.prop) { - modelSetUnk14(weapon->base.model, weapon->base.model->unk14); + modelSetScale(weapon->base.model, weapon->base.model->scale); propReparent(weapon->base.prop, chr->prop); weapon->unk62 = PALDOWN(720); propobjSetDropped(weapon->base.prop, DROPREASON_1); diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 937fd1474..2a5e15abd 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -2416,7 +2416,7 @@ bool aiObjectMoveToPad(void) pad.up.x, pad.up.y, pad.up.z); if (obj->model) { - func00015f04(obj->model->unk14, &matrix); + func00015f04(obj->model->scale, &matrix); } rooms[0] = pad.room; @@ -5417,7 +5417,7 @@ bool aiObjectDoAnimation(void) modelSetAnimPlaySpeed(obj->model, 1.2, 0); #endif modelSetAnimation(obj->model, anim_id, 0, fstartframe, thing, 0); - modelSetAnimScale(obj->model, func0f15c888() * obj->model->unk14 * 100.0f); + modelSetAnimScale(obj->model, func0f15c888() * obj->model->scale * 100.0f); } } diff --git a/src/game/game_00c490.c b/src/game/game_00c490.c index f28f8a691..d8dfd349e 100644 --- a/src/game/game_00c490.c +++ b/src/game/game_00c490.c @@ -423,7 +423,7 @@ glabel var7f1a7f80 /* f00cfbc: c4880014 */ lwc1 $f8,0x14($a0) /* f00cfc0: 46064282 */ mul.s $f10,$f8,$f6 /* f00cfc4: 44055000 */ mfc1 $a1,$f10 -/* f00cfc8: 0c006bd6 */ jal modelSetUnk14 +/* f00cfc8: 0c006bd6 */ jal modelSetScale /* f00cfcc: 00000000 */ nop /* f00cfd0: 100001a3 */ b .L0f00d660 /* f00cfd4: 8fbf0034 */ lw $ra,0x34($sp) @@ -467,7 +467,7 @@ glabel var7f1a7f80 /* f00d060: afa6006c */ sw $a2,0x6c($sp) /* f00d064: 46082182 */ mul.s $f6,$f4,$f8 /* f00d068: 44053000 */ mfc1 $a1,$f6 -/* f00d06c: 0c006bd6 */ jal modelSetUnk14 +/* f00d06c: 0c006bd6 */ jal modelSetScale /* f00d070: 00000000 */ nop /* f00d074: 8fab0070 */ lw $t3,0x70($sp) /* f00d078: 8fa4006c */ lw $a0,0x6c($sp) @@ -504,7 +504,7 @@ glabel var7f1a7f80 /* f00d0e8: c48a0014 */ lwc1 $f10,0x14($a0) /* f00d0ec: 46045202 */ mul.s $f8,$f10,$f4 /* f00d0f0: 44054000 */ mfc1 $a1,$f8 -/* f00d0f4: 0c006bd6 */ jal modelSetUnk14 +/* f00d0f4: 0c006bd6 */ jal modelSetScale /* f00d0f8: 00000000 */ nop /* f00d0fc: 10000158 */ b .L0f00d660 /* f00d100: 8fbf0034 */ lw $ra,0x34($sp) @@ -824,7 +824,7 @@ glabel var7f1a7f80 /* f00d584: c48a0014 */ lwc1 $f10,0x14($a0) /* f00d588: 460e5182 */ mul.s $f6,$f10,$f14 /* f00d58c: 44053000 */ mfc1 $a1,$f6 -/* f00d590: 0c006bd6 */ jal modelSetUnk14 +/* f00d590: 0c006bd6 */ jal modelSetScale /* f00d594: 00000000 */ nop .L0f00d598: /* f00d598: 8e040018 */ lw $a0,0x18($s0) @@ -833,7 +833,7 @@ glabel var7f1a7f80 /* f00d5a0: c4880014 */ lwc1 $f8,0x14($a0) /* f00d5a4: 46044282 */ mul.s $f10,$f8,$f4 /* f00d5a8: 44055000 */ mfc1 $a1,$f10 -/* f00d5ac: 0c006bd6 */ jal modelSetUnk14 +/* f00d5ac: 0c006bd6 */ jal modelSetScale /* f00d5b0: 00000000 */ nop /* f00d5b4: 8e0e0018 */ lw $t6,0x18($s0) /* f00d5b8: 27a500ac */ addiu $a1,$sp,0xac @@ -1106,7 +1106,7 @@ void setupCamera(struct cameraobj *camera, s32 cmdindex) } func00016d58(&camera->camrotm, 0.0f, 0.0f, 0.0f, xdiff, ydiff, zdiff, 0.0f, 1.0f, 0.0f); - func00015f04(obj->model->unk14, &camera->camrotm); + func00015f04(obj->model->scale, &camera->camrotm); camera->toleft = 0; camera->yleft = *(s32 *)&camera->yleft * M_BADTAU / 65536.0f; @@ -1332,7 +1332,7 @@ void setupSingleMonitor(struct singlemonitorobj *monitor, s32 cmdindex) if (prop && monitor->base.monitorthing) { monitor->base.hidden |= OBJHFLAG_00000040; - modelSetUnk14(monitor->base.model, monitor->base.model->unk14 * scale); + modelSetScale(monitor->base.model, monitor->base.model->scale * scale); monitor->base.model->attachedto = owner->model; if (monitor->ownerpart == MODELPART_00) { @@ -1347,7 +1347,7 @@ void setupSingleMonitor(struct singlemonitorobj *monitor, s32 cmdindex) propReparent(prop, owner->prop); func000162e8(0.3664608001709f, &sp64); - func00015f04(monitor->base.model->unk14 / owner->model->unk14, &sp64); + func00015f04(monitor->base.model->scale / owner->model->scale, &sp64); modelGetRootPosition(monitor->base.model, &spa4); spa4.x = -spa4.x; @@ -1810,7 +1810,7 @@ glabel var7f1a926cpf .PF0f00e8c8: /* f00e8c8: 46002282 */ mul.s $f10,$f4,$f0 /* f00e8cc: 44055000 */ mfc1 $a1,$f10 -/* f00e8d0: 0c006b3a */ jal modelSetUnk14 +/* f00e8d0: 0c006b3a */ jal modelSetScale /* f00e8d4: 00000000 */ nop .PF0f00e8d8: /* f00e8d8: 0fc181c7 */ jal propPrependToList1 @@ -2200,7 +2200,7 @@ glabel var7f1a8064 .L0f00e8cc: /* f00e8cc: 46008182 */ mul.s $f6,$f16,$f0 /* f00e8d0: 44053000 */ mfc1 $a1,$f6 -/* f00e8d4: 0c006bd6 */ jal modelSetUnk14 +/* f00e8d4: 0c006bd6 */ jal modelSetScale /* f00e8d8: 00000000 */ nop .L0f00e8dc: /* f00e8dc: 0fc1812f */ jal propPrependToList1 @@ -2367,7 +2367,7 @@ glabel var7f1a8064 // mult = sp48; // } // -// modelSetUnk14(door->base.model, door->base.model->unk14 * mult); +// modelSetScale(door->base.model, door->base.model->scale * mult); // } // // propPrependToList1(prop); @@ -3477,7 +3477,7 @@ void setupParseObjects(s32 stagenum) if (owner && owner->prop) { obj->hidden |= OBJHFLAG_HASOWNER; - modelSetUnk14(obj->model, obj->model->unk14); + modelSetScale(obj->model, obj->model->scale); propReparent(obj->prop, owner->prop); } } diff --git a/src/game/game_0125a0.c b/src/game/game_0125a0.c index 3eca64a1a..afa71c7d8 100644 --- a/src/game/game_0125a0.c +++ b/src/game/game_0125a0.c @@ -81,7 +81,7 @@ void currentPlayerInitAnimation(void) func00022fa4(&g_Vars.currentplayer->model, &var8007c0c0, &g_Vars.currentplayer->unk0494, 0); animInitialise(g_Vars.currentplayer->model.anim); - modelSetUnk14(&g_Vars.currentplayer->model, 0.1000000089407f); + modelSetScale(&g_Vars.currentplayer->model, 0.1000000089407f); modelSetAnimPlaySpeed(&g_Vars.currentplayer->model, (PAL ? 1.2f : 1), 0); g_Vars.currentplayer->headanim = 0; diff --git a/src/game/game_02cde0.c b/src/game/game_02cde0.c index ebfdd4818..efc81e31f 100644 --- a/src/game/game_02cde0.c +++ b/src/game/game_02cde0.c @@ -446,7 +446,7 @@ glabel var7f1a8a84 .L0f02d26c: /* f02d26c: 1180002d */ beqz $t4,.L0f02d324 /* f02d270: 01802025 */ or $a0,$t4,$zero -/* f02d274: 0c006bd6 */ jal modelSetUnk14 +/* f02d274: 0c006bd6 */ jal modelSetScale /* f02d278: 8fa50044 */ lw $a1,0x44($sp) /* f02d27c: 8fa4005c */ lw $a0,0x5c($sp) /* f02d280: 0c006bd9 */ jal modelSetAnimScale diff --git a/src/game/game_097ba0.c b/src/game/game_097ba0.c index a8d4c94de..8e661c554 100644 --- a/src/game/game_097ba0.c +++ b/src/game/game_097ba0.c @@ -21,6 +21,7 @@ #include "game/game_0b4950.h" #include "game/game_0b69d0.h" #include "game/game_0c33f0.h" +#include "game/gfxmemory.h" #include "game/sight.h" #include "game/inventory/inventory.h" #include "game/game_127910.h" @@ -11281,7 +11282,7 @@ void func0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, Mtxf if (objprop) { propPrependToList1(objprop); propShow(objprop); - func00015f04(obj->model->unk14, matrix1); + func00015f04(obj->model->scale, matrix1); func0f06a580(obj, coord, matrix1, rooms); if (obj->type == OBJTYPE_WEAPON && ((struct weaponobj *) obj)->weaponnum == WEAPON_BOLT) { @@ -11304,7 +11305,7 @@ void func0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, Mtxf obj->projectile->unk088 = prop; func0f068694(objprop); - func00015d18(matrix2, &obj->projectile->unk020); + func00015d18(matrix2, (Mtxf *)&obj->projectile->unk020); obj->projectile->unk004.x = arg4[0]; obj->projectile->unk004.y = arg4[1]; @@ -12466,86 +12467,41 @@ glabel var7f1ac72c ); #endif -GLOBAL_ASM( -glabel func0f09f848 -/* f09f848: 00047100 */ sll $t6,$a0,0x4 -/* f09f84c: 01c47023 */ subu $t6,$t6,$a0 -/* f09f850: 27bdff80 */ addiu $sp,$sp,-128 -/* f09f854: 000e7080 */ sll $t6,$t6,0x2 -/* f09f858: 01c47021 */ addu $t6,$t6,$a0 -/* f09f85c: 3c02800a */ lui $v0,%hi(g_Vars+0x284) -/* f09f860: 8c42a244 */ lw $v0,%lo(g_Vars+0x284)($v0) -/* f09f864: 000e70c0 */ sll $t6,$t6,0x3 -/* f09f868: 01c47021 */ addu $t6,$t6,$a0 -/* f09f86c: afb10018 */ sw $s1,0x18($sp) -/* f09f870: 000e7080 */ sll $t6,$t6,0x2 -/* f09f874: afbf0024 */ sw $ra,0x24($sp) -/* f09f878: afb30020 */ sw $s3,0x20($sp) -/* f09f87c: afb2001c */ sw $s2,0x1c($sp) -/* f09f880: afb00014 */ sw $s0,0x14($sp) -/* f09f884: 004e8821 */ addu $s1,$v0,$t6 -/* f09f888: 8e300850 */ lw $s0,0x850($s1) -/* f09f88c: 26310638 */ addiu $s1,$s1,0x638 -/* f09f890: 52000032 */ beqzl $s0,.L0f09f95c -/* f09f894: 8fbf0024 */ lw $ra,0x24($sp) -/* f09f898: 8e120014 */ lw $s2,0x14($s0) -/* f09f89c: 5240002f */ beqzl $s2,.L0f09f95c -/* f09f8a0: 8fbf0024 */ lw $ra,0x24($sp) -/* f09f8a4: 8c4f00bc */ lw $t7,0xbc($v0) -/* f09f8a8: 262402f4 */ addiu $a0,$s1,0x2f4 -/* f09f8ac: afaf0030 */ sw $t7,0x30($sp) -/* f09f8b0: 8e38021c */ lw $t8,0x21c($s1) -/* f09f8b4: 8e130018 */ lw $s3,0x18($s0) -/* f09f8b8: 57000014 */ bnezl $t8,.L0f09f90c -/* f09f8bc: 8e680008 */ lw $t0,0x8($s3) -/* f09f8c0: 0c005746 */ jal func00015d18 -/* f09f8c4: 27a50034 */ addiu $a1,$sp,0x34 -/* f09f8c8: 44800000 */ mtc1 $zero,$f0 -/* f09f8cc: 27a50034 */ addiu $a1,$sp,0x34 -/* f09f8d0: e7a00064 */ swc1 $f0,0x64($sp) -/* f09f8d4: e7a00068 */ swc1 $f0,0x68($sp) -/* f09f8d8: e7a0006c */ swc1 $f0,0x6c($sp) -/* f09f8dc: 8e190018 */ lw $t9,0x18($s0) -/* f09f8e0: 0c0057c1 */ jal func00015f04 -/* f09f8e4: c72c0014 */ lwc1 $f12,0x14($t9) -/* f09f8e8: 8fa70030 */ lw $a3,0x30($sp) -/* f09f8ec: 02002025 */ or $a0,$s0,$zero -/* f09f8f0: 26250374 */ addiu $a1,$s1,0x374 -/* f09f8f4: 27a60034 */ addiu $a2,$sp,0x34 -/* f09f8f8: 0fc1a960 */ jal func0f06a580 -/* f09f8fc: 24e70028 */ addiu $a3,$a3,0x28 -/* f09f900: 0fc19711 */ jal func0f065c44 -/* f09f904: 02402025 */ or $a0,$s2,$zero -/* f09f908: 8e680008 */ lw $t0,0x8($s3) -.L0f09f90c: -/* f09f90c: 8504000e */ lh $a0,0xe($t0) -/* f09f910: 00044980 */ sll $t1,$a0,0x6 -/* f09f914: 0fc59e7d */ jal gfxAllocate -/* f09f918: 01202025 */ or $a0,$t1,$zero -/* f09f91c: ae62000c */ sw $v0,0xc($s3) -/* f09f920: 26240620 */ addiu $a0,$s1,0x620 -/* f09f924: 0c005746 */ jal func00015d18 -/* f09f928: 00402825 */ or $a1,$v0,$zero -/* f09f92c: 8e6a0008 */ lw $t2,0x8($s3) -/* f09f930: 02602025 */ or $a0,$s3,$zero -/* f09f934: 0c0072c3 */ jal func0001cb0c -/* f09f938: 8d450000 */ lw $a1,0x0($t2) -/* f09f93c: 924b0001 */ lbu $t3,0x1($s2) -/* f09f940: 356c0042 */ ori $t4,$t3,0x42 -/* f09f944: a24c0001 */ sb $t4,0x1($s2) -/* f09f948: 8e6d000c */ lw $t5,0xc($s3) -/* f09f94c: c5a40038 */ lwc1 $f4,0x38($t5) -/* f09f950: 46002187 */ neg.s $f6,$f4 -/* f09f954: e6460014 */ swc1 $f6,0x14($s2) -/* f09f958: 8fbf0024 */ lw $ra,0x24($sp) -.L0f09f95c: -/* f09f95c: 8fb00014 */ lw $s0,0x14($sp) -/* f09f960: 8fb10018 */ lw $s1,0x18($sp) -/* f09f964: 8fb2001c */ lw $s2,0x1c($sp) -/* f09f968: 8fb30020 */ lw $s3,0x20($sp) -/* f09f96c: 03e00008 */ jr $ra -/* f09f970: 27bd0080 */ addiu $sp,$sp,0x80 -); +void func0f09f848(s32 handnum) +{ + struct hand *hand = &g_Vars.currentplayer->hands[handnum]; + struct defaultobj *obj = &hand->rocket->base; + + if (obj) { + struct prop *objprop = obj->prop; + Mtxf mtx; + + if (objprop) { + struct prop *playerprop = g_Vars.currentplayer->prop; + struct model *model = obj->model; + + if (!hand->firedrocket) { + func00015d18(&hand->posmtx, &mtx); + + mtx.m[3][0] = 0; + mtx.m[3][1] = 0; + mtx.m[3][2] = 0; + + func00015f04(obj->model->scale, &mtx); + func0f06a580(obj, &hand->muzzlepos, &mtx, playerprop->rooms); + func0f065c44(objprop); + } + + model->matrices = gfxAllocate(model->filedata->nummatrices * sizeof(Mtxf)); + + func00015d18(&hand->muzzlemat, &model->matrices[0]); + func0001cb0c(model, model->filedata->rootnode); + + objprop->flags |= PROPFLAG_40 | PROPFLAG_02; + objprop->z = -model->matrices[0].m[3][2]; + } + } +} void func0f09f974(s32 handnum, struct weaponfunc_shootprojectile *func) { diff --git a/src/game/propobj.c b/src/game/propobj.c index 453798e89..5531e616f 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -5713,7 +5713,7 @@ glabel func0f06a1ec /* f06a388: afa60028 */ sw $a2,0x28($sp) /* f06a38c: 460a3402 */ mul.s $f16,$f6,$f10 /* f06a390: 44058000 */ mfc1 $a1,$f16 -/* f06a394: 0c006bd6 */ jal modelSetUnk14 +/* f06a394: 0c006bd6 */ jal modelSetScale /* f06a398: 00000000 */ nop /* f06a39c: 8fa60028 */ lw $a2,0x28($sp) /* f06a3a0: 44800000 */ mtc1 $zero,$f0 @@ -47232,7 +47232,7 @@ glabel var7f1aa6e0 // // // cf0 // func0001648c(&sp12c, spac); -// func00015f04(hovercar->base.model->unk14, spac); +// func00015f04(hovercar->base.model->scale, spac); // func00015a00(spac, sp6c, spec); // func00015da0(spec, sp15c); // func00015cd8(sp15c, hovercar->base.realrot); @@ -47651,7 +47651,7 @@ u32 func0f07e474(struct prop *prop) newparent = setupCommandGetObject(cmdoffset + padnum); if (newparent && newparent->prop) { - modelSetUnk14(obj->model, obj->model->unk14); + modelSetScale(obj->model, obj->model->scale); propReparent(obj->prop, newparent->prop); silent = true; } @@ -47803,12 +47803,12 @@ s32 objTick(struct prop *prop) } sp556 = true; - sp476.unk10 = gfxAllocate(model->filedata->unk0e * sizeof(Mtxf)); + sp476.unk10 = gfxAllocate(model->filedata->nummatrices * sizeof(Mtxf)); sp476.matrix = currentPlayerGetMatrix1740(); func0001cebc(&sp476, model); if (sp572) { - func00015be4(currentPlayerGetUnk174c(), model->unk0c, &sp412); + func00015be4(currentPlayerGetUnk174c(), model->matrices, &sp412); func00015da0(&sp412, obj->realrot); sp400.x = sp412.m[3][0]; @@ -47901,7 +47901,7 @@ s32 objTick(struct prop *prop) func00015a00(currentPlayerGetMatrix1740(), &sp248, &sp152); sp556 = true; - sp312.unk10 = gfxAllocate(model->filedata->unk0e * sizeof(Mtxf)); + sp312.unk10 = gfxAllocate(model->filedata->nummatrices * sizeof(Mtxf)); sp312.matrix = &sp152; func0001cebc(&sp312, model); @@ -47919,7 +47919,7 @@ s32 objTick(struct prop *prop) if (modelGetCurAnimFrame(model) >= modelGetNumAnimFrames(model) - 1) { animTurnOff(model->anim); model->anim = NULL; - func00015be4(currentPlayerGetUnk174c(), model->unk0c, &sp248); + func00015be4(currentPlayerGetUnk174c(), model->matrices, &sp248); func00015da0(&sp248, obj->realrot); tagnum = objGetTagNum(obj); @@ -48054,12 +48054,12 @@ s32 objTick(struct prop *prop) } if (sp556 == false) { - model->unk0c = gfxAllocate(model->filedata->unk0e * 64); + model->matrices = gfxAllocate(model->filedata->nummatrices * sizeof(Mtxf)); func0f07e2cc(prop); func0001cb0c(model, model->filedata->rootnode); } - prop->z = -model->unk0c->m[3][2]; + prop->z = -model->matrices[0].m[3][2]; func0f07063c(prop, sp572); child = prop->child; @@ -66726,7 +66726,7 @@ glabel func0f089c70 /* f089d00: 00000000 */ nop /* f089d04: 46008482 */ mul.s $f18,$f16,$f0 /* f089d08: 44059000 */ mfc1 $a1,$f18 -/* f089d0c: 0c006bd6 */ jal modelSetUnk14 +/* f089d0c: 0c006bd6 */ jal modelSetScale /* f089d10: 00000000 */ nop /* f089d14: 8e290020 */ lw $t1,0x20($s1) /* f089d18: 8e0a0018 */ lw $t2,0x18($s0) @@ -68528,7 +68528,7 @@ glabel func0f08b108 /* f08b178: 00000000 */ nop /* f08b17c: 46008482 */ mul.s $f18,$f16,$f0 /* f08b180: 44059000 */ mfc1 $a1,$f18 -/* f08b184: 0c006bd6 */ jal modelSetUnk14 +/* f08b184: 0c006bd6 */ jal modelSetScale /* f08b188: 00000000 */ nop /* f08b18c: 02002025 */ or $a0,$s0,$zero /* f08b190: 0fc22b95 */ jal func0f08ae54 diff --git a/src/game/title.c b/src/game/title.c index 888bc9bfc..49086a851 100644 --- a/src/game/title.c +++ b/src/game/title.c @@ -1527,7 +1527,7 @@ glabel titleInitPdLogo /* f016dd8: 246324f8 */ addiu $v1,$v1,%lo(g_TitleModel) /* f016ddc: ac620000 */ sw $v0,0x0($v1) /* f016de0: 00402025 */ or $a0,$v0,$zero -/* f016de4: 0c006bd6 */ jal modelSetUnk14 +/* f016de4: 0c006bd6 */ jal modelSetScale /* f016de8: 3c053f80 */ lui $a1,0x3f80 /* f016dec: 3c048006 */ lui $a0,%hi(g_TitleModel) /* f016df0: 8c8424f8 */ lw $a0,%lo(g_TitleModel)($a0) @@ -1563,7 +1563,7 @@ glabel titleInitPdLogo /* f016e68: 246324fc */ addiu $v1,$v1,%lo(g_TitleModel2) /* f016e6c: ac620000 */ sw $v0,0x0($v1) /* f016e70: 00402025 */ or $a0,$v0,$zero -/* f016e74: 0c006bd6 */ jal modelSetUnk14 +/* f016e74: 0c006bd6 */ jal modelSetScale /* f016e78: 3c053f80 */ lui $a1,0x3f80 /* f016e7c: 3c048006 */ lui $a0,%hi(g_TitleModel2) /* f016e80: 8c8424fc */ lw $a0,%lo(g_TitleModel2)($a0) @@ -1599,7 +1599,7 @@ glabel titleInitPdLogo /* f016ef8: 24632508 */ addiu $v1,$v1,%lo(var80062508) /* f016efc: ac620000 */ sw $v0,0x0($v1) /* f016f00: 00402025 */ or $a0,$v0,$zero -/* f016f04: 0c006bd6 */ jal modelSetUnk14 +/* f016f04: 0c006bd6 */ jal modelSetScale /* f016f08: 3c053f80 */ lui $a1,0x3f80 /* f016f0c: 3c048006 */ lui $a0,%hi(var80062508) /* f016f10: 8c842508 */ lw $a0,%lo(var80062508)($a0) @@ -1635,7 +1635,7 @@ glabel titleInitPdLogo /* f016f88: 2463250c */ addiu $v1,$v1,%lo(var8006250c) /* f016f8c: ac620000 */ sw $v0,0x0($v1) /* f016f90: 00402025 */ or $a0,$v0,$zero -/* f016f94: 0c006bd6 */ jal modelSetUnk14 +/* f016f94: 0c006bd6 */ jal modelSetScale /* f016f98: 3c053f80 */ lui $a1,0x3f80 /* f016f9c: 3c048006 */ lui $a0,%hi(var8006250c) /* f016fa0: 8c84250c */ lw $a0,%lo(var8006250c)($a0) @@ -1710,7 +1710,7 @@ glabel titleInitPdLogo // func00022d24(g_ModelStates[MODEL_NLOGO].filedata); // // g_TitleModel = func0f0b3280(g_ModelStates[MODEL_NLOGO].filedata); -// modelSetUnk14(g_TitleModel, 1); +// modelSetScale(g_TitleModel, 1); // modelSetRootPosition(g_TitleModel, &coord); // } // @@ -1723,7 +1723,7 @@ glabel titleInitPdLogo // func00022d24(g_ModelStates[MODEL_NLOGO2].filedata); // // g_TitleModel2 = func0f0b3280(g_ModelStates[MODEL_NLOGO2].filedata); -// modelSetUnk14(g_TitleModel2, 1); +// modelSetScale(g_TitleModel2, 1); // modelSetRootPosition(g_TitleModel2, &coord); // } // @@ -1736,7 +1736,7 @@ glabel titleInitPdLogo // func00022d24(g_ModelStates[MODEL_PDTWO].filedata); // // var80062508 = func0f0b30ac(g_ModelStates[MODEL_PDTWO].filedata); -// modelSetUnk14(var80062508, 1); +// modelSetScale(var80062508, 1); // modelSetRootPosition(var80062508, &coord); // } // @@ -1749,7 +1749,7 @@ glabel titleInitPdLogo // func00022d24(g_ModelStates[MODEL_PDTHREE].filedata); // // var8006250c = func0f0b30ac(g_ModelStates[MODEL_PDTHREE].filedata); -// modelSetUnk14(var8006250c, 1); +// modelSetScale(var8006250c, 1); // modelSetRootPosition(var8006250c, &coord); // } // @@ -5350,7 +5350,7 @@ void titleInitNintendoLogo(void) func00022d24(g_ModelStates[MODEL_NINTENDOLOGO].filedata); g_TitleModel = func0f0b30ac(g_ModelStates[MODEL_NINTENDOLOGO].filedata); - modelSetUnk14(g_TitleModel, 1); + modelSetScale(g_TitleModel, 1); modelSetRootPosition(g_TitleModel, &coord); var800624f4 = 1; joy00014810(false); @@ -6031,7 +6031,7 @@ void titleInitRareLogo(void) func00022d24(g_ModelStates[MODEL_RARELOGO].filedata); g_TitleModel = func0f0b30ac(g_ModelStates[MODEL_RARELOGO].filedata); - modelSetUnk14(g_TitleModel, 1); + modelSetScale(g_TitleModel, 1); modelSetRootPosition(g_TitleModel, &coord); var800624f4 = 1; diff --git a/src/game/training/training.c b/src/game/training/training.c index cfe115e26..1cc3ddd35 100644 --- a/src/game/training/training.c +++ b/src/game/training/training.c @@ -2134,7 +2134,7 @@ void frInitTargets(void) func00016374(M_PI, &sp144); } - func00015f04(obj->model->unk14, &sp144); + func00015f04(obj->model->scale, &sp144); func00015da0(&sp144, sp108); func00015cd8(sp108, obj->realrot); @@ -6853,7 +6853,7 @@ glabel var7f1b94e4 // // // 81c // func00016374(g_FrData.targets[i].angle + M_PI, &spbc); -// func00015f04(obj->model->unk14, &spbc); +// func00015f04(obj->model->scale, &spbc); // func00015da0(&spbc, sp98); // func00015cd8(sp98, obj->realrot); // } diff --git a/src/include/game/game_0c33f0.h b/src/include/game/game_0c33f0.h index 5e229819b..07b2f88ef 100644 --- a/src/include/game/game_0c33f0.h +++ b/src/include/game/game_0c33f0.h @@ -4,6 +4,6 @@ #include "data.h" #include "types.h" -void func0f0c33f0(Mtxf *matrix, s32 arg1); +void func0f0c33f0(Mtxf *matrices, s32 count); #endif diff --git a/src/include/lib/lib_159b0.h b/src/include/lib/lib_159b0.h index b68cdecd8..f8cc2f033 100644 --- a/src/include/lib/lib_159b0.h +++ b/src/include/lib/lib_159b0.h @@ -14,7 +14,7 @@ void func00015b68(Mtxf *matrix, struct coord *arg1, struct coord *arg2); void func00015be0(Mtxf *matrix1, Mtxf *matrix2); void func00015be4(Mtxf *arg0, Mtxf *arg1, Mtxf *arg2); void func00015cd8(f32 *arg0, f32 *realrot); -void func00015d18(Mtxf *matrix, f32 *arg1); +void func00015d18(Mtxf *matrix, Mtxf *arg1); void func00015d54(f32 *realrot, Mtxf *matrix); void func00015da0(Mtxf *arg0, f32 *arg1); void func00015dd4(struct coord *pos, Mtxf *matrix); diff --git a/src/include/lib/model.h b/src/include/lib/model.h index 43da8ddbd..d1bc06183 100644 --- a/src/include/lib/model.h +++ b/src/include/lib/model.h @@ -26,7 +26,7 @@ void modelSetRootPosition(struct model *model, struct coord *pos); u32 func0001ad5c(void); f32 func0001ae44(struct model *model); void func0001ae90(struct model *model, f32 angle); -void modelSetUnk14(struct model *model, f32 arg1); +void modelSetScale(struct model *model, f32 scale); void modelSetAnimScale(struct model *model, f32 scale); f32 func0001af80(struct model *model); u32 func0001af98(void); diff --git a/src/include/types.h b/src/include/types.h index f70590533..db278e15d 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -633,7 +633,7 @@ struct modelfiledata { struct modelnode **parts; s16 numparts; - s16 unk0e; + s16 nummatrices; f32 unk10; }; @@ -642,9 +642,9 @@ struct model { /*0x01*/ u8 unk01; /*0x04*/ struct chrdata *chr; /*0x08*/ struct modelfiledata *filedata; - /*0x0c*/ Mtxf *unk0c; + /*0x0c*/ Mtxf *matrices; /*0x10*/ void **datas; // array of pointers to modeldata structs - /*0x14*/ f32 unk14; + /*0x14*/ f32 scale; /*0x18*/ struct model *attachedto; /*0x1c*/ struct modelnode *unk1c; /*0x20*/ struct anim *anim; @@ -2167,58 +2167,11 @@ struct hand { /*0x08e0*/ u32 unk08e0; /*0x08e4*/ u32 unk08e4; /*0x08e8*/ u32 unk08e8; - /*0x08ec*/ u32 unk08ec; - /*0x08f0*/ u32 unk08f0; - /*0x08f4*/ u32 unk08f4; - /*0x08f8*/ u32 unk08f8; - /*0x08fc*/ u32 unk08fc; - /*0x0900*/ u32 unk0900; - /*0x0904*/ u32 unk0904; - /*0x0908*/ u32 unk0908; - /*0x090c*/ u32 unk090c; - /*0x0910*/ u32 unk0910; - /*0x0914*/ u32 unk0914; - /*0x0918*/ u32 unk0918; - /*0x091c*/ u32 unk091c; - /*0x0920*/ u32 unk0920; - /*0x0924*/ u32 unk0924; - /*0x0928*/ u32 unk0928; - /*0x092c*/ u32 unk092c; - /*0x0930*/ u32 unk0930; - /*0x0934*/ u32 unk0934; - /*0x0938*/ u32 unk0938; - /*0x093c*/ u32 unk093c; - /*0x0940*/ u32 unk0940; - /*0x0944*/ u32 unk0944; - /*0x0948*/ u32 unk0948; - /*0x094c*/ u32 unk094c; - /*0x0950*/ u32 unk0950; - /*0x0954*/ u32 unk0954; - /*0x0958*/ u32 unk0958; - /*0x095c*/ u32 unk095c; - /*0x0960*/ u32 unk0960; - /*0x0964*/ u32 unk0964; - /*0x0968*/ u32 unk0968; - /*0x096c*/ u32 unk096c; - /*0x0970*/ u32 unk0970; - /*0x0974*/ u32 unk0974; - /*0x0978*/ u32 unk0978; - /*0x097c*/ u32 unk097c; - /*0x0980*/ u32 unk0980; - /*0x0984*/ u32 unk0984; - /*0x0988*/ u32 unk0988; - /*0x098c*/ u32 unk098c; - /*0x0990*/ u32 unk0990; - /*0x0994*/ u32 unk0994; - /*0x0998*/ u32 unk0998; - /*0x099c*/ u32 unk099c; - /*0x09a0*/ u32 unk09a0; - /*0x09a4*/ u32 unk09a4; - /*0x09a8*/ u32 unk09a8; - /*0x09ac*/ u32 unk09ac; - /*0x09b0*/ u32 unk09b0; - /*0x09b4*/ u32 unk09b4; - /*0x09b8*/ u32 unk09b8; + /*0x08ec*/ Mtxf cammtx; + /*0x092c*/ Mtxf posmtx; + /*0x096c*/ Mtxf prevmtx; + /*0x09ac*/ struct coord muzzlepos; + /*0x09b8*/ f32 muzzlez; /*0x09bc*/ struct model unk09bc; /*0x09e0*/ struct anim anim; /*0x0a6c*/ u32 unk0a6c[32]; @@ -2276,22 +2229,7 @@ struct hand { /*0x0c4c*/ s32 stateframes; /*0x0c50*/ s32 statecycles; /*0x0c54*/ s32 statelastframe; - /*0x0c58*/ u32 unk0c58; - /*0x0c5c*/ u32 unk0c5c; - /*0x0c60*/ u32 unk0c60; - /*0x0c64*/ u32 unk0c64; - /*0x0c68*/ u32 unk0c68; - /*0x0c6c*/ u32 unk0c6c; - /*0x0c70*/ u32 unk0c70; - /*0x0c74*/ u32 unk0c74; - /*0x0c78*/ u32 unk0c78; - /*0x0c7c*/ u32 unk0c7c; - /*0x0c80*/ u32 unk0c80; - /*0x0c84*/ u32 unk0c84; - /*0x0c88*/ u32 unk0c88; - /*0x0c8c*/ u32 unk0c8c; - /*0x0c90*/ u32 unk0c90; - /*0x0c94*/ u32 unk0c94; + /*0x0c58*/ Mtxf muzzlemat; /*0x0c98*/ f32 gs_float1; /*0x0c9c*/ f32 gs_float2; /*0x0ca0*/ f32 gs_float3; diff --git a/src/lib/model.c b/src/lib/model.c index 0b33d64fa..f704004ad 100644 --- a/src/lib/model.c +++ b/src/lib/model.c @@ -663,9 +663,9 @@ void func0001ae90(struct model *model, f32 angle) } } -void modelSetUnk14(struct model *model, f32 arg1) +void modelSetScale(struct model *model, f32 scale) { - model->unk14 = arg1; + model->scale = scale; } void modelSetAnimScale(struct model *model, f32 scale) @@ -677,7 +677,7 @@ void modelSetAnimScale(struct model *model, f32 scale) f32 func0001af80(struct model *model) { - return model->filedata->unk10 * model->unk14; + return model->filedata->unk10 * model->scale; } GLOBAL_ASM(