core2/modelRender.c documentation

This commit is contained in:
Banjo Kazooie
2022-12-01 13:27:28 -06:00
parent b74c76a430
commit aa33833595
43 changed files with 385 additions and 356 deletions

View File

@@ -3,6 +3,7 @@
#include <ultra64.h> #include <ultra64.h>
#include "model.h" #include "model.h"
#include "generic.h"
enum model_render_depth_mode_e{ enum model_render_depth_mode_e{
MODEL_RENDER_DEPTH_NONE = 0, MODEL_RENDER_DEPTH_NONE = 0,
@@ -16,9 +17,21 @@ BKTextureList *model_getTextureList(BKModelBin *arg0);
void modelRender_reset(void); void modelRender_reset(void);
BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3], f32 scale, f32*arg5, BKModelBin* model_bin); BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3], f32 scale, f32*arg5, BKModelBin* model_bin);
void modelRender_preDraw(GenMethod_1 func, s32 arg);
void modelRender_postDraw(GenMethod_1 func, s32 arg);
void modelRender_setDisplayList(BKGfxList *gfx_list); void modelRender_setDisplayList(BKGfxList *gfx_list);
void func_8033A308(f32 arg0[3]);
void modelRender_setPrimAndEnvColors(s32 env[4], s32 prim[4]);
void modelRender_setEnvColor(s32 r, s32 g, s32 b, s32 a);
void modelRender_setAlpha(s32 a);
void func_8033A444(struct58s *arg0);
void func_8033A450(s32 arg0);
void func_8033A45C(s32 arg0, s32 arg1);
void func_8033A470(s32 arg0, s32 arg1);
void modelRender_setTextureList(BKTextureList *textureList); void modelRender_setTextureList(BKTextureList *textureList);
void func_8033A494(s32 arg0);
void func_8033A4A0(enum asset_e modelId, f32 arg1, f32 arg2);
void modelRender_setVertexList(BKVertexList *vertex_list); void modelRender_setVertexList(BKVertexList *vertex_list);
void modelRender_setDepthMode(enum model_render_depth_mode_e renderMode); void modelRender_setDepthMode(enum model_render_depth_mode_e renderMode);
void modelRender_defrag(void);
#endif #endif

View File

@@ -18,15 +18,12 @@
#include "bs_funcs.h" #include "bs_funcs.h"
#include "bsint.h" #include "bsint.h"
#include "generic.h"
extern f32 fabsf(f32); extern f32 fabsf(f32);
#pragma intrinsic (fabsf) #pragma intrinsic (fabsf)
typedef void (* GenMethod_0)(void);
typedef void (* GenMethod_1)(s32);
typedef void (* GenMethod_2)(s32, s32);
typedef void (* GenMethod_4)(s32, s32, s32, s32);
typedef void (* GenMethod_5)(s32, s32, s32, s32, s32);
#define NOT(boolean) ((boolean) ^ 1) #define NOT(boolean) ((boolean) ^ 1)
#define TUPLE_ASSIGN(out, a, b, c) {\ #define TUPLE_ASSIGN(out, a, b, c) {\

View File

@@ -120,7 +120,7 @@ typedef struct {
u8 unk60[0x30]; u8 unk60[0x30];
u8 unk90[0x20]; u8 unk90[0x20];
u8 unkB0[0x40]; u8 unkB0[0x40];
BKModelBin *unkF0; BKModelBin *model;
AnimCtrl *anim_ctrl; AnimCtrl *anim_ctrl;
BKSprite *unkF8; BKSprite *unkF8;
BKSpriteDisplayData *unkFC; BKSpriteDisplayData *unkFC;

11
include/generic.h Normal file
View File

@@ -0,0 +1,11 @@
#ifndef _GENERIC_METHODS_H_
#define _GENERIC_METHODS_H_
typedef void (* GenMethod_0)(void);
typedef void (* GenMethod_1)(s32);
typedef void (* GenMethod_2)(s32, s32);
typedef void (* GenMethod_3)(s32, s32, s32);
typedef void (* GenMethod_4)(s32, s32, s32, s32);
typedef void (* GenMethod_5)(s32, s32, s32, s32, s32);
#endif

View File

@@ -109,8 +109,8 @@ Actor *chyumblie_draw(ActorMarker *this, Gfx **gfx, Mtx** mtx, Vtx **vtx){
return thisActor; return thisActor;
} }
func_8033A2D4(func_803253A0, thisActor, sp40); modelRender_preDraw((GenMethod_1) func_803253A0, (s32)thisActor);
func_8033A2E8(func_80325794, this); modelRender_postDraw((GenMethod_1) func_80325794, (s32)this);
sp44[0] = thisActor->position_x; sp44[0] = thisActor->position_x;
sp44[1] = thisActor->position_y + sp40->unk0*75.0f; sp44[1] = thisActor->position_y + sp40->unk0*75.0f;
sp44[2] = thisActor->position_z; sp44[2] = thisActor->position_z;

View File

@@ -130,7 +130,7 @@ Actor *chgobi2_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
sp3C[1] = this->yaw; sp3C[1] = this->yaw;
sp3C[2] = this->roll; sp3C[2] = this->roll;
func_8033A238(func_803356A0(this->unk148)); func_8033A238(func_803356A0(this->unk148));
func_8033A2D4(func_803253A0, this); modelRender_preDraw(func_803253A0, this);
modelRender_draw(gfx, mtx, this->position, sp3C, 1.0f, NULL, func_80330B1C(this_marker)); modelRender_draw(gfx, mtx, this->position, sp3C, 1.0f, NULL, func_80330B1C(this_marker));
if(this->state == 4){ if(this->state == 4){

View File

@@ -71,7 +71,7 @@ Actor *func_80388C64(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
sp3C[0] = this->pitch; sp3C[0] = this->pitch;
sp3C[1] = this->yaw; sp3C[1] = this->yaw;
sp3C[2] = this->roll; sp3C[2] = this->roll;
func_8033A2D4(func_803253A0, this); modelRender_preDraw(func_803253A0, this);
func_8033A450(func_80329934()); func_8033A450(func_80329934());
modelRender_draw(gfx, mtx, this->position, sp3C, 1.0f, NULL,func_80330B1C(this_marker)); modelRender_draw(gfx, mtx, this->position, sp3C, 1.0f, NULL,func_80330B1C(this_marker));
func_8034A174(func_80329934(), 5, local->unk0); func_8034A174(func_80329934(), 5, local->unk0);

View File

@@ -29,7 +29,7 @@ Actor *func_803892D0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
position[1] = this->position_y; position[1] = this->position_y;
position[2] = this->position_z; position[2] = this->position_z;
position[1] += 8.0f; position[1] += 8.0f;
func_8033A2D4(func_803253A0, this); modelRender_preDraw(func_803253A0, this);
modelRender_draw(gfx, mtx, position, rotation, this->unk1C[0], NULL, func_80330B1C(this_marker)); modelRender_draw(gfx, mtx, position, rotation, this->unk1C[0], NULL, func_80330B1C(this_marker));
} }
return this; return this;

View File

@@ -85,7 +85,7 @@ Actor *func_80388188(ActorMarker *this, Gfx **dl, Mtx **mptr, Vtx **vtx){
sp48[0] = actorPtr->position_x; sp48[0] = actorPtr->position_x;
sp48[1] = actorPtr->unk1C_y + 3.0f; sp48[1] = actorPtr->unk1C_y + 3.0f;
sp48[2] = actorPtr->position_z; sp48[2] = actorPtr->position_z;
func_8033A410( (s32) MIN(255.0f, actorPtr->unk60) ); modelRender_setAlpha( (s32) MIN(255.0f, actorPtr->unk60) );
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
modelRender_draw(dl, mptr, sp48, sp54, actorPtr->unk28, sp60, func_8030A428(0x18)); modelRender_draw(dl, mptr, sp48, sp54, actorPtr->unk28, sp60, func_8030A428(0x18));
actorPtr->position_y -= 1.9; actorPtr->position_y -= 1.9;

View File

@@ -69,10 +69,10 @@ Actor *chMotzhand_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
func_8033A238(func_803356A0(this->unk148)); func_8033A238(func_803356A0(this->unk148));
if(this->state == 4){ if(this->state == 4){
func_8033A410((s32) (local->alpha * 255.0f)); modelRender_setAlpha((s32) (local->alpha * 255.0f));
} }
else{ else{
func_8033A410((s32) 255); modelRender_setAlpha((s32) 255);
} }
sp3C[0] = sp3C[1] = sp3C[2] = 0.0f; sp3C[0] = sp3C[1] = sp3C[2] = 0.0f;

View File

@@ -84,10 +84,10 @@ Actor *chnapper_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
} }
if(this->state == 1){ //set model alpha if(this->state == 1){ //set model alpha
func_8033A410(0x80); modelRender_setAlpha(0x80);
} }
else{ else{
func_8033A410(0xdc); modelRender_setAlpha(0xdc);
} }
return func_80325888(marker, gfx, mtx, vtx); return func_80325888(marker, gfx, mtx, vtx);

View File

