document viewport functions

This commit is contained in:
mariob92
2024-09-10 00:17:16 +02:00
parent b77274c9ea
commit 4f843f3ecb
67 changed files with 562 additions and 548 deletions

View File

@@ -34,9 +34,9 @@ int func_802A3350(void){
}
void func_802A339C(f32 arg0[3], f32 arg1[3], f32 arg2){
func_8024C5A8(arg0);
viewport_getLookVector(arg0);
ml_vec3f_scale(arg0, arg2);
viewport_get_rotation_vec3f(arg1);
viewport_getRotation_vec3f(arg1);
}
void func_802A33D8(void){

View File

@@ -282,7 +282,7 @@ static void __bsdronexform_setState(int next_state){
case 5:// 802B02F4
_player_getPosition(sp24);
sp24[1] += 30.0f;
func_8024E3A8(sp24, 80.0f);
viewport_adjustPointDistance(sp24, 80.0f);
func_802AFBB8(sp24);
func_8029E3C0(0, 0.1f);
break;

View File

@@ -88,7 +88,7 @@ f32 func_802D7038(Actor *this) {
void func_802D7124(Actor *actor, f32 arg1) {
f32 vp[3];
viewport_get_position_vec3f(&vp);
viewport_getPosition_vec3f(&vp);
if ((actor->position[0] - vp[0]) * (actor->position[0] - vp[0]) + (actor->position[2] - vp[2]) * (actor->position[2] - vp[2]) < 12250000.0f) {
func_802D729C(actor, arg1);
}

View File

@@ -50,7 +50,7 @@ typedef struct{
extern void item_set(enum item_e, s32);
extern void actor_postdrawMethod(ActorMarker *);
extern void viewport_set_near_far(f32, f32);
extern void viewport_setNearAndFar(f32, f32);
Actor *chBottlesBonus_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void chBottlesBonus_update(Actor *this);
@@ -122,8 +122,8 @@ void chBottlesBonus_func_802DD080(Gfx **gfx, Mtx **mtx) {
f32 vp_position[3];
f32 vp_rotation[3];
func_8024E258();
viewport_set_near_far(50.0f, 2000.0f);
viewport_backupState();
viewport_setNearAndFar(50.0f, 2000.0f);
if (getGameMode() == GAME_MODE_A_SNS_PICTURE) {
vp_rotation[0] = 0.0f;
vp_rotation[1] = 0.0f;
@@ -139,15 +139,15 @@ void chBottlesBonus_func_802DD080(Gfx **gfx, Mtx **mtx) {
vp_rotation[1] = 270.0f;
vp_rotation[2] = 0.0f;
}
viewport_set_position_vec3f(vp_position);
viewport_set_rotation_vec3f(vp_rotation);
viewport_setPosition_vec3f(vp_position);
viewport_setRotation_vec3f(vp_rotation);
viewport_update();
func_8024C904(gfx, mtx);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
}
void chBottlesBonus_func_802DD158(Gfx **gfx, Mtx** mtx){
func_8024E2FC();
func_8024C904(gfx, mtx);
viewport_restoreState();
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
}
Actor *chBottlesBonus_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {

View File

@@ -88,11 +88,11 @@ void func_802CDAC4(Actor *this){
f32 sp1C[3];
camera_setType(1);
viewport_set_position_vec3f(this->position);
viewport_setPosition_vec3f(this->position);
sp1C[0] = this->pitch;
sp1C[1] = this->yaw;
sp1C[2] = 0.0f;
viewport_set_rotation_vec3f(sp1C);
viewport_setRotation_vec3f(sp1C);
}
void func_802CDB18(Actor *this){

View File

@@ -37,18 +37,18 @@ Actor *chOverlayNoController_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vt
actor = marker_getActor(marker);
modelRender_preDraw((GenFunction_1)actor_predrawMethod, (s32)actor);
modelRender_postDraw((GenFunction_1)actor_postdrawMethod, (s32)marker);
func_8024E258();
viewport_backupState();
{sp58[0] = 0.0f; sp58[1] = 0.0f; sp58[2] = 1312.5f;};
{sp4C[0] = 0.0f; sp4C[1] = 0.0f; sp4C[2] = 0.0f;};
viewport_set_position_vec3f(sp58);
viewport_set_rotation_vec3f(sp4C);
viewport_setPosition_vec3f(sp58);
viewport_setRotation_vec3f(sp4C);
viewport_update();
func_8024C904(gdl, mptr);
viewport_setRenderViewportAndPerspectiveMatrix(gdl, mptr);
{sp40[0] = 0.0f; sp40[1] = 0.0f; sp40[2] = 0.0f;};
{sp34[0] = 0.0f; sp34[1] = 165.0f; sp34[2] = 0.0f;};
modelRender_draw(gdl, mptr, sp40, 0, 1.0f, sp34, marker_loadModelBin(marker));
func_8024E2FC();
func_8024C904(gdl, mptr);
viewport_restoreState();
viewport_setRenderViewportAndPerspectiveMatrix(gdl, mptr);
return actor;
}

View File

@@ -47,18 +47,18 @@ Actor *chOverlayPressStart_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx
modelRender_preDraw((GenFunction_1)actor_predrawMethod, (s32)actor);
modelRender_postDraw((GenFunction_1)actor_postdrawMethod, (s32)marker);
func_8024E258();
viewport_backupState();
{sp58[0] = 0.0f; sp58[1] = 0.0f; sp58[2] = 1312.5f;};
{sp4C[0] = 0.0f; sp4C[1] = 0.0f; sp4C[2] = 0.0f;};
viewport_set_position_vec3f(sp58);
viewport_set_rotation_vec3f(sp4C);
viewport_setPosition_vec3f(sp58);
viewport_setRotation_vec3f(sp4C);
viewport_update();
func_8024C904(gdl, mptr);
viewport_setRenderViewportAndPerspectiveMatrix(gdl, mptr);
{sp40[0] = 0.0f; sp40[1] = 0.0f; sp40[2] = 0.0f;};
{sp34[0] = 0.0f; sp34[1] = 400.0f; sp34[2] = 0.0f;};
modelRender_draw(gdl, mptr, sp40, 0, 1.0f, sp34, marker_loadModelBin(marker));
func_8024E2FC();
func_8024C904(gdl, mptr);
viewport_restoreState();
viewport_setRenderViewportAndPerspectiveMatrix(gdl, mptr);
return actor;
}

View File

@@ -52,7 +52,7 @@ void __chTermite_updateWalkSFX(Actor *this) {
f32 sp24[3];
f32 sp20;
viewport_get_position_vec3f(&sp24);
viewport_getPosition_vec3f(&sp24);
sp20 = ml_map_f( (300.0f - sp24[0])*(300.0f - sp24[0]) + (this->position[1] - sp24[1])*(this->position[1] - sp24[1]) + (-858.0f - sp24[2])*(-858.0f - sp24[2])
, 7617600.0f, 8236900.0f
, 8000.0f, 1000.0f

View File

@@ -203,7 +203,7 @@ f32 func_8029B41C(void){
f32 sp1C;
player_getPosition(sp2C);
viewport_get_position_vec3f(sp20);
viewport_getPosition_vec3f(sp20);
func_80257F18(sp2C, sp20, &sp1C);
return sp1C;
}
@@ -363,7 +363,7 @@ void func_8029B984(f32 dst[3]){
f32 sp18[3];
_player_getPosition(plyr_pos);
viewport_get_position_vec3f(sp18);
viewport_getPosition_vec3f(sp18);
ml_vec3f_diff_copy(dst, sp18, plyr_pos);
}

View File

@@ -33,8 +33,8 @@ void func_802BAC58(void) {
f32 vp_rotation[3];
f32 sp1C[3];
viewport_get_position_vec3f(vp_position);
viewport_get_rotation_vec3f(vp_rotation);
viewport_getPosition_vec3f(vp_position);
viewport_getRotation_vec3f(vp_rotation);
func_802BEA4C(vp_rotation, vp_position, 150.0f, sp1C);
if (D_8037D810 == NULL) {
D_8037D810 = func_8032FBE4(sp1C, func_802BABC0, 1, 0x15D);

View File

@@ -120,9 +120,9 @@ void func_802BBA84(void) {
f32 max[3];
mapModel_getBounds(min, max);
viewport_get_position_vec3f(vp_position);
viewport_get_rotation_vec3f(vp_rotation);
func_8024C5A8(sp48);
viewport_getPosition_vec3f(vp_position);
viewport_getRotation_vec3f(vp_rotation);
viewport_getLookVector(sp48);
D_8037D8CC = (f32) func_8033EAF8(min, max, vp_position, sp48);
D_8037D8CC += 100.0f;
if (D_8037D8CC < 1000.0f) {
@@ -295,11 +295,11 @@ void ncCamera_update(void){
break;
}
viewport_get_position_vec3f(sp2C);
viewport_get_rotation_vec3f(sp20);
viewport_getPosition_vec3f(sp2C);
viewport_getRotation_vec3f(sp20);
func_802BB4D8(sp2C, sp20);
viewport_set_position_vec3f(sp2C);
viewport_set_rotation_vec3f(sp20);
viewport_setPosition_vec3f(sp2C);
viewport_setRotation_vec3f(sp20);
viewport_update();
func_802BEFB0();
func_802BBA84();
@@ -352,8 +352,8 @@ void func_802BC2CC(s32 arg0) {
if (ncCameraType == CAMERA_TYPE_2_DYNAMIC) {
func_802BE894(D_8037D918, D_8037D908);
}
viewport_set_position_vec3f(D_8037D908);
viewport_set_rotation_vec3f(D_8037D918);
viewport_setPosition_vec3f(D_8037D908);
viewport_setRotation_vec3f(D_8037D918);
viewport_update();
__spawnQueue_add_2((GenFunction_2)func_802BC2A0, reinterpret_cast(s32, sp24), reinterpret_cast(s32, sp20));
if (ncCameraType == CAMERA_TYPE_2_DYNAMIC) {

View File

@@ -94,7 +94,7 @@ void func_802BEFB0(void) {
return;
}
D_8037DA80.unk10 += time_getDelta();
viewport_get_position_vec3f(sp30);
viewport_getPosition_vec3f(sp30);
sp24[0] = sp30[0];
sp24[1] = sp30[1] + 10000.0f;
sp24[2] = sp30[2];

View File

@@ -63,7 +63,7 @@ void func_802CA92C(Actor *this){
f32 sp28[3];
this->marker->collidable = FALSE;
player_getPosition(this->position);
viewport_get_position_vec3f(sp34);
viewport_getPosition_vec3f(sp34);
ml_vec3f_diff_copy(sp28, sp34, this->position);
ml_vec3f_set_length_copy(sp28, sp28, 180.0f);
this->position_x += sp28[0];

View File

@@ -434,8 +434,8 @@ void func_802CCC5C(Actor *this) {
}
if (this->state == 1) {
player_getPosition(sp8C);
viewport_get_position_vec3f(sp80);
func_8024C5A8(sp74);
viewport_getPosition_vec3f(sp80);
viewport_getLookVector(sp74);
sp5C[0] = this->position[0] - sp80[0];
sp5C[1] = this->position[1] - sp80[1];
sp5C[2] = this->position[2] - sp80[2];

View File

@@ -38,7 +38,7 @@ void func_802D8730(Actor *this) {
if(sp38 < this->position_y)
return;
func_8024E3A8(this->position, 40.0f);
viewport_adjustPointDistance(this->position, 40.0f);
this->position_y = sp38;
this->velocity_y -= sp3C;
if (this->velocity_y < 0.0f) {

View File

@@ -31,17 +31,17 @@ Actor *func_802DC320(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
this = marker_getActor(marker);
modelRender_preDraw( (GenFunction_1)actor_predrawMethod, (s32)this);
modelRender_postDraw((GenFunction_1)actor_postdrawMethod, (s32)marker);
func_8024E258();
viewport_backupState();
vp_position[0] = 0.0f;
vp_position[1] = 0.0f;
vp_position[2] = 937.5f;
vp_rotation[0] = 0.0f;
vp_rotation[1] = 0.0f;
vp_rotation[2] = 0.0f;
viewport_set_position_vec3f(vp_position);
viewport_set_rotation_vec3f(vp_rotation);
viewport_setPosition_vec3f(vp_position);
viewport_setRotation_vec3f(vp_rotation);
viewport_update();
func_8024C904(gfx, mtx);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
model_position[0] = 0.0f;
model_position[1] = 0.0f;
model_position[2] = 0.0f;
@@ -49,8 +49,8 @@ Actor *func_802DC320(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
sp34[1] = 137.5f;
sp34[2] = 0.0f;
modelRender_draw(gfx, mtx, model_position, NULL, 1.0f, sp34, marker_loadModelBin(marker));
func_8024E2FC();
func_8024C904(gfx, mtx);
viewport_restoreState();
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
return this;
}

View File

@@ -30,17 +30,17 @@ Actor *func_802DC7E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
this = marker_getActor(marker);
modelRender_preDraw( (GenFunction_1)actor_predrawMethod, (s32)this);
modelRender_postDraw((GenFunction_1)actor_postdrawMethod, (s32)marker);
func_8024E258();
viewport_backupState();
sp58[0] = 0.0f;
sp58[1] = 0.0f;
sp58[2] = 860.0f;
sp4C[0] = 0.0f;
sp4C[1] = 0.0f;
sp4C[2] = 0.0f;
viewport_set_position_vec3f(sp58);
viewport_set_rotation_vec3f(sp4C);
viewport_setPosition_vec3f(sp58);
viewport_setRotation_vec3f(sp4C);
viewport_update();
func_8024C904(gfx, mtx);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
sp40[0] = 0.0f;
sp40[1] = 0.0f;
sp40[2] = 0.0f;
@@ -48,8 +48,8 @@ Actor *func_802DC7E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
sp34[1] = -87.0f;
sp34[2] = 0.0f;
modelRender_draw(gfx, mtx, sp40, NULL, 1.0f, sp34, marker_loadModelBin(marker));
func_8024E2FC();
func_8024C904(gfx, mtx);
viewport_restoreState();
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
return this;
}

View File

@@ -145,6 +145,6 @@ void func_802E08F0(Actor *this) {
if (actor_animationIsAt(this, 0.99f) != 0) {
marker_despawn(this->marker);
}
viewport_get_rotation_vec3f(sp24);
viewport_getRotation_vec3f(sp24);
this->yaw = sp24[1];
}

View File

@@ -55,12 +55,12 @@ void func_802E329C(s32 arg0, Gfx **gfx_begin, Gfx **gfx_end) {
drawRectangle2D(&gfx, 0, 0, (s32) (f32) framebuffer_width, (s32) (f32) framebuffer_height, 0, 0, 0);
}
if ((D_8037E8C0.unk14 == 0) || (D_8037E8C0.unk14 == 3)) {
func_8024C904(&gfx, &mtx);
viewport_setRenderViewportAndPerspectiveMatrix(&gfx, &mtx);
gcbound_draw(&gfx);
}
if (D_8037E8C0.unk14 == 1) {
drawRectangle2D(&gfx, 0, 0, (s32) (f32) framebuffer_width, (s32) (f32) framebuffer_height, 0, 0, 0);
func_8024C904(&gfx, &mtx);
viewport_setRenderViewportAndPerspectiveMatrix(&gfx, &mtx);
func_802F1858(D_8037E8C0.unk10, &gfx, &mtx, &vtx);
}
finishFrame(&gfx);

View File

@@ -5,9 +5,9 @@
#include "gc/gctransition.h"
extern void func_8024C510(f32);
extern void viewport_set_position_f3(f32, f32, f32);
extern void viewport_set_rotation_f3(f32, f32, f32);
extern void viewport_set_near_far(f32, f32);
extern void viewport_setPosition_f3(f32, f32, f32);
extern void viewport_setRotation_f3(f32, f32, f32);
extern void viewport_setNearAndFar(f32, f32);
extern void func_802F5374(void);
extern void func_802FA0F8(void);
extern void timedFuncQueue_update(void);
@@ -64,8 +64,8 @@ struct{
} D_8037E8E0;
void func_802E3800(void){
viewport_set_position_f3(0.0f, 0.0f, 0.0f);
viewport_set_rotation_f3(-30.0f, 30.0f, 0.0f);
viewport_setPosition_f3(0.0f, 0.0f, 0.0f);
viewport_setRotation_f3(-30.0f, 30.0f, 0.0f);
func_8024C510(3000.0f);
viewport_update();
}
@@ -401,7 +401,7 @@ void func_802E4214(enum map_e map_id){
func_80253428(1);
animCache_init();
viewport_reset();
viewport_set_near_far(1.0f, 10000.0f);
viewport_setNearAndFar(1.0f, 10000.0f);
rand_reset();
scissorBox_setDefault();
func_80253FE8();

View File

@@ -215,8 +215,8 @@ void func_802ECBD4(BKVertexList *dst, BKVertexList *src, f32 arg2[3], f32 rotati
f32 temp_f0;
s32 pad40;
viewport_get_position_vec3f(sp74);
func_8024C5A8(sp68);
viewport_getPosition_vec3f(sp74);
viewport_getLookVector(sp68);
mlMtxIdent();
func_80252CC4(arg2, rotation, 1.0f, NULL);
func_8025235C(sp74, sp74);

View File

@@ -40,7 +40,7 @@ void func_802F1440(Struct_Core2_6A4B0_2 *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx)
static s32 t_values[6] = {0x60, 0x60, 0x860, 0x60, 0x860, 0x860};
if (!arg0->unk10) {
func_8024C7B8(gfx, mtx);
viewport_setRenderViewportAndOrthoMatrix(gfx, mtx);
}
gSPDisplayList((*gfx)++, D_803689D0);
@@ -87,7 +87,7 @@ void func_802F1440(Struct_Core2_6A4B0_2 *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx)
}
}
if (!arg0->unk10) {
func_8024C904(gfx, mtx);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
}
}
@@ -160,7 +160,7 @@ void func_802F1A10(Struct_Core2_6A4B0_2 *arg0, f32 angle_degrees) {
cos = cosf(angle_degrees * 2 * BAD_PI);
sin = sinf(angle_degrees * 2 * BAD_PI);
viewport_get_position_vec3f(spC0);
viewport_getPosition_vec3f(spC0);
spCC[0] = (-(framebuffer_width / 2) * 4) + 8;
spCC[1] = ((framebuffer_height / 2) * 4) - 0x38;
spCC[2] = -0xA;
@@ -214,7 +214,7 @@ void func_802F1CAC(Struct_Core2_6A4B0_2 *arg0) {
s32 *var_s2;
viewport_get_position_vec3f(sp78);
viewport_getPosition_vec3f(sp78);
sp84[0] = (s32) ((1000.0f - sp78[0]) - 200.0f);
sp84[1] = (s32) ((0.0f - sp78[1]) + 300.0f);
sp84[2] = (s32) ((2000.0f - sp78[2]) + 0.0f);

View File

@@ -67,11 +67,11 @@ void func_802F1FC0(Struct65s *self, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
s32 width;
s32 height;
viewport_get_position_vec3f(spDC);
viewport_getPosition_vec3f(spDC);
spD0[0] = self->unk0[0] - spDC[0];
spD0[1] = self->unk0[1] - spDC[1];
spD0[2] = self->unk0[2] - spDC[2];
mlMtxSet(func_8024DD90());
mlMtxSet(viewport_getMatrix());
func_80252330(spD0[0], spD0[1], spD0[2]);
mlMtxApply(*mtx);
gSPMatrix((*gfx)++, OS_K0_TO_PHYSICAL((*mtx)++), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -326,7 +326,7 @@ void func_802F2ED0(Struct64s *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
f32 sp38[3];
if (arg0 != NULL && arg0->unk4) {
viewport_get_rotation_vec3f(sp38);
viewport_getRotation_vec3f(sp38);
mlMtxIdent();
mlMtxRotPitch(-sp38[0]);
mlMtxRotYaw(-sp38[1]);

View File

@@ -36,7 +36,7 @@ ParticleEmitter *func_802F4274(f32 arg0[3]) {
ml_vec3f_copy(sp2C, arg0);
func_8024559C(sp2C, &sp20, &sp28);
sp2C[1] = sp28 + 14.0f;
viewport_get_position_vec3f(sp38);
viewport_getPosition_vec3f(sp38);
sp44[0] = sp38[0] - sp2C[0];
sp44[2] = sp38[2] - sp2C[2];
sp44[1] = 0.0f;

View File

@@ -633,7 +633,7 @@ void _printbuffer_draw_letter(char letter, f32* xPtr, f32* yPtr, f32 arg3, Gfx *
//toggle letter gradient
D_80380AF4 ^= 1;
if(D_80380AF4){
func_8024C7B8(gfx, mtx);
viewport_setRenderViewportAndOrthoMatrix(gfx, mtx);
gDPPipeSync((*gfx)++);
gDPSetTexturePersp((*gfx)++, G_TP_PERSP);
gDPSetPrimColor((*gfx)++, 0, 0, 0x00, 0x00, 0x00, 0xFF);
@@ -883,7 +883,7 @@ void printbuffer_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
gDPPipeSync((*gfx)++);
gDPSetTexturePersp((*gfx)++, G_TP_PERSP);
gDPSetTextureFilter((*gfx)++, G_TF_BILERP);
func_8024C904(gfx, mtx);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
}//*/
//adds a new string to the print buffer and updates string buffer end ptr

View File

@@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
extern s32 func_8024DD34(f32,f32, f32);
extern s32 viewport_isPointPlane2_3f(f32,f32, f32);
/* .code */
void func_802F7EB0(struct3s *this){
@@ -19,8 +19,8 @@ void func_802F7EB0(struct3s *this){
return;
player_getPosition(plyrPos);
func_8024C5A8(camNorm);
viewport_get_rotation_vec3f(camRot);
viewport_getLookVector(camNorm);
viewport_getRotation_vec3f(camRot);
sp50 = vector_pushBackNew(&this->unk20);
tmpf = randf2(50.0f, 1100.0f);
sp4C[0] = 0.0f;
@@ -37,7 +37,7 @@ void func_802F7EB0(struct3s *this){
sp4C[1] = plyrPos[1] + sp4C[1];
sp4C[2] = plyrPos[2] + sp4C[2];
if(tmpf < 550.0)
for(i = 0; (i < 0xa) && func_8024DD34(sp4C[0],sp4C[1]- 10.0f, sp4C[2]); i++){
for(i = 0; (i < 0xa) && viewport_isPointPlane2_3f(sp4C[0],sp4C[1]- 10.0f, sp4C[2]); i++){
sp4C[1] += 100.0f;
}

View File

@@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
extern int func_8024DD34(f32, f32, f32);
extern int viewport_isPointPlane2_3f(f32, f32, f32);
#define _SQ3(x, y, z) (((x) * (x)) + ((y) * (y)) + ((z) * (z)))
#define _SQ3v1(v) (v[0] * v[0] + v[1] * v[1] + v[2] * v[2])
@@ -20,8 +20,8 @@ void func_802F87B0(struct6s *this){
return;
player_getPosition(plyrPos);
func_8024C5A8(camNorm);
viewport_get_rotation_vec3f(camRot);
viewport_getLookVector(camNorm);
viewport_getRotation_vec3f(camRot);
ptr = vector_pushBackNew(&this->unk1C);
f20 = randf2(50.0f, 1200.0f);
sp4C[0] = 0.0f;
@@ -39,7 +39,7 @@ void func_802F87B0(struct6s *this){
sp4C[1] += plyrPos[1];
sp4C[2] += plyrPos[2];
if(f20 < 600.0){
for(i = 0; i <10 && func_8024DD34(sp4C[0], sp4C[1] - 10.0f, sp4C[2]); i++){
for(i = 0; i <10 && viewport_isPointPlane2_3f(sp4C[0], sp4C[1] - 10.0f, sp4C[2]); i++){
sp4C[1] += 100.0f;
}
}

View File

@@ -7,8 +7,8 @@ typedef struct {
f32 unkC[3];
}Struct_core2_72060_0;
extern f32 viewport_get_yaw();
extern int func_8024DD34(f32, f32, f32);
extern f32 viewport_getYaw();
extern int viewport_isPointPlane2_3f(f32, f32, f32);
extern void func_80251B5C(f32, f32, f32);
extern void mlMtx_rotate_pitch_deg(f32);
extern void mlMtx_rotate_yaw_deg(f32);
@@ -166,12 +166,12 @@ void func_802F919C(void) {
} else {
var_f20 = 70.0f;
}
ml_vec3f_yaw_rotate_copy(sp4C, sp4C, viewport_get_yaw() + randf2(-var_f20, var_f20));
ml_vec3f_yaw_rotate_copy(sp4C, sp4C, viewport_getYaw() + randf2(-var_f20, var_f20));
sp4C[0] += D_80381040[0];
sp4C[1] += D_80381040[1];
sp4C[2] += D_80381040[2];
if (sp58 < 650.0) {
for(sp44 = 0; sp44 < 5 && func_8024DD34(sp4C[0], sp4C[1] - 10.0f, sp4C[2]) ; sp44++){
for(sp44 = 0; sp44 < 5 && viewport_isPointPlane2_3f(sp4C[0], sp4C[1] - 10.0f, sp4C[2]) ; sp44++){
sp4C[1] += 200.0f;
}
}
@@ -200,8 +200,8 @@ void func_802F962C(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
void *phi_s0_2;
if ((D_80369280 != NULL) && (D_80369284 != 0)) {
viewport_get_position_vec3f(D_80381050);
viewport_get_rotation_vec3f(D_80381060);
viewport_getPosition_vec3f(D_80381050);
viewport_getRotation_vec3f(D_80381060);
D_80381090 = (s32)D_80369288 + D_80369288->gfx_list_offset_C + sizeof(BKGfxList);
temp_s3 = (BKVertexList *)((s32)D_80369288 + D_80369288->vtx_list_offset_10);
D_8038108C = vtxList_getGlobalNorm(temp_s3);

View File

@@ -140,7 +140,7 @@ void func_80301F50(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
var_s1 = arg4[2];
var_s0 = var_fp + var_s1*D_80381FA0.stride[1];
while(var_s1 < arg3[2]) {
if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) {
if ((var_s0->prop2Cnt != 0) && cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1++;
@@ -150,7 +150,7 @@ void func_80301F50(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
var_s1 = arg5[2];
var_s0 = var_fp + var_s1*D_80381FA0.stride[1];
while( var_s1 >= arg3[2]) {
if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) {
if ((var_s0->prop2Cnt != 0) && cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1--;
@@ -166,7 +166,7 @@ void func_80301F50(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
var_s1 = arg4[2];
var_s0 = var_fp + var_s1*D_80381FA0.stride[1];
while(var_s1 < arg3[2]) {
if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) {
if ((var_s0->prop2Cnt != 0) && cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1++;
@@ -176,7 +176,7 @@ void func_80301F50(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
var_s1 = arg5[2];
var_s0 = var_fp + var_s1*D_80381FA0.stride[1];
while(var_s1 >= arg3[2]) {
if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) {
if ((var_s0->prop2Cnt != 0) && cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1--;
@@ -200,7 +200,7 @@ void func_80301F50(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
var_s1 = arg4[2];
var_s0 = var_fp + var_s1*D_80381FA0.stride[1];
while( var_s1 < arg3[2]) {
if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) {
if ((var_s0->prop2Cnt != 0) && cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1++;
@@ -210,7 +210,7 @@ void func_80301F50(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
var_s1 = arg5[2];
var_s0 = var_fp + var_s1*D_80381FA0.stride[1];
while( var_s1 >= arg3[2]) {
if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) {
if ((var_s0->prop2Cnt != 0) && cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1--;
@@ -226,7 +226,7 @@ void func_80301F50(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
var_s1 = arg4[2];
var_s0 = var_fp + var_s1*D_80381FA0.stride[1];
while(var_s1 < arg3[2]) {
if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) {
if ((var_s0->prop2Cnt != 0) && cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1++;
@@ -236,7 +236,7 @@ void func_80301F50(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
var_s1 = arg5[2];
var_s0 = var_fp + var_s1*D_80381FA0.stride[1];
while(var_s1 >= arg3[2]) {
if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) {
if ((var_s0->prop2Cnt != 0) && cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1--;
@@ -267,7 +267,7 @@ void func_80302634(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
for(sp54 = arg4[2]; sp54 < arg3[2]; sp54++) {
var_fp = var_s0 + arg4[0];
for(var_s1 = arg4[0]; var_s1 < arg3[0]; var_s1++) {
if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) {
if ((var_fp->prop2Cnt != 0) && cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp++;
@@ -275,7 +275,7 @@ void func_80302634(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
var_fp = var_s0 + arg5[0];
for(var_s1 = arg5[0]; var_s1 >= arg3[0]; var_s1--) {
if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) {
if ((var_fp->prop2Cnt != 0) && cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp--;
@@ -288,7 +288,7 @@ void func_80302634(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
for(sp54 = arg5[2]; sp54 >= arg3[2]; sp54--) {
var_fp = var_s0 + arg4[0];
for(var_s1 = arg4[0]; var_s1 < arg3[0]; var_s1++) {
if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) {
if ((var_fp->prop2Cnt != 0) && cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp++;
@@ -296,7 +296,7 @@ void func_80302634(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
var_fp = var_s0 + arg5[0];
for(var_s1 = arg5[0]; var_s1 >= arg3[0]; var_s1--) {
if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) {
if ((var_fp->prop2Cnt != 0) && cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp--;
@@ -315,7 +315,7 @@ void func_80302634(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
for(sp54 = arg4[2]; sp54 < arg3[2]; sp54++) {
var_fp = var_s0 + arg4[0];
for(var_s1 = arg4[0]; var_s1 < arg3[0]; var_s1++) {
if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) {
if ((var_fp->prop2Cnt != 0) && cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp++;
@@ -323,7 +323,7 @@ void func_80302634(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
var_fp = var_s0 + arg5[0];
for(var_s1 = arg5[0]; var_s1 >= arg3[0]; var_s1--) {
if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) {
if ((var_fp->prop2Cnt != 0) && cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp--;
@@ -336,7 +336,7 @@ void func_80302634(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
for(sp54 = arg5[2]; sp54 >= arg3[2]; sp54--) {
var_fp = var_s0 + arg4[0];
for(var_s1 = arg4[0]; var_s1 < arg3[0]; var_s1++) {
if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) {
if ((var_fp->prop2Cnt != 0) && cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp++;
@@ -344,7 +344,7 @@ void func_80302634(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
var_fp = var_s0 + arg5[0];
for(var_s1 = arg5[0]; var_s1 >= arg3[0]; var_s1--) {
if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) {
if ((var_fp->prop2Cnt != 0) && cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp--;
@@ -369,8 +369,8 @@ void func_80302C94(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
return;
func_8032D3A8();
viewport_get_position_vec3f(vp_position);
viewport_get_rotation_vec3f(vp_rotation);
viewport_getPosition_vec3f(vp_position);
viewport_getRotation_vec3f(vp_rotation);
func_80256664(vp_rotation);
cube_positionToIndices(vp_cube_indices, vp_position);
vp_cube_indices[0] -= D_80381FA0.min[0];\
@@ -2404,8 +2404,8 @@ void func_80308D2C(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
do {
if (!func_80308F54(D_80382150[phi_s4])) {
temp_s3 = &D_80381FA0.cube_list[D_80382150[phi_s4]];
if (func_8024D8F4(temp_s3)) {
veiwport_get_position_vec3w(vp_pos);
if (cube_isInFrustum(temp_s3)) {
viewport_getPosition_vec3w(vp_pos);
vp_cube_index = cube_atPosition_s32(vp_pos) - D_80381FA0.cube_list;
for(phi_s0 = 0; (phi_s0 < D_80382150[phi_s4 + 1]) && (vp_cube_index != D_80382150[phi_s0 + 2]); phi_s0++) {
}

View File

@@ -218,8 +218,8 @@ s32 func_8030CDE4(SfxSource *arg0){
f32 temp_f0;
f32 pad;
viewport_get_position_vec3f(&sp44);
func_8024C5A8(&sp38);
viewport_getPosition_vec3f(&sp44);
viewport_getLookVector(&sp38);
sp2C[0] = arg0->position[0] - sp44[0];
sp2C[1] = arg0->position[1] - sp44[1];
sp2C[2] = arg0->position[2] - sp44[2];

View File

@@ -309,7 +309,7 @@ Actor *func_80325CAC(ActorMarker *marker, Gfx **gfx, Gfx **mtx, Vtx **vtx) {
this->position[1] -= D_8036E58C[1];
this->position[2] -= D_8036E58C[2];
}
viewport_get_rotation_vec3f(rotation);
viewport_getRotation_vec3f(rotation);
rotation[2] += this->roll;
func_80338338(0xFF, 0xFF, 0xFF);
if (this->unk124_11 != 0) {

View File

@@ -101,7 +101,7 @@ void func_8032CB50(Cube *cube, bool global) {
if (cube->prop2Cnt >= 2) {
if (global == 0) {
veiwport_get_position_vec3w(ref_position); //distance from viewport
viewport_getPosition_vec3w(ref_position); //distance from viewport
} else {
ref_position[0] = 0;
ref_position[1] = 0;

View File

@@ -19,7 +19,7 @@ u32 D_803835E0;
/* public */
void func_80335110(s32);
void func_80335128(s32);
void viewport_set_near_far(f32, f32);
void viewport_setNearAndFar(f32, f32);
void func_80335140(enum map_e);
void func_8033520C(s32);
@@ -31,8 +31,8 @@ void func_80334540(Gfx** gdl, Mtx **mptr, Vtx **vptr) {
if (D_803835E0 == 0) {
drawRectangle2D(gdl, 0, 0, framebuffer_width, framebuffer_height, 0, 0, 0);
func_802BBD2C(&sp44, &sp40);
viewport_set_near_far(sp44, sp40);
func_8024C904(gdl, mptr);
viewport_setNearAndFar(sp44, sp40);
viewport_setRenderViewportAndPerspectiveMatrix(gdl, mptr);
return;
}
if (func_80320708() == 0) {
@@ -41,8 +41,8 @@ void func_80334540(Gfx** gdl, Mtx **mptr, Vtx **vptr) {
spawnQueue_unlock();
sky_draw(gdl, mptr, vptr);
func_802BBD2C(&sp44, &sp40);
viewport_set_near_far(sp44, sp40);
func_8024C904(gdl, mptr);
viewport_setNearAndFar(sp44, sp40);
viewport_setRenderViewportAndPerspectiveMatrix(gdl, mptr);
if (mapModel_has_xlu_bin() != 0) {
mapModel_opa_draw(gdl, mptr, vptr);
if (game_is_frozen() == 0) {

View File

@@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
Mtx *func_8024DD9C(void);
Mtx *viewport_getDefaultMatrix(void);
void mlMtxSet(Mtx *);
void func_80252330(f32, f32, f32);
void mlMtxApply(Mtx *);
@@ -443,11 +443,11 @@ void func_803380F8(Gfx **gfx, Mtx **mtx, f32 arg2[3]) {
f32 sp2C[3];
f32 sp20[3];
viewport_get_position_vec3f(sp2C);
viewport_getPosition_vec3f(sp2C);
sp20[0] = arg2[0] - sp2C[0];
sp20[1] = arg2[1] - sp2C[1];
sp20[2] = arg2[2] - sp2C[2];
mlMtxSet(func_8024DD90());
mlMtxSet(viewport_getMatrix());
func_80252330(sp20[0], sp20[1], sp20[2]);
mlMtxApply(*mtx);
gSPMatrix((*gfx)++, (*mtx)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -457,11 +457,11 @@ void func_803381B4(Gfx **gfx, Mtx **mtx, f32 arg2[3]) {
f32 sp2C[3];
f32 sp20[3];
viewport_get_position_vec3f(sp2C);
viewport_getPosition_vec3f(sp2C);
sp20[0] = arg2[0] - sp2C[0];
sp20[1] = arg2[1] - sp2C[1];
sp20[2] = arg2[2] - sp2C[2];
mlMtxSet(func_8024DD9C());
mlMtxSet(viewport_getDefaultMatrix());
func_80252330(sp20[0], sp20[1], sp20[2]);
mlMtxApply(*mtx);
gSPMatrix((*gfx)++, (*mtx)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@@ -40,10 +40,10 @@ void func_8033F7F0(u8 arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx){
if(sp54->unk28_23 != 1){
ml_vec3f_copy(sp48, sp54->unk4);
sp48[1] += (sp54->unk1C*sp54->unk20[1])/100.0;
viewport_get_position_vec3f(sp3C);
viewport_getPosition_vec3f(sp3C);
ml_vec3f_diff_copy(sp30, sp48, sp3C);
if(sp54->unk28_12){
mlMtxSet(func_8024DD90());
mlMtxSet(viewport_getMatrix());
}
else{
mlMtxIdent();

View File

@@ -7,7 +7,7 @@ extern void func_80252330(f32, f32, f32);
extern void mlMtxRotatePYR(f32, f32, f32);
extern void mlMtxApply(Mtx *);
extern void func_80349AD0(void);
extern void func_8024C5A8(f32[3]);
extern void viewport_getLookVector(f32[3]);
@@ -51,8 +51,8 @@ void func_80344138(BKSpriteDisplayData *self, s32 frame, s32 mirrored, f32 posit
f32 sp38;
f32 sp34;
viewport_get_position_vec3f(sp6C);
func_8024C5A8(sp60);
viewport_getPosition_vec3f(sp6C);
viewport_getLookVector(sp60);
sp50[0] = position[0] - sp6C[0];
sp50[1] = position[1] - sp6C[1];
sp50[2] = position[2] - sp6C[2];
@@ -81,7 +81,7 @@ void func_80344138(BKSpriteDisplayData *self, s32 frame, s32 mirrored, f32 posit
if (D_80371EC0.unk0 != NULL) {
D_80371EC0.unk0(D_80371EC0.unk4);
}
mlMtxSet(func_8024DD90());
mlMtxSet(viewport_getMatrix());
func_80252330(sp50[0], sp50[1], sp50[2]);
if ((scale != NULL) || mirrored) {
mlMtxScale_xyz((mirrored) ? -scale[0] : scale[0], sp38, sp34);
@@ -109,8 +109,8 @@ void func_80344424(BKSpriteDisplayData *arg0, s32 frame, bool mirrored, f32 posi
f32 sp38;
f32 sp34;
viewport_get_position_vec3f(sp6C);
func_8024C5A8(sp60);
viewport_getPosition_vec3f(sp6C);
viewport_getLookVector(sp60);
sp50[0] = position[0] - sp6C[0];
sp50[1] = position[1] - sp6C[1];
sp50[2] = position[2] - sp6C[2];
@@ -140,7 +140,7 @@ void func_80344424(BKSpriteDisplayData *arg0, s32 frame, bool mirrored, f32 posi
if (D_80371EC0.unk0 != NULL) {
D_80371EC0.unk0(D_80371EC0.unk4);
}
mlMtxSet(func_8024DD90());
mlMtxSet(viewport_getMatrix());
mlMtxRotatePYR(0.0f, 0.0f, rotation);
func_80252330(sp50[0], sp50[1], sp50[2]);
if ((scale != NULL) || mirrored) {
@@ -167,8 +167,8 @@ void func_80344720(BKSpriteDisplayData *arg0, s32 frame, bool mirrored, f32 posi
f32 var_f14;
BKSpriteFrameDisplayData *temp_a3;
viewport_get_position_vec3f(sp5C);
func_8024C5A8(sp50);
viewport_getPosition_vec3f(sp5C);
viewport_getLookVector(sp50);
sp40[0] = position[0] - sp5C[0];
sp40[1] = position[1] - sp5C[1];
sp40[2] = position[2] - sp5C[2];

View File

@@ -3,7 +3,7 @@
#include "variables.h"
extern bool func_8028F170(f32, f32);
extern void viewport_get_position_vec3f(f32[3]);
extern void viewport_getPosition_vec3f(f32[3]);
typedef struct {
f32 unk0;
@@ -129,8 +129,8 @@ void func_80350818(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
temp_s1 = D_80386170.unk4;
if (( temp_s1 != NULL) && D_8038617C.unk0) {
viewport_get_position_vec3f(spDC);
viewport_get_rotation_vec3f(spD0);
viewport_getPosition_vec3f(spDC);
viewport_getRotation_vec3f(spD0);
sp9C[0] = temp_s1->unk4[0];
sp9C[1] = temp_s1->unk4[1];
sp9C[2] = temp_s1->unk4[2];
@@ -196,7 +196,7 @@ void func_80350CA4(void) {
s32 var_v0;
if (D_80386170.unk4 != NULL) {
viewport_get_position_vec3f(sp54);
viewport_getPosition_vec3f(sp54);
sp48[0] = D_80386170.unk4->unk4[0];
sp48[1] = D_80386170.unk4->unk4[1];
sp48[2] = D_80386170.unk4->unk4[2];

View File

@@ -97,7 +97,7 @@ void func_8036158C(Actor *this){
player_getPosition(sp24);
actor_collisionOff(this);
if( ml_distance_vec3f(this->position, sp24) < 1000.0f
&& func_8024DC04(this->position_x, this->position_y, this->position_z)
&& viewport_isPointOutsideFrustum_3f(this->position_x, this->position_y, this->position_z)
&& ml_timer_update(&local->unk4, sp30)
){
func_80361330(this, 2);

View File

@@ -80,7 +80,7 @@ Struct62s D_803731E0[0x20] = {
/* .code */
void func_80361A30(f32 arg0[3], s32 arg1){
if(func_8024DD0C(arg0)){
if(viewport_isPointOutsideFrustum_vec3f(arg0)){
func_8030E6A4(arg1 >> 16, ((arg1 >> 8) & 0xff)*0.0078125, (arg1 & 0xff)*128.0);
}
}

View File

@@ -68,7 +68,7 @@ void fxairscore_draw(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mtx,
if (s_sprite != 0) {
gSPDisplayList((*gfx)++, s_fxairscore_context);
func_80347FC0(gfx, s_sprite, 0, 0, 0, 0, 0, 2, 2, &texture_width, &texture_height);
func_8024C7B8(gfx, mtx);
viewport_setRenderViewportAndOrthoMatrix(gfx, mtx);
//render all 6 air pieces
for(i_part = 0; i_part < AIRSCORE_COUNT; i_part++){
if ((i_part != 0) && (i_part != 5)) {
@@ -104,7 +104,7 @@ void fxairscore_draw(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mtx,
gDPPipeSync((*gfx)++);
gDPSetTextureLUT((*gfx)++, G_TT_NONE);
gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE);
func_8024C904(gfx, mtx);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
}
}

View File

@@ -143,7 +143,7 @@ void func_802FD360(struct8s *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx){
if(arg0->unk20 == ITEM_C_NOTE){
gDPSetCombineMode((*gfx)++, G_CC_MODULATEIA, G_CC_MODULATEIA);
}
func_8024C7B8(gfx, mtx);
viewport_setRenderViewportAndOrthoMatrix(gfx, mtx);
gSPVertex((*gfx)++, *vtx, 4, 0);
if(arg0->unk20 == ITEM_0_HOURGLASS_TIMER){
tmp_s2 = 0xC;
@@ -184,7 +184,7 @@ void func_802FD360(struct8s *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx){
gDPPipeSync((*gfx)++);
gDPSetTextureLUT((*gfx)++, G_TT_NONE);
gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE);
func_8024C904(gfx, mtx);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
}
struct8s *fxcommon2score_new(enum item_e item_id) {

View File

@@ -82,7 +82,7 @@ void fxhealthscore_draw(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mt
gSPDisplayList((*gfx)++, D_8036A918);
func_80347FC0(gfx, D_8036A910, 0, 0, 0, 0, 0, 2, 2, &spEC, &spE8);
func_8024C7B8(gfx, mtx);
viewport_setRenderViewportAndOrthoMatrix(gfx, mtx);
//loop over each honeycomb piece
for(i = D_80381F00-1; i >= 0; i--){//L80300E40
if(i != 0 && (i + 1 != D_80381F00 || D_80381F00 & 1)
@@ -124,7 +124,7 @@ void fxhealthscore_draw(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mt
gDPPipeSync((*gfx)++);
gDPSetTextureLUT((*gfx)++, G_TT_NONE);
gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE);
func_8024C904(gfx, mtx);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
}
bool func_803012B8(f32 arg0, s32 arg1, s32 arg2){

View File

@@ -115,7 +115,7 @@ void fxhoneycarrierscore_draw(s32 arg0, struct8s *arg1, Gfx **arg2, Mtx **arg3,
sp118 = D_803815C0 == 2;
if (D_8036A010 != 0) {
func_80347FC0(arg2, (sp118 ) ? (D_8036A014 != 0) ? D_8036A014 : D_8036A010 : D_8036A010, 0, 0, 0, 0, 0, 2, 2, &sp13C, &sp138);
func_8024C7B8(arg2, arg3);
viewport_setRenderViewportAndOrthoMatrix(arg2, arg3);
gSPDisplayList((*arg2)++, D_8036A030);
for(sp134 = 0; sp134 < ((sp118)? ((D_8036A014 != 0) ? 2 : 1) : 6); sp134++){
sp110 = D_8036A018[sp134] * -0x3C;
@@ -169,7 +169,7 @@ void fxhoneycarrierscore_draw(s32 arg0, struct8s *arg1, Gfx **arg2, Mtx **arg3,
gDPPipeSync((*arg2)++);
gDPSetTextureLUT((*arg2)++, G_TT_NONE);
gDPPipelineMode((*arg2)++, G_PM_NPRIMITIVE);
func_8024C904(arg2, arg3);
viewport_setRenderViewportAndPerspectiveMatrix(arg2, arg3);
}
}

View File

@@ -145,7 +145,7 @@ void fxjinjoscore_draw(s32 arg0, struct8s *arg1, Gfx **gfx, Mtx **mtx, Vtx **vtx
s32 j; // v0_2 (spF8)
gSPDisplayList((*gfx)++, D_8036A228);
func_8024C7B8(gfx, mtx);
viewport_setRenderViewportAndOrthoMatrix(gfx, mtx);
pos_x = 44.0f;
// Draw all jinjo heads
for(jinjo_id = 0; jinjo_id < 5; jinjo_id++){
@@ -200,7 +200,7 @@ void fxjinjoscore_draw(s32 arg0, struct8s *arg1, Gfx **gfx, Mtx **mtx, Vtx **vtx
gDPPipeSync((*gfx)++);
gDPSetTextureLUT((*gfx)++, G_TT_NONE);
gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE);
func_8024C904(gfx, mtx);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
}
bool func_802FFA10(f32 arg0, s32 arg1, s32 arg2){

View File

@@ -84,7 +84,7 @@ void fxlifescore_draw(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mtx,
if(1); //fake
if (D_80381EB0[D_80381EC4] != NULL) {
gSPDisplayList((*gfx)++, D_8036A278);
func_8024C7B8(gfx, mtx);
viewport_setRenderViewportAndOrthoMatrix(gfx, mtx);
if(gfx);
gDPPipeSync((*gfx)++);
gDPSetCombineLERP((*gfx)++, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0);
@@ -116,7 +116,7 @@ void fxlifescore_draw(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mtx,
gDPPipeSync((*gfx)++);
gDPSetTextureLUT((*gfx)++, G_TT_NONE);
gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE);
func_8024C904(gfx, mtx);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
}
}

View File

@@ -1208,7 +1208,7 @@ void __gcpausemenu_drawSprite(Gfx** gdl, Mtx** mptr, Vtx** vptr, BKSprite* sprit
func_80338338(0xFF, 0xFF, 0xFF);
func_803382FC(a);
func_8033837C(0);
viewport_get_position_vec3f(sp50);
viewport_getPosition_vec3f(sp50);
sp34 = func_8024DE1C(x, y, sp5C, sp44);
mlMtxIdent(); //matrix_stack_identity
@@ -1319,7 +1319,7 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
if (D_80383010.unk3E[i] < 0.0) {
D_80383010.unk3E[i] += 360.0;
}
func_8024E258();
viewport_backupState();
sp98[0] = ((i-1)*0.4)*360 + -360.0f;
sp98[1] = 0.0f;
sp98[2] = 1000.0f;
@@ -1327,10 +1327,10 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
sp8C[0] = 0.0f;
sp8C[1] = 0.0f;
sp8C[2] = 0.0f;
viewport_set_position_vec3f(sp98);
viewport_set_rotation_vec3f(sp8C);
viewport_setPosition_vec3f(sp98);
viewport_setRotation_vec3f(sp8C);
viewport_update();
func_8024C904(gfx, mtx);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
sp98[0] = 0.0f;
sp98[1] = 0.0f;
sp98[2] = 0.0f;
@@ -1350,8 +1350,8 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
modelRender_setDepthMode(MODEL_RENDER_DEPTH_NONE);
modelRender_setAlpha(D_80383010.sns_alpha);
modelRender_draw(gfx, mtx, sp98, sp8C, 0.8f, sp80, D_80383010.sns_egg_model);
func_8024E2FC();
func_8024C904(gfx, mtx);
viewport_restoreState();
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
}
}
if (sns_get_item_state(7, 0)) {
@@ -1362,7 +1362,7 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
if (D_80383010.unk3E[0] < 0.0) {
D_80383010.unk3E[0] += 360.0;
}
func_8024E258();
viewport_backupState();
sp98[0] = 0.0f;
sp98[1] = 0.0f;
@@ -1372,10 +1372,10 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
sp8C[1] = 0.0f;
sp8C[2] = 0.0f;
viewport_set_position_vec3f(sp98);
viewport_set_rotation_vec3f(sp8C);
viewport_setPosition_vec3f(sp98);
viewport_setRotation_vec3f(sp8C);
viewport_update();
func_8024C904(gfx, mtx);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
sp98[0] = 0.0f;
sp98[1] = 0.0f;
@@ -1391,8 +1391,8 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
modelRender_setDepthMode(MODEL_RENDER_DEPTH_NONE);
modelRender_setAlpha(D_80383010.sns_alpha);
modelRender_draw(gfx, mtx, sp98, sp8C, 0.8f, sp80, D_80383010.ice_key_model);
func_8024E2FC();
func_8024C904(gfx, mtx);
viewport_restoreState();
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
}
}

View File

@@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
extern void viewport_set_near_far(f32, f32);
extern void viewport_setNearAndFar(f32, f32);
typedef struct {
s16 model_id;
@@ -74,11 +74,11 @@ void sky_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){
f32 rotation[3];
BKModelBin *iAsset;
viewport_set_near_far(5.0f, 15000.0f);
viewport_setNearAndFar(5.0f, 15000.0f);
if(gcSky.model_bins[0]){
drawRectangle2D(gfx, 0, 0, (s32)(f32) framebuffer_width, (s32)(f32)framebuffer_height,0, 0, 0); //fill screen with black
func_8024C904(gfx, mtx);
viewport_get_position_vec3f(position);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
viewport_getPosition_vec3f(position);
for(i = 0; i < 3; i++){
iAsset = gcSky.model_bins[i];
if(iAsset){

View File

@@ -7,7 +7,7 @@
void animctrl_setAnimTimer(AnimCtrl*, f32);
void func_8025AC20(s32, s32, s32, f32, char*, s32);
f32 func_80257618(void);
void viewport_set_near_far(f32, f32);
void viewport_setNearAndFar(f32, f32);
typedef enum {
TRANSITION_ID_1_BLACK_IN = 1,
@@ -251,7 +251,7 @@ void gctransition_draw(Gfx **gdl, Mtx **mptr, Vtx **vptr){
if(s_current_transition.state == 0)
return;
func_8024E258();
viewport_backupState();
if(s_current_transition.animctrl != NULL){
vp_position[0] = 0.0f;
vp_position[1] = 0.0f;
@@ -265,11 +265,11 @@ void gctransition_draw(Gfx **gdl, Mtx **mptr, Vtx **vptr){
vp_rotation[0] = 0.0f;
vp_rotation[1] = 0.0f;
vp_rotation[2] = 0.0f;
viewport_set_near_far(D_8036C440, D_8036C444);
viewport_set_position_vec3f(vp_position); //viewport_get_position_vec3f
viewport_set_rotation_vec3f(vp_rotation); //viewport_get_rotation_vec3f
viewport_setNearAndFar(D_8036C440, D_8036C444);
viewport_setPosition_vec3f(vp_position); //viewport_getPosition_vec3f
viewport_setRotation_vec3f(vp_rotation); //viewport_getRotation_vec3f
viewport_update(); //camera_updateNormal
func_8024C904(gdl, mptr);
viewport_setRenderViewportAndPerspectiveMatrix(gdl, mptr);
sp58[0] = 0.0f;
@@ -367,8 +367,8 @@ void gctransition_draw(Gfx **gdl, Mtx **mptr, Vtx **vptr){
if(s_current_transition.animctrl != NULL){
gDPSetTextureFilter((*gdl)++, G_TF_BILERP);
}
func_8024E2FC();
func_8024C904(gdl, mptr);
viewport_restoreState();
viewport_setRenderViewportAndPerspectiveMatrix(gdl, mptr);
}

View File

@@ -849,7 +849,7 @@ void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, s3
func_803382FC(this->unk168 * arg6);
func_803382E4(5);
func_80335D30(gfx);
func_8024C7B8(gfx, mtx);
viewport_setRenderViewportAndOrthoMatrix(gfx, mtx);
mlMtxIdent();
if (this->unk1A4_24) {
mlMtxRotYaw(180.0f);
@@ -867,7 +867,7 @@ void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, s3
modelRender_setDepthMode(MODEL_RENDER_DEPTH_NONE);
func_80344090(arg5, this->unk186, gfx);
func_8033687C(gfx);
func_8024C904(gfx, mtx);
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
}
void func_80316764(GcZoombox *this, s32 arg1) {

View File

@@ -10,10 +10,10 @@ extern bool func_802ED420(BKModelUnk20List *arg0, u8 *arg1, u32 arg2);
extern void func_802ED52C(BKModelUnk20List *, f32[3], f32);
extern void func_80252AF0(f32[3], f32[3], f32[3], f32, f32[3]);
extern void mlMtxRotatePYR(f32, f32, f32);
extern void viewport_get_position_vec3f(f32[3]);
extern void viewport_get_rotation_vec3f(f32[3]);
extern void viewport_set_position_vec3f(f32[3]);
extern void viewport_set_rotation_vec3f(f32[3]);
extern void viewport_getPosition_vec3f(f32[3]);
extern void viewport_getRotation_vec3f(f32[3]);
extern void viewport_setPosition_vec3f(f32[3]);
extern void viewport_setRotation_vec3f(f32[3]);
extern void viewport_update(void);
extern void func_8033BD4C(BKModelBin *);
extern s32 func_8024DB50(f32[3], f32);
@@ -696,8 +696,8 @@ void modelRender_reset(void){
func_8033A45C(1,1);
func_8033A45C(2,0);
if(D_80383758.unk18){
viewport_set_position_vec3f(D_80383758.unk1C);
viewport_set_rotation_vec3f(D_80383758.unk28);
viewport_setPosition_vec3f(D_80383758.unk1C);
viewport_setRotation_vec3f(D_80383758.unk28);
viewport_update();
}
}
@@ -942,7 +942,7 @@ void func_80338DCC(Gfx ** gfx, Mtx ** mtx, void *arg2){
sp20[0] = (f32)cmd->unkE[0] * modelRenderScale;
sp20[1] = (f32)cmd->unkE[1] * modelRenderScale;
sp20[2] = (f32)cmd->unkE[2] * modelRenderScale;
if(func_8024D374(sp2C, sp20)){
if(viewport_isBoundingBoxInFrustum(sp2C, sp20)){
func_80339124(gfx, mtx, (BKGeoList*)((s32)cmd + cmd->unk14));
}
}
@@ -1034,8 +1034,8 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 rotation
}
D_80370990 = 0;
viewport_get_position_vec3f(modelRenderCameraPosition);
viewport_get_rotation_vec3f(modelRenderCameraRotation);
viewport_getPosition_vec3f(modelRenderCameraPosition);
viewport_getRotation_vec3f(modelRenderCameraRotation);
if(D_80383758.unk18){
D_80383758.unk1C[0] = modelRenderCameraPosition[0];
D_80383758.unk1C[1] = modelRenderCameraPosition[1];
@@ -1075,8 +1075,8 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 rotation
modelRenderCameraRotation[0] = D_80383758.unkC[0],
modelRenderCameraRotation[1] = D_80383758.unkC[1],
modelRenderCameraRotation[2] = D_80383758.unkC[2];
viewport_set_position_vec3f(modelRenderCameraPosition);
viewport_set_rotation_vec3f(modelRenderCameraRotation);
viewport_setPosition_vec3f(modelRenderCameraPosition);
viewport_setRotation_vec3f(modelRenderCameraRotation);
viewport_update();
camera_focus[0] = object_position[0] - modelRenderCameraPosition[0];
camera_focus[1] = object_position[1] - modelRenderCameraPosition[1];
@@ -1420,8 +1420,8 @@ void func_8033A28C(bool arg0){
void func_8033A298(bool arg0){
D_80383758.unk18 = arg0;
if(arg0){
viewport_get_position_vec3f(D_80383758.unk0);
viewport_get_rotation_vec3f(D_80383758.unkC);
viewport_getPosition_vec3f(D_80383758.unk0);
viewport_getRotation_vec3f(D_80383758.unkC);
}
}

View File

@@ -7,8 +7,8 @@ void ncDynamicCamF_init(void){
f32 sp24[3];
f32 sp12[3];
viewport_get_position_vec3f(sp24);
viewport_get_rotation_vec3f(sp12);
viewport_getPosition_vec3f(sp24);
viewport_getRotation_vec3f(sp12);
ncDynamicCamera_setPosition(sp24);
ncDynamicCamera_setRotation(sp12);
player_getPosition(__playerStartPosition);

View File

@@ -211,8 +211,8 @@ void func_802BCBD4(void) {
func_802C0120();
func_802C2258();
func_802C0F4C();
viewport_get_rotation_vec3f(cameraRotation);
viewport_get_position_vec3f(cameraPosition);
viewport_getRotation_vec3f(cameraRotation);
viewport_getPosition_vec3f(cameraPosition);
ml_vec3f_copy(D_8037D948, cameraPosition);
ml_vec3f_clear(D_8037D9C8);
ml_vec3f_clear(D_8037D9E0);
@@ -365,8 +365,8 @@ void ncDynamicCamera_update(void){
if(dynamicCameraInFirstPerson){
ncFirstPersonCamera_getPositionAndRotation(sp24, sp18);
}
viewport_set_position_vec3f(sp24);
viewport_set_rotation_vec3f(sp18);
viewport_setPosition_vec3f(sp24);
viewport_setRotation_vec3f(sp18);
}
int ncDynamicCamera_getState(void){
@@ -939,8 +939,8 @@ void func_802BE720(void){
f32 sp28[3];
f32 sp1C[3];
viewport_get_position_vec3f(sp28);
viewport_get_rotation_vec3f(sp1C);
viewport_getPosition_vec3f(sp28);
viewport_getRotation_vec3f(sp1C);
ncDynamicCamera_setPosition(sp28);
ncDynamicCamera_setRotation(sp1C);
@@ -960,8 +960,8 @@ void func_802BE794(void){
sp2C[1] += 100.0f;
player_getRotation(sp20);
sp20[1] = mlNormalizeAngle(sp20[1] + 180.0f);
viewport_set_position_vec3f(sp2C);
viewport_set_rotation_vec3f(sp20);
viewport_setPosition_vec3f(sp2C);
viewport_setRotation_vec3f(sp20);
func_8024C510(300.0f);
func_802BE720();
}//L802BE828

View File

@@ -15,8 +15,8 @@ void ncRandomCamera_init(void) {
s32 sp24[3];
s32 sp18[3];
viewport_get_position_vec3f(D_8037DA50.storedPosition);
viewport_get_rotation_vec3f(D_8037DA50.storedRotation);
viewport_getPosition_vec3f(D_8037DA50.storedPosition);
viewport_getRotation_vec3f(D_8037DA50.storedRotation);
mapModel_getBounds(sp24, sp18);
D_8037DA50.minPosition[0] = (f32) sp24[0];
@@ -30,8 +30,8 @@ void ncRandomCamera_init(void) {
void ncRandomCamera_end(void){
viewport_set_position_vec3f(D_8037DA50.storedPosition);
viewport_set_rotation_vec3f(D_8037DA50.storedRotation);
viewport_setPosition_vec3f(D_8037DA50.storedPosition);
viewport_setRotation_vec3f(D_8037DA50.storedRotation);
}
void ncRandomCamera_update(void) {
@@ -45,6 +45,6 @@ void ncRandomCamera_update(void) {
sp18[0] = randf2(-90.0f, 90.0f);\
sp18[1] = randf2(0.0f, 360.0f);\
sp18[2] = 0.0f;
viewport_set_position_vec3f(sp24);
viewport_set_rotation_vec3f(sp18);
viewport_setPosition_vec3f(sp24);
viewport_setRotation_vec3f(sp18);
}

View File

@@ -33,8 +33,8 @@ void ncStaticCamera_setPosition(f32 arg0[3]){
}
void ncStaticCamera_update(void){
viewport_set_position_vec3f(ncStaticCameraPosition);
viewport_set_rotation_vec3f(ncStaticCameraRotation);
viewport_setPosition_vec3f(ncStaticCameraPosition);
viewport_setRotation_vec3f(ncStaticCameraRotation);
}
void __ncStaticCamera_setToNode(s32 camera_node_index){