Merge branch 'mr-origin-69'

This commit is contained in:
Banjo Kazooie
2024-09-13 20:26:40 -05:00
80 changed files with 806 additions and 660 deletions

View File

@@ -7,7 +7,6 @@
#include "SnS.h"
extern void func_803012F8(void);
extern f32 func_8024DDD8(f32[3], f32);
extern f32 ml_distanceSquared_vec3f(f32 arg0[3], f32 arg1[3]);
extern void __baMarker_8028BA00(s32);
extern void func_802C418C(void);

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
#include "core2/ba/physics.h"
extern void func_8028FDC8(f32);
@@ -34,9 +35,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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
#include "core2/ba/physics.h"
@@ -282,7 +283,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

@@ -1,6 +1,8 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern void __spawnQueue_add_2(void (*)(s32, s32), s32, s32);
@@ -88,7 +90,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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern void func_8025982C(f32[3], f32[3], f32[3], f32);
extern void func_8025A6CC(enum comusic_e arg0, s32 arg1);
@@ -50,7 +51,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 +123,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 +140,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

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
#ifndef ABS
#define ABS(d) ((d) >= 0) ? (d) : -(d)
#endif
@@ -86,7 +88,7 @@ void chBottlesBonusCursor_func_802DF460(s32 indx, ActorMarker *caller, f32 arg2[
sp1C[0] = arg2[0] * 100.0f;
sp1C[1] = arg2[1] * 100.0f;
sp1C[2] = arg2[2] * 100.0f;
if (func_8024E030(sp1C, D_8037E068[indx]) == 0) {
if (viewport_func_8024E030(sp1C, D_8037E068[indx]) == 0) {
D_8037E068[indx][0] = D_8037E068[indx][1] = 0.0f;
}
}
@@ -149,7 +151,7 @@ void chBottlesBonusCursor_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
modelRender_postDraw((GenFunction_1)actor_postdrawMethod, (s32)chBottlesBonusCursorMarker);
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
actor_setOpacity(this, 0xB9);
func_8024E030(this->position, D_8037E5C0.unk18);
viewport_func_8024E030(this->position, D_8037E5C0.unk18);
sp3C = (this->scale * 650.0f);
func_80253208(gfx,
(s32)(D_8037E5C0.unk18[0] - sp3C/2), (s32)(D_8037E5C0.unk18[1] - sp3C/2),
@@ -157,7 +159,7 @@ void chBottlesBonusCursor_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
D_803A5D00[getActiveFramebuffer()]
);
modelRender_draw(gfx, mtx, this->position, rotation, this->scale, NULL, marker_loadModelBin(chBottlesBonusCursorMarker));
func_8024E030(this->position, D_8037E5C0.unk10);
viewport_func_8024E030(this->position, D_8037E5C0.unk10);
if (this->state == 1) {
D_8037E5C0.unk10[0] -= 24.0f;
D_8037E5C0.unk10[1] -= 8.0f;

View File

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
void func_802CD898(Actor *);
void func_802CD8C0(Actor *);
@@ -88,11 +89,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

@@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
extern int func_8024DB50(f32 arg0[3], f32 arg1);
#include <core1/viewport.h>
void chfirefx_update(Actor *this);
@@ -75,7 +75,7 @@ void chfirefx_update(Actor *this){
}
}//L80359934
if(subaddie_playerIsWithinSphere(this, 2000)){
if( func_8024DB50(this->position, 50.0f) && this->unk38_31 ){
if( viewport_func_8024DB50(this->position, 50.0f) && this->unk38_31 ){
if(!(globalTimer_getTime() & 3) && randf() < 0.1){
__chfirefx_spawnSmoke(this->position, this->scale);
} //L803599AC

View File

@@ -2,6 +2,9 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern Actor *spawn_actor_f32(enum actor_e, f32[3], s32);
extern void actor_postdrawMethod(ActorMarker *marker);
@@ -37,18 +40,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

@@ -2,6 +2,9 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern void subaddie_set_state_with_direction(Actor *, s32, f32, s32);
extern void actor_predrawMethod(Actor *);
extern void actor_postdrawMethod(ActorMarker *);
@@ -47,18 +50,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

@@ -2,6 +2,9 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
bool func_8034A6FC(f32, f32);
void chTermite_update(Actor *this);
@@ -52,7 +55,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

@@ -1,8 +1,8 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
f32 func_8024DDD8(f32[3], f32);
extern void func_8024E71C(s32, f32*);
extern f32 ml_acosf(f32);
extern f32 player_getYaw(void);
@@ -141,7 +141,7 @@ f32 func_8029B33C(void){
f32 sp1C[3];
_player_getPosition(sp1C);
return func_8024DDD8(sp1C, func_8029B2F4());
return viewport_adjustAngleToRight(sp1C, func_8029B2F4());
}
s32 func_8029B370(void){

View File

@@ -5,8 +5,8 @@
#include "core2/statetimer.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
#include <core1/viewport.h>
f32 func_8024DDD8(f32[3], f32);
extern void func_8024E71C(s32, f32*);
extern f32 ml_acosf(f32);
extern f32 player_getYaw(void);
@@ -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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern void func_802BEA4C(f32[3], f32[3], f32, f32[3]);
extern ActorProp *func_80320EB0(ActorMarker *, f32, s32);
@@ -33,8 +34,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

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "core2/nc/camera.h"
#include <core1/viewport.h>
extern Actor *func_80328230(enum actor_e, f32[3], f32[3]);
extern void func_802BEA4C(f32[3], f32[3], f32, f32[3]);
@@ -120,9 +121,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 +296,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 +353,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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
typedef struct{
u8 map_id;
@@ -94,7 +95,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

@@ -5,9 +5,9 @@
#include "prop.h"
#include "core2/statetimer.h"
#include "core2/ba/physics.h"
#include <core1/viewport.h>
extern f32 func_8024DDD8(f32[3], f32);
extern int func_80259254(f32 vec[3], f32 x, f32 z, f32 val);
extern f32 player_getYaw(void);
@@ -144,8 +144,8 @@ bool func_8028AE10(void) {
_player_getPosition(sp1C);
ideal_yaw = yaw_getIdeal();
sp2C = func_8024DDD8(sp1C, 90.0f);
sp28 = func_8024DDD8(sp1C, 270.0f);
sp2C = viewport_adjustAngleToRight(sp1C, 90.0f);
sp28 = viewport_adjustAngleToRight(sp1C, 270.0f);
if (sp28 < sp2C) {
return (sp2C < ideal_yaw) || (ideal_yaw < sp28);
}

View File

@@ -1,6 +1,8 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern f32 func_8028E82C(void);
@@ -63,7 +65,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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern f32 func_8025715C(f32, f32);
extern f32 func_802575BC(f32);
@@ -434,8 +435,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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern f32 func_8028EF88(void);
void func_802D8730(Actor *this);
@@ -38,7 +39,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

@@ -2,9 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "core2/particle.h"
extern bool func_8024DB50(f32[3], f32);
#include <core1/viewport.h>
void func_802DC208(Actor *this);
@@ -57,7 +55,7 @@ void func_802DC208(Actor *this) {
actor_collisionOff(this);
this->marker->propPtr->unk8_3 = TRUE;
}
if( func_8024DB50(this->position, 50.0f)
if( viewport_func_8024DB50(this->position, 50.0f)
&& func_802DC188()
&& !(globalTimer_getTime() & 0x1F)
&& randf() < 0.1

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern void actor_postdrawMethod(ActorMarker *);
@@ -31,17 +32,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 +50,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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern void actor_postdrawMethod(ActorMarker *);
@@ -30,17 +31,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 +49,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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern void func_802C71F0(Actor *);
extern void actor_postdrawMethod(ActorMarker *);
@@ -145,6 +146,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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern void func_8023DFF0(s32);
extern void comusicPlayer_update(void);
@@ -55,12 +56,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

@@ -2,12 +2,9 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
#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 func_802F5374(void);
extern void func_802FA0F8(void);
extern void timedFuncQueue_update(void);
@@ -64,9 +61,9 @@ 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);
func_8024C510(3000.0f);
viewport_setPosition_f3(0.0f, 0.0f, 0.0f);
viewport_setRotation_f3(-30.0f, 30.0f, 0.0f);
viewport_moveAlongZAxis(3000.0f);
viewport_update();
}
@@ -401,7 +398,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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern void func_80252CC4(f32[3], f32 [3], f32, f32[3]);
extern f32 func_8034A9D0(f32[4], f32);
@@ -215,8 +216,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

@@ -2,6 +2,9 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern s16 D_803A5D00[2][0xF660];
typedef struct Struct_Core2_6A4B0_2{
@@ -40,7 +43,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 +90,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 +163,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 +217,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

@@ -3,6 +3,8 @@
#include "variables.h"
#include "ml/mtx.h"
#include <core1/viewport.h>
extern s16 D_803A5D00[2][0xF660];
@@ -69,11 +71,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);
@@ -328,7 +330,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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern func_802EFAB0(ParticleEmitter *, s32, f32);
@@ -36,7 +37,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

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
typedef struct{
@@ -633,7 +634,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 +884,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

@@ -1,8 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern s32 func_8024DD34(f32,f32, f32);
#include <core1/viewport.h>
/* .code */
void func_802F7EB0(struct3s *this){
@@ -19,8 +18,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 +36,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_isPointPlane_3f(sp4C[0],sp4C[1]- 10.0f, sp4C[2]); i++){
sp4C[1] += 100.0f;
}

View File

@@ -1,8 +1,8 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern int func_8024DD34(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_isPointPlane_3f(sp4C[0], sp4C[1] - 10.0f, sp4C[2]); i++){
sp4C[1] += 100.0f;
}
}

View File

@@ -2,18 +2,16 @@
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
#include <core1/viewport.h>
typedef struct {
u8 pad0[0xC];
f32 unkC[3];
}Struct_core2_72060_0;
extern f32 viewport_get_yaw();
extern int func_8024DD34(f32, f32, f32);
extern void func_80251B5C(f32, f32, f32);
extern void func_80252A38(f32, f32, f32);
extern f32 vtxList_getGlobalNorm(BKVertexList *);
extern bool func_8024DB50(f32[3], f32);
struct4Cs *D_80369280 = NULL;
@@ -164,12 +162,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_isPointPlane_3f(sp4C[0], sp4C[1] - 10.0f, sp4C[2]) ; sp44++){
sp4C[1] += 200.0f;
}
}
@@ -198,8 +196,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 = (Gfx*)((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);
@@ -229,7 +227,7 @@ bool func_802F989C(Gfx **gfx, Mtx **mtx, f32 arg2[3]) {
if( ((-17000.0f < D_80381070[0]) &&(D_80381070[0] < 17000.0f))
&& (arg2[1] > -200.0f)
&& ((-17000.0f < D_80381070[2]) && (D_80381070[2] < 17000.0f))
&& func_8024DB50(arg2, D_8038108C)
&& viewport_func_8024DB50(arg2, D_8038108C)
) {
func_80251B5C(D_80381070[0], D_80381070[1], D_80381070[2]);
mlMtxApply(*mtx);

View File

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
#include <core2/file.h>
#include "prop.h"
@@ -141,7 +142,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) && viewport_cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1++;
@@ -151,7 +152,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) && viewport_cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1--;
@@ -167,7 +168,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) && viewport_cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1++;
@@ -177,7 +178,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) && viewport_cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1--;
@@ -201,7 +202,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) && viewport_cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1++;
@@ -211,7 +212,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) && viewport_cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1--;
@@ -227,7 +228,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) && viewport_cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1++;
@@ -237,7 +238,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) && viewport_cube_isInFrustum2(var_s0) != 0) {
func_80301F10(var_s0, gfx, mtx, vtx);
}
var_s1--;
@@ -268,7 +269,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) && viewport_cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp++;
@@ -276,7 +277,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) && viewport_cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp--;
@@ -289,7 +290,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) && viewport_cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp++;
@@ -297,7 +298,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) && viewport_cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp--;
@@ -316,7 +317,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) && viewport_cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp++;
@@ -324,7 +325,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) && viewport_cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp--;
@@ -337,7 +338,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) && viewport_cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp++;
@@ -345,7 +346,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) && viewport_cube_isInFrustum2(var_fp) != 0) {
func_80301F10(var_fp, gfx, mtx, vtx);
}
var_fp--;
@@ -370,8 +371,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];\
@@ -2402,8 +2403,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 (viewport_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

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "n_libaudio.h"
#include <core1/viewport.h>
extern f32 func_80256AB4(f32, f32, f32, f32);
extern void func_80335394(s32, f32);
@@ -218,8 +219,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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
#include "actor.h"
#include "prop.h"
@@ -309,7 +310,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

@@ -3,6 +3,7 @@
#include "variables.h"
#include "enums.h"
#include <core1/viewport.h>
#include <core2/file.h>
#define AssetCacheSize 0x3D5
@@ -103,7 +104,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

@@ -1,11 +1,11 @@
#include <ultra64.h>
#include <core2/file.h>
#include "functions.h"
#include "variables.h"
#include "core2/particle.h"
#include <core1/viewport.h>
#include "core2/anim/sprite.h"
#include <core2/file.h>
#include "core2/particle.h"
/* .data */
extern u8 D_80370250 = 0;
@@ -22,7 +22,6 @@ u32 D_803835E0;
/* public */
void func_80335110(s32);
void func_80335128(s32);
void viewport_set_near_far(f32, f32);
void func_80335140(enum map_e);
void func_8033520C(s32);
@@ -34,8 +33,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) {
@@ -44,8 +43,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,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
#include <core1/viewport.h>
void func_80252330(f32, f32, f32);
void func_803382D8(s32 arg0);
@@ -442,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);
@@ -456,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

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
#include <core1/viewport.h>
extern void mlMtxRotatePYR(f32, f32, f32);
extern void func_80252330(f32, f32, f32);
@@ -40,10 +42,10 @@ void func_8033F7F0(u8 indx, Gfx **gfx, Mtx **mtx, Vtx **vtx){
if(sp54->unk28_23 != 1){
ml_vec3f_copy(sp48, sp54->position);
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

@@ -2,11 +2,12 @@
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
#include <core1/viewport.h>
extern void spriteRender_drawWithSegment(Gfx**, Vtx**, BKSprite *, s32, s32);
extern void func_80252330(f32, f32, f32);\
extern void func_80349AD0(void);
extern void func_8024C5A8(f32[3]);
@@ -50,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];
@@ -80,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);
@@ -108,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];
@@ -139,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) {
@@ -166,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

@@ -1,9 +1,9 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern bool func_8028F170(f32, f32);
extern void viewport_get_position_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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
typedef struct {
u8 *unk0;
@@ -97,7 +98,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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern void func_80288C7C(VLA**);
extern void func_80288D84(s32, f32, void (*)(s32,s32), s32, s32);
@@ -80,7 +81,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

@@ -2,7 +2,8 @@
#include "functions.h"
#include "variables.h"
extern int func_8024DB50(f32[3], f32 );
#include <core1/viewport.h>
extern void func_802EFF5C(ParticleEmitter *, f32, f32, f32);
extern void func_802EFF7C(ParticleEmitter *, f32, f32, f32);
extern void func_802EFF9C(ParticleEmitter *, f32);
@@ -487,17 +488,17 @@ void func_80362E94(Actor *this){
switch(this->unkF4_8){
case 0x3: //L80362ED8
if(func_8024DB50(this->position, 50.0f) && randf() < 0.2){
if(viewport_func_8024DB50(this->position, 50.0f) && randf() < 0.2){
func_80362084(this->position);
}
break;
case 0xa: //L80362F24
if(func_8024DB50(this->position, 50.0f) && randf() < 0.1){
if(viewport_func_8024DB50(this->position, 50.0f) && randf() < 0.1){
func_8036247C(this->position);
}
break;
case 0xc: //L80362F70
if(func_8024DB50(this->position, 50.0f)){
if(viewport_func_8024DB50(this->position, 50.0f)){
if(randf() < 0.4)
func_80362680(this->position);
if(randf() < 0.8)
@@ -505,27 +506,27 @@ void func_80362E94(Actor *this){
}
break;
case 0x10://L80362FE8
if(func_8024DB50(this->position, 50.0f) && randf() < 0.1){
if(viewport_func_8024DB50(this->position, 50.0f) && randf() < 0.1){
func_80362A48(this->position);
}
break;
case 0x11://L80363034
if(func_8024DB50(this->position, 50.0f) && randf() < 0.06){
if(viewport_func_8024DB50(this->position, 50.0f) && randf() < 0.06){
func_80362ADC(this->position);
}
break;
case 0x12://L80363080
if(func_8024DB50(this->position, 50.0f) && randf() < 0.06){
if(viewport_func_8024DB50(this->position, 50.0f) && randf() < 0.06){
func_80362C04(this->position);
}
break;
case 0x13://L803630CC
if(func_8024DB50(this->position, 50.0f) && randf() < 0.4){
if(viewport_func_8024DB50(this->position, 50.0f) && randf() < 0.4){
func_80362B70(this->position);
}
break;
case 0x14://L80363118
if(func_8024DB50(this->position, 300.0f)){
if(viewport_func_8024DB50(this->position, 300.0f)){
if(randf() < 0.01)
func_80362C98(this->position);
func_80362D2C(this->position);

View File

@@ -2,6 +2,9 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
#define AIRSCORE_COUNT (6)
#define FXAIRSCORE_SCALE (0.68f)
@@ -68,7 +71,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 +107,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

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
f32 time_getDelta(void);
f32 func_802FB0DC(struct8s *);
f32 func_802FB0E4(struct8s *);
@@ -143,7 +145,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 +186,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

@@ -2,7 +2,8 @@
#include "functions.h"
#include "variables.h"
extern f32 func_8024DE1C(f32, f32, f32[3], f32[3]);
#include <core1/viewport.h>
extern f32 vtxList_getGlobalNorm(BKVertexList *);
extern void func_80253208(Gfx **gdl, s32 x, s32 y, s32 w, s32 h, void *color_buffer);
@@ -192,7 +193,7 @@ void fxcommon3score_draw(enum item_e item_id, void *arg1, Gfx **gfx, Mtx **mtx,
a1->value_string[0] = '\0';
strIToA(a1->value_string, itemPrint_getValue(item_id));
print_bold_spaced(a1->unk30 + a1->unk40, sp40 + a1->unk44, a1->value_string);
sp3C = func_8024DE1C(a1->unk30, sp40, sp5C, sp68);
sp3C = viewport_transformCoordinate(a1->unk30, sp40, sp5C, sp68);
sp44[0] = 0.0f;
sp44[1] = a1->unk38;

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern f32 func_802FB0E4(struct8s*);
extern s32 framebuffer_width;
@@ -82,7 +84,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 +126,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

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
#define _76D90_MAX(s,t) ((s < t)? t : s)
#define _76D90_MIN(s,t) ((s > t)? t : s)
@@ -115,7 +117,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 +171,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

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern f32 func_802FB0E4(struct8s *);
/* .data */
@@ -145,7 +147,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 +202,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

@@ -2,6 +2,9 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern f32 func_802FB0E4(struct8s*);
/* .code */
@@ -84,7 +87,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 +119,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

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
#include <core1/viewport.h>
#include "zoombox.h"
@@ -1208,9 +1209,9 @@ 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);
sp34 = viewport_transformCoordinate(x, y, sp5C, sp44);
mlMtxIdent(); //matrix_stack_identity
sp38[0] = sp5C[0] - sp50[0];
sp38[1] = sp5C[1] - sp50[1];
@@ -1319,7 +1320,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 +1328,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 +1351,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 +1363,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 +1373,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 +1392,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

@@ -1,8 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void viewport_set_near_far(f32, f32);
#include <core1/viewport.h>
typedef struct {
s16 model_id;
@@ -74,11 +73,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

@@ -2,12 +2,12 @@
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
#include "gc/gctransition.h"
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);
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

@@ -3,8 +3,9 @@
#include "variables.h"
#include "zoombox.h"
#include "ml/mtx.h"
#include <core1/viewport.h>
extern f32 func_8024DE1C(f32, f32, f32[3], f32[3]);
void func_80252330(f32, f32, f32);
extern f32 func_8033DDB8(void);
extern void func_8024E60C(s32, void *);
@@ -826,7 +827,7 @@ void func_803163A8(GcZoombox *this, Gfx **gfx, Mtx **mtx) {
f32 sp38[3];
f32 sp34;
sp34 = func_8024DE1C(this->unk170, this->unk172, sp50, sp5C);
sp34 = viewport_transformCoordinate(this->unk170, this->unk172, sp50, sp5C);
if (this->unk1A4_24) {
sp5C[1] += 180.0f;
sp5C[0] -= 2*sp5C[0];
@@ -852,7 +853,7 @@ void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, BK
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);
@@ -870,7 +871,7 @@ void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, BK
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

@@ -1,7 +1,10 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
#include "core2/modelRender.h"
#include "animation.h"
#include "ml/mtx.h"
@@ -11,11 +14,6 @@ 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_update(void);
extern void func_8033BD4C(BKModelBin *);
extern s32 func_8024DB50(f32[3], f32);
extern AnimMtxList *animMtxList_new();
@@ -695,8 +693,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();
}
}
@@ -941,7 +939,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));
}
}
@@ -958,7 +956,7 @@ void func_80338EB8(Gfx ** gfx, Mtx ** mtx, void *arg2){
sp34[1] = (f32)cmd->unk8[1] * modelRenderScale;
sp34[2] = (f32)cmd->unk8[2] * modelRenderScale;
sp30 = (f32)cmd->unkE*modelRenderScale;
if(func_8024DB50(sp34, sp30) && cmd->unk10){
if(viewport_func_8024DB50(sp34, sp30) && cmd->unk10){
func_80339124(gfx, mtx, (BKGeoList*)((s32)cmd + cmd->unk10));
}
}
@@ -980,7 +978,7 @@ void func_80338EB8(Gfx ** gfx, Mtx ** mtx, void *arg2){
sp34[0] += modelRenderCameraPosition[0];
sp34[1] += modelRenderCameraPosition[1];
sp34[2] += modelRenderCameraPosition[2];
if(func_8024DB50(sp34, sp30) && cmd->unk10){
if(viewport_func_8024DB50(sp34, sp30) && cmd->unk10){
func_80339124(gfx, mtx, (BKGeoList*)((s32)cmd + cmd->unk10));
}
@@ -1033,8 +1031,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];
@@ -1074,8 +1072,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];
@@ -1101,7 +1099,7 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 rotation
return 0;
}
D_80370990 = (D_80383704) ? func_8024DB50(object_position, spD0*scale) : 1;
D_80370990 = (D_80383704) ? viewport_func_8024DB50(object_position, spD0*scale) : 1;
if(D_80370990 == 0){
modelRender_reset();
return 0;
@@ -1419,8 +1417,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

@@ -1,5 +1,6 @@
#include <ultra64.h>
#include "functions.h"
#include <core1/viewport.h>
static f32 __playerStartPosition[3];
@@ -7,8 +8,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

@@ -1,11 +1,12 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
extern bool func_80245314(f32[3], f32[3], f32, f32, u32);
extern int func_80244D94(f32[3], f32[3], f32[3], u32, f32);
extern int func_8024575C(f32[3], f32[3], f32, f32[3], s32, u32);
extern void func_8024C510(f32);
extern f32 func_80258708(f32[3], f32[3]);
extern f32 func_80259198(f32, f32);
extern f32 func_8028E82C(void);
@@ -211,8 +212,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 +366,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 +940,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,9 +961,9 @@ 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);
func_8024C510(300.0f);
viewport_setPosition_vec3f(sp2C);
viewport_setRotation_vec3f(sp20);
viewport_moveAlongZAxis(300.0f);
func_802BE720();
}//L802BE828
}

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
/* .bss */
struct {
@@ -15,8 +16,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 +31,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 +46,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

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
#include "core2/nc/camera.h"
@@ -33,8 +34,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){

View File

@@ -1,9 +1,9 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
#include "core2/particle.h"
extern int func_8024DB50(f32 (*)[3], f32);
extern s32 spriteGetFrameCount(BKSprite *);
extern void func_80344720(s32 SpriteGfx, s32 frame, s32, f32[3], f32[3], f32[3], Gfx **, Mtx **);
extern void func_80344424(s32 SpriteGfx, s32 frame, s32, f32[3], f32[3], f32, Gfx **, Mtx **);
@@ -645,7 +645,7 @@ void particleEmitter_update(ParticleEmitter *this){
}//L802F0254
if( 0.0f != this->unkFC
&& !func_8024DB50(&particle->position, this->unkFC)
&& !viewport_func_8024DB50(&particle->position, this->unkFC)
){
memcpy(particle, --this->pList_end_128, sizeof(Particle));
}