mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-07-11 23:30:27 -04:00
Merge branch 'frameinterpolation' of https://github.com/HarbourMasters/SpaghettiKart into frameinterpolation
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <actors.h>
|
||||
#include <main.h>
|
||||
#include <assets/choco_mountain_data.h>
|
||||
#include "port/interpolation/FrameInterpolation.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the falling rock actor.
|
||||
@@ -12,7 +13,7 @@
|
||||
void render_actor_falling_rock(Camera* camera, struct FallingRock* rock) {
|
||||
Vec3s sp98;
|
||||
Vec3f sp8C;
|
||||
Mat4 sp4C;
|
||||
Mat4 mtx;
|
||||
f32 height;
|
||||
UNUSED s32 pad[4];
|
||||
|
||||
@@ -41,16 +42,24 @@ void render_actor_falling_rock(Camera* camera, struct FallingRock* rock) {
|
||||
sp98[1] = 0;
|
||||
sp98[2] = 0;
|
||||
sp8C[1] = height + 2.0f;
|
||||
mtxf_pos_rotation_xyz(sp4C, sp8C, sp98);
|
||||
if (render_set_position(sp4C, 0) == 0) {
|
||||
FrameInterpolation_RecordMatrixPush(mtx);
|
||||
|
||||
mtxf_pos_rotation_xyz(mtx, sp8C, sp98);
|
||||
if (render_set_position(mtx, 0) == 0) {
|
||||
return;
|
||||
}
|
||||
gSPDisplayList(gDisplayListHead++, d_course_choco_mountain_dl_6F88);
|
||||
FrameInterpolation_RecordMatrixPop(mtx);
|
||||
|
||||
}
|
||||
}
|
||||
mtxf_pos_rotation_xyz(sp4C, rock->pos, rock->rot);
|
||||
if (render_set_position(sp4C, 0) == 0) {
|
||||
FrameInterpolation_RecordMatrixPush(mtx);
|
||||
|
||||
mtxf_pos_rotation_xyz(mtx, rock->pos, rock->rot);
|
||||
if (render_set_position(mtx, 0) == 0) {
|
||||
return;
|
||||
}
|
||||
gSPDisplayList(gDisplayListHead++, d_course_choco_mountain_dl_falling_rock);
|
||||
FrameInterpolation_RecordMatrixPop(mtx);
|
||||
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
|
||||
someVec2[0] = item_box->pos[0];
|
||||
someVec2[1] = item_box->resetDistance + 2.0f;
|
||||
someVec2[2] = item_box->pos[2];
|
||||
FrameInterpolation_RecordMatrixPush(someMatrix1);
|
||||
|
||||
mtxf_pos_rotation_xyz(someMatrix1, someVec2, someRot);
|
||||
|
||||
if (!render_set_position(someMatrix1, 0)) {
|
||||
@@ -52,8 +54,13 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
|
||||
}
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D002EE8);
|
||||
FrameInterpolation_RecordMatrixPop(someMatrix1);
|
||||
|
||||
someRot[1] = item_box->rot[1] * 2;
|
||||
someVec2[1] = item_box->pos[1];
|
||||
|
||||
FrameInterpolation_RecordMatrixPush(someMatrix1);
|
||||
|
||||
mtxf_pos_rotation_xyz(someMatrix1, someVec2, someRot);
|
||||
|
||||
if (!render_set_position(someMatrix1, 0)) {
|
||||
@@ -61,8 +68,13 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
|
||||
}
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, itemBoxQuestionMarkModel);
|
||||
FrameInterpolation_RecordMatrixPop(someMatrix1);
|
||||
|
||||
}
|
||||
if (item_box->state == 5) {
|
||||
FrameInterpolation_RecordMatrixPush(someMatrix1);
|
||||
|
||||
|
||||
mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot);
|
||||
|
||||
if (!render_set_position(someMatrix1, 0)) {
|
||||
@@ -70,8 +82,12 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
|
||||
}
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, itemBoxQuestionMarkModel);
|
||||
FrameInterpolation_RecordMatrixPop(someMatrix1);
|
||||
|
||||
}
|
||||
if (item_box->state != 3) {
|
||||
FrameInterpolation_RecordMatrixPush(someMatrix1);
|
||||
|
||||
mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot);
|
||||
|
||||
if (!render_set_position(someMatrix1, 0)) {
|
||||
@@ -94,11 +110,15 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
|
||||
// }
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPDisplayList(gDisplayListHead++, D_0D003090);
|
||||
FrameInterpolation_RecordMatrixPop(someMatrix1);
|
||||
|
||||
} else {
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gDPSetBlendMask(gDisplayListHead++, 0xFF);
|
||||
thing = item_box->someTimer;
|
||||
FrameInterpolation_RecordMatrixPush(someMatrix2);
|
||||
|
||||
mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot);
|
||||
if (thing < 10.0f) {
|
||||
someMultiplier = 1.0f;
|
||||
@@ -122,6 +142,11 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
|
||||
}
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D003158);
|
||||
FrameInterpolation_RecordMatrixPop(someMatrix2);
|
||||
|
||||
FrameInterpolation_RecordMatrixPush(someMatrix2);
|
||||
|
||||
|
||||
temp_f2_2 = 0.8f * thing;
|
||||
temp_f12 = 0.5f * thing;
|
||||
someVec1[0] = temp_f2_2;
|
||||
@@ -134,10 +159,14 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
|
||||
}
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D0031B8);
|
||||
FrameInterpolation_RecordMatrixPop(someMatrix2);
|
||||
|
||||
temp_f0_2 = -0.5f * thing;
|
||||
someVec1[0] = temp_f2_2;
|
||||
someVec1[1] = 1.2f * thing;
|
||||
someVec1[2] = temp_f0_2;
|
||||
FrameInterpolation_RecordMatrixPush(someMatrix2);
|
||||
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) {
|
||||
@@ -145,6 +174,8 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
|
||||
}
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D003128);
|
||||
FrameInterpolation_RecordMatrixPop(someMatrix2);
|
||||
|
||||
if (!(item_box->someTimer & 1)) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else {
|
||||
@@ -153,6 +184,8 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
|
||||
someVec1[0] = 0.0f;
|
||||
someVec1[1] = 1.8f * thing;
|
||||
someVec1[2] = -1.0f * thing;
|
||||
FrameInterpolation_RecordMatrixPush(someMatrix2);
|
||||
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) {
|
||||
@@ -160,10 +193,14 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
|
||||
}
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D0031E8);
|
||||
FrameInterpolation_RecordMatrixPop(someMatrix2);
|
||||
|
||||
temp_f0_3 = -0.8f * thing;
|
||||
someVec1[0] = temp_f0_3;
|
||||
someVec1[1] = 0.6f * thing;
|
||||
someVec1[2] = temp_f0_2;
|
||||
FrameInterpolation_RecordMatrixPush(someMatrix2);
|
||||
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) {
|
||||
@@ -171,9 +208,14 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
|
||||
}
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D003188);
|
||||
FrameInterpolation_RecordMatrixPop(someMatrix2);
|
||||
|
||||
someVec1[0] = temp_f0_3;
|
||||
someVec1[1] = temp_f2;
|
||||
someVec1[2] = temp_f12;
|
||||
FrameInterpolation_RecordMatrixPush(someMatrix2);
|
||||
|
||||
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) {
|
||||
@@ -181,6 +223,8 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
|
||||
}
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D0030F8);
|
||||
FrameInterpolation_RecordMatrixPop(someMatrix2);
|
||||
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
|
||||
@@ -15,6 +15,7 @@ void AddMatrix(std::vector<Mtx>& stack, Mat4 mtx, s32 flags) {
|
||||
|
||||
FrameInterpolation_RecordMatrixMtxFToMtx((MtxF*)mtx, &stack.back());
|
||||
// Convert to a fixed-point matrix
|
||||
FrameInterpolation_RecordMatrixMtxFToMtx((MtxF*)mtx, &stack.back());
|
||||
guMtxF2L(mtx, &stack.back());
|
||||
|
||||
// Load the matrix
|
||||
|
||||
Reference in New Issue
Block a user