summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMegaMech <inkstudios1@hotmail.com>2025-05-17 13:38:22 -0600
committerMegaMech <inkstudios1@hotmail.com>2025-05-17 13:38:22 -0600
commit749dad19d918360c7bd8e15c75e070fae6b2a142 (patch)
treed64a2d9a4989cc71986ad7728e86b3e01b28edec
parentb57f562c8aa7510c933b8bfe5a3510f2e0b1f513 (diff)
Balloons fixes
-rw-r--r--src/engine/objects/GrandPrixBalloons.cpp14
-rw-r--r--src/racing/actors.c2
2 files changed, 9 insertions, 7 deletions
diff --git a/src/engine/objects/GrandPrixBalloons.cpp b/src/engine/objects/GrandPrixBalloons.cpp
index eb6b311de..253c68464 100644
--- a/src/engine/objects/GrandPrixBalloons.cpp
+++ b/src/engine/objects/GrandPrixBalloons.cpp
@@ -3,6 +3,7 @@
#include "port/Game.h"
#include "assets/other_textures.h"
#include "assets/common_data.h"
+#include "port/interpolation/FrameInterpolation.h"
extern "C" {
#include "update_objects.h"
@@ -12,8 +13,6 @@ extern "C" {
#include "math_util.h"
#include "math_util_2.h"
#include "menus.h"
-// Doesn't seem to compile on Windows
-// #include "port/interpolation/FrameInterpolation.h"
}
size_t OGrandPrixBalloons::_count = 0;
@@ -36,6 +35,7 @@ OGrandPrixBalloons::OGrandPrixBalloons(const FVector& pos) {
find_unused_obj_index(&gObjectParticle3[i]);
init_object(gObjectParticle3[i], 0);
}
+ // printf("primAlfa %d\n", object->primAlpha);
}
void OGrandPrixBalloons::Tick() {
@@ -108,10 +108,10 @@ void OGrandPrixBalloons::func_80053D74(s32 objectIndex, UNUSED s32 arg1, s32 ver
Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(common_vtx_hedgehog);
// @port: Tag the transform.
- // FrameInterpolation_RecordOpenChild("Balloon", TAG_ITEM_ADDR(object)); //Not working properly just yet
-
+ size_t i = 0;
if (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX) {
object = &gObjectList[objectIndex];
+ FrameInterpolation_RecordOpenChild("Balloon", TAG_ITEM_ADDR((objectIndex << 8) + i++)); //Not working properly just yet
D_80183E80[2] = (s16) (object->unk_084[6] + 0x8000);
rsp_set_matrix_transformation(object->pos, (u16*) D_80183E80, object->sizeScaling);
set_color_render((s32) object->unk_084[0], (s32) object->unk_084[1], (s32) object->unk_084[2],
@@ -119,10 +119,10 @@ void OGrandPrixBalloons::func_80053D74(s32 objectIndex, UNUSED s32 arg1, s32 ver
(s32) object->primAlpha);
gSPVertex(gDisplayListHead++, (uintptr_t)&vtx[vertexIndex], 4, 0);
gSPDisplayList(gDisplayListHead++, (Gfx*)common_rectangle_display);
+ FrameInterpolation_RecordCloseChild();
}
// @port Pop the transform id.
- // FrameInterpolation_RecordCloseChild();
}
void OGrandPrixBalloons::func_80074924(s32 objectIndex) {
@@ -195,7 +195,9 @@ void OGrandPrixBalloons::func_80074924(s32 objectIndex) {
void OGrandPrixBalloons::func_80074D94(s32 objectIndex) {
if (gObjectList[objectIndex].unk_0AE == 1) {
- if ((_numBalloons2 <= gObjectList[objectIndex].offset[1]) &&
+ //! @warning this fades out the balloons. Original game uses _numBalloons3 here but they disappear before off-screen.
+ // So _numBalloons replaces it for now.
+ if ((_numBalloons <= gObjectList[objectIndex].offset[1]) &&
(s16_step_down_towards(&gObjectList[objectIndex].primAlpha, 0, 8) != 0)) {
func_80086F60(objectIndex);
}
diff --git a/src/racing/actors.c b/src/racing/actors.c
index 266bd8d4b..65c734be3 100644
--- a/src/racing/actors.c
+++ b/src/racing/actors.c
@@ -2552,7 +2552,7 @@ void render_course_actors(struct UnkStruct_800DC5EC* arg0) {
render_actor_yoshi_egg(camera, sBillBoardMtx, (struct YoshiValleyEgg*) actor, pathCounter);
break;
}
- FrameInterpolation_RecordCloseChild(actor, i);
+ FrameInterpolation_RecordCloseChild();
}
if (GetCourse() == GetMooMooFarm()) {
render_cows(camera, sBillBoardMtx);