@@ -32,9 +32,9 @@ void func_8038AC40(Struct_MMM_47D0_0 *arg0, struct struct_68_s *arg1, f32 positi
if (arg0->unk4 != 3) { if (arg0->unk4 != 3) {
if ((arg0->unk4 == 0) || (arg0->unk4 == 1)) { if ((arg0->unk4 == 0) || (arg0->unk4 == 1)) {
func_8033A410(0xFF, arg0); modelRender_setAlpha(0xFF);
} else if (arg0->unk4 == 2) { } else if (arg0->unk4 == 2) {
func_8033A410((s32)((1 - ((f64)arg0->unk8 * 1)) * 255.0), arg0); modelRender_setAlpha((s32)((1 - ((f64)arg0->unk8 * 1)) * 255.0));
} }
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
modelRender_draw(gfx, mtx, position, rotation, scale, NULL, model_bin); modelRender_draw(gfx, mtx, position, rotation, scale, NULL, model_bin);

View File

@@ -25,21 +25,21 @@ void func_8038B3F0(Struct5Fs *arg0, struct struct_68_s *arg1, f32 position[3], f
sp58[1] = temp_f4; sp58[1] = temp_f4;
sp58[2] = temp_f4; sp58[2] = temp_f4;
sp58[3] = 0xFF; sp58[3] = 0xFF;
func_8033A334(sp58, __mmm_5000_red); modelRender_setPrimAndEnvColors(sp58, __mmm_5000_red);
} else if (arg0->unk4 > 0.0f) { } else if (arg0->unk4 > 0.0f) {
temp_f6 = (s32) (((1.0f - arg0->unk4) * 223.0f) + 32.0f); temp_f6 = (s32) (((1.0f - arg0->unk4) * 223.0f) + 32.0f);
sp44[0] = temp_f6; sp44[0] = temp_f6;
sp44[1] = temp_f6; sp44[1] = temp_f6;
sp44[2] = temp_f6; sp44[2] = temp_f6;
sp44[3] = 0xFF; sp44[3] = 0xFF;
func_8033A334(sp44, __mmm_5000_green); modelRender_setPrimAndEnvColors(sp44, __mmm_5000_green);
} else if (arg0->unk0 > 0.0f) { } else if (arg0->unk0 > 0.0f) {
temp_f8 = (s32) (((1.0f - arg0->unk0) * 223.0f) + 32.0f); temp_f8 = (s32) (((1.0f - arg0->unk0) * 223.0f) + 32.0f);
sp30[0] = temp_f8; sp30[0] = temp_f8;
sp30[1] = temp_f8; sp30[1] = temp_f8;
sp30[2] = temp_f8; sp30[2] = temp_f8;
sp30[3] = 0xFF; sp30[3] = 0xFF;
func_8033A334(sp30, __mmm_5000_blue); modelRender_setPrimAndEnvColors(sp30, __mmm_5000_blue);
} }
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
modelRender_draw(gfx, mtx, position, rotation, scale, NULL, model_bin); modelRender_draw(gfx, mtx, position, rotation, scale, NULL, model_bin);

View File

@@ -4,7 +4,6 @@
extern void func_8028F9DC(s32); extern void func_8028F9DC(s32);
extern void func_803253A0(Actor *); extern void func_803253A0(Actor *);
extern void func_8033A2D4(void(*)(Actor *), Actor *);
/* typedefs and declarations */ /* typedefs and declarations */
typedef struct { typedef struct {
@@ -77,7 +76,7 @@ Actor *func_8038A224(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3){
return actor; return actor;
} }
func_8033A2D4(func_803253A0, actor); modelRender_preDraw(func_803253A0, actor);
if(local->unk4){ if(local->unk4){
modelRender_draw(gdl, mptr, &actor->position, NULL, 1.0f, NULL, local->unk4); modelRender_draw(gdl, mptr, &actor->position, NULL, 1.0f, NULL, local->unk4);
} }

View File

@@ -111,7 +111,7 @@ Actor *func_8038B230(ActorMarker *marker, Gfx** gdl, Mtx** mptr, s32 arg3){
sp3C[0] = actor->pitch; sp3C[0] = actor->pitch;
sp3C[1] = actor->yaw; sp3C[1] = actor->yaw;
sp3C[2] = actor->roll; sp3C[2] = actor->roll;
func_8033A2D4(&func_803253A0, actor); modelRender_preDraw(&func_803253A0, actor);
func_8033A450(func_80329934()); func_8033A450(func_80329934());
modelRender_draw(gdl, mptr, &actor->position, &sp3C, actor->scale, NULL, func_80330B1C(marker)); modelRender_draw(gdl, mptr, &actor->position, &sp3C, actor->scale, NULL, func_80330B1C(marker));
func_8034A174(func_80329934(), 5, &local->unk4); func_8034A174(func_80329934(), 5, &local->unk4);

View File

@@ -265,7 +265,7 @@ void RBB_func_8038CC9C(Actor *this, s32 new_state){
int i; int i;
f32 pad; f32 pad;
f32 sp68[3]; f32 sp68[3];
f32 sp64; f32 player_position;
f32 sp60; f32 sp60;
f32 sp5C; f32 sp5C;
f32 sp58; f32 sp58;
@@ -404,11 +404,11 @@ void RBB_func_8038CC9C(Actor *this, s32 new_state){
if(this->state == 3 || this->state == 4 || this->state == 5){ if(this->state == 3 || this->state == 4 || this->state == 5){
local->unk20 = RBB_func_8038CBF0(this); local->unk20 = RBB_func_8038CBF0(this);
if( local->unk20 == 0){ if( local->unk20 == 0){
sp64 = local->unk0->unk4*300.0f; player_position = local->unk0->unk4*300.0f;
for(i = 0; i < 10; i++){ for(i = 0; i < 10; i++){
local->unk14[0] = local->unk8[0] + randf2(-sp64, sp64); local->unk14[0] = local->unk8[0] + randf2(-player_position, player_position);
local->unk14[1] = local->unk14[1]; local->unk14[1] = local->unk14[1];
local->unk14[2] = local->unk8[2] + randf2(-sp64, sp64); local->unk14[2] = local->unk8[2] + randf2(-player_position, player_position);
func_8038CA70(this, &local->unk14); func_8038CA70(this, &local->unk14);
local->unk20 = RBB_func_8038CBF0(this); local->unk20 = RBB_func_8038CBF0(this);
if(local->unk20) if(local->unk20)
@@ -465,9 +465,9 @@ Actor *func_8038D638(ActorMarker *marker, Gfx **gdl, Mtx ** mptr, s32 arg3){
func_8033A45C(6, (actor->state == 4)? 2: 1); func_8033A45C(6, (actor->state == 4)? 2: 1);
func_8033A45C(7, (actor->state == 4)? 2: 1); func_8033A45C(7, (actor->state == 4)? 2: 1);
} }
func_8033A2D4(func_803253A0, actor); modelRender_preDraw( (GenMethod_1)func_803253A0, (s32)actor);
func_8033A2E8(func_80325794, marker); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker);
modelRender_draw(gdl, mptr, &actor->position, &sp3C, actor->scale, NULL, func_80330B1C(marker)); modelRender_draw(gdl, mptr, actor->position, sp3C, actor->scale, NULL, func_80330B1C(marker));
return actor; return actor;
} }
@@ -493,7 +493,7 @@ void func_8038D7E8(ActorMarker *marker, s32 arg1){
void func_8038D8B4(Actor *actor){} void func_8038D8B4(Actor *actor){}
void func_8038D8BC(Actor *this){ void func_8038D8BC(Actor *this){
f32 sp64[3]; f32 player_position[3];
ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &this->local; ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &this->local;
f32 sp5C; f32 sp5C;
f32 sp58; f32 sp58;
@@ -540,7 +540,7 @@ void func_8038D8BC(Actor *this){
return; return;
} }
player_getPosition(&sp64); player_getPosition(player_position);
if(this->state == 1){ if(this->state == 1){
if(func_803203FC(2)){ if(func_803203FC(2)){
if(func_803203FC(3)){ if(func_803203FC(3)){
@@ -548,7 +548,7 @@ void func_8038D8BC(Actor *this){
} }
} }
else{//L8038DAA8 else{//L8038DAA8
if(ml_vec3f_distance(&this->position, &sp64) < 1200.0f){ if(ml_vec3f_distance(this->position, player_position) < 1200.0f){
RBB_func_8038CC9C(this, 2); RBB_func_8038CC9C(this, 2);
} }
} }
@@ -565,7 +565,7 @@ void func_8038D8BC(Actor *this){
if(func_8033567C(this->unk148) == ASSET_147_ANIM_BOOMBOX_MOVE){ if(func_8033567C(this->unk148) == ASSET_147_ANIM_BOOMBOX_MOVE){
func_8033568C(this->unk148, &sp5C, &sp58); func_8033568C(this->unk148, &sp5C, &sp58);
if(sp5C < 0.6 && 0.6 <= sp58){ if(sp5C < 0.6 && 0.6 <= sp58){
func_8030E878(SFX_6C_LOCKUP_CLOSING, randf2(-0.05f, 0.05f) + local->unk0->unk14, 0x4e20, &this->position, 500.0f, 1000.0f); func_8030E878(SFX_6C_LOCKUP_CLOSING, randf2(-0.05f, 0.05f) + local->unk0->unk14, 20000, this->position, 500.0f, 1000.0f);
}//L8038DC04 }//L8038DC04
if(sp5C < 0.1 && 0.1 <= sp58){ if(sp5C < 0.1 && 0.1 <= sp58){
func_8038C39C(this); func_8038C39C(this);
@@ -584,7 +584,7 @@ void func_8038D8BC(Actor *this){
func_8033568C(this->unk148, &sp54, &sp50); func_8033568C(this->unk148, &sp54, &sp50);
if(0.1 <= sp50 && sp50 <= 0.6){ if(0.1 <= sp50 && sp50 <= 0.6){
sp4C = (sp50 - 0.1)/0.5; sp4C = (sp50 - 0.1)/0.5;
func_80255FE4(&this->position, &local->unk8, &local->unk14, sp4C); func_80255FE4(this->position, local->unk8, local->unk14, sp4C);
this->yaw = local->unk24 + sp4C*(local->unk28 - local->unk24); this->yaw = local->unk24 + sp4C*(local->unk28 - local->unk24);
} }
@@ -602,7 +602,7 @@ void func_8038D8BC(Actor *this){
tmp_f2 = tmp_f2/0.3; tmp_f2 = tmp_f2/0.3;
else else
tmp_f2 = 1.0f; tmp_f2 = 1.0f;
func_80255FE4(&this->position, &local->unk8, &local->unk14, tmp_f2); func_80255FE4(this->position, local->unk8, local->unk14, tmp_f2);
} }
}//L8038DE10 }//L8038DE10

View File

@@ -305,7 +305,7 @@ Actor * func_8038F4B0(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3){
D_803912A0[0] = actor->pitch; D_803912A0[0] = actor->pitch;
D_803912A0[1] = actor->yaw; D_803912A0[1] = actor->yaw;
D_803912A0[2] = actor->roll; D_803912A0[2] = actor->roll;
func_8033A334(sp28, &D_80390DDC); modelRender_setPrimAndEnvColors(sp28, &D_80390DDC);
}//L8038F5F8 }//L8038F5F8
return func_80325888(marker, gdl, mptr, arg3); return func_80325888(marker, gdl, mptr, arg3);
} }

View File

@@ -239,7 +239,7 @@ Actor *func_8038A0D0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
sp40[2] = actor->position[2]; sp40[2] = actor->position[2];
func_8032AA58(actor, sp3C); func_8032AA58(actor, sp3C);
func_8033A2D4(func_803253A0, actor); modelRender_preDraw(func_803253A0, actor);
modelRender_draw(gfx, mtx, sp40, sp4C, sp3C, NULL, func_80330B1C(marker)); modelRender_draw(gfx, mtx, sp40, sp4C, sp3C, NULL, func_80330B1C(marker));
return actor; return actor;
} }

View File

@@ -48,7 +48,7 @@ Actor *func_802D6F48(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
} }
if(other) if(other)
func_8033A410(other->alpha_124_19); modelRender_setAlpha(other->alpha_124_19);
sp40 = ml_map_f(this->unk28, 0.0f , 800.0f, 0.53f, 0.18f)*this->unk1C[1]; sp40 = ml_map_f(this->unk28, 0.0f , 800.0f, 0.53f, 0.18f)*this->unk1C[1];
modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE); modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE);
modelRender_draw(gfx, mtx, this->position, sp44, sp40, NULL, func_80330B1C(marker)); modelRender_draw(gfx, mtx, this->position, sp44, sp40, NULL, func_80330B1C(marker));

View File

@@ -109,10 +109,10 @@ Actor *func_802C4360(ActorMarker *marker, Gfx **arg1, Mtx **arg2, Vtx **arg3){
func_8033A45C(0xC, 1); func_8033A45C(0xC, 1);
func_8033A45C(0xF, 1); func_8033A45C(0xF, 1);
if(sp1C == D_80365E00){ if(sp1C == D_80365E00){
func_8033A388(0xFF, 0xFF, 0xFF, 0xFF); modelRender_setEnvColor(0xFF, 0xFF, 0xFF, 0xFF);
} }
else{ else{
func_8033A388(0x64, 0x64, 0x64, 0xFF); modelRender_setEnvColor(0x64, 0x64, 0x64, 0xFF);
} }
return func_80325888(marker, arg1, arg2, arg3); return func_80325888(marker, arg1, arg2, arg3);
} }

View File

@@ -17,7 +17,7 @@ ActorInfo D_80366EF0 = {
/* .code */ /* .code */
void func_802CA790(Actor *this){ void func_802CA790(Actor *this){
func_8033A410(0xff); modelRender_setAlpha(0xff);
modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE); modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE);
} }
@@ -52,7 +52,7 @@ Actor *func_802CA7BC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
sp48[1] = this->yaw; sp48[1] = this->yaw;
sp48[2] = this->roll; sp48[2] = this->roll;
sp44 = ml_map_f(sp54[1] - sp40, 0.0f, 300.0f, 0.43f, 0.28f); sp44 = ml_map_f(sp54[1] - sp40, 0.0f, 300.0f, 0.43f, 0.28f);
func_8033A2D4(func_802CA790, this); modelRender_preDraw(func_802CA790, this);
modelRender_draw(gfx, mtx, this->position, sp48, sp44, NULL, func_80330B1C(marker)); modelRender_draw(gfx, mtx, this->position, sp48, sp44, NULL, func_80330B1C(marker));
return this; return this;
} }

View File

@@ -98,12 +98,12 @@ Actor *chBeeSwarm_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
sp8C[2] = this->position[2] + phi_s0->unk0[2]; sp8C[2] = this->position[2] + phi_s0->unk0[2];
modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE); modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE);
func_8033A410(0xFF); modelRender_setAlpha(0xFF);
modelRender_draw(gfx, mtx, sp8C, sp80, 0.25f, NULL, phi_fp); modelRender_draw(gfx, mtx, sp8C, sp80, 0.25f, NULL, phi_fp);
local->unk5 |= func_8033A170(); local->unk5 |= func_8033A170();
if(phi_s2 < 10){ if(phi_s2 < 10){
sp8C[1] = local->unk18 + 6.0f; sp8C[1] = local->unk18 + 6.0f;
func_8033A410(0xC0); modelRender_setAlpha(0xC0);
modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE); modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE);
modelRender_draw(gfx, mtx, sp8C, sp80, 0.1f, NULL, local->unk20); modelRender_draw(gfx, mtx, sp8C, sp80, 0.1f, NULL, local->unk20);
local->unk5 |= func_8033A170(); local->unk5 |= func_8033A170();

View File

@@ -29,8 +29,8 @@ Actor *func_802DC320(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
f32 sp34[3]; f32 sp34[3];
this = marker_getActor(marker); this = marker_getActor(marker);
func_8033A2D4(func_803253A0, this); modelRender_preDraw( (GenMethod_1)func_803253A0, (s32)this);
func_8033A2E8(func_80325794, marker); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker);
func_8024E258(); func_8024E258();
sp58[0] = 0.0f; sp58[0] = 0.0f;
sp58[1] = 0.0f; sp58[1] = 0.0f;

View File

@@ -28,8 +28,8 @@ Actor *func_802DC7E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
f32 sp34[3]; f32 sp34[3];
this = marker_getActor(marker); this = marker_getActor(marker);
func_8033A2D4(func_803253A0, this); modelRender_preDraw( (GenMethod_1)func_803253A0, (s32)this);
func_8033A2E8(func_80325794, marker); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker);
func_8024E258(); func_8024E258();
sp58[0] = 0.0f; sp58[0] = 0.0f;
sp58[1] = 0.0f; sp58[1] = 0.0f;

View File

@@ -45,8 +45,8 @@ Actor *func_802DCB50(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **vptr){
if(D_8037DE84) if(D_8037DE84)
return actor; return actor;
func_8033A2D4(func_803253A0, actor); modelRender_preDraw((GenMethod_1)func_803253A0, (s32)actor);
func_8033A2E8(func_80325794, marker); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker);
func_8024E258(); func_8024E258();
{sp58[0] = 0.0f; sp58[1] = 0.0f; sp58[2] = 1312.5f;}; {sp58[0] = 0.0f; sp58[1] = 0.0f; sp58[2] = 1312.5f;};
{sp4C[0] = 0.0f; sp4C[1] = 0.0f; sp4C[2] = 0.0f;}; {sp4C[0] = 0.0f; sp4C[1] = 0.0f; sp4C[2] = 0.0f;};

View File

@@ -35,8 +35,8 @@ Actor *func_802DCE00(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **vptr){
actor = marker_getActor(marker); actor = marker_getActor(marker);
func_8033A2D4(func_803253A0, actor); modelRender_preDraw((GenMethod_1)func_803253A0, (s32)actor);
func_8033A2E8(func_80325794, marker); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker);
func_8024E258(); func_8024E258();
{sp58[0] = 0.0f; sp58[1] = 0.0f; sp58[2] = 1312.5f;}; {sp58[0] = 0.0f; sp58[1] = 0.0f; sp58[2] = 1312.5f;};
{sp4C[0] = 0.0f; sp4C[1] = 0.0f; sp4C[2] = 0.0f;}; {sp4C[0] = 0.0f; sp4C[1] = 0.0f; sp4C[2] = 0.0f;};

View File

@@ -171,8 +171,8 @@ Actor *func_802DD188(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
gDPSetTextureFilter((*gfx)++, G_TF_POINT); gDPSetTextureFilter((*gfx)++, G_TF_POINT);
gSPSegment((*gfx)++, 0x04, osVirtualToPhysical(sp50)); gSPSegment((*gfx)++, 0x04, osVirtualToPhysical(sp50));
func_8033A2D4(func_803253A0, sp6C); modelRender_preDraw((GenMethod_1)func_803253A0, (s32)sp6C);
func_8033A2E8(func_80325794, marker); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker);
modelRender_draw(gfx, mtx, sp60, NULL, D_80368250, sp54, func_80330B1C(marker)); modelRender_draw(gfx, mtx, sp60, NULL, D_80368250, sp54, func_80330B1C(marker));
gDPSetTextureFilter((*gfx)++, G_TF_BILERP); gDPSetTextureFilter((*gfx)++, G_TF_BILERP);

View File

@@ -65,9 +65,9 @@ Actor *func_802DEC00(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
gDPSetColorDither((*gfx)++, G_CD_DISABLE); gDPSetColorDither((*gfx)++, G_CD_DISABLE);
func_80253190(gfx); func_80253190(gfx);
gSPSegment((*gfx)++, 0x04, osVirtualToPhysical(sp48)); gSPSegment((*gfx)++, 0x04, osVirtualToPhysical(sp48));
func_8033A2D4(func_803253A0, this); modelRender_preDraw((GenMethod_1)func_803253A0, (s32)this);
func_8033A2E8(func_80325794, marker); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker);
modelRender_draw(gfx, mtx, this->position, NULL, 4.5f, &sp4C, func_80330B1C(marker)); modelRender_draw(gfx, mtx, this->position, NULL, 4.5f, sp4C, func_80330B1C(marker));
gDPSetTextureFilter((*gfx)++, G_TF_BILERP); gDPSetTextureFilter((*gfx)++, G_TF_BILERP);
gDPSetColorDither((*gfx)++, G_CD_MAGICSQ); gDPSetColorDither((*gfx)++, G_CD_MAGICSQ);
func_802DD158(gfx, mtx); func_802DD158(gfx, mtx);

View File

@@ -31,8 +31,8 @@ Actor *func_802DF160(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
gDPSetTextureFilter((*gfx)++, G_TF_POINT); gDPSetTextureFilter((*gfx)++, G_TF_POINT);
gSPSegment((*gfx)++, 0x04, osVirtualToPhysical(sp38)); gSPSegment((*gfx)++, 0x04, osVirtualToPhysical(sp38));
func_8033A2D4(func_803253A0, this); modelRender_preDraw((GenMethod_1)func_803253A0, (s32)this);
func_8033A2E8(func_80325794, D_8037E000); modelRender_postDraw((GenMethod_1)func_80325794, (s32)D_8037E000);
modelRender_draw(gfx, mtx, &D_80368360, NULL, 1.0f, NULL, func_80330B1C(D_8037E000)); modelRender_draw(gfx, mtx, &D_80368360, NULL, 1.0f, NULL, func_80330B1C(D_8037E000));
gDPSetTextureFilter((*gfx)++, G_TF_BILERP); gDPSetTextureFilter((*gfx)++, G_TF_BILERP);
return this; return this;

View File

@@ -146,8 +146,8 @@ void func_802DF71C(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
f32 sp3C; f32 sp3C;
this = func_80325300(D_8037E060, &sp44); this = func_80325300(D_8037E060, &sp44);
func_8033A2D4(func_803253A0, this); modelRender_preDraw((GenMethod_1)func_803253A0, (s32)this);
func_8033A2E8(func_80325794, D_8037E060); modelRender_postDraw((GenMethod_1)func_80325794, (s32)D_8037E060);
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
actor_setOpacity(this, 0xB9); actor_setOpacity(this, 0xB9);
func_8024E030(this->position, D_8037E5C0.unk18); func_8024E030(this->position, D_8037E5C0.unk18);

View File

@@ -89,9 +89,9 @@ Actor *func_802E0738(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this; Actor *this;
this = func_80325300(marker, &sp34); this = func_80325300(marker, &sp34);
func_8033A2D4(func_802E0710, this); modelRender_preDraw( (GenMethod_1)func_802E0710, (s32)this);
func_8033A2E8(func_80325794, marker); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker);
modelRender_draw(gfx, mtx, this->position, &sp34, this->scale, NULL, func_80330B1C(marker)); modelRender_draw(gfx, mtx, this->position, sp34, this->scale, NULL, func_80330B1C(marker));
return this; return this;
} }

View File

@@ -78,7 +78,7 @@ void func_802E3854(void){
func_80254464(); func_80254464();
for(i = 0; i < 0xF; i++){ for(i = 0; i < 0xF; i++){
func_802E6820(5); func_802E6820(5);
func_8033A4D8(); modelRender_defrag();
mapSavestate_defrag_all(); mapSavestate_defrag_all();
gctransition_8030B740(); gctransition_8030B740();
func_802F542C(); func_802F542C();
@@ -589,7 +589,7 @@ s32 func_802E48D8(void){
func_80288470(); func_80288470();
func_802F1320(); func_802F1320();
func_802BA128(); func_802BA128();
func_8033A4D8(); modelRender_defrag();
func_8028FB68(); func_8028FB68();
func_802F0E58(); func_802F0E58();
func_8030A298(); func_8030A298();

View File

@@ -162,7 +162,7 @@ void func_802EEE3C(ParticleEmitter *this, Gfx **gfx, Mtx **mtx, Vtx **vtx, u32 a
sp8C[1] = iPtr->position_18[1] + this->unk4[1]; sp8C[1] = iPtr->position_18[1] + this->unk4[1];
sp8C[2] = iPtr->position_18[2] + this->unk4[2]; sp8C[2] = iPtr->position_18[2] + this->unk4[2];
if( 0.0f != this->unk10 || 1.0 != this->unk14 || this->unk49 != 0xff ){ if( 0.0f != this->unk10 || 1.0 != this->unk14 || this->unk49 != 0xff ){
func_8033A410((s32) (iPtr->unkC*this->unk49)); modelRender_setAlpha((s32) (iPtr->unkC*this->unk49));
}//L802EEF5C }//L802EEF5C
// tmp_a3 = (this->unk18 & 0x10)?0:1; // tmp_a3 = (this->unk18 & 0x10)?0:1;
modelRender_setDepthMode((this->unk18 & 0x10)?0:1); modelRender_setDepthMode((this->unk18 & 0x10)?0:1);

View File

@@ -9,7 +9,7 @@ extern UNK_TYPE(s32) func_802E92AC(BKCollisionList *, BKVertexList *, f32[3], f3
extern UNK_TYPE(s32) func_802EC394(BKMeshList *, UNK_TYPE(s32), UNK_TYPE(s32), f32, UNK_TYPE(s32), UNK_TYPE(s32), UNK_TYPE(s32)); extern UNK_TYPE(s32) func_802EC394(BKMeshList *, UNK_TYPE(s32), UNK_TYPE(s32), f32, UNK_TYPE(s32), UNK_TYPE(s32), UNK_TYPE(s32));
extern void func_802EC458(BKVertexList *, s32[3], s32[3]); extern void func_802EC458(BKVertexList *, s32[3], s32[3]);
extern void func_8033A494(s32); extern void func_8033A494(s32);
extern void func_8033A388(s32, s32, s32, s32); extern void modelRender_setEnvColor(s32, s32, s32, s32);
extern void func_802F7BC0(Gfx **, Mtx **, Vtx **); extern void func_802F7BC0(Gfx **, Mtx **, Vtx **);
extern void func_8033A450(s32); extern void func_8033A450(s32);
extern void func_8033A45C(s32, s32); extern void func_8033A45C(s32, s32);
@@ -164,20 +164,20 @@ Struct_core2_82000_0 D_8036ABE0[] = {
struct { struct {
void *unk0; void *unk0;
void *unk4; void *unk4;
BKCollisionList *unk8; BKCollisionList *collision_opa;
BKCollisionList *unkC; BKCollisionList *collision_xlu;
BKModel *unk10; BKModel *model_opa;
BKModel *unk14; BKModel *model_xlu;
BKModelBin *unk18; BKModelBin *model_bin_opa;
BKModelBin *unk1C; BKModelBin *model_bin_xlu;
s32 unk20; s32 unk20;
struct5Bs *unk24; struct5Bs *unk24;
Struct_core2_82000_0 *unk28; Struct_core2_82000_0 *unk28;
u8 unk2C; u8 env_red;
u8 unk2D; u8 env_green;
u8 unk2E; u8 env_blue;
f32 unk30; f32 unk30;
}D_80382350; }levelModel;
enum asset_e func_8030A068(void); enum asset_e func_8030A068(void);
@@ -237,7 +237,7 @@ f32 func_80308FDC(f32 arg0[3], u32 arg1) {
return 0.0f; return 0.0f;
} }
void func_803091D4(Gfx **gfx, Mtx **mtx, Vtx **vtx) { void levelModel_opa_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
s32 temp_a0; s32 temp_a0;
if (func_80320708() && levelSpecificFlags_validateCRC2() && func_80320248()) { if (func_80320708() && levelSpecificFlags_validateCRC2() && func_80320248()) {
@@ -339,44 +339,42 @@ void func_803091D4(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
func_8033A45C(6, (func_8038EAE0(0xA) || func_8031FF1C(0xE2) || func_803203FC(0xC1))); func_8033A45C(6, (func_8038EAE0(0xA) || func_8031FF1C(0xE2) || func_803203FC(0xC1)));
break; break;
} }
func_8033A450(D_80382350.unk24); func_8033A450(levelModel.unk24);
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
temp_a0 = D_80382350.unk0; temp_a0 = levelModel.unk0;
if (temp_a0 != 0) { if (temp_a0 != 0) {
func_8033A494(temp_a0); func_8033A494(temp_a0);
} }
func_8033A388(D_80382350.unk2C, D_80382350.unk2D, D_80382350.unk2E, 0xFF); modelRender_setEnvColor(levelModel.env_red, levelModel.env_green, levelModel.env_blue, 0xFF);
modelRender_draw(gfx, mtx, NULL, NULL, D_80382350.unk28->unk14, NULL, D_80382350.unk18); modelRender_draw(gfx, mtx, NULL, NULL, levelModel.unk28->unk14, NULL, levelModel.model_bin_opa);
if (!func_80309F78()) { if (!func_80309F78()) {
func_802F7BC0(gfx, mtx, vtx); func_802F7BC0(gfx, mtx, vtx);
} }
} }
} }
//levelRender_model2_draw void levelModel_xlu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
void func_80309628(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
s32 temp_a0; s32 temp_a0;
if (D_80382350.unk1C != NULL) { if (levelModel.model_bin_xlu != NULL) {
if (map_get() == MAP_1D_MMM_CELLAR) { if (map_get() == MAP_1D_MMM_CELLAR) {
func_8033A45C(1, (func_80326EEC(0x191) != NULL) ? 0 : 1); func_8033A45C(1, (func_80326EEC(0x191) != NULL) ? 0 : 1);
} }
modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE); modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE);
temp_a0 = D_80382350.unk4; temp_a0 = levelModel.unk4;
if (temp_a0 != 0) { if (temp_a0 != 0) {
func_8033A494(temp_a0); func_8033A494(temp_a0);
} }
func_8033A388(D_80382350.unk2C, D_80382350.unk2D, D_80382350.unk2E, 0xFF); modelRender_setEnvColor(levelModel.env_red, levelModel.env_green, levelModel.env_blue, 0xFF);
modelRender_draw(gfx, mtx, NULL, NULL, D_80382350.unk28->unk14, NULL, D_80382350.unk1C); modelRender_draw(gfx, mtx, NULL, NULL, levelModel.unk28->unk14, NULL, levelModel.model_bin_xlu);
func_802F7BC0(gfx, mtx, vtx); func_802F7BC0(gfx, mtx, vtx);
} }
} }
void func_80309704(s32 arg0, s32 arg1, s32 arg2){} void func_80309704(s32 arg0, s32 arg1, s32 arg2){}
s32 func_80309714(void){ s32 func_80309714(void){
return D_80382350.unk8->unk12; return levelModel.collision_opa->unk12;
} }
f32 func_80309724(f32 arg0[3]){ f32 func_80309724(f32 arg0[3]){
@@ -384,44 +382,44 @@ f32 func_80309724(f32 arg0[3]){
} }
BKModel *func_80309744(s32 arg0){ BKModel *func_80309744(s32 arg0){
return (arg0) ? D_80382350.unk14 : D_80382350.unk10; return (arg0) ? levelModel.model_xlu : levelModel.model_opa;
} }
s32 func_80309764(s32 arg0){ BKModelBin *func_80309764(s32 arg0){
if(arg0 == 0) if(arg0 == 0)
return D_80382350.unk18; return levelModel.model_bin_opa;
if(arg0 == 1) if(arg0 == 1)
return D_80382350.unk1C; return levelModel.model_bin_xlu;
return 0; return 0;
} }
s32 func_80309794(void){ s32 func_80309794(void){
return D_80382350.unk20; return levelModel.unk20;
} }
struct5Bs *func_803097A0(void){ struct5Bs *func_803097A0(void){
return D_80382350.unk24; return levelModel.unk24;
} }
void func_803097AC(s32 arg0[3], s32 arg1[3]) { void func_803097AC(s32 arg0[3], s32 arg1[3]) {
func_802EC458(func_8033A148(D_80382350.unk18), arg0, arg1); func_802EC458(func_8033A148(levelModel.model_bin_opa), arg0, arg1);
func_8033ECD8(arg0, arg1, 0x3E8); func_8033ECD8(arg0, arg1, 0x3E8);
arg0[0] = arg0[0] + D_80382350.unk28->unk6[0]; arg0[0] = arg0[0] + levelModel.unk28->unk6[0];
arg0[1] = arg0[1] + D_80382350.unk28->unk6[1]; arg0[1] = arg0[1] + levelModel.unk28->unk6[1];
arg0[2] = arg0[2] + D_80382350.unk28->unk6[2]; arg0[2] = arg0[2] + levelModel.unk28->unk6[2];
arg1[0] = arg1[0] + D_80382350.unk28->unkC[0]; arg1[0] = arg1[0] + levelModel.unk28->unkC[0];
arg1[1] = arg1[1] + D_80382350.unk28->unkC[1]; arg1[1] = arg1[1] + levelModel.unk28->unkC[1];
arg1[2] = arg1[2] + D_80382350.unk28->unkC[2]; arg1[2] = arg1[2] + levelModel.unk28->unkC[2];
} }
void func_80309888(s32 arg0[3], s32 arg1[3]) { void func_80309888(s32 arg0[3], s32 arg1[3]) {
s32 i; s32 i;
func_802EC458(func_8033A148(D_80382350.unk18), arg0, arg1); func_802EC458(func_8033A148(levelModel.model_bin_opa), arg0, arg1);
for(i = 0; i < 3; i++){ for(i = 0; i < 3; i++){
arg0[i] *= D_80382350.unk30; arg0[i] *= levelModel.unk30;
arg1[i] *= D_80382350.unk30; arg1[i] *= levelModel.unk30;
} }
} }
@@ -430,14 +428,14 @@ void func_80309998(s32 arg0[3], s32 arg1[3]) {
s32 sp3C[3]; s32 sp3C[3];
s32 sp30[3]; s32 sp30[3];
func_802EC458(func_8033A148(D_80382350.unk18), arg0, arg1); func_802EC458(func_8033A148(levelModel.model_bin_opa), arg0, arg1);
for(i = 0; i < 3; i++){ for(i = 0; i < 3; i++){
arg0[i] *= D_80382350.unk30; arg0[i] *= levelModel.unk30;
arg1[i] *= D_80382350.unk30; arg1[i] *= levelModel.unk30;
} }
if (D_80382350.unk1C != NULL) { if (levelModel.model_bin_xlu != NULL) {
func_802EC458(func_8033A148(D_80382350.unk1C), sp3C, sp30); func_802EC458(func_8033A148(levelModel.model_bin_xlu), sp3C, sp30);
for(j = 0; j < 3; j++){ for(j = 0; j < 3; j++){
if(sp3C[j] < arg0[j]){ if(sp3C[j] < arg0[j]){
arg0[j] = sp3C[j]; arg0[j] = sp3C[j];
@@ -458,27 +456,27 @@ BKCollisionTri *func_80309B48(f32 arg0[3], f32 arg1[3], f32 arg2[3], s32 arg3) {
BKCollisionTri *sp2C; BKCollisionTri *sp2C;
BKCollisionTri *temp_v0; BKCollisionTri *temp_v0;
D_80382350.unk20 = 0; levelModel.unk20 = 0;
if (D_80382350.unkC != NULL) { if (levelModel.collision_xlu != NULL) {
if ((arg3 & 0x80001F00) == 0x80001F00) { if ((arg3 & 0x80001F00) == 0x80001F00) {
sp2C = NULL; sp2C = NULL;
} else { } else {
sp2C = func_802E76B0(D_80382350.unk8, func_8033A148(D_80382350.unk18), arg0, arg1, arg2, arg3); sp2C = func_802E76B0(levelModel.collision_opa, func_8033A148(levelModel.model_bin_opa), arg0, arg1, arg2, arg3);
} }
temp_v0 = func_802E76B0(D_80382350.unkC, func_8033A148(D_80382350.unk1C), arg0, arg1, arg2, arg3); temp_v0 = func_802E76B0(levelModel.collision_xlu, func_8033A148(levelModel.model_bin_xlu), arg0, arg1, arg2, arg3);
if (temp_v0 != NULL) { if (temp_v0 != NULL) {
D_80382350.unk20 = (s32) D_80382350.unk1C; levelModel.unk20 = (s32) levelModel.model_bin_xlu;
return temp_v0; return temp_v0;
} }
if (sp2C != NULL) { if (sp2C != NULL) {
D_80382350.unk20 = (s32) D_80382350.unk18; levelModel.unk20 = (s32) levelModel.model_bin_opa;
} }
return sp2C; return sp2C;
} }
else{ else{
sp2C = func_802E76B0(D_80382350.unk8, func_8033A148(D_80382350.unk18), arg0, arg1, arg2, arg3); sp2C = func_802E76B0(levelModel.collision_opa, func_8033A148(levelModel.model_bin_opa), arg0, arg1, arg2, arg3);
if (sp2C != NULL) { if (sp2C != NULL) {
D_80382350.unk20 = (s32) D_80382350.unk18; levelModel.unk20 = (s32) levelModel.model_bin_opa;
} }
} }
return sp2C; return sp2C;
@@ -488,17 +486,17 @@ BKCollisionTri *func_80309C74(f32 arg0[3], f32 arg1[3], f32 arg2[3], s32 arg3, B
BKCollisionTri *sp2C; BKCollisionTri *sp2C;
BKCollisionTri *phi_v0; BKCollisionTri *phi_v0;
sp2C = func_802E76B0(D_80382350.unk8, func_8033A148(D_80382350.unk18), arg0, arg1, arg2, arg3); sp2C = func_802E76B0(levelModel.collision_opa, func_8033A148(levelModel.model_bin_opa), arg0, arg1, arg2, arg3);
if (sp2C != NULL) { if (sp2C != NULL) {
*arg4 = D_80382350.unk18; *arg4 = levelModel.model_bin_opa;
} }
if (D_80382350.unkC == NULL) { if (levelModel.collision_xlu == NULL) {
return sp2C; return sp2C;
} }
phi_v0 = func_802E76B0(D_80382350.unkC, func_8033A148(D_80382350.unk1C), arg0, arg1, arg2, arg3); phi_v0 = func_802E76B0(levelModel.collision_xlu, func_8033A148(levelModel.model_bin_xlu), arg0, arg1, arg2, arg3);
if (phi_v0 != 0) { if (phi_v0 != 0) {
*arg4 = D_80382350.unk1C; *arg4 = levelModel.model_bin_xlu;
} }
return (phi_v0 != NULL) ? phi_v0 : sp2C; return (phi_v0 != NULL) ? phi_v0 : sp2C;
} }
@@ -506,7 +504,7 @@ BKCollisionTri *func_80309C74(f32 arg0[3], f32 arg1[3], f32 arg2[3], s32 arg3, B
UNK_TYPE(s32) func_80309D58(UNK_TYPE(s32) arg0, UNK_TYPE(s32) arg1) { UNK_TYPE(s32) func_80309D58(UNK_TYPE(s32) arg0, UNK_TYPE(s32) arg1) {
BKMeshList *temp_v0; BKMeshList *temp_v0;
temp_v0 = func_8033A12C(D_80382350.unk18); temp_v0 = func_8033A12C(levelModel.model_bin_opa);
if (temp_v0 != NULL) { if (temp_v0 != NULL) {
return func_802EC394(temp_v0, 0, 0, 1.0f, 0, arg0, arg1); return func_802EC394(temp_v0, 0, 0, 1.0f, 0, arg0, arg1);
} }
@@ -517,17 +515,17 @@ UNK_TYPE(s32) func_80309DBC(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3[3], s32
s32 sp34; s32 sp34;
s32 temp_v0_2; s32 temp_v0_2;
D_80382350.unk20 = 0; levelModel.unk20 = 0;
sp34 = func_802E8E88(D_80382350.unk8, func_8033A148(D_80382350.unk18), arg0, arg1, arg2, arg3, arg4, arg5); sp34 = func_802E8E88(levelModel.collision_opa, func_8033A148(levelModel.model_bin_opa), arg0, arg1, arg2, arg3, arg4, arg5);
if (sp34 != 0) { if (sp34 != 0) {
D_80382350.unk20 = (s32) D_80382350.unk18; levelModel.unk20 = (s32) levelModel.model_bin_opa;
} }
if (D_80382350.unkC == 0) { if (levelModel.collision_xlu == 0) {
return sp34; return sp34;
} }
temp_v0_2 = func_802E8E88(D_80382350.unkC, func_8033A148(D_80382350.unk1C), arg0, arg1, arg2, arg3, arg4, arg5); temp_v0_2 = func_802E8E88(levelModel.collision_xlu, func_8033A148(levelModel.model_bin_xlu), arg0, arg1, arg2, arg3, arg4, arg5);
if (temp_v0_2 != 0) { if (temp_v0_2 != 0) {
D_80382350.unk20 = (s32) D_80382350.unk1C; levelModel.unk20 = (s32) levelModel.model_bin_xlu;
return temp_v0_2; return temp_v0_2;
} }
return sp34; return sp34;
@@ -537,16 +535,16 @@ UNK_TYPE(s32) func_80309EB0(f32 arg0[3], f32 arg1, f32 arg2[3], s32 arg3) {
s32 sp24; s32 sp24;
s32 temp_v0_2; s32 temp_v0_2;
sp24 = func_802E92AC(D_80382350.unk8, func_8033A148(D_80382350.unk18), arg0, arg1, arg2, arg3); sp24 = func_802E92AC(levelModel.collision_opa, func_8033A148(levelModel.model_bin_opa), arg0, arg1, arg2, arg3);
if (D_80382350.unkC == 0) { if (levelModel.collision_xlu == 0) {
return sp24; return sp24;
} }
temp_v0_2 = func_802E92AC(D_80382350.unkC, func_8033A148(D_80382350.unk1C), arg0, arg1, arg2, arg3); temp_v0_2 = func_802E92AC(levelModel.collision_xlu, func_8033A148(levelModel.model_bin_xlu), arg0, arg1, arg2, arg3);
return (temp_v0_2 != 0) ? temp_v0_2 : sp24; return (temp_v0_2 != 0) ? temp_v0_2 : sp24;
} }
bool func_80309F78(void) { bool func_80309F78(void) {
return (D_80382350.unk18 != NULL) && (D_80382350.unk1C != NULL); return (levelModel.model_bin_opa != NULL) && (levelModel.model_bin_xlu != NULL);
} }
bool func_80309FA4(enum map_e map_id){ bool func_80309FA4(enum map_e map_id){
@@ -560,97 +558,97 @@ bool func_80309FA4(enum map_e map_id){
return FALSE; return FALSE;
} }
void func_80309FF0(void){ void levelModel_free(void){
assetcache_release(D_80382350.unk18); assetcache_release(levelModel.model_bin_opa);
if(D_80382350.unk1C) if(levelModel.model_bin_xlu)
assetcache_release(D_80382350.unk1C); assetcache_release(levelModel.model_bin_xlu);
if(D_80382350.unk10) if(levelModel.model_opa)
model_free(D_80382350.unk10); model_free(levelModel.model_opa);
if(D_80382350.unk14) if(levelModel.model_xlu)
model_free(D_80382350.unk14); model_free(levelModel.model_xlu);
func_8034A2A8(D_80382350.unk24); func_8034A2A8(levelModel.unk24);
} }
enum asset_e func_8030A068(void){ enum asset_e func_8030A068(void){
return D_80382350.unk28->model1_id; return levelModel.unk28->model1_id;
} }
void func_8030A078(void) { void func_8030A078(void) {
BKMeshList *sp24; BKMeshList *sp24;
Struct_core2_82000_0 *temp_v0; Struct_core2_82000_0 *temp_v0;
D_80382350.unk2E = 0xFF; levelModel.env_blue = 0xFF;
D_80382350.unk2D = 0xFF; levelModel.env_green = 0xFF;
D_80382350.unk2C = 0xFF; levelModel.env_red = 0xFF;
temp_v0 = func_80308F90(map_get());; temp_v0 = func_80308F90(map_get());;
D_80382350.unk28 = temp_v0; levelModel.unk28 = temp_v0;
D_80382350.unk30 = (f32) temp_v0->unk14; levelModel.unk30 = (f32) temp_v0->unk14;
D_80382350.unk18 = (BKModelBin *)assetcache_get(D_80382350.unk28->model1_id); levelModel.model_bin_opa = (BKModelBin *)assetcache_get(levelModel.unk28->model1_id);
D_80382350.unk8 = func_8033A084(D_80382350.unk18); levelModel.collision_opa = func_8033A084(levelModel.model_bin_opa);
D_80382350.unk20 = 0; levelModel.unk20 = 0;
if (D_80382350.unk28->model2_id != 0) { if (levelModel.unk28->model2_id != 0) {
D_80382350.unk1C = (BKModelBin *)assetcache_get(D_80382350.unk28->model2_id); levelModel.model_bin_xlu = (BKModelBin *)assetcache_get(levelModel.unk28->model2_id);
D_80382350.unkC = func_8033A084(D_80382350.unk1C); levelModel.collision_xlu = func_8033A084(levelModel.model_bin_xlu);
} else { } else {
D_80382350.unk1C = NULL; levelModel.model_bin_xlu = NULL;
D_80382350.unkC = NULL; levelModel.collision_xlu = NULL;
} }
sp24 = func_8033A0B0(D_80382350.unk18); sp24 = func_8033A0B0(levelModel.model_bin_opa);
if (sp24 != NULL) { if (sp24 != NULL) {
D_80382350.unk10 = func_8033F5F8(sp24, func_8033A148(D_80382350.unk18)); levelModel.model_opa = func_8033F5F8(sp24, func_8033A148(levelModel.model_bin_opa));
} else { } else {
D_80382350.unk10 = NULL; levelModel.model_opa = NULL;
} }
if (D_80382350.unk10 != NULL) { if (levelModel.model_opa != NULL) {
func_8034C6DC(D_80382350.unk10); func_8034C6DC(levelModel.model_opa);
} }
if (D_80382350.unk1C != NULL) { if (levelModel.model_bin_xlu != NULL) {
sp24 = func_8033A0B0(D_80382350.unk1C); sp24 = func_8033A0B0(levelModel.model_bin_xlu);
} }
else{ else{
sp24 = NULL; sp24 = NULL;
} }
if (sp24 != NULL) { if (sp24 != NULL) {
D_80382350.unk14 = func_8033F5F8(sp24, func_8033A148(D_80382350.unk1C)); levelModel.model_xlu = func_8033F5F8(sp24, func_8033A148(levelModel.model_bin_xlu));
} else { } else {
D_80382350.unk14 = 0; levelModel.model_xlu = 0;
} }
if (D_80382350.unk14 != NULL) { if (levelModel.model_xlu != NULL) {
func_8034C6DC(D_80382350.unk14); func_8034C6DC(levelModel.model_xlu);
} }
D_80382350.unk24 = func_8034A2C8(); levelModel.unk24 = func_8034A2C8();
func_80320B44(func_80309B48, func_80309DBC, func_80309EB0, func_80309794); func_80320B44(func_80309B48, func_80309DBC, func_80309EB0, func_80309794);
if (( D_80382350.unk18 != NULL) && (func_8033A110( D_80382350.unk18) != NULL)) { if (( levelModel.model_bin_opa != NULL) && (func_8033A110( levelModel.model_bin_opa) != NULL)) {
D_80382350.unk0 = func_80349C3C(); levelModel.unk0 = func_80349C3C();
func_80349D00(D_80382350.unk0, func_8033A110(D_80382350.unk18)); func_80349D00(levelModel.unk0, func_8033A110(levelModel.model_bin_opa));
} else { } else {
D_80382350.unk0 = NULL; levelModel.unk0 = NULL;
} }
if ((D_80382350.unk1C != NULL) && (func_8033A110(D_80382350.unk1C) != 0)) { if ((levelModel.model_bin_xlu != NULL) && (func_8033A110(levelModel.model_bin_xlu) != 0)) {
D_80382350.unk4 = func_80349C3C(); levelModel.unk4 = func_80349C3C();
func_80349D00(D_80382350.unk4, func_8033A110(D_80382350.unk1C)); func_80349D00(levelModel.unk4, func_8033A110(levelModel.model_bin_xlu));
} }
else{ else{
D_80382350.unk4 = NULL; levelModel.unk4 = NULL;
} }
} }
void func_8030A280(s32 r, s32 g, s32 b){ void levelModel_setEnvColor(s32 r, s32 g, s32 b){
D_80382350.unk2C = r; levelModel.env_red = r;
D_80382350.unk2D = g; levelModel.env_green = g;
D_80382350.unk2E = b; levelModel.env_blue = b;
} }
void func_8030A298(void){ void func_8030A298(void){
if(D_80382350.unk24 != NULL){ if(levelModel.unk24 != NULL){
D_80382350.unk24 = func_8034A348(D_80382350.unk24); levelModel.unk24 = func_8034A348(levelModel.unk24);
} }
} }

View File

@@ -24,7 +24,7 @@ void func_8031B718(void){
} }
void func_8031B760(void){ void func_8031B760(void){
func_8030A280(D_80383170.rgb[0], D_80383170.rgb[1], D_80383170.rgb[2]); levelModel_setEnvColor(D_80383170.rgb[0], D_80383170.rgb[1], D_80383170.rgb[2]);
} }
void func_8031B790(void) { void func_8031B790(void) {

View File

@@ -13,10 +13,9 @@ extern void func_802EE6CC(f32[3], s32[4], s32[4], s32, f32, f32, s32, s32, s32);
extern void func_8033A244(f32); extern void func_8033A244(f32);
extern void func_8033A410(s32);
f32 func_80257204(f32, f32, f32, f32); f32 func_80257204(f32, f32, f32, f32);
extern Actor *func_802C4260(enum actor_id, s32 x, s32 y, s32 z, s32 yaw); extern Actor *func_802C4260(enum actor_e actor_id, s32 x, s32 y, s32 z, s32 yaw);
f32 func_8033229C(ActorMarker *); f32 func_8033229C(ActorMarker *);
f32 func_8028EBA4(void); f32 func_8028EBA4(void);
extern void func_8032FFF4(ActorMarker *, ActorMarker *, s32); extern void func_8032FFF4(ActorMarker *, ActorMarker *, s32);
@@ -87,7 +86,7 @@ Actor *func_80325340(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
} }
void func_803253A0(Actor *this){ void func_803253A0(Actor *this){
s32 pad; s32 pad4C;
BKModelBin *sp48; BKModelBin *sp48;
bool sp44; bool sp44;
BKVertexList *sp40; BKVertexList *sp40;
@@ -116,11 +115,11 @@ void func_803253A0(Actor *this){
}//L8032548C }//L8032548C
if(this->alpha_124_19 < 0xFF){ if(this->alpha_124_19 < 0xFF){
func_8033A410(this->alpha_124_19); modelRender_setAlpha(this->alpha_124_19);
} }
modelRender_setDepthMode(this->depth_mode); modelRender_setDepthMode(this->depth_mode);
if(this->marker->unk44 != 0){ if((s32)this->marker->unk44 != 0){
if((s32)this->marker->unk44 == 1){ if((s32)this->marker->unk44 == 1){
func_8033A450(D_8036E568); func_8033A450(D_8036E568);
} }
@@ -219,8 +218,8 @@ Actor *func_80325888(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
Actor *this; Actor *this;
this = func_80325300(marker, sp3C); this = func_80325300(marker, sp3C);
func_8033A2D4(func_803253A0, this); modelRender_preDraw((GenMethod_1)func_803253A0, (s32)this);
func_8033A2E8(func_80325794, marker); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker);
modelRender_draw(gfx, mtx, this->position, sp3C, this->scale, (this->unk104 != NULL) ? D_8036E580 : NULL, func_803257B4(marker)); modelRender_draw(gfx, mtx, this->position, sp3C, this->scale, (this->unk104 != NULL) ? D_8036E580 : NULL, func_803257B4(marker));
return this; return this;
} }
@@ -341,8 +340,8 @@ Actor *func_80325E78(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
this = func_80325300(marker, rotation); this = func_80325300(marker, rotation);
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
func_8033A2D4(func_803253A0, this); modelRender_preDraw((GenMethod_1)func_803253A0, (s32)this);
func_8033A2E8(func_80325794, marker); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker);
modelRender_draw(gfx, mtx, this->position, rotation, this->scale, (this->unk104 != NULL) ? D_8036E580 : NULL, func_803257B4(marker)); modelRender_draw(gfx, mtx, this->position, rotation, this->scale, (this->unk104 != NULL) ? D_8036E580 : NULL, func_803257B4(marker));
return this; return this;
} }

View File

@@ -102,9 +102,9 @@ void func_80291AF0(Gfx **gfx, Mtx **mtx, Vtx **vtx){
if(D_8037C0E0){ if(D_8037C0E0){
func_80289F30(); func_80289F30();
func_8029DD6C(); func_8029DD6C();
func_8033A388(sp50[0], sp50[1], sp50[2], D_8037C0E6); modelRender_setEnvColor(sp50[0], sp50[1], sp50[2], D_8037C0E6);
func_8033A280(2.0f); func_8033A280(2.0f);
func_8033A2D4(func_80291AC4, 0); modelRender_preDraw(func_80291AC4, 0);
func_8033A450(D_80363780); func_8033A450(D_80363780);
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
if(D_8037C150.unk0){ if(D_8037C150.unk0){

View File

@@ -42,7 +42,7 @@ void func_80334540(Gfx** gdl, Mtx **mptr, Vtx **vptr) {
func_8024CE60(sp44, sp40); func_8024CE60(sp44, sp40);
func_8024C904(gdl, mptr); func_8024C904(gdl, mptr);
if (func_80309F78() != 0) { if (func_80309F78() != 0) {
func_803091D4(gdl, mptr, vptr); levelModel_opa_draw(gdl, mptr, vptr);
if (func_802E49F0() == 0) { if (func_802E49F0() == 0) {
func_80322E64(gdl, mptr, vptr); func_80322E64(gdl, mptr, vptr);
} }
@@ -65,7 +65,7 @@ void func_80334540(Gfx** gdl, Mtx **mptr, Vtx **vptr) {
func_802F0A34(gdl, mptr, vptr); func_802F0A34(gdl, mptr, vptr);
} }
if (func_802E49F0() == 0) { if (func_802E49F0() == 0) {
func_80309628(gdl, mptr, vptr); levelModel_xlu_draw(gdl, mptr, vptr);
} }
if (func_802E49F0() == 0) { if (func_802E49F0() == 0) {
func_8032D3D8(gdl, mptr, vptr); func_8032D3D8(gdl, mptr, vptr);
@@ -78,7 +78,7 @@ void func_80334540(Gfx** gdl, Mtx **mptr, Vtx **vptr) {
} }
func_802D520C(gdl, mptr, vptr); func_802D520C(gdl, mptr, vptr);
} else { } else {
func_803091D4(gdl, mptr, vptr); levelModel_opa_draw(gdl, mptr, vptr);
func_80322E64(gdl, mptr, vptr); func_80322E64(gdl, mptr, vptr);
func_8034F6F0(gdl, mptr, vptr); func_8034F6F0(gdl, mptr, vptr);
func_8028E6A4(gdl, mptr, vptr); func_8028E6A4(gdl, mptr, vptr);
@@ -154,7 +154,7 @@ void func_80334910(void) {
func_80323100(); func_80323100();
cubeList_free(); cubeList_free();
func_8031B710(); func_8031B710();
func_80309FF0(); levelModel_free();
func_8030A6B0(); func_8030A6B0();
func_80333918(); func_80333918();
sky_free(); sky_free();

View File

@@ -162,7 +162,7 @@ void func_80350818(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
sp80[2] = temp_s2->unk4[i].unk4[2]; sp80[2] = temp_s2->unk4[i].unk4[2];
sp80[3] = temp_s2->unk4[i].unk4[3]; sp80[3] = temp_s2->unk4[i].unk4[3];
sp80[3] *= var_f22; sp80[3] *= var_f22;
func_8033A334(sp80, D_803725A8); modelRender_setPrimAndEnvColors(sp80, D_803725A8);
modelRender_draw(gfx, mtx, spB8, spD0, temp_s2->unk4[i].unk14*0.25, NULL, D_80386170.unk8); modelRender_draw(gfx, mtx, spB8, spD0, temp_s2->unk4[i].unk14*0.25, NULL, D_80386170.unk8);
} }
} }

View File

@@ -48,8 +48,8 @@ Actor *func_8035ECA0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
local = (ActorLocal_core2_D7D10 *)&this->local; local = (ActorLocal_core2_D7D10 *)&this->local;
func_8033A45C(3, (s32) this->velocity[1]); func_8033A45C(3, (s32) this->velocity[1]);
func_8033A45C(4, local->unk0); func_8033A45C(4, local->unk0);
func_8033A2D4(func_803253A0, this); modelRender_preDraw( (GenMethod_1)func_803253A0, (s32)this);
func_8033A2E8(func_80325794, marker); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker);
modelRender_draw(gfx, mtx, this->position, rotation, this->scale, D_80373008, func_803257B4(marker)); modelRender_draw(gfx, mtx, this->position, rotation, this->scale, D_80373008, func_803257B4(marker));
return this; return this;
} }

View File

@@ -1358,7 +1358,7 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
} }
func_8033A45C(i, 1); func_8033A45C(i, 1);
modelRender_setDepthMode(MODEL_RENDER_DEPTH_NONE); modelRender_setDepthMode(MODEL_RENDER_DEPTH_NONE);
func_8033A410(D_80383010.sns_alpha); modelRender_setAlpha(D_80383010.sns_alpha);
modelRender_draw(gfx, mtx, &sp98, &sp8C, 0.8f, &sp80, D_80383010.sns_egg_model); modelRender_draw(gfx, mtx, &sp98, &sp8C, 0.8f, &sp80, D_80383010.sns_egg_model);
func_8024E2FC(); func_8024E2FC();
func_8024C904(gfx, mtx); func_8024C904(gfx, mtx);
@@ -1399,7 +1399,7 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
sp80[1] = 120.0f; sp80[1] = 120.0f;
sp80[2] = 0.0f; sp80[2] = 0.0f;
modelRender_setDepthMode(MODEL_RENDER_DEPTH_NONE); modelRender_setDepthMode(MODEL_RENDER_DEPTH_NONE);
func_8033A410(D_80383010.sns_alpha); modelRender_setAlpha(D_80383010.sns_alpha);
modelRender_draw(gfx, mtx, sp98, sp8C, 0.8f, sp80, D_80383010.ice_key_model); modelRender_draw(gfx, mtx, sp98, sp8C, 0.8f, sp80, D_80383010.ice_key_model);
func_8024E2FC(); func_8024E2FC();
func_8024C904(gfx, mtx); func_8024C904(gfx, mtx);

View File

@@ -467,9 +467,9 @@ void func_803152C4(gczoombox_t *this){
} }
void func_80315300(gczoombox_t *this){ void func_80315300(gczoombox_t *this){
if(this->unkF0 != NULL){ if(this->model != NULL){
func_8033BD20(&this->unkF0); func_8033BD20(&this->model);
this->unkF0 = NULL; this->model = NULL;
} }
if(this->anim_ctrl != NULL){ if(this->anim_ctrl != NULL){
animctrl_free(this->anim_ctrl); animctrl_free(this->anim_ctrl);
@@ -845,7 +845,7 @@ void func_803163A8(gczoombox_t *this, Gfx **gfx, Mtx **mtx) {
if (this->anim_ctrl != NULL) { if (this->anim_ctrl != NULL) {
func_8028781C(this->anim_ctrl, sp50, 1); func_8028781C(this->anim_ctrl, sp50, 1);
} }
modelRender_draw(gfx, mtx, sp50, sp5C, this->unk198 * sp34, &sp38, this->unkF0); modelRender_draw(gfx, mtx, sp50, sp5C, this->unk198 * sp34, &sp38, this->model);
} }
void func_803164B0(gczoombox_t *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, s32 arg5, f32 arg6) { void func_803164B0(gczoombox_t *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, s32 arg5, f32 arg6) {
@@ -993,7 +993,7 @@ void gczoombox_draw(gczoombox_t *this, Gfx **gdl, Mtx ** mptr, void *vptr){
if(getGameMode() == GAME_MODE_9_BANJO_AND_KAZOOIE) if(getGameMode() == GAME_MODE_9_BANJO_AND_KAZOOIE)
func_8034A900(); func_8034A900();
//L80316BCC //L80316BCC
if(this->unk1A4_28 && this->state && this->unkF0){ if(this->unk1A4_28 && this->state && this->model){
func_803162B4(this); func_803162B4(this);
func_803163A8(this, gdl, mptr); func_803163A8(this, gdl, mptr);
if( this->unk139 == 2 if( this->unk139 == 2
@@ -1453,7 +1453,7 @@ gczoombox_t *gczoombox_new(s32 arg0, enum talk_pic_e portrait_id, s32 arg2, s32
this->unk1A4_11 = this->unk1A4_18 = 1; this->unk1A4_11 = this->unk1A4_18 = 1;
this->unkF0 = assetcache_get(0x89d); this->model = assetcache_get(0x89d);
func_80317C90(this, portrait_id); func_80317C90(this, portrait_id);
this->anim_ctrl = animctrl_new(0); this->anim_ctrl = animctrl_new(0);
animctrl_reset(this->anim_ctrl); animctrl_reset(this->anim_ctrl);

View File

@@ -22,25 +22,12 @@ extern void mlMtxApply(Mtx* mtx);
extern struct58s *func_802EA154(); extern struct58s *func_802EA154();
extern struct58s *func_802EA374(struct58s *); extern struct58s *func_802EA374(struct58s *);
typedef struct{
s32 env[4];
s32 prim[4];
} Struct_Core2_B1400_0;
typedef struct{ typedef struct{
void (* unk0)(Actor *); void (* unk0)(Actor *);
Actor *unk4; Actor *unk4;
} Struct_Core2_B1400_1; } Struct_Core2_B1400_1;
typedef struct{
f32 unk0[3];
f32 unkC[3];
s32 unk18;
f32 unk1C[3];
f32 unk28[3];
} Struct_Core2_B1400_2;
typedef void (*GeoListFunc)(Gfx **, Mtx **, void *); typedef void (*GeoListFunc)(Gfx **, Mtx **, void *);
typedef struct { typedef struct {
@@ -150,7 +137,8 @@ typedef struct {
s32 unk8; s32 unk8;
}GeoCmd10; }GeoCmd10;
void modelRender_reset(void);
void func_803384A8(Gfx **, Mtx **, void *); void func_803384A8(Gfx **, Mtx **, void *);
void func_803385BC(Gfx **, Mtx **, void *); void func_803385BC(Gfx **, Mtx **, void *);
void func_803387F8(Gfx **, Mtx **, void *); void func_803387F8(Gfx **, Mtx **, void *);
@@ -168,7 +156,6 @@ void func_80338DCC(Gfx **, Mtx **, void *);
void func_80338EB8(Gfx **, Mtx **, void *); void func_80338EB8(Gfx **, Mtx **, void *);
void func_8033909C(Gfx **, Mtx **, void *); void func_8033909C(Gfx **, Mtx **, void *);
void func_80339124(Gfx **, Mtx **, BKGeoList *); void func_80339124(Gfx **, Mtx **, BKGeoList *);
void func_8033A410(s32 a);
void func_8033A45C(s32 arg0, s32 arg1); void func_8033A45C(s32 arg0, s32 arg1);
// Sets up 2 cycle mode // Sets up 2 cycle mode
@@ -605,6 +592,13 @@ GeoListFunc D_80370994[] = {
func_8033878C func_8033878C
}; };
enum model_render_color_mode_e{
COLOR_MODE_DYNAMIC_PRIM_AND_ENV,
COLOR_MODE_DYNAMIC_ENV,
COLOR_MODE_STATIC_OPAQUE,
COLOR_MODE_STATIC_TRANSPARENT
};
/* .bss */ /* .bss */
s32 D_80383650; s32 D_80383650;
s32 D_80383658[0x2A]; s32 D_80383658[0x2A];
@@ -613,36 +607,54 @@ bool D_80383704;
f32 D_80383708; f32 D_80383708;
f32 D_8038370C; f32 D_8038370C;
s32 D_80383710; s32 D_80383710;
s32 D_80383714; enum model_render_color_mode_e modelRenderColorMode;
BKGfxList *modelRenderDisplayList; BKGfxList * modelRenderDisplayList;
struct58s *D_8038371C; struct58s * D_8038371C;
static BKTextureList *modelRenderTextureList; static BKTextureList * modelRenderTextureList;
s32 D_80383724; s32 D_80383724;
static BKVertexList *modelRenderVextureList; static BKVertexList * modelRenderVextureList;
BKModelUnk20List *D_8038372C; BKModelUnk20List * D_8038372C;
struct58s *D_80383730; struct58s * D_80383730;
f32 D_80383734; f32 D_80383734;
Struct_Core2_B1400_0 D_80383738;
Struct_Core2_B1400_2 D_80383758;
struct{ struct{
void (* unk0)(Actor *); s32 env[4];
Actor *unk4; s32 prim[4];
void (* unk8)(ActorMarker *); } modelRenderDynColors;
ActorMarker *unkC;
} D_80383790; struct{
s32 D_803837A0[4]; f32 unk0[3];
f32 unkC[3];
s32 unk18;
f32 unk1C[3];
f32 unk28[3];
} D_80383758;
struct{
GenMethod_1 pre_method;
s32 pre_arg;
GenMethod_1 post_method;
s32 post_arg;
} modelRenderCallback;
s32 modelRenderDynEnvColor[4];
struct { struct {
s32 unk0; s32 unk0;
f32 unk4[3]; f32 unk4[3];
}D_803837B0; }D_803837B0;
u8 D_803837C0;
u8 modelRenderDynAlpha;
struct { struct {
s32 model_id; //model_asset_index s32 model_id; //model_asset_index
f32 unk4; f32 unk4;
f32 unk8; f32 unk8;
u8 padC[0x4]; u8 padC[0x4];
} D_803837C8; } D_803837C8;
static s32 modelRenderDepthMode;
static enum model_render_depth_mode_e modelRenderDepthMode;
struct { struct {
LookAt lookat_buffer[32]; LookAt lookat_buffer[32];
LookAt *cur_lookat; LookAt *cur_lookat;
@@ -650,8 +662,8 @@ struct {
f32 eye_pos[3]; f32 eye_pos[3];
} D_803837E0; } D_803837E0;
Mtx D_80383BF8; Mtx D_80383BF8;
f32 D_80383C38[3]; f32 modelRenderCameraPosition[3];
f32 D_80383C48[3]; f32 modelRenderCameraRotation[3];
BKModelBin *modelRenderModelBin; BKModelBin *modelRenderModelBin;
f32 D_80383C58[3]; f32 D_80383C58[3];
f32 D_80383C64; f32 D_80383C64;
@@ -667,7 +679,7 @@ void modelRender_reset(void){
D_80383704 = TRUE; D_80383704 = TRUE;
D_8038370C = 1.0f; D_8038370C = 1.0f;
D_80383710 = FALSE; D_80383710 = FALSE;
D_80383714 = 2; modelRenderColorMode = COLOR_MODE_STATIC_OPAQUE;
D_80383650 = 0; D_80383650 = 0;
modelRenderDisplayList = NULL; modelRenderDisplayList = NULL;
D_8038371C = NULL; D_8038371C = NULL;
@@ -675,11 +687,11 @@ void modelRender_reset(void){
D_80383724 = 0; D_80383724 = 0;
modelRenderVextureList = NULL; modelRenderVextureList = NULL;
D_8038372C = 0; D_8038372C = 0;
D_80383790.unk0 = NULL; modelRenderCallback.pre_method = NULL;
D_80383790.unk8 = NULL; modelRenderCallback.post_method = NULL;
D_803837B0.unk0 = 0; D_803837B0.unk0 = 0;
D_803837C8.model_id = 0; D_803837C8.model_id = 0;
modelRenderDepthMode = 0; modelRenderDepthMode = MODEL_RENDER_DEPTH_NONE;
func_8033A45C(1,1); func_8033A45C(1,1);
func_8033A45C(2,0); func_8033A45C(2,0);
if(D_80383758.unk18){ if(D_80383758.unk18){
@@ -702,9 +714,9 @@ void func_803384A8(Gfx **gfx, Mtx **mtx, void *arg2){
if(cmd->unk8){ if(cmd->unk8){
func_8025235C(sp30, cmd->unkC); func_8025235C(sp30, cmd->unkC);
func_80251788(sp30[0], sp30[1], sp30[2]); func_80251788(sp30[0], sp30[1], sp30[2]);
mlMtxRotYaw(D_80383C48[1]); mlMtxRotYaw(modelRenderCameraRotation[1]);
if(!cmd->unkA){ if(!cmd->unkA){
mlMtxRotPitch(D_80383C48[0]); mlMtxRotPitch(modelRenderCameraRotation[0]);
} }
mlMtxScale(D_80383734); mlMtxScale(D_80383734);
mlMtxTranslate(-cmd->unkC[0], -cmd->unkC[1], -cmd->unkC[2]); mlMtxTranslate(-cmd->unkC[0], -cmd->unkC[1], -cmd->unkC[2]);
@@ -869,9 +881,9 @@ void func_80338BFC(Gfx **gfx, Mtx **mtx, void *arg2){
else{ else{
func_8025235C(sp20, cmd->unkC); func_8025235C(sp20, cmd->unkC);
} }
sp20[0] += D_80383C38[0]; sp20[0] += modelRenderCameraPosition[0];
sp20[1] += D_80383C38[1]; sp20[1] += modelRenderCameraPosition[1];
sp20[2] += D_80383C38[2]; sp20[2] += modelRenderCameraPosition[2];
func_8034A308(D_80383650, cmd->unk8, sp20); func_8034A308(D_80383650, cmd->unk8, sp20);
} }
} }
@@ -963,9 +975,9 @@ void func_80338EB8(Gfx ** gfx, Mtx ** mtx, void *arg2){
func_8025235C(sp34, sp34); func_8025235C(sp34, sp34);
} }
sp34[0] += D_80383C38[0]; sp34[0] += modelRenderCameraPosition[0];
sp34[1] += D_80383C38[1]; sp34[1] += modelRenderCameraPosition[1];
sp34[2] += D_80383C38[2]; sp34[2] += modelRenderCameraPosition[2];
if(func_8024DB50(sp34, sp30) && cmd->unk10){ if(func_8024DB50(sp34, sp30) && cmd->unk10){
func_80339124(gfx, mtx, (BKGeoList*)((s32)cmd + cmd->unk10)); func_80339124(gfx, mtx, (BKGeoList*)((s32)cmd + cmd->unk10));
} }
@@ -999,9 +1011,9 @@ void func_80339124(Gfx ** gfx, Mtx ** mtx, BKGeoList *geo_list){
BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3], f32 scale, f32*arg5, BKModelBin* model_bin){ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3], f32 scale, f32*arg5, BKModelBin* model_bin){
f32 camera_focus[3]; f32 camera_focus[3];
f32 spF0; f32 camera_focus_distance;
f32 padEC; f32 padEC;
f32 camera_position[3]; f32 object_position[3];
void *rendermode_table_opa; // Table of render modes to use for opaque rendering void *rendermode_table_opa; // Table of render modes to use for opaque rendering
void *rendermode_table_xlu; // Table of render modes to use for translucent rendering void *rendermode_table_xlu; // Table of render modes to use for translucent rendering
f32 spD4; f32 spD4;
@@ -1019,30 +1031,30 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3],
} }
D_80370990 = 0; D_80370990 = 0;
func_8024C5CC(D_80383C38); func_8024C5CC(modelRenderCameraPosition);
func_8024C764(D_80383C48); func_8024C764(modelRenderCameraRotation);
if(D_80383758.unk18){ if(D_80383758.unk18){
D_80383758.unk1C[0] = D_80383C38[0]; D_80383758.unk1C[0] = modelRenderCameraPosition[0];
D_80383758.unk1C[1] = D_80383C38[1]; D_80383758.unk1C[1] = modelRenderCameraPosition[1];
D_80383758.unk1C[2] = D_80383C38[2]; D_80383758.unk1C[2] = modelRenderCameraPosition[2];
D_80383758.unk28[0] = D_80383C48[0];\ D_80383758.unk28[0] = modelRenderCameraRotation[0];\
D_80383758.unk28[1] = D_80383C48[1];\ D_80383758.unk28[1] = modelRenderCameraRotation[1];\
D_80383758.unk28[2] = D_80383C48[2]; D_80383758.unk28[2] = modelRenderCameraRotation[2];
} }
if(position){ if(position){
camera_position[0] = position[0]; object_position[0] = position[0];
camera_position[1] = position[1]; object_position[1] = position[1];
camera_position[2] = position[2]; object_position[2] = position[2];
} }
else{ else{
camera_position[0] = camera_position[1] = camera_position[2] = 0.0f; object_position[0] = object_position[1] = object_position[2] = 0.0f;
} }
camera_focus[0] = camera_position[0] - D_80383C38[0]; camera_focus[0] = object_position[0] - modelRenderCameraPosition[0];
camera_focus[1] = camera_position[1] - D_80383C38[1]; camera_focus[1] = object_position[1] - modelRenderCameraPosition[1];
camera_focus[2] = camera_position[2] - D_80383C38[2]; camera_focus[2] = object_position[2] - modelRenderCameraPosition[2];
if( ((camera_focus[0] < -17000.0f) || (17000.0f < camera_focus[0])) if( ((camera_focus[0] < -17000.0f) || (17000.0f < camera_focus[0]))
|| ((camera_focus[1] < -17000.0f) || (17000.0f < camera_focus[1])) || ((camera_focus[1] < -17000.0f) || (17000.0f < camera_focus[1]))
@@ -1053,19 +1065,19 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3],
} }
if(D_80383758.unk18){ if(D_80383758.unk18){
D_80383C38[0] = D_80383758.unk0[0]; modelRenderCameraPosition[0] = D_80383758.unk0[0];
D_80383C38[1] = D_80383758.unk0[1]; modelRenderCameraPosition[1] = D_80383758.unk0[1];
D_80383C38[2] = D_80383758.unk0[2]; modelRenderCameraPosition[2] = D_80383758.unk0[2];
D_80383C48[0] = D_80383758.unkC[0], modelRenderCameraRotation[0] = D_80383758.unkC[0],
D_80383C48[1] = D_80383758.unkC[1], modelRenderCameraRotation[1] = D_80383758.unkC[1],
D_80383C48[2] = D_80383758.unkC[2]; modelRenderCameraRotation[2] = D_80383758.unkC[2];
func_8024CD88(D_80383C38); func_8024CD88(modelRenderCameraPosition);
func_8024CE18(D_80383C48); func_8024CE18(modelRenderCameraRotation);
func_8024CFD4(); func_8024CFD4();
camera_focus[0] = camera_position[0] - D_80383C38[0]; camera_focus[0] = object_position[0] - modelRenderCameraPosition[0];
camera_focus[1] = camera_position[1] - D_80383C38[1]; camera_focus[1] = object_position[1] - modelRenderCameraPosition[1];
camera_focus[2] = camera_position[2] - D_80383C38[2]; camera_focus[2] = object_position[2] - modelRenderCameraPosition[2];
} }
if(model_bin){ if(model_bin){
@@ -1077,24 +1089,24 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3],
spD0 = D_803837C8.unk8; spD0 = D_803837C8.unk8;
spD4 = D_803837C8.unk4; spD4 = D_803837C8.unk4;
} }
spF0 = gu_sqrtf(camera_focus[0]*camera_focus[0] + camera_focus[1]*camera_focus[1] + camera_focus[2]*camera_focus[2]); camera_focus_distance = gu_sqrtf(camera_focus[0]*camera_focus[0] + camera_focus[1]*camera_focus[1] + camera_focus[2]*camera_focus[2]);
if( 4000.0f <= spF0 && spD4*scale*D_8038370C*50.0f < D_80383708){ if( 4000.0f <= camera_focus_distance && spD4*scale*D_8038370C*50.0f < D_80383708){
D_80383708 = spD4*scale*D_8038370C*50.0f; D_80383708 = spD4*scale*D_8038370C*50.0f;
} }
if(D_80383708 <= spF0){ if(D_80383708 <= camera_focus_distance){
modelRender_reset(); modelRender_reset();
return 0; return 0;
} }
D_80370990 = (D_80383704) ? func_8024DB50(camera_position, spD0*scale) : 1; D_80370990 = (D_80383704) ? func_8024DB50(object_position, spD0*scale) : 1;
if(D_80370990 == 0){ if(D_80370990 == 0){
modelRender_reset(); modelRender_reset();
return 0; return 0;
} }
if(D_80383790.unk0){ if(modelRenderCallback.pre_method != NULL){
D_80383790.unk0(D_80383790.unk4); modelRenderCallback.pre_method(modelRenderCallback.pre_arg);
} }
func_80349AD0(); func_80349AD0();
if(model_bin == NULL){ if(model_bin == NULL){
@@ -1108,19 +1120,19 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3],
if(D_80383710){ if(D_80383710){
tmp_f0 = D_80383708 - 500.0f; tmp_f0 = D_80383708 - 500.0f;
if(tmp_f0 < spF0){ if(tmp_f0 < camera_focus_distance){
alpha = (s32)((1.0f - (spF0 - tmp_f0)/500.0f)*255.0f); alpha = (s32)((1.0f - (camera_focus_distance - tmp_f0)/500.0f)*255.0f);
if(D_80383714 == 0){ if(modelRenderColorMode == COLOR_MODE_DYNAMIC_PRIM_AND_ENV){
D_80383738.prim[3] = (D_80383738.prim[3] * alpha) / 0xff; modelRenderDynColors.prim[3] = (modelRenderDynColors.prim[3] * alpha) / 0xff;
} }
else if(D_80383714 == 1){ else if(modelRenderColorMode == COLOR_MODE_DYNAMIC_ENV){
D_803837A0[3] = (D_803837A0[3] * alpha)/0xff; modelRenderDynEnvColor[3] = (modelRenderDynEnvColor[3] * alpha)/0xff;
} }
else if(D_80383714 == 2){ else if(modelRenderColorMode == COLOR_MODE_STATIC_OPAQUE){
func_8033A410(alpha); modelRender_setAlpha(alpha);
} }
else if(D_80383714 == 3){ else if(modelRenderColorMode == COLOR_MODE_STATIC_TRANSPARENT){
D_803837C0 = (D_803837C0 *alpha)/0xff; modelRenderDynAlpha = (modelRenderDynAlpha *alpha)/0xff;
} }
} }
} }
@@ -1160,13 +1172,13 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3],
rendermode_table_xlu = renderModesDepthCompareXlu; rendermode_table_xlu = renderModesDepthCompareXlu;
} }
if(D_80383714 == 0){ if(modelRenderColorMode == COLOR_MODE_DYNAMIC_PRIM_AND_ENV){
s32 alpha; s32 alpha;
alpha = D_80383738.prim[3] + (D_80383738.env[3]*(0xFF - D_80383738.prim[3]))/0xff; alpha = modelRenderDynColors.prim[3] + (modelRenderDynColors.env[3]*(0xFF - modelRenderDynColors.prim[3]))/0xff;
gSPDisplayList((*gfx)++, setup2CycleDL); gSPDisplayList((*gfx)++, setup2CycleDL);
gDPSetEnvColor((*gfx)++, D_80383738.env[0], D_80383738.env[1], D_80383738.env[2], alpha); gDPSetEnvColor((*gfx)++, modelRenderDynColors.env[0], modelRenderDynColors.env[1], modelRenderDynColors.env[2], alpha);
gDPSetPrimColor((*gfx)++, 0, 0, D_80383738.prim[0], D_80383738.prim[1], D_80383738.prim[2], 0); gDPSetPrimColor((*gfx)++, 0, 0, modelRenderDynColors.prim[0], modelRenderDynColors.prim[1], modelRenderDynColors.prim[2], 0);
// Set up segment 3 to point to the right render mode table based on the alpha value // Set up segment 3 to point to the right render mode table based on the alpha value
if(alpha == 0xFF){ if(alpha == 0xFF){
@@ -1177,25 +1189,25 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3],
} }
//TODO //TODO
} }
else if(D_80383714 == 1){ else if(modelRenderColorMode == COLOR_MODE_DYNAMIC_ENV){
gSPDisplayList((*gfx)++, setup2CycleBlackPrimDL); gSPDisplayList((*gfx)++, setup2CycleBlackPrimDL);
gDPSetEnvColor((*gfx)++, D_803837A0[0], D_803837A0[1], D_803837A0[2], D_803837A0[3]); gDPSetEnvColor((*gfx)++, modelRenderDynEnvColor[0], modelRenderDynEnvColor[1], modelRenderDynEnvColor[2], modelRenderDynEnvColor[3]);
// Set up segment 3 to point to the right render mode table based on the alpha value // Set up segment 3 to point to the right render mode table based on the alpha value
if(D_803837A0[3] == 0xFF){ if(modelRenderDynEnvColor[3] == 0xFF){
gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(rendermode_table_opa)); gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(rendermode_table_opa));
} }
else{ else{
gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(rendermode_table_xlu)); gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(rendermode_table_xlu));
} }
} }
else if(D_80383714 == 2){ else if(modelRenderColorMode == COLOR_MODE_STATIC_OPAQUE){
gSPDisplayList((*gfx)++, setup2CycleWhiteEnvDL); gSPDisplayList((*gfx)++, setup2CycleWhiteEnvDL);
gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(rendermode_table_opa)); gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(rendermode_table_opa));
} }
else if(D_80383714 == 3){ else if(modelRenderColorMode == COLOR_MODE_STATIC_TRANSPARENT){
gSPDisplayList((*gfx)++, setup2CycleDL_copy); gSPDisplayList((*gfx)++, setup2CycleDL_copy);
gDPSetEnvColor((*gfx)++, 0xFF, 0xFF, 0xFF, D_803837C0); gDPSetEnvColor((*gfx)++, 0xFF, 0xFF, 0xFF, modelRenderDynAlpha);
gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(rendermode_table_xlu)); gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(rendermode_table_xlu));
} }
@@ -1232,7 +1244,7 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3],
} }
if(D_8038372C){ if(D_8038372C){
func_802ED52C(D_8038372C, D_80383C38, scale); func_802ED52C(D_8038372C, modelRenderCameraPosition, scale);
} }
if(model_bin->unk28 != NULL && D_8038371C != NULL){ if(model_bin->unk28 != NULL && D_8038371C != NULL){
@@ -1241,10 +1253,10 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3],
mlMtxIdent(); mlMtxIdent();
if(D_80383758.unk18){ if(D_80383758.unk18){
func_80252AF0(D_80383758.unk1C, camera_position, arg3, scale, arg5); func_80252AF0(D_80383758.unk1C, object_position, arg3, scale, arg5);
} }
else{ else{
func_80252AF0(D_80383C38, camera_position, arg3, scale, arg5); func_80252AF0(modelRenderCameraPosition, object_position, arg3, scale, arg5);
} }
if(D_803837B0.unk0){ if(D_803837B0.unk0){
@@ -1268,8 +1280,8 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3],
func_80339124(gfx, mtx, (BKGeoList *)((u8 *)model_bin + model_bin->geo_list_offset_4)); func_80339124(gfx, mtx, (BKGeoList *)((u8 *)model_bin + model_bin->geo_list_offset_4));
gSPPopMatrix((*gfx)++, G_MTX_MODELVIEW); gSPPopMatrix((*gfx)++, G_MTX_MODELVIEW);
if(D_80383790.unk8){ if(modelRenderCallback.post_method != NULL){
D_80383790.unk8(D_80383790.unkC); modelRenderCallback.post_method(modelRenderCallback.post_arg);
} }
if(D_803837C8.model_id){ if(D_803837C8.model_id){
@@ -1409,14 +1421,14 @@ void func_8033A298(bool arg0){
} }
} }
void func_8033A2D4(void(*func)(Actor *), Actor* actor){ void modelRender_preDraw(GenMethod_1 func, s32 arg){
D_80383790.unk0 = func; modelRenderCallback.pre_method = func;
D_80383790.unk4 = actor; modelRenderCallback.pre_arg = arg;
} }
void func_8033A2E8(void(*func)(ActorMarker *), ActorMarker* marker){ void modelRender_postDraw(GenMethod_1 func, s32 arg){
D_80383790.unk8 = func; modelRenderCallback.post_method = func;
D_80383790.unkC = marker; modelRenderCallback.post_arg = arg;
} }
void modelRender_setDisplayList(BKGfxList *gfx_list){ void modelRender_setDisplayList(BKGfxList *gfx_list){
@@ -1430,36 +1442,36 @@ void func_8033A308(f32 arg0[3]){
D_803837B0.unk4[2] = arg0[2]; D_803837B0.unk4[2] = arg0[2];
} }
void func_8033A334(s32 env[4], s32 prim[4]){ void modelRender_setPrimAndEnvColors(s32 env[4], s32 prim[4]){
D_80383714 = 0; modelRenderColorMode = COLOR_MODE_DYNAMIC_PRIM_AND_ENV;
D_80383738.env[0] = env[0]; modelRenderDynColors.env[0] = env[0];
D_80383738.env[1] = env[1]; modelRenderDynColors.env[1] = env[1];
D_80383738.env[2] = env[2]; modelRenderDynColors.env[2] = env[2];
D_80383738.env[3] = env[3]; modelRenderDynColors.env[3] = env[3];
D_80383738.prim[0] = prim[0]; modelRenderDynColors.prim[0] = prim[0];
D_80383738.prim[1] = prim[1]; modelRenderDynColors.prim[1] = prim[1];
D_80383738.prim[2] = prim[2]; modelRenderDynColors.prim[2] = prim[2];
D_80383738.prim[3] = prim[3]; modelRenderDynColors.prim[3] = prim[3];
} }
void func_8033A388(s32 r, s32 g, s32 b, s32 a){ void modelRender_setEnvColor(s32 r, s32 g, s32 b, s32 a){
D_80383714 = 1; modelRenderColorMode = COLOR_MODE_DYNAMIC_ENV;
D_803837A0[0] = MIN(0xFF, r); modelRenderDynEnvColor[0] = MIN(0xFF, r);
D_803837A0[1] = MIN(0xFF, g); modelRenderDynEnvColor[1] = MIN(0xFF, g);
D_803837A0[2] = MIN(0xFF, b); modelRenderDynEnvColor[2] = MIN(0xFF, b);
D_803837A0[3] = MIN(0xFF, a); modelRenderDynEnvColor[3] = MIN(0xFF, a);
} }
void func_8033A410(s32 a){ void modelRender_setAlpha(s32 a){
if(a == 0xff){ if(a == 0xff){
D_80383714 = 2; modelRenderColorMode = COLOR_MODE_STATIC_OPAQUE;
} }
else{ else{
D_80383714 = 3; modelRenderColorMode = COLOR_MODE_STATIC_TRANSPARENT;
D_803837C0 = a; modelRenderDynAlpha = a;
} }
} }
@@ -1501,7 +1513,7 @@ void modelRender_setDepthMode(enum model_render_depth_mode_e renderMode){
modelRenderDepthMode = renderMode; modelRenderDepthMode = renderMode;
} }
void func_8033A4D8(void){ void modelRender_defrag(void){
if(D_80383730 != NULL){ if(D_80383730 != NULL){
D_80383730 = func_802EA374(D_80383730); D_80383730 = func_802EA374(D_80383730);
} }