mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-09-02 18:32:49 -04:00
pr Code 80005fd0 (#181)
* fix error * a lot of change * basic rename of local variable * continue rename and improve Enhancements * re-apply change * revert the remove of dma_texture and fix mtxf_multiplication * more documentation port * some fix * more fix * fix arround * Update torch * fix spelling --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
@@ -29,7 +29,7 @@ extern s8 gPlayerCount;
|
||||
|
||||
size_t OBombKart::_count = 0;
|
||||
|
||||
OBombKart::OBombKart(FVector pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C) {
|
||||
OBombKart::OBombKart(FVector pos, TrackPathPoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C) {
|
||||
Name = "Bomb Kart";
|
||||
_idx = _count;
|
||||
Vec3f _pos = {0, 0, 0};
|
||||
@@ -81,7 +81,7 @@ OBombKart::OBombKart(FVector pos, TrackWaypoint* waypoint, uint16_t waypointInde
|
||||
void OBombKart::Tick() {
|
||||
f32 sp118;
|
||||
f32 var_f18;
|
||||
TrackWaypoint* temp_v0_2;
|
||||
TrackPathPoint* temp_v0_2;
|
||||
f32 temp_f0_3;
|
||||
f32 sp108;
|
||||
f32 temp_f14;
|
||||
@@ -109,7 +109,7 @@ void OBombKart::Tick() {
|
||||
u16 temp_t6;
|
||||
u16 temp_t7;
|
||||
u16 circleTimer;
|
||||
TrackWaypoint* temp_v0_4;
|
||||
TrackPathPoint* temp_v0_4;
|
||||
Player* player;
|
||||
|
||||
state = State;
|
||||
@@ -168,7 +168,7 @@ void OBombKart::Tick() {
|
||||
temp_t6 = (circleTimer * 0xFFFF) / 360;
|
||||
sp118 = coss(temp_t6) * 25.0;
|
||||
temp_f0_3 = sins(temp_t6) * 25.0;
|
||||
temp_v0_2 = &D_80164550[0][waypoint];
|
||||
temp_v0_2 = &gTrackPaths[0][waypoint];
|
||||
newPos[0] = temp_v0_2->posX + sp118;
|
||||
newPos[1] = CenterY + 3.5f;
|
||||
newPos[2] = temp_v0_2->posZ + temp_f0_3;
|
||||
@@ -188,7 +188,7 @@ void OBombKart::Tick() {
|
||||
temp_t6 = (circleTimer * 0xFFFF) / 360;
|
||||
sp118 = coss(temp_t6) * 25.0;
|
||||
temp_f0_3 = sins(temp_t6) * 25.0;
|
||||
temp_v0_2 = &D_80164550[0][waypoint];
|
||||
temp_v0_2 = &gTrackPaths[0][waypoint];
|
||||
newPos[0] = temp_v0_2->posX + sp118;
|
||||
newPos[1] = CenterY + 3.5f;
|
||||
newPos[2] = temp_v0_2->posZ + temp_f0_3;
|
||||
@@ -209,19 +209,19 @@ void OBombKart::Tick() {
|
||||
break;
|
||||
|
||||
case States::PODIUM_CEREMONY:
|
||||
if ((D_8016347C == 0) || (gNearestWaypointByPlayerId[3] < 5)) {
|
||||
if ((D_8016347C == 0) || (gNearestPathPointByPlayerId[3] < 5)) {
|
||||
break;
|
||||
} else {
|
||||
waypoint = func_8000D2B4(newPos[0], newPos[1], newPos[2], waypoint, 3);
|
||||
if ((waypoint < 0) || (gWaypointCountByPathIndex[3] < waypoint)) {
|
||||
if ((waypoint < 0) || (gPathCountByPathIndex[3] < waypoint)) {
|
||||
waypoint = 0;
|
||||
}
|
||||
if (((s32) waypoint) < 0x1A) {
|
||||
temp_v0_2 = &D_80164550[3][(waypoint + 1) % gWaypointCountByPathIndex[3]];
|
||||
temp_v0_2 = &gTrackPaths[3][(waypoint + 1) % gPathCountByPathIndex[3]];
|
||||
D_80162FB0[0] = temp_v0_2->posX;
|
||||
D_80162FB0[1] = temp_v0_2->posY;
|
||||
D_80162FB0[2] = temp_v0_2->posZ;
|
||||
temp_v0_4 = &D_80164550[3][(waypoint + 2) % gWaypointCountByPathIndex[3]];
|
||||
temp_v0_4 = &gTrackPaths[3][(waypoint + 2) % gPathCountByPathIndex[3]];
|
||||
D_80162FC0[0] = temp_v0_4->posX;
|
||||
D_80162FC0[1] = temp_v0_4->posY;
|
||||
D_80162FC0[2] = temp_v0_4->posZ;
|
||||
@@ -260,11 +260,11 @@ void OBombKart::Tick() {
|
||||
}
|
||||
break;
|
||||
case States::EXPLODE:
|
||||
temp_v0_2 = &D_80164550[0][waypoint];
|
||||
temp_v0_2 = &gTrackPaths[0][waypoint];
|
||||
D_80162FB0[0] = temp_v0_2->posX;
|
||||
D_80162FB0[1] = temp_v0_2->posY;
|
||||
D_80162FB0[2] = temp_v0_2->posZ;
|
||||
temp_v0_4 = &D_80164550[0][(waypoint + 1) % gWaypointCountByPathIndex[0]];
|
||||
temp_v0_4 = &gTrackPaths[0][(waypoint + 1) % gPathCountByPathIndex[0]];
|
||||
D_80162FC0[0] = temp_v0_4->posX;
|
||||
D_80162FC0[1] = temp_v0_4->posY;
|
||||
D_80162FC0[2] = temp_v0_4->posZ;
|
||||
@@ -429,7 +429,7 @@ void OBombKart::Waypoint(s32 screenId) {
|
||||
s32 bombWaypoint;
|
||||
s32 waypointDiff;
|
||||
|
||||
playerWaypoint = gNearestWaypointByPlayerId[screenId];
|
||||
playerWaypoint = gNearestPathPointByPlayerId[screenId];
|
||||
playerHUD[screenId].unk_74 = 0;
|
||||
if ((State == States::EXPLODE) || (State == States::DISABLED)) { return; };
|
||||
bombWaypoint = WaypointIndex;
|
||||
|
||||
@@ -18,12 +18,12 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* Used in VS mode
|
||||
*
|
||||
*
|
||||
* This differs from the other vehicle classes in that it does not get added to the standard actor list
|
||||
* So this is sort of its own thing. Draw call in different place too.
|
||||
*/
|
||||
class OBombKart : public OObject {
|
||||
public:
|
||||
public:
|
||||
enum States : uint16_t { // 0,1,3,5
|
||||
DISABLED,
|
||||
CCW,
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
Vec3f Pos;
|
||||
Vec3f WheelPos[4]; //! @todo Turn WheelPos into a struct
|
||||
f32 Unk_3C;
|
||||
u16 SomeRot; // Some angle
|
||||
u16 SomeRot; // Some angle
|
||||
u16 WaypointIndex; // The waypoint the kart circles
|
||||
States State = States::DISABLED;
|
||||
u16 BounceTimer = 0;
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
Collision _Collision;
|
||||
|
||||
// Set waypoint to NULL if using a spawn position and not a waypoint.
|
||||
explicit OBombKart(FVector pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C);
|
||||
explicit OBombKart(FVector pos, TrackPathPoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C);
|
||||
|
||||
~OBombKart() {
|
||||
_count--;
|
||||
@@ -66,7 +66,8 @@ public:
|
||||
void SomeRender(Vec3f arg1);
|
||||
void LoadMtx();
|
||||
void Waypoint(s32 screenId);
|
||||
private:
|
||||
|
||||
private:
|
||||
static size_t _count;
|
||||
s32 _idx;
|
||||
Player* FindTarget();
|
||||
@@ -74,6 +75,4 @@ private:
|
||||
|
||||
Vec3f _spawnPos;
|
||||
Player* _target = NULL;
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -34,7 +34,6 @@ OBoos::OBoos(size_t numBoos, const IPathSpan& leftBoundary, const IPathSpan& act
|
||||
|
||||
_indices.resize(numBoos, 0);
|
||||
|
||||
|
||||
// Generate objects
|
||||
for (size_t i = 0; i < numBoos; i++) {
|
||||
find_unused_obj_index(&_indices[i]);
|
||||
@@ -55,7 +54,7 @@ void OBoos::Tick() {
|
||||
|
||||
OBoos::func_8007CA70();
|
||||
for (size_t i = 0; i < _numBoos; i++) {
|
||||
objectIndex = _indices[i]; //indexObjectList3[i];
|
||||
objectIndex = _indices[i]; // indexObjectList3[i];
|
||||
object = &gObjectList[objectIndex];
|
||||
if (object->state != 0) {
|
||||
func_8007C684(objectIndex);
|
||||
@@ -83,7 +82,7 @@ void OBoos::Draw(s32 cameraId) {
|
||||
s32 objectIndex;
|
||||
|
||||
for (size_t i = 0; i < _numBoos; i++) {
|
||||
objectIndex = _indices[i]; //indexObjectList3[i];
|
||||
objectIndex = _indices[i]; // indexObjectList3[i];
|
||||
if (gObjectList[objectIndex].state >= 2) {
|
||||
temp_s2 = func_8008A364(objectIndex, cameraId, 0x4000U, 0x00000320);
|
||||
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
||||
@@ -111,7 +110,7 @@ void OBoos::func_800523B8(s32 objectIndex, s32 arg1, u32 arg2) {
|
||||
object = &gObjectList[objectIndex];
|
||||
object->orientation[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos);
|
||||
func_800484BC(object->pos, object->orientation, object->sizeScaling, object->primAlpha, (u8*) object->activeTLUT,
|
||||
(u8*)object->activeTexture, object->vertex, 0x00000030, 0x00000028, 0x00000030, 0x00000028);
|
||||
(u8*) object->activeTexture, object->vertex, 0x00000030, 0x00000028, 0x00000030, 0x00000028);
|
||||
if ((is_obj_flag_status_active(objectIndex, 0x00000020) != 0) && (arg2 < 0x15F91U)) {
|
||||
func_8004A630(&D_8018C830, object->pos, 0.4f);
|
||||
}
|
||||
@@ -123,14 +122,14 @@ void OBoos::func_8007CA70(void) {
|
||||
|
||||
if (_isActive == false) {
|
||||
_playerId = OBoos::func_8007C9F8();
|
||||
point = &gNearestWaypointByPlayerId[_playerId];
|
||||
point = &gNearestPathPointByPlayerId[_playerId];
|
||||
if ((*point > _active.Start) && (*point < _active.End)) {
|
||||
// First group entrance
|
||||
OBoos::BooStart(0, _playerId);
|
||||
}
|
||||
}
|
||||
if (_isActive == true) {
|
||||
point = &gNearestWaypointByPlayerId[_playerId];
|
||||
point = &gNearestPathPointByPlayerId[_playerId];
|
||||
|
||||
if ((*point > _leftBoundary.Start) && (*point < _leftBoundary.End)) {
|
||||
// First group exit reverse direction
|
||||
@@ -146,7 +145,7 @@ void OBoos::func_8007CA70(void) {
|
||||
void OBoos::func_8007C5B4(s32 objectIndex) {
|
||||
Object* object;
|
||||
|
||||
init_texture_object(objectIndex, (u8*)d_course_banshee_boardwalk_boo_tlut, gTextureGhosts, 48, 40);
|
||||
init_texture_object(objectIndex, (u8*) d_course_banshee_boardwalk_boo_tlut, gTextureGhosts, 48, 40);
|
||||
object = &gObjectList[objectIndex];
|
||||
object->pos[0] = 0.0f;
|
||||
object->pos[1] = 0.0f;
|
||||
@@ -269,7 +268,7 @@ void OBoos::BooStart(s32 group, s32 playerId) {
|
||||
void OBoos::BooExit(s32 group) {
|
||||
s32 objectIndex;
|
||||
for (size_t i = 0; i < _numBoos; i++) {
|
||||
objectIndex = _indices[i]; //indexObjectList3[group + temp_a0];
|
||||
objectIndex = _indices[i]; // indexObjectList3[group + temp_a0];
|
||||
gObjectList[objectIndex].unk_0DC += 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,12 +65,12 @@ void OChainChomp::func_80055AB8(s32 objectIndex, s32 cameraId) {
|
||||
D_80183E80[1] =
|
||||
func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
|
||||
D_80183E80[2] = 0x8000;
|
||||
func_800468E0(D_80183E40, D_80183E80, 0.54f, (u8*)d_course_rainbow_road_sphere, (Vtx*)D_0D0062B0, 0x00000020,
|
||||
0x00000040, 0x00000020, 0x00000040, 5);
|
||||
func_800468E0(D_80183E40, D_80183E80, 0.54f, (u8*) d_course_rainbow_road_sphere, (Vtx*) D_0D0062B0,
|
||||
0x00000020, 0x00000040, 0x00000020, 0x00000040, 5);
|
||||
} else {
|
||||
rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].direction_angle,
|
||||
gObjectList[objectIndex].sizeScaling);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0077D0);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D0077D0);
|
||||
render_animated_model((Armature*) gObjectList[objectIndex].model,
|
||||
(Animation**) gObjectList[objectIndex].vertex, 0,
|
||||
(s16) gObjectList[objectIndex].textureListIndex);
|
||||
@@ -79,7 +79,7 @@ void OChainChomp::func_80055AB8(s32 objectIndex, s32 cameraId) {
|
||||
}
|
||||
|
||||
void OChainChomp::func_80085878(s32 objectIndex, s32 arg1) {
|
||||
TrackWaypoint* temp_v0;
|
||||
TrackPathPoint* temp_v0;
|
||||
Object* object;
|
||||
|
||||
object = &gObjectList[objectIndex];
|
||||
@@ -91,7 +91,7 @@ void OChainChomp::func_80085878(s32 objectIndex, s32 arg1) {
|
||||
set_object_flag(objectIndex, 0x04000200);
|
||||
object->unk_084[8] = (arg1 * 0x12C) + 0x1F4;
|
||||
set_obj_origin_pos(objectIndex, 0.0f, -15.0f, 0.0f);
|
||||
temp_v0 = &D_80164490[(u16) object->unk_084[8]];
|
||||
temp_v0 = &gCurrentTrackPath[(u16) object->unk_084[8]];
|
||||
set_obj_origin_offset(objectIndex, temp_v0->posX, temp_v0->posY, temp_v0->posZ);
|
||||
set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
|
||||
object->unk_034 = 4.0f;
|
||||
@@ -99,7 +99,6 @@ void OChainChomp::func_80085878(s32 objectIndex, s32 arg1) {
|
||||
object_next_state(objectIndex);
|
||||
}
|
||||
|
||||
|
||||
void OChainChomp::func_800859C8(s32 objectIndex, s32 arg1) {
|
||||
Object* object;
|
||||
|
||||
@@ -119,8 +118,3 @@ void OChainChomp::func_800859C8(s32 objectIndex, s32 arg1) {
|
||||
}
|
||||
func_80074344(objectIndex, &object->surfaceHeight, -0.8f, 0.8f, 0.03f, 0, -1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -57,22 +57,22 @@ void OCheepCheep::Draw(s32 cameraId) { // func_8005217C
|
||||
object = &gObjectList[temp_a3];
|
||||
if (object->state >= 2) {
|
||||
if (is_obj_flag_status_active(temp_a3, 0x10) != 0) {
|
||||
rsp_set_matrix_transformation(object->pos, object->direction_angle, object->sizeScaling);
|
||||
func_800520C0(temp_a3);
|
||||
rsp_set_matrix_transformation(object->pos, object->direction_angle, object->sizeScaling);
|
||||
func_800520C0(temp_a3);
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007828);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007828);
|
||||
gSPLight(gDisplayListHead++, &D_800E45C0l[0].l[0], LIGHT_1);
|
||||
gSPLight(gDisplayListHead++, &D_800E45C0l[0].a, LIGHT_2);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_banshee_boardwalk_dl_7B38);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_banshee_boardwalk_dl_7B38);
|
||||
gSPLight(gDisplayListHead++, &D_800E45C0l[1].l[0], LIGHT_1);
|
||||
gSPLight(gDisplayListHead++, &D_800E45C0l[1].a, LIGHT_2);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_banshee_boardwalk_dl_7978);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_banshee_boardwalk_dl_7978);
|
||||
gSPLight(gDisplayListHead++, &D_800E45C0l[2].l[0], LIGHT_1);
|
||||
gSPLight(gDisplayListHead++, &D_800E45C0l[2].a, LIGHT_2);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_banshee_boardwalk_dl_78C0);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_banshee_boardwalk_dl_78C0);
|
||||
gSPLight(gDisplayListHead++, &D_800E45C0l[3].l[0], LIGHT_1);
|
||||
gSPLight(gDisplayListHead++, &D_800E45C0l[3].a, LIGHT_2);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_banshee_boardwalk_dl_7650);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_banshee_boardwalk_dl_7650);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ void OCheepCheep::func_8007BBBC(s32 objectIndex) {
|
||||
object = &gObjectList[objectIndex];
|
||||
switch (object->state) {
|
||||
case 1:
|
||||
func_800735BC(objectIndex, (Gfx*)d_course_banshee_boardwalk_dl_cheep_cheep, 2.0f);
|
||||
func_800735BC(objectIndex, (Gfx*) d_course_banshee_boardwalk_dl_cheep_cheep, 2.0f);
|
||||
set_object_flag(objectIndex, 0x00000010);
|
||||
object->unk_0D5 = 0;
|
||||
break;
|
||||
@@ -115,8 +115,8 @@ void OCheepCheep::func_8007BD04(s32 playerId) {
|
||||
|
||||
objectIndex = indexObjectList2[0];
|
||||
if (gObjectList[objectIndex].state == 0) {
|
||||
if (((s32) gNearestWaypointByPlayerId[playerId] >= _span.Start) &&
|
||||
((s32) gNearestWaypointByPlayerId[playerId] <= _span.End)) {
|
||||
if (((s32) gNearestPathPointByPlayerId[playerId] >= _span.Start) &&
|
||||
((s32) gNearestPathPointByPlayerId[playerId] <= _span.End)) {
|
||||
set_obj_origin_pos(objectIndex, xOrientation * _spawnPos.x, _spawnPos.y, _spawnPos.z);
|
||||
init_object(objectIndex, 1);
|
||||
}
|
||||
@@ -129,7 +129,7 @@ void OCheepCheep::init_var_cheep_cheep(s32 objectIndex) {
|
||||
object = &gObjectList[objectIndex];
|
||||
object->unk_0D5 = 1;
|
||||
object->status = 0;
|
||||
object->model = (Gfx*)d_course_banshee_boardwalk_dl_cheep_cheep;
|
||||
object->model = (Gfx*) d_course_banshee_boardwalk_dl_cheep_cheep;
|
||||
object->sizeScaling = 0.2f;
|
||||
object_next_state(objectIndex);
|
||||
set_obj_origin_pos(objectIndex, D_800E634C[0][0], D_800E634C[0][1] + 55.0, D_800E634C[0][2]);
|
||||
|
||||
@@ -221,8 +221,8 @@ void OMole::func_80081D34(s32 objectIndex) {
|
||||
player->soundEffects |= 2;
|
||||
}
|
||||
object->direction_angle[1] = camera->rot[1];
|
||||
object->velocity[1] = (player->unk_094 / 2) + 3.0;
|
||||
object->unk_034 = player->unk_094 + 1.0;
|
||||
object->velocity[1] = (player->speed / 2) + 3.0;
|
||||
object->unk_034 = player->speed + 1.0;
|
||||
if (object->velocity[1] >= 5.0) {
|
||||
object->velocity[1] = 5.0f;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,6 @@ void OThwomp::Tick60fps() { // func_80081210
|
||||
if (is_obj_flag_status_active(_objectIndex, 0x00010000) != 0) {
|
||||
OThwomp::func_80080A4C(_objectIndex, var_s4);
|
||||
}
|
||||
|
||||
}
|
||||
OThwomp::func_8007542C(3);
|
||||
|
||||
@@ -191,8 +190,8 @@ void OThwomp::func_80081080(s32 objectIndex) {
|
||||
Object* object;
|
||||
|
||||
object = &gObjectList[objectIndex];
|
||||
object->activeTexture = (const char*)D_8018D490;
|
||||
object->textureList = (const char**)D_8018D490;
|
||||
object->activeTexture = (const char*) D_8018D490;
|
||||
object->textureList = (const char**) D_8018D490;
|
||||
object->primAlpha = 0x00FF;
|
||||
object->direction_angle[1] = 0;
|
||||
object->orientation[0] = 0;
|
||||
@@ -361,7 +360,7 @@ void OThwomp::func_8007F8D8() {
|
||||
|
||||
if (var_s4 != 0) {
|
||||
for (var_s0 = 0; var_s0 < 4; var_s0++, player++) {
|
||||
if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_KART_AI)) {
|
||||
if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_CPU)) {
|
||||
if (OThwomp::func_8007F75C(var_s0) != 0) {
|
||||
break;
|
||||
}
|
||||
@@ -376,7 +375,7 @@ s32 OThwomp::func_8007F75C(s32 playerId) {
|
||||
s32 var_s6;
|
||||
s32 waypoint;
|
||||
|
||||
waypoint = gNearestWaypointByPlayerId[playerId];
|
||||
waypoint = gNearestPathPointByPlayerId[playerId];
|
||||
var_s6 = 0;
|
||||
if ((waypoint >= 0xAA) && (waypoint < 0xB5)) {
|
||||
if (_idx == 0) {
|
||||
@@ -615,20 +614,20 @@ void OThwomp::func_8007F6C4(s32 objectIndex, s32 playerId) {
|
||||
|
||||
void OThwomp::func_80080B28(s32 objectIndex, s32 playerId) {
|
||||
f32 temp_f0;
|
||||
Player* temp_s0;
|
||||
Player* player;
|
||||
|
||||
temp_s0 = &gPlayerOne[playerId];
|
||||
player = &gPlayerOne[playerId];
|
||||
if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) {
|
||||
if (!(temp_s0->soundEffects & 0x100)) {
|
||||
temp_f0 = func_80088F54(objectIndex, temp_s0);
|
||||
if ((temp_f0 <= 9.0) && !(temp_s0->effects & 0x04000000) &&
|
||||
(has_collided_horizontally_with_player(objectIndex, temp_s0) != 0)) {
|
||||
if ((temp_s0->type & 0x8000) && !(temp_s0->type & 0x100)) {
|
||||
if (!(temp_s0->effects & 0x200)) {
|
||||
if (!(player->soundEffects & 0x100)) {
|
||||
temp_f0 = func_80088F54(objectIndex, player);
|
||||
if ((temp_f0 <= 9.0) && !(player->effects & 0x04000000) &&
|
||||
(has_collided_horizontally_with_player(objectIndex, player) != 0)) {
|
||||
if ((player->type & 0x8000) && !(player->type & 0x100)) {
|
||||
if (!(player->effects & 0x200)) {
|
||||
func_80089474(objectIndex, playerId, 1.4f, 1.1f, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x4C));
|
||||
} else if (func_80072354(objectIndex, 0x00000040) != 0) {
|
||||
if (temp_s0->type & 0x1000) {
|
||||
func_800C98B8(temp_s0->pos, temp_s0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A));
|
||||
if (player->type & 0x1000) {
|
||||
func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A));
|
||||
} else {
|
||||
func_800C9060((u8) playerId, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A));
|
||||
}
|
||||
@@ -641,21 +640,21 @@ void OThwomp::func_80080B28(s32 objectIndex, s32 playerId) {
|
||||
}
|
||||
}
|
||||
} else if ((temp_f0 <= 17.5) && (func_80072320(objectIndex, 1) != 0) &&
|
||||
(is_within_horizontal_distance_of_player(objectIndex, temp_s0, (temp_s0->unk_094 * 0.5) + _boundingBoxSize) !=
|
||||
0)) {
|
||||
if ((temp_s0->type & 0x8000) && !(temp_s0->type & 0x100)) {
|
||||
(is_within_horizontal_distance_of_player(objectIndex, player,
|
||||
(player->speed * 0.5) + _boundingBoxSize) != 0)) {
|
||||
if ((player->type & 0x8000) && !(player->type & 0x100)) {
|
||||
if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) {
|
||||
func_80072180();
|
||||
}
|
||||
func_800722A4(objectIndex, 2);
|
||||
temp_s0->unk_040 = (s16) objectIndex;
|
||||
temp_s0->unk_046 |= 2;
|
||||
temp_s0->soundEffects |= 0x100;
|
||||
func_80088FF0(temp_s0);
|
||||
player->unk_040 = (s16) objectIndex;
|
||||
player->unk_046 |= 2;
|
||||
player->soundEffects |= 0x100;
|
||||
func_80088FF0(player);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
func_80088FF0(temp_s0);
|
||||
func_80088FF0(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -693,29 +692,29 @@ void OThwomp::Draw(s32 cameraId) {
|
||||
OThwomp::DrawModel(objectIndex);
|
||||
}
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0079C8);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D0079C8);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gSPNumLights(gDisplayListHead++, 1);
|
||||
gSPLight(gDisplayListHead++, &D_800E4668.l[0], LIGHT_1);
|
||||
gSPLight(gDisplayListHead++, &D_800E4668.a, LIGHT_2);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BOTH);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
|
||||
load_texture_block_rgba16_mirror((u8*)d_course_bowsers_castle_thwomp_side, 0x00000020, 0x00000020);
|
||||
load_texture_block_rgba16_mirror((u8*) d_course_bowsers_castle_thwomp_side, 0x00000020, 0x00000020);
|
||||
for (i = 0; i < gObjectParticle3_SIZE; i++) {
|
||||
objectIndex = gObjectParticle3[i];
|
||||
if (objectIndex != NULL_OBJECT_ID) {
|
||||
object = &gObjectList[objectIndex];
|
||||
if ((object->state > 0) && (State == MOVE_FAR) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) {
|
||||
rsp_set_matrix_transformation(object->pos, object->orientation, object->sizeScaling);
|
||||
gSPVertex(gDisplayListHead++, (uintptr_t)D_0D005C00, 3, 0);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D006930);
|
||||
gSPVertex(gDisplayListHead++, (uintptr_t) D_0D005C00, 3, 0);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D006930);
|
||||
}
|
||||
}
|
||||
}
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
gSPTexture(gDisplayListHead++, 0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007AE0);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007AE0);
|
||||
load_texture_block_ia8_nomirror(D_8018D490, 0x00000020, 0x00000020);
|
||||
func_8004B3C8(0);
|
||||
D_80183E80[0] = 0;
|
||||
@@ -727,7 +726,7 @@ void OThwomp::Draw(s32 cameraId) {
|
||||
if ((object->state >= 2) && (State == MOVE_AND_ROTATE) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) {
|
||||
func_8004B138(0x000000FF, 0x000000FF, 0x000000FF, (s32) object->primAlpha);
|
||||
D_80183E80[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos);
|
||||
func_800431B0(object->pos, D_80183E80, object->sizeScaling, (Vtx*)D_0D005AE0);
|
||||
func_800431B0(object->pos, D_80183E80, object->sizeScaling, (Vtx*) D_0D005AE0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -739,10 +738,10 @@ void OThwomp::DrawModel(s32 objectIndex) {
|
||||
rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation,
|
||||
gObjectList[objectIndex].sizeScaling);
|
||||
OThwomp::ThwompLights(objectIndex);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007828);
|
||||
gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007828);
|
||||
gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16);
|
||||
gDPLoadTLUT_pal256(gDisplayListHead++, d_course_bowsers_castle_thwomp_tlut);
|
||||
rsp_load_texture_mask((u8*)gObjectList[objectIndex].activeTexture, 0x00000010, 0x00000040, 4);
|
||||
rsp_load_texture_mask((u8*) gObjectList[objectIndex].activeTexture, 0x00000010, 0x00000040, 4);
|
||||
gSPDisplayList(gDisplayListHead++, gObjectList[objectIndex].model);
|
||||
}
|
||||
}
|
||||
@@ -840,9 +839,9 @@ void OThwomp::func_8007EC30(s32 objectIndex) {
|
||||
set_obj_direction_angle(objectIndex, 0U, _faceDirection, 0U);
|
||||
set_obj_orientation(objectIndex, 0U, _faceDirection, 0U);
|
||||
}
|
||||
init_texture_object(objectIndex, (uint8_t*) d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces,
|
||||
0x10U, (u16) 0x00000040);
|
||||
object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp;
|
||||
init_texture_object(objectIndex, (uint8_t*) d_course_bowsers_castle_thwomp_tlut,
|
||||
(const char**) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040);
|
||||
object->model = (Gfx*) d_course_bowsers_castle_dl_thwomp;
|
||||
object->unk_01C[1] = 30.0f;
|
||||
set_object_flag(objectIndex, 0x05000220);
|
||||
object->type = 0;
|
||||
@@ -877,10 +876,10 @@ void OThwomp::MoveAndRotateBehaviour(s32 objectIndex) { // func_8007F5A8
|
||||
void OThwomp::func_8007EE5C(s32 objectIndex) {
|
||||
Object* object;
|
||||
|
||||
init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces,
|
||||
0x10U, (u16) 0x00000040);
|
||||
init_texture_object(objectIndex, (u8*) d_course_bowsers_castle_thwomp_tlut,
|
||||
(const char**) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040);
|
||||
object = &gObjectList[objectIndex];
|
||||
object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp;
|
||||
object->model = (Gfx*) d_course_bowsers_castle_dl_thwomp;
|
||||
set_object_flag(objectIndex, 0x04000220);
|
||||
object->type = 0;
|
||||
object->unk_0DF = 6;
|
||||
@@ -930,10 +929,10 @@ void OThwomp::MoveFarBehaviour(s32 objectIndex) { // func_8007FFC0
|
||||
void OThwomp::func_8007FA08(s32 objectIndex) {
|
||||
Object* object;
|
||||
|
||||
init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces,
|
||||
0x10U, (u16) 0x00000040);
|
||||
init_texture_object(objectIndex, (u8*) d_course_bowsers_castle_thwomp_tlut,
|
||||
(const char**) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040);
|
||||
object = &gObjectList[objectIndex];
|
||||
object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp;
|
||||
object->model = (Gfx*) d_course_bowsers_castle_dl_thwomp;
|
||||
set_object_flag(objectIndex, 0x04000220);
|
||||
object->type = 0;
|
||||
object->surfaceHeight = 0.0f;
|
||||
@@ -980,7 +979,7 @@ void OThwomp::func_8007FB48(s32 objectIndex) {
|
||||
func_80086FD4(objectIndex);
|
||||
break;
|
||||
case 2:
|
||||
gObjectList[objectIndex].velocity[0] = player->unk_094 * xOrientation * 1.25;
|
||||
gObjectList[objectIndex].velocity[0] = player->speed * xOrientation * 1.25;
|
||||
if (gObjectList[objectIndex].unk_048 >= gObjectList[objectIndex].unk_0B0) {
|
||||
if (gObjectList[objectIndex].unk_0B0 == gObjectList[objectIndex].unk_048) {
|
||||
if (_rand & 1) { // D_8018D400 & 1
|
||||
@@ -1096,10 +1095,10 @@ void OThwomp::StationaryFastBehaviour(s32 objectIndex) { // func_800801FC
|
||||
void OThwomp::func_80080078(s32 objectIndex) { // func_80080078
|
||||
Object* object;
|
||||
|
||||
init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces,
|
||||
0x10U, (u16) 0x00000040);
|
||||
init_texture_object(objectIndex, (u8*) d_course_bowsers_castle_thwomp_tlut,
|
||||
(const char**) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040);
|
||||
object = &gObjectList[objectIndex];
|
||||
object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp;
|
||||
object->model = (Gfx*) d_course_bowsers_castle_dl_thwomp;
|
||||
set_object_flag(objectIndex, 0x04000220);
|
||||
object->type = 2;
|
||||
object->unk_0DF = 8;
|
||||
@@ -1167,11 +1166,11 @@ void OThwomp::func_800802C0(s32 objectIndex) {
|
||||
|
||||
object = &gObjectList[objectIndex];
|
||||
object->unk_0D8 = 0;
|
||||
init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces,
|
||||
0x10U, (u16) 0x00000040);
|
||||
object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp;
|
||||
init_texture_object(objectIndex, (u8*) d_course_bowsers_castle_thwomp_tlut,
|
||||
(const char**) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040);
|
||||
object->model = (Gfx*) d_course_bowsers_castle_dl_thwomp;
|
||||
object->textureListIndex = 0;
|
||||
//object->sizeScaling = 1.5f;
|
||||
// object->sizeScaling = 1.5f;
|
||||
set_object_flag(objectIndex, 0x05000220);
|
||||
object->type = 1;
|
||||
object->unk_0DF = 6;
|
||||
@@ -1193,7 +1192,7 @@ void OThwomp::func_800802C0(s32 objectIndex) {
|
||||
}
|
||||
|
||||
void OThwomp::SlidingBehaviour(s32 objectIndex) { // func_800808CC
|
||||
switch (gObjectList[objectIndex].state) { /* irregular */
|
||||
switch (gObjectList[objectIndex].state) { /* irregular */
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
@@ -1277,10 +1276,10 @@ void OThwomp::func_8008078C(s32 objectIndex) {
|
||||
void OThwomp::func_80080524(s32 objectIndex) {
|
||||
Object* object;
|
||||
|
||||
init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces,
|
||||
0x10U, (u16) 0x00000040);
|
||||
init_texture_object(objectIndex, (u8*) d_course_bowsers_castle_thwomp_tlut,
|
||||
(const char**) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040);
|
||||
object = &gObjectList[objectIndex];
|
||||
object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp;
|
||||
object->model = (Gfx*) d_course_bowsers_castle_dl_thwomp;
|
||||
object->textureListIndex = 0;
|
||||
set_object_flag(objectIndex, 0x04000220);
|
||||
object->type = 0;
|
||||
|
||||
Reference in New Issue
Block a user