From 9673015f71b396b0c8f4f0816d738ac07a0f37e3 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Thu, 6 May 2021 17:55:14 +1000 Subject: [PATCH] Decompile func000216cc --- src/include/lib/model.h | 2 +- src/include/types.h | 5 ----- src/lib/model.c | 35 ++++++++++------------------------- 3 files changed, 11 insertions(+), 31 deletions(-) diff --git a/src/include/lib/model.h b/src/include/lib/model.h index 20c8fb0c9..6ebd9f001 100644 --- a/src/include/lib/model.h +++ b/src/include/lib/model.h @@ -86,7 +86,7 @@ void modelApplyCullMode(struct modelrenderdata *renderdata); void modelRenderNodeGundl(struct modelrenderdata *renderdata, struct model *model, struct modelnode *node); void modelRenderNodeDl(struct modelrenderdata *renderdata, struct model *model, struct modelnode *node); void modelRenderNodeType16(struct modelrenderdata *renderdata, struct modelnode *node); -void func000216cc(struct modelrenderdata *renderdata, struct modeltexture *texture, s32 arg2); +void func000216cc(struct modelrenderdata *renderdata, struct textureconfig *tconfig, s32 arg2); void modelRenderNodeGunfire(struct modelrenderdata *renderdata, struct model *model, struct modelnode *node); void modelRender(struct modelrenderdata *renderdata, struct model *model); bool func000220fc(union modelrodata *rodata, Mtxf *mtx, struct coord *arg2, struct coord *arg3); diff --git a/src/include/types.h b/src/include/types.h index 0048dd37f..ec1163f88 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -7123,9 +7123,4 @@ struct rdptask { u32 unk5c; }; -struct modeltexture { - u32 unk00; - u8 unk04; -}; - #endif diff --git a/src/lib/model.c b/src/lib/model.c index 50299d58d..d9d756dee 100644 --- a/src/lib/model.c +++ b/src/lib/model.c @@ -5965,25 +5965,10 @@ glabel modelRenderNodeType16 /* 216c8: 27bd0048 */ addiu $sp,$sp,0x48 ); -GLOBAL_ASM( -glabel func000216cc -/* 216cc: 27bdffd8 */ addiu $sp,$sp,-40 -/* 216d0: afbf0024 */ sw $ra,0x24($sp) -/* 216d4: afa40028 */ sw $a0,0x28($sp) -/* 216d8: 00807025 */ or $t6,$a0,$zero -/* 216dc: 8dc70004 */ lw $a3,0x4($t6) -/* 216e0: 240f0002 */ addiu $t7,$zero,0x2 -/* 216e4: 24180001 */ addiu $t8,$zero,0x1 -/* 216e8: afb80014 */ sw $t8,0x14($sp) -/* 216ec: afaf0010 */ sw $t7,0x10($sp) -/* 216f0: afa00018 */ sw $zero,0x18($sp) -/* 216f4: 0fc2ce70 */ jal func0f0b39c0 -/* 216f8: 2484000c */ addiu $a0,$a0,0xc -/* 216fc: 8fbf0024 */ lw $ra,0x24($sp) -/* 21700: 27bd0028 */ addiu $sp,$sp,0x28 -/* 21704: 03e00008 */ jr $ra -/* 21708: 00000000 */ nop -); +void func000216cc(struct modelrenderdata *renderdata, struct textureconfig *tconfig, s32 arg2) +{ + func0f0b39c0(&renderdata->gdl, tconfig, arg2, renderdata->zbufferenabled, 2, 1, 0); +} GLOBAL_ASM( glabel modelRenderNodeGunfire @@ -6534,7 +6519,7 @@ glabel var70054454 // struct tmpcolour colourtemplate = {0xffffffff}; // 80 // f32 scale; // struct tmpcolour *colours; -// struct modeltexture *texture; +// struct textureconfig *texture; // Mtxf *mtx; // f32 tmp; // f32 distance; @@ -6629,13 +6614,13 @@ glabel var70054454 // // // d4c // if (rodata->texture) { -// texture = rodata->texture; +// tconfig = rodata->texture; // // sp62 = random() * 1024; -// sp5c = (coss(sp62) * texture->unk04 * 0xb5) >> 18; -// sp58 = (sins(sp62) * texture->unk04 * 0xb5) >> 18; +// sp5c = (coss(sp62) * tconfig->width * 0xb5) >> 18; +// sp58 = (sins(sp62) * tconfig->width * 0xb5) >> 18; // -// centre = texture->unk04 << 4; +// centre = tconfig->width << 4; // // vertices[0].unk08 = centre - sp5c; // vertices[0].unk0a = centre - sp58; @@ -6646,7 +6631,7 @@ glabel var70054454 // vertices[3].unk08 = centre - sp58; // vertices[3].unk0a = centre + sp5c; // -// func000216cc(renderdata, texture, 4); +// func000216cc(renderdata, tconfig, 4); // } else { // func000216cc(renderdata, NULL, 1); // }