Merge pull request #133 from MegaMech/next

Fix loadtile, Impl more OObjects
This commit is contained in:
MegaMech
2024-12-31 09:50:21 -07:00
committed by GitHub
135 changed files with 7656 additions and 6899 deletions
+6 -1
View File
@@ -96,9 +96,10 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src/networking
${CMAKE_CURRENT_SOURCE_DIR}/src/engine
${CMAKE_CURRENT_SOURCE_DIR}/src/engine/courses
${CMAKE_CURRENT_SOURCE_DIR}/src/engine/objects
${CMAKE_CURRENT_SOURCE_DIR}/src/engine/particles
${CMAKE_CURRENT_SOURCE_DIR}/src/enhancements
${CMAKE_CURRENT_SOURCE_DIR}/src/enhancements/freecam
${CMAKE_CURRENT_SOURCE_DIR}/src/engine
)
# Collect source files to build the executable
@@ -142,6 +143,10 @@ file(GLOB_RECURSE ALL_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"src/engine/*.h"
"src/engine/courses/*.c"
"src/engine/courses/*.h"
"src/engine/objects/*.cpp"
"src/engine/objects/*.h"
"src/engine/particles/*.cpp"
"src/engine/particles/*.h"
"src/enhancements/*.c"
"src/enhancements/*.h"
"src/enhancements/freecam/*.c"
@@ -28,8 +28,8 @@ glabel func_80082F1C
/* 083B68 80082F68 0C01C922 */ jal object_next_state
/* 083B6C 80082F6C E4440000 */ swc1 $f4, ($v0)
/* 083B70 80082F70 8FA9002C */ lw $t1, 0x2c($sp)
/* 083B74 80082F74 3C0B800E */ lui $t3, %hi(D_800E5DF4) # $t3, 0x800e
/* 083B78 80082F78 256B5DF4 */ addiu $t3, %lo(D_800E5DF4) # addiu $t3, $t3, 0x5df4
/* 083B74 80082F74 3C0B800E */ lui $t3, %hi(gFlagpoleSpawns) # $t3, 0x800e
/* 083B78 80082F78 256B5DF4 */ addiu $t3, %lo(gFlagpoleSpawns) # addiu $t3, $t3, 0x5df4
/* 083B7C 80082F7C 000950C0 */ sll $t2, $t1, 3
/* 083B80 80082F80 014B1021 */ addu $v0, $t2, $t3
/* 083B84 80082F84 844C0000 */ lh $t4, ($v0)
-21
View File
@@ -34,25 +34,4 @@ extern Gfx* sherbet_land_dls_2[];
extern Gfx* wario_stadium_dls[];
#endif
extern const course_texture banshee_boardwalk_textures[];
extern const course_texture big_donut_textures[];
extern const course_texture block_fort_textures[];
extern const course_texture bowsers_castle_textures[];
extern const course_texture choco_mountain_textures[];
extern const course_texture double_deck_textures[];
extern const course_texture frappe_snowland_textures[];
extern const course_texture kalimari_desert_textures[];
extern const course_texture koopa_troopa_beach_textures[];
extern const course_texture luigi_raceway_textures[];
extern const course_texture mario_raceway_textures[];
extern const course_texture moo_moo_farm_textures[];
extern const course_texture rainbow_road_textures[];
extern const course_texture royal_raceway_textures[];
extern const course_texture sherbet_land_textures[];
extern const course_texture skyscraper_textures[];
extern const course_texture toads_turnpike_textures[];
extern const course_texture wario_stadium_textures[];
extern const course_texture yoshi_valley_textures[];
extern const course_texture dks_jungle_parkway_textures[];
#endif
@@ -9,32 +9,6 @@
#include <assets/banshee_boardwalk_data.h>
#include <libultra/gbi.h>
const course_texture banshee_boardwalk_textures[] = {
{ gTexture6447C4, 0x0106, 0x0800, 0x0 },
{ gTexture676FB0, 0x0525, 0x0800, 0x0 },
{ gTexture643B3C, 0x0798, 0x0800, 0x0 },
{ gTexture64BB60, 0x0169, 0x0800, 0x0 },
{ gTexture64BCCC, 0x0450, 0x0800, 0x0 },
{ gTexture64FBF4, 0x0274, 0x0800, 0x0 },
{ gTexture651B20, 0x041D, 0x0800, 0x0 },
{ gTexture66262C, 0x02F7, 0x0800, 0x0 },
{ gTexture668728, 0x01F5, 0x0800, 0x0 },
{ gTexture66A3DC, 0x07C5, 0x0800, 0x0 },
{ gTexture66CA98, 0x02C9, 0x0800, 0x0 },
{ gTexture66CD64, 0x02C0, 0x0800, 0x0 },
{ gTexture66D698, 0x0370, 0x0800, 0x0 },
{ gTexture66E608, 0x05E8, 0x0800, 0x0 },
{ gTexture67B388, 0x03D2, 0x0800, 0x0 },
{ gTextureSignWelcome0, 0x0A2E, 0x1000, 0x0 },
{ gTextureSignWelcome1, 0x0A0A, 0x1000, 0x0 },
{ gTextureSignWoodenBack0, 0x06EF, 0x1000, 0x0 },
{ gTextureSignWoodenBack1, 0x06D1, 0x1000, 0x0 },
{ gTextureSignWoodRedArrow, 0x04E1, 0x1000, 0x0 },
{ gTexture68D940, 0x057D, 0x0800, 0x0 },
{ gTexture685AC0, 0x07CC, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
const Gfx* banshee_boardwalk_dls[] = {
d_course_banshee_boardwalk_dl_A0, d_course_banshee_boardwalk_dl_210, d_course_banshee_boardwalk_dl_160,
d_course_banshee_boardwalk_dl_270, d_course_banshee_boardwalk_dl_358, d_course_banshee_boardwalk_dl_4F0,
+1 -5
View File
@@ -1,8 +1,4 @@
#include <libultra/types.h>
#include "course_offsets.h"
const course_texture big_donut_textures[] = {
{ gTexture66ABA4, 0x0312, 0x0800, 0x0 }, { gTexture6747C4, 0x0145, 0x0800, 0x0 },
{ gTexture67490C, 0x021C, 0x0800, 0x0 }, { gTexture64BA50, 0x0110, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
-7
View File
@@ -1,10 +1,3 @@
#include <libultra/types.h>
#include "course_offsets.h"
#include <assets/other_textures.h>
const course_texture block_fort_textures[] = {
{ gTexture64286C, 0x010A, 0x0800, 0x0 }, { gTextureGrayCheckerboard, 0x010C, 0x0800, 0x0 },
{ gTextureGrayCobblestone, 0x010C, 0x0800, 0x0 }, { gTexture64275C, 0x0110, 0x0800, 0x0 },
{ gTexture642978, 0x010D, 0x0800, 0x0 }, { gTexture6747C4, 0x0145, 0x0800, 0x0 },
{ gTexture6442D4, 0x0138, 0x0800, 0x0 }, { 0x00000000, 0x0000, 0x0000, 0x0 },
};
-32
View File
@@ -2,38 +2,6 @@
#include "course_offsets.h"
#include <assets/bowsers_castle_data.h>
const course_texture bowsers_castle_textures[] = {
{ gTexture64313C, 0x01B8, 0x0800, 0x0 },
{ gTexture6528DC, 0x0278, 0x0800, 0x0 },
{ gTexture66ED38, 0x010E, 0x0800, 0x0 },
{ gTexture676C6C, 0x0110, 0x0800, 0x0 },
{ gTexture676EA8, 0x0108, 0x0800, 0x0 },
{ gTexture679D34, 0x0106, 0x0800, 0x0 },
{ gTextureGrass6, 0x023B, 0x0800, 0x0 },
{ gTexture6522E0, 0x05FC, 0x0800, 0x0 },
{ gTexture651F40, 0x039F, 0x0800, 0x0 },
{ gTextureRoofTile, 0x0129, 0x0800, 0x0 },
{ gTextureSignBowser0, 0x07D0, 0x1000, 0x0 },
{ gTextureSignBowser1, 0x064D, 0x1000, 0x0 },
{ gTexture66ABA4, 0x0312, 0x0800, 0x0 },
{ gTexture66EBF0, 0x0146, 0x0800, 0x0 },
{ gTexture6733CC, 0x020E, 0x0800, 0x0 },
{ gTexture673118, 0x02B1, 0x0800, 0x0 },
{ gTexture673FF8, 0x035B, 0x0800, 0x0 },
{ gTexture674B28, 0x0230, 0x0800, 0x0 },
{ gTextureSignGreenArrow, 0x025B, 0x1000, 0x0 },
{ gTexture68D834, 0x010A, 0x0800, 0x0 },
{ gTexture676D7C, 0x012C, 0x0800, 0x0 },
{ gTexture67ADF0, 0x0595, 0x0800, 0x0 },
{ gTexture67EFEC, 0x016F, 0x0800, 0x0 },
{ gTexture653DB0, 0x06AE, 0x0800, 0x0 },
{ gTexture66CA98, 0x02C9, 0x0800, 0x0 },
{ gTexture673990, 0x02D8, 0x0800, 0x0 },
{ gTexture67A370, 0x05AA, 0x0800, 0x0 },
{ gTexture67A91C, 0x04D1, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
const Gfx* bowsers_castle_dls[] = {
d_course_bowsers_castle_dl_0, d_course_bowsers_castle_dl_230, d_course_bowsers_castle_dl_110,
d_course_bowsers_castle_dl_398, d_course_bowsers_castle_dl_428, d_course_bowsers_castle_dl_640,
-24
View File
@@ -2,30 +2,6 @@
#include "course_offsets.h"
#include <assets/choco_mountain_data.h>
const course_texture choco_mountain_textures[] = {
{ gTexture64619C, 0x0124, 0x0800, 0x0 },
{ gTexture64647C, 0x0829, 0x1000, 0x0 },
{ gTexture647F4C, 0x05BC, 0x1000, 0x0 },
{ gTexture64FBF4, 0x0274, 0x0800, 0x0 },
{ gTexture653DB0, 0x06AE, 0x0800, 0x0 },
{ gTexture652B54, 0x0606, 0x0800, 0x0 },
{ gTexture65315C, 0x04A9, 0x0800, 0x0 },
{ gTexture6684F8, 0x010D, 0x0800, 0x0 },
{ gTextureSignLuigis0, 0x0287, 0x1000, 0x0 },
{ gTextureSignLuigis1, 0x02AF, 0x1000, 0x0 },
{ gTextureSignNintendoRed0, 0x02A6, 0x1000, 0x0 },
{ gTextureSignNintendoRed1, 0x02F7, 0x1000, 0x0 },
{ gTexture6774D8, 0x0113, 0x0800, 0x0 },
{ gTextureSignFallingRocks, 0x012C, 0x0800, 0x0 },
{ gTextureSignBackside, 0x011E, 0x0800, 0x0 },
{ gTexture679C04, 0x012F, 0x0800, 0x0 },
{ gTexture67B864, 0x014C, 0x0800, 0x0 },
{ gTexture67DC20, 0x03EF, 0x0800, 0x0 },
{ gTextureSignYoshi, 0x04DF, 0x1000, 0x0 },
{ gTextureCheckerboardBlueGray, 0x04A1, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
const Gfx* choco_mountain_dls[] = {
d_course_choco_mountain_dl_0, d_course_choco_mountain_dl_150, d_course_choco_mountain_dl_B0,
d_course_choco_mountain_dl_208, d_course_choco_mountain_dl_2A8, d_course_choco_mountain_dl_410,
@@ -2,34 +2,6 @@
#include "course_offsets.h"
#include <assets/dks_jungle_parkway_data.h>
const course_texture dks_jungle_parkway_textures[] = {
{ gTexture648508, 0x01FE, 0x1000, 0x0 },
{ gTexture6684F8, 0x010D, 0x0800, 0x0 },
{ gTextureWoodBridgeSlats, 0x0DAB, 0x1000, 0x0 },
{ gTexture654460, 0x0B12, 0x1000, 0x0 },
{ gTexture654F74, 0x0A24, 0x1000, 0x0 },
{ gTexture655998, 0x059F, 0x0800, 0x0 },
{ gTexture655F38, 0x0BB9, 0x1000, 0x0 },
{ gTexture656AF4, 0x0AD3, 0x1000, 0x0 },
{ gTexture6575C8, 0x0DA7, 0x1000, 0x0 },
{ gTexture658370, 0x0DBA, 0x1000, 0x0 },
{ gTexture65912C, 0x0DBC, 0x1000, 0x0 },
{ gTexture659EE8, 0x0EF5, 0x1000, 0x0 },
{ gTexture65ADE0, 0x0D5A, 0x1000, 0x0 },
{ gTexture65BB3C, 0x0D9E, 0x1000, 0x0 },
{ gTexture65C8DC, 0x0CF5, 0x1000, 0x0 },
{ gTexture65D5D4, 0x0D18, 0x1000, 0x0 },
{ gTexture65E2EC, 0x02B0, 0x0800, 0x0 },
{ gTexture65EAEC, 0x034A, 0x0800, 0x0 },
{ gTexture65E59C, 0x054F, 0x1000, 0x0 },
{ gTexture65EE38, 0x0CDE, 0x1000, 0x0 },
{ gTexture65FB18, 0x03EE, 0x0800, 0x0 },
{ gTextureSignPinkArrow, 0x0198, 0x0800, 0x0 },
{ gTextureWaves0, 0x04D0, 0x0800, 0x0 },
{ gTexture683844, 0x0655, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
const Gfx* d_course_dks_jungle_parkway_unknown_dl_list[] = {
d_course_dks_jungle_parkway_dl_20, d_course_dks_jungle_parkway_dl_210, d_course_dks_jungle_parkway_dl_180,
d_course_dks_jungle_parkway_dl_310, d_course_dks_jungle_parkway_dl_400, d_course_dks_jungle_parkway_dl_628,
-6
View File
@@ -1,8 +1,2 @@
#include <libultra/types.h>
#include "course_offsets.h"
const course_texture double_deck_textures[] = {
{ gTextureGrayCobblestone, 0x010C, 0x0800, 0x0 },
{ gTexture642978, 0x010D, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
-8
View File
@@ -2,14 +2,6 @@
#include "course_offsets.h"
#include <assets/frappe_snowland_data.h>
const course_texture frappe_snowland_textures[] = {
{ gTexture6684F8, 0x010D, 0x0800, 0x0 }, { gTexture66CA98, 0x02C9, 0x0800, 0x0 },
{ gTexture66EBF0, 0x0146, 0x0800, 0x0 }, { gTexture675434, 0x0245, 0x0800, 0x0 },
{ gTexture677F04, 0x0213, 0x0800, 0x0 }, { gTexture678118, 0x0314, 0x0800, 0x0 },
{ gTexture679258, 0x04E3, 0x1000, 0x0 }, { gTexture67973C, 0x04C6, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
const Gfx* d_course_frappe_snowland_dl_list[] = {
d_course_frappe_snowland_dl_0, d_course_frappe_snowland_dl_1B8, d_course_frappe_snowland_dl_C8,
d_course_frappe_snowland_dl_298, d_course_frappe_snowland_dl_398, d_course_frappe_snowland_dl_540,
-16
View File
@@ -2,22 +2,6 @@
#include "course_offsets.h"
#include <assets/kalimari_desert_data.h>
const course_texture kalimari_desert_textures[] = {
{ gTexture6684F8, 0x010D, 0x0800, 0x0 }, { gTextureSignLuigis0, 0x0287, 0x1000, 0x0 },
{ gTextureSignLuigis1, 0x02AF, 0x1000, 0x0 }, { gTextureSignMarioStar0, 0x02D2, 0x1000, 0x0 },
{ gTextureSignMarioStar1, 0x02B1, 0x1000, 0x0 }, { gTextureSignNintendoRed0, 0x02A6, 0x1000, 0x0 },
{ gTextureSignNintendoRed1, 0x02F7, 0x1000, 0x0 }, { gTexture67490C, 0x021C, 0x0800, 0x0 },
{ gTextureSignYoshi, 0x04DF, 0x1000, 0x0 }, { gTextureCheckerboardBlueGray, 0x04A1, 0x1000, 0x0 },
{ gTexture646CA8, 0x073A, 0x1000, 0x0 }, { gTexture6473E4, 0x05AD, 0x1000, 0x0 },
{ gTexture647994, 0x05B5, 0x1000, 0x0 }, { gTexture668920, 0x03D9, 0x0800, 0x0 },
{ gTextureRailroadTrack, 0x0B5B, 0x1000, 0x0 }, { gTextureRailroadCrossingTrack, 0x0208, 0x1000, 0x0 },
{ gTexture67291C, 0x059C, 0x0800, 0x0 }, { gTextureFenceBarbedWire, 0x021E, 0x1000, 0x0 },
{ gTexture67D304, 0x091C, 0x1000, 0x0 }, { gTexture67E010, 0x0415, 0x0800, 0x0 },
{ gTexture67EEAC, 0x0140, 0x0800, 0x0 }, { gTextureSignShellShot0, 0x038C, 0x1000, 0x0 },
{ gTextureSignShellShot1, 0x0247, 0x1000, 0x0 }, { gTextureSignKoopaAir0, 0x0360, 0x1000, 0x0 },
{ gTextureSignKoopaAir1, 0x0304, 0x1000, 0x0 }, { 0x00000000, 0x0000, 0x0000, 0x0 },
};
const Gfx* kalimari_desert_dls[] = {
d_course_kalimari_desert_dl_0, d_course_kalimari_desert_dl_258, d_course_kalimari_desert_dl_100,
d_course_kalimari_desert_dl_310, d_course_kalimari_desert_dl_4A0, d_course_kalimari_desert_dl_778,
@@ -3,26 +3,6 @@
#include <assets/koopa_troopa_beach_data.h>
#include "animation.h"
const course_texture koopa_troopa_beach_textures[] = {
{ gTexture643B3C, 0x0798, 0x0800, 0x0 },
{ gTexture66A3DC, 0x07C5, 0x0800, 0x0 },
{ gTextureSignWoodRedArrow, 0x04E1, 0x1000, 0x0 },
{ gTexture66DD38, 0x0330, 0x1000, 0x0 },
{ gTexture643430, 0x0604, 0x0800, 0x0 },
{ gTexture660D8C, 0x0126, 0x0800, 0x0 },
{ gTexture6609D0, 0x03BB, 0x1000, 0x0 },
{ gTextureGrass12, 0x0874, 0x0800, 0x0 },
{ gTexture66CA98, 0x02C9, 0x0800, 0x0 },
{ gTexture66EBF0, 0x0146, 0x0800, 0x0 },
{ gTexture67BEE8, 0x02D0, 0x0800, 0x0 },
{ gTextureSandFinish, 0x022E, 0x0800, 0x0 },
{ gTextureWheelSteamEngine, 0x020F, 0x0800, 0x0 },
{ gTexture669570, 0x0E6B, 0x1000, 0x0 },
{ gTextureWaves1, 0x05C4, 0x0800, 0x0 },
{ gTextureWaves2, 0x0488, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
Gfx* d_course_koopa_troopa_beach_dl_list1[] = {
d_course_koopa_troopa_beach_dl_90, d_course_koopa_troopa_beach_dl_278, d_course_koopa_troopa_beach_dl_188,
d_course_koopa_troopa_beach_dl_3C0, d_course_koopa_troopa_beach_dl_4B0, d_course_koopa_troopa_beach_dl_6E0,
-44
View File
@@ -2,50 +2,6 @@
#include "course_offsets.h"
#include <assets/luigi_raceway_data.h>
const course_texture luigi_raceway_textures[] = {
{ gTextureSignShellShot0, 0x038C, 0x1000, 0x0 },
{ gTextureSignShellShot1, 0x0247, 0x1000, 0x0 },
{ gTextureCheckerboardYellowBlue, 0x013A, 0x0800, 0x0 },
{ gTexture64619C, 0x0124, 0x0800, 0x0 },
{ gTextureCheckerboardBlueGreen, 0x0139, 0x0800, 0x0 },
{ gTextureGrass3, 0x0372, 0x0800, 0x0 },
{ gTextureFlagRed, 0x019E, 0x0800, 0x0 },
{ gTexture65100C, 0x0120, 0x0800, 0x0 },
{ gTexture65112C, 0x0150, 0x0800, 0x0 },
{ gTexture653608, 0x07A7, 0x0800, 0x0 },
{ gTextureGrass11, 0x01F8, 0x0800, 0x0 },
{ gTextureSignLuigiFace0, 0x05C9, 0x1000, 0x0 },
{ gTextureSignLuigiFace1, 0x065F, 0x1000, 0x0 },
{ gTexture66C7A8, 0x0149, 0x0800, 0x0 },
{ gTexture670AC8, 0x0FBF, 0x1000, 0x0 },
{ gTexture671A88, 0x012D, 0x0800, 0x0 },
{ gTexture6735DC, 0x03B1, 0x0800, 0x0 },
{ gTexture673C68, 0x038D, 0x0800, 0x0 },
{ gTexture6747C4, 0x0145, 0x0800, 0x0 },
{ gTextureRoad1, 0x02D2, 0x1000, 0x0 },
{ gTextureRoad2, 0x02AE, 0x1000, 0x0 },
{ gTextureRoadFinish1, 0x026B, 0x1000, 0x0 },
{ gTexture67BBD8, 0x0310, 0x0800, 0x0 },
{ gTexture68272C, 0x01F9, 0x1000, 0x0 },
{ gTexture682928, 0x01F9, 0x1000, 0x0 },
{ gTexture682B24, 0x01F9, 0x1000, 0x0 },
{ gTexture682D20, 0x01F9, 0x1000, 0x0 },
{ gTexture682F1C, 0x01F9, 0x1000, 0x0 },
{ gTexture683118, 0x01F9, 0x1000, 0x0 },
{ gTextureSignBlue64, 0x0567, 0x1000, 0x0 },
{ gTextureSignKoopaAir0, 0x0360, 0x1000, 0x0 },
{ gTextureSignKoopaAir1, 0x0304, 0x1000, 0x0 },
{ gTextureSignLuigis0, 0x0287, 0x1000, 0x0 },
{ gTextureSignLuigis1, 0x02AF, 0x1000, 0x0 },
{ gTextureSignMarioStar0, 0x02D2, 0x1000, 0x0 },
{ gTextureSignMarioStar1, 0x02B1, 0x1000, 0x0 },
{ gTextureSignNintendoRed0, 0x02A6, 0x1000, 0x0 },
{ gTextureSignNintendoRed1, 0x02F7, 0x1000, 0x0 },
{ gTextureSignYoshi, 0x04DF, 0x1000, 0x0 },
{ gTextureCheckerboardBlueGray, 0x04A1, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
const Gfx* luigi_raceway_dls[] = {
d_course_luigi_raceway_dl_0, d_course_luigi_raceway_dl_328, d_course_luigi_raceway_dl_1A8,
d_course_luigi_raceway_dl_480, d_course_luigi_raceway_dl_6E0, d_course_luigi_raceway_dl_9F8,
-34
View File
@@ -2,40 +2,6 @@
#include "course_offsets.h"
#include <assets/mario_raceway_data.h>
const course_texture mario_raceway_textures[] = {
{ gTextureCheckerboardYellowPink, 0x0149, 0x0800, 0x0 },
{ gTexture64619C, 0x0124, 0x0800, 0x0 },
{ gTextureGrass1, 0x0125, 0x0800, 0x0 },
{ gTexture64BB60, 0x0169, 0x0800, 0x0 },
{ gTextureGrass7, 0x05DE, 0x0800, 0x0 },
{ gTextureGrass5, 0x023F, 0x0800, 0x0 },
{ gTextureFlagRed, 0x019E, 0x0800, 0x0 },
{ gTexture663F90, 0x0122, 0x0800, 0x0 },
{ gTexture6642A4, 0x0162, 0x0800, 0x0 },
{ gTexture6640B4, 0x01EF, 0x0800, 0x0 },
{ gTextureGrass10, 0x01F8, 0x0800, 0x0 },
{ gTexture6684F8, 0x010D, 0x0800, 0x0 },
{ gTextureSignLuigis0, 0x0287, 0x1000, 0x0 },
{ gTextureSignLuigis1, 0x02AF, 0x1000, 0x0 },
{ gTextureSignMarioStar0, 0x02D2, 0x1000, 0x0 },
{ gTextureSignMarioStar1, 0x02B1, 0x1000, 0x0 },
{ gTexture66C8F4, 0x01A1, 0x0800, 0x0 },
{ gTextureSignNintendoRed0, 0x02A6, 0x1000, 0x0 },
{ gTextureSignNintendoRed1, 0x02F7, 0x1000, 0x0 },
{ gTexture670AC8, 0x0FBF, 0x1000, 0x0 },
{ gTexture674354, 0x046F, 0x0800, 0x0 },
{ gTextureRoad0, 0x0300, 0x1000, 0x0 },
{ gTextureRoadFinish0, 0x0338, 0x1000, 0x0 },
{ gTexture67B9B0, 0x0225, 0x0800, 0x0 },
{ gTextureSignYoshi, 0x04DF, 0x1000, 0x0 },
{ gTextureCheckerboardBlueGray, 0x04A1, 0x1000, 0x0 },
{ gTextureSignShellShot0, 0x038C, 0x1000, 0x0 },
{ gTextureSignShellShot1, 0x0247, 0x1000, 0x0 },
{ gTextureSignKoopaAir0, 0x0360, 0x1000, 0x0 },
{ gTextureSignKoopaAir1, 0x0304, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
#ifndef TARGET_N64
const char* mario_raceway_dls[] = {
#else
-32
View File
@@ -2,38 +2,6 @@
#include "course_offsets.h"
#include <assets/moo_moo_farm_data.h>
const course_texture moo_moo_farm_textures[] = {
{ gTextureWoodDoor0, 0x0294, 0x1000, 0x0 },
{ gTextureGrass2, 0x0415, 0x0800, 0x0 },
{ gTexture64AF50, 0x0140, 0x0800, 0x0 },
{ gTexture64B090, 0x0365, 0x0800, 0x0 },
{ gTexture64B54C, 0x038C, 0x0800, 0x0 },
{ gTexture64B3F8, 0x0153, 0x0800, 0x0 },
{ gTextureSignNintendo0, 0x0541, 0x1000, 0x0 },
{ gTextureSignNintendo1, 0x0512, 0x1000, 0x0 },
{ gTexture6684F8, 0x010D, 0x0800, 0x0 },
{ gTextureSignLuigis0, 0x0287, 0x1000, 0x0 },
{ gTextureSignLuigis1, 0x02AF, 0x1000, 0x0 },
{ gTextureSignMarioStar0, 0x02D2, 0x1000, 0x0 },
{ gTextureSignMarioStar1, 0x02B1, 0x1000, 0x0 },
{ gTexture674D58, 0x030C, 0x1000, 0x0 },
{ gTexture675064, 0x01BB, 0x0800, 0x0 },
{ gTexture675220, 0x0212, 0x0800, 0x0 },
{ gTexture6775EC, 0x0233, 0x1000, 0x0 },
{ gTexture683314, 0x02DC, 0x1000, 0x0 },
{ gTexture68CDA0, 0x0110, 0x0800, 0x0 },
{ gTexture6442D4, 0x0138, 0x0800, 0x0 },
{ gTexture64440C, 0x029D, 0x1000, 0x0 },
{ gTexture6446AC, 0x0116, 0x0800, 0x0 },
{ gTextureMooMooFarmSignLeft, 0x0A66, 0x1000, 0x0 },
{ gTextureMooMooFarmSignRight, 0x0A64, 0x1000, 0x0 },
{ gTexture64ACAC, 0x02A3, 0x0800, 0x0 },
{ gTexture66D698, 0x0370, 0x0800, 0x0 },
{ gTexture66EBF0, 0x0146, 0x0800, 0x0 },
{ gTextureWheelSteamEngineReal, 0x022F, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
const Gfx* moo_moo_farm_dls[] = {
d_course_moo_moo_farm_dl_88, d_course_moo_moo_farm_dl_598, d_course_moo_moo_farm_dl_338,
d_course_moo_moo_farm_dl_8A0, d_course_moo_moo_farm_dl_B00, d_course_moo_moo_farm_dl_FE0,
-9
View File
@@ -2,15 +2,6 @@
#include "course_offsets.h"
#include <assets/rainbow_road_data.h>
const course_texture rainbow_road_textures[] = {
{ gTextureStarOutline, 0x037A, 0x0800, 0x0 },
{ gTexture67A1B8, 0x01B7, 0x0800, 0x0 },
{ gTextureCheckerboardBlackWhite, 0x0107, 0x0800, 0x0 },
{ gTexture662A34, 0x0106, 0x0800, 0x0 },
{ gTextureRainbow, 0x025D, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
Gfx* rainbow_road_dls[] = {
d_course_rainbow_road_dl_D8, d_course_rainbow_road_dl_210, d_course_rainbow_road_dl_178,
d_course_rainbow_road_dl_288, d_course_rainbow_road_dl_338, d_course_rainbow_road_dl_4A0,
-47
View File
@@ -2,53 +2,6 @@
#include "course_offsets.h"
#include <assets/royal_raceway_data.h>
const course_texture royal_raceway_textures[] = {
{ gTexture64619C, 0x0124, 0x0800, 0x0 },
{ gTexture645134, 0x052C, 0x0800, 0x0 },
{ gTextureWoodDoor1, 0x0903, 0x1000, 0x0 },
{ gTexture64BB60, 0x0169, 0x0800, 0x0 },
{ gTextureGrass3, 0x0372, 0x0800, 0x0 },
{ gTexture64F9E8, 0x020B, 0x1000, 0x0 },
{ gTextureFlagRed, 0x019E, 0x0800, 0x0 },
{ gTextureCrownJewelBlue, 0x0301, 0x0800, 0x0 },
{ gTextureCrown, 0x0106, 0x0800, 0x0 },
{ gTextureCrownJewelPink, 0x0313, 0x0800, 0x0 },
{ gTextureSignKoopaAir0, 0x0360, 0x1000, 0x0 },
{ gTextureSignKoopaAir1, 0x0304, 0x1000, 0x0 },
{ gTexture6684F8, 0x010D, 0x0800, 0x0 },
{ gTextureSignLuigis0, 0x0287, 0x1000, 0x0 },
{ gTextureSignLuigis1, 0x02AF, 0x1000, 0x0 },
{ gTextureSignMarioStar0, 0x02D2, 0x1000, 0x0 },
{ gTextureSignMarioStar1, 0x02B1, 0x1000, 0x0 },
{ gTexture66CA98, 0x02C9, 0x0800, 0x0 },
{ gTextureCheckerboardPink, 0x0157, 0x0800, 0x0 },
{ gTexture670AC8, 0x0FBF, 0x1000, 0x0 },
{ gTextureRoad0, 0x0300, 0x1000, 0x0 },
{ gTextureRoadFinish0, 0x0338, 0x1000, 0x0 },
{ gTextureSignYoshi, 0x04DF, 0x1000, 0x0 },
{ gTextureCheckerboardBlueGray, 0x04A1, 0x1000, 0x0 },
{ gTextureCastleBricks, 0x0B33, 0x1000, 0x0 },
{ gTextureCastleBridge, 0x0428, 0x0800, 0x0 },
{ gTextureGrass8, 0x02CB, 0x0800, 0x0 },
{ gTextureGrass9, 0x0421, 0x0800, 0x0 },
{ gTexture6646B8, 0x0298, 0x1000, 0x0 },
{ gTexture664408, 0x02AE, 0x1000, 0x0 },
{ gTextureBricksRed, 0x0C55, 0x1000, 0x0 },
{ gTexture665C0C, 0x059D, 0x0800, 0x0 },
{ gTexture6661AC, 0x01F7, 0x0800, 0x0 },
{ gTexture6663A4, 0x05F6, 0x0800, 0x0 },
{ gTexture667BAC, 0x067A, 0x0800, 0x0 },
{ gTextureFlagRed2, 0x0186, 0x0800, 0x0 },
{ gTexture66DB60, 0x01D6, 0x0800, 0x0 },
{ gTextureStainglassPeach0, 0x0ED1, 0x1000, 0x0 },
{ gTextureStainglassPeach1, 0x0DA9, 0x1000, 0x0 },
{ gTextureFencePostWooden, 0x083D, 0x1000, 0x0 },
{ gTexture648508, 0x01FE, 0x1000, 0x0 },
{ gTexture6449D4, 0x075D, 0x0800, 0x0 },
{ gTexture67FE0C, 0x02DE, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
const Gfx* royal_raceway_dls[] = {
d_course_royal_raceway_dl_0, d_course_royal_raceway_dl_360, d_course_royal_raceway_dl_258,
d_course_royal_raceway_dl_470, d_course_royal_raceway_dl_6D0, d_course_royal_raceway_dl_A48,
-9
View File
@@ -3,15 +3,6 @@
#include <assets/sherbet_land_data.h>
#include "animation.h"
const course_texture sherbet_land_textures[] = {
{ gTexture643B3C, 0x0798, 0x0800, 0x0 }, { gTexture66D024, 0x04EA, 0x0800, 0x0 },
{ gTexture678118, 0x0314, 0x0800, 0x0 }, { gTextureSignWoodRedArrow, 0x04E1, 0x1000, 0x0 },
{ gTexture678CC8, 0x058E, 0x0800, 0x0 }, { gTexture67842C, 0x050E, 0x0800, 0x0 },
{ gTexture67893C, 0x038B, 0x0800, 0x0 }, { gTexture651984, 0x019C, 0x0800, 0x0 },
{ gTexture651428, 0x055B, 0x0800, 0x0 }, { gTexture662924, 0x0110, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
const Gfx* sherbet_land_dls[] = {
d_course_sherbet_land_dl_0, d_course_sherbet_land_dl_158, d_course_sherbet_land_dl_C0,
d_course_sherbet_land_dl_1A8, d_course_sherbet_land_dl_280, d_course_sherbet_land_dl_3B8,
-29
View File
@@ -1,29 +0,0 @@
#include <libultra/types.h>
#include "course_offsets.h"
const course_texture skyscraper_textures[] = {
{ gTexture6457D8, 0x0160, 0x0800, 0x0 },
{ gTexture6462C0, 0x01B9, 0x0800, 0x0 },
{ gTexture6864E8, 0x0807, 0x1000, 0x0 },
{ gTexture686CF0, 0x08B7, 0x1000, 0x0 },
{ gTexture6875A8, 0x093F, 0x1000, 0x0 },
{ gTexture687EE8, 0x0883, 0x1000, 0x0 },
{ gTexture68876C, 0x0AC2, 0x1000, 0x0 },
{ gTexture689230, 0x09CE, 0x1000, 0x0 },
{ gTexture689C00, 0x0884, 0x1000, 0x0 },
{ gTexture68A484, 0x07D6, 0x1000, 0x0 },
{ gTexture68AC5C, 0x0A47, 0x1000, 0x0 },
{ gTexture68B6A4, 0x07C5, 0x1000, 0x0 },
{ gTexture68BE6C, 0x04A1, 0x1000, 0x0 },
{ gTexture68C310, 0x030D, 0x1000, 0x0 },
{ gTexture64B8D8, 0x0177, 0x0800, 0x0 },
{ gTexture645660, 0x0176, 0x0800, 0x0 },
{ gTextureNumberYellowBlue1, 0x01AE, 0x0800, 0x0 },
{ gTextureNumberYellowBlue2, 0x01C6, 0x0800, 0x0 },
{ gTextureNumberYellowBlue3, 0x01CC, 0x0800, 0x0 },
{ gTextureNumberYellowBlue4, 0x01E4, 0x0800, 0x0 },
{ gTexture668608, 0x0120, 0x0800, 0x0 },
{ gTexture67B75C, 0x0108, 0x0800, 0x0 },
{ gTexture6835F0, 0x0252, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
-23
View File
@@ -3,29 +3,6 @@
#include "course_offsets.h"
#include <assets/toads_turnpike_data.h>
const course_texture toads_turnpike_textures[] = {
{ gTexture645134, 0x052C, 0x0800, 0x0 },
{ gTexture64FE68, 0x0258, 0x1000, 0x0 },
{ gTexture6607C0, 0x0105, 0x0800, 0x0 },
{ gTexture6608C8, 0x0106, 0x0800, 0x0 },
{ gTextureGrass11, 0x01F8, 0x0800, 0x0 },
{ gTextureSignNintendoRed0, 0x02A6, 0x1000, 0x0 },
{ gTextureSignNintendoRed1, 0x02F7, 0x1000, 0x0 },
{ gTexture671A88, 0x012D, 0x0800, 0x0 },
{ gTextureRoad2, 0x02AE, 0x1000, 0x0 },
{ gTextureRoad3, 0x0286, 0x1000, 0x0 },
{ gTextureRoad4, 0x0282, 0x1000, 0x0 },
{ gTextureRoadFinish0, 0x0338, 0x1000, 0x0 },
{ gTextureSignToadYellow, 0x0723, 0x1000, 0x0 },
{ gTextureSignToadGreen, 0x071F, 0x1000, 0x0 },
{ gTextureSignMergingLanes, 0x0118, 0x0800, 0x0 },
{ gTexture65127C, 0x01AB, 0x0800, 0x0 },
{ gTextureRoad5, 0x02B9, 0x1000, 0x0 },
{ gTextureSignToadRed, 0x0610, 0x1000, 0x0 },
{ gTexture668228, 0x0130, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
Gfx* d_course_toads_turnpike_dl_list[] = {
d_course_toads_turnpike_dl_80, d_course_toads_turnpike_dl_1F8, d_course_toads_turnpike_dl_158,
d_course_toads_turnpike_dl_2D0, d_course_toads_turnpike_dl_380, d_course_toads_turnpike_dl_4E8,
-24
View File
@@ -2,30 +2,6 @@
#include "course_offsets.h"
#include <assets/wario_stadium_data.h>
const course_texture wario_stadium_textures[] = {
{ gTexture67F15C, 0x02F1, 0x0800, 0x0 },
{ gTexture67F450, 0x0194, 0x0800, 0x0 },
{ gTextureSignWarioFace, 0x0825, 0x1000, 0x0 },
{ gTexture670AC8, 0x0FBF, 0x1000, 0x0 },
{ gTextureCheckerboardBlackWhite, 0x0107, 0x0800, 0x0 },
{ gTexture64C11C, 0x0695, 0x0800, 0x0 },
{ gTexture64C7B4, 0x046C, 0x0800, 0x0 },
{ gTexture668228, 0x0130, 0x0800, 0x0 },
{ gTexture668358, 0x01A0, 0x0800, 0x0 },
{ gTexture66AEB8, 0x0201, 0x0800, 0x0 },
{ gTexture677A40, 0x0275, 0x0800, 0x0 },
{ gTexture67E428, 0x0A81, 0x1000, 0x0 },
{ gTexture643A34, 0x0106, 0x0800, 0x0 },
{ gTexture66EBF0, 0x0146, 0x0800, 0x0 },
{ gTexture68272C, 0x01F9, 0x1000, 0x0 },
{ gTexture682928, 0x01F9, 0x1000, 0x0 },
{ gTexture682B24, 0x01F9, 0x1000, 0x0 },
{ gTexture682D20, 0x01F9, 0x1000, 0x0 },
{ gTexture682F1C, 0x01F9, 0x1000, 0x0 },
{ gTexture683118, 0x01F9, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
const Gfx* wario_stadium_dls[] = {
d_course_wario_stadium_dl_0, d_course_wario_stadium_dl_158, d_course_wario_stadium_dl_B8,
d_course_wario_stadium_dl_1B8, d_course_wario_stadium_dl_2A0, d_course_wario_stadium_dl_440,
-18
View File
@@ -20,24 +20,6 @@ extern u8 gTextureSignWoodRedArrow[];
extern u8 gTexture68DEC0[];
#endif
const course_texture yoshi_valley_textures[] = {
{ gTexture66EBF0, 0x0146, 0x0800, 0x0 },
{ gTextureWoodBridgeSlats, 0x0DAB, 0x1000, 0x0 },
{ gTexture65E2EC, 0x02B0, 0x0800, 0x0 },
{ gTexture6846DC, 0x04EA, 0x0800, 0x0 },
{ gTextureFenceRope, 0x0540, 0x0800, 0x0 },
{ gTexture685108, 0x04D4, 0x0800, 0x0 },
{ gTexture64CC20, 0x0EC3, 0x1000, 0x0 },
{ gTextureGrass4, 0x05C3, 0x0800, 0x0 },
{ gTexture6775EC, 0x0233, 0x1000, 0x0 },
{ gTexture68E2D0, 0x087F, 0x0800, 0x0 },
{ gTextureCheckerboardBlackWhite, 0x0107, 0x0800, 0x0 },
{ gTexture643B3C, 0x0798, 0x0800, 0x0 },
{ gTextureSignWoodRedArrow, 0x04E1, 0x1000, 0x0 },
{ gTexture68DEC0, 0x0410, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
Gfx* d_course_yoshi_valley_dl_list[] = {
d_course_yoshi_valley_dl_40, d_course_yoshi_valley_dl_3F0, d_course_yoshi_valley_dl_290,
d_course_yoshi_valley_dl_4E8, d_course_yoshi_valley_dl_7A0, d_course_yoshi_valley_dl_BC0,
+7 -1
View File
@@ -351,6 +351,11 @@ enum DIRECTION {
#define BALLOON_STATUS_PRESENT 1
#define BALLOON_STATUS_DEPARTING 2
/**
* Number of podiums in podium ceremony
*/
#define NUM_PODIUMS 3
/**
* @brief Max representable time, 100 minutes measured in centiseconds
*/
@@ -397,7 +402,6 @@ enum DIRECTION {
#define COLOR_LAVA GPACK_RGB888(0x34, 0x00, 0x00)
#define COLOR_BLACK GPACK_RGB888(0, 0, 0)
#endif // DEFINES_H
/**
*
@@ -410,3 +414,5 @@ enum DIRECTION {
#define FACING_Y_AXIS 0x4000
#define FACING_X_AXIS 0x8000
#define FACING_Z_AXIS 0x2000
#endif // DEFINES_H
+34 -1
View File
@@ -104,7 +104,7 @@ enum SURFACE_TYPE {
/* 0x10 */ ROPE_BRIDGE, // Bowser's Castle bridge 2, DK Jungle bridge
/* 0x11 */ WOOD_BRIDGE, // Frappe Snowland bridge, Bowser's Castle bridge 1,3, Yoshi Valley bridge 2
/* 0xFC */ BOOST_RAMP_WOOD = 0xFC, // DK Jungle
/* 0xFD */ OUT_OF_BOUNDS, // DK Jungle river island
/* 0xFD */ OUT_OF_BOUNDS, // DK Jungle river island oob / out of bounds
/* 0xFE */ BOOST_RAMP_ASPHALT, // Royal Raceway
/* 0xFF */ RAMP // Koopa Troopa beach
};
@@ -138,6 +138,39 @@ void gSPDisplayListOffset(Gfx* pkt, Gfx* dl, int offset);
void gSPVertex(Gfx* pkt, uintptr_t v, int n, int v0);
void gSPInvalidateTexCache(Gfx* pkt, uintptr_t texAddr);
// Dumb hack to fix load tile size on higher than native resolutions
#define gMKLoadTextureTile(pkt, timg, fmt, siz, width, height, uls, ult, lrs, lrt, pal, cms, cmt, masks, maskt, \
shifts, shiftt) \
_DW({ \
gDPSetTextureImage(pkt, fmt, siz, width, timg); \
gDPSetTile(pkt, fmt, siz, (((((lrs) - (uls) + 1) * siz##_TILE_BYTES) + 7) >> 3), 0, G_TX_LOADTILE, 0, cmt, \
maskt, shiftt, cms, masks, shifts); \
gDPLoadSync(pkt); \
gDPLoadTile(pkt, G_TX_LOADTILE, (uls) << G_TEXTURE_IMAGE_FRAC, (ult) << G_TEXTURE_IMAGE_FRAC, \
(lrs) << G_TEXTURE_IMAGE_FRAC, (lrt + 2) << G_TEXTURE_IMAGE_FRAC); \
gDPPipeSync(pkt); \
gDPSetTile(pkt, fmt, siz, (((((lrs) - (uls) + 1) * siz##_LINE_BYTES) + 7) >> 3), 0, G_TX_RENDERTILE, pal, cmt, \
maskt, shiftt, cms, masks, shifts); \
gDPSetTileSize(pkt, G_TX_RENDERTILE, (uls) << G_TEXTURE_IMAGE_FRAC, (ult) << G_TEXTURE_IMAGE_FRAC, \
(lrs) << G_TEXTURE_IMAGE_FRAC, (lrt) << G_TEXTURE_IMAGE_FRAC); \
})
#define gMKLoadTextureTile_4b(pkt, timg, fmt, width, height, uls, ult, lrs, lrt, pal, cms, cmt, masks, maskt, shifts, \
shiftt) \
_DW({ \
gDPSetTextureImage(pkt, fmt, G_IM_SIZ_8b, ((width) >> 1), timg); \
gDPSetTile(pkt, fmt, G_IM_SIZ_8b, (((((lrs) - (uls) + 1) >> 1) + 7) >> 3), 0, G_TX_LOADTILE, 0, cmt, maskt, \
shiftt, cms, masks, shifts); \
gDPLoadSync(pkt); \
gDPLoadTile(pkt, G_TX_LOADTILE, (uls) << (G_TEXTURE_IMAGE_FRAC - 1), (ult) << (G_TEXTURE_IMAGE_FRAC), \
(lrs) << (G_TEXTURE_IMAGE_FRAC - 1), (lrt + 2) << (G_TEXTURE_IMAGE_FRAC)); \
gDPPipeSync(pkt); \
gDPSetTile(pkt, fmt, G_IM_SIZ_4b, (((((lrs) - (uls) + 1) >> 1) + 7) >> 3), 0, G_TX_RENDERTILE, pal, cmt, \
maskt, shiftt, cms, masks, shifts); \
gDPSetTileSize(pkt, G_TX_RENDERTILE, (uls) << G_TEXTURE_IMAGE_FRAC, (ult) << G_TEXTURE_IMAGE_FRAC, \
(lrs) << G_TEXTURE_IMAGE_FRAC, (lrt) << G_TEXTURE_IMAGE_FRAC); \
})
#ifdef __cplusplus
}
#endif
+1 -1
View File
@@ -223,7 +223,7 @@ typedef struct {
/* 0x6 */ u16 rot;
} YVFlagPoleSpawn; // size = 0x8;
extern YVFlagPoleSpawn D_800E5DF4[];
extern YVFlagPoleSpawn gFlagpoleSpawns[];
#define NUM_CRABS 0xA
+17 -1
View File
@@ -1,6 +1,7 @@
#include <actors.h>
#include <libultra/gbi.h>
#include <main.h>
#include "assets/other_textures.h"
// #include <assets/dks_jungle_parkway_data.h>
/**
@@ -28,7 +29,22 @@ void render_actor_kiwano_fruit(UNUSED Camera* camera, Mat4 arg1, struct Actor* a
return;
}
addr = segmented_texture_to_virtual((actor->rot[0] << 0xA) + 0x03009000);
// Animate actor by creating an index from rot[0]. Divide by texture size to get whole number 0-2.
// All three animated textures need to be the same size for this to work.
size_t idx = (actor->rot[0] << 0xA) / ResourceGetTexSizeByName(gTextureDksJungleParkwayKiwanoFruit1);
switch(idx) {
case 0:
addr = gTextureDksJungleParkwayKiwanoFruit1;
break;
case 1:
addr = gTextureDksJungleParkwayKiwanoFruit2;
break;
case 2:
addr = gTextureDksJungleParkwayKiwanoFruit3;
break;
}
//addr = segmented_texture_to_virtual((actor->rot[0] << 0xA) + 0x03009000);
gDPLoadTextureBlock(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(addr), G_IM_FMT_CI, G_IM_SIZ_8b, 32, 32, 0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOLOD);
+1
View File
@@ -191,6 +191,7 @@ void camera_init(f32 posX, f32 posY, f32 posZ, UNUSED s16 rot, u32 arg4, s32 cam
func_802B7F7C(camera->pos, camera->lookAt, camera->rot);
}
// Thwomp related
void func_8001CA10(Camera* camera) {
camera->unk_94.unk_8 = 0;
camera->unk_94.unk_0 = 6.0f;
+1 -1
View File
@@ -322,7 +322,7 @@ void credits_spawn_actors(void) {
// Stupid hack to sync segment 3 memory allocations with hard-coded address in data.
gNextFreeMemoryAddress += 0x9000;
destroy_all_actors();
m_ClearActors();
CM_CleanWorld();
CourseManager_CreditsSpawnActors();
+50 -62
View File
@@ -551,25 +551,21 @@ void render_object(u32 arg0) {
}
void render_object_p1(void) {
gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]),
G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
CourseManager_DrawBombKarts(PLAYER_ONE);
//render_bomb_karts_wrap(PLAYER_ONE);
if (gGamestate == ENDING) {
func_80055F48(PLAYER_ONE);
func_80056160(PLAYER_ONE);
func_8005217C(PLAYER_ONE);
func_80054BE8(PLAYER_ONE);
return;
}
if (!gDemoMode) {
render_lakitu(PLAYER_ONE);
}
CourseManager_DrawBombKarts(PLAYER_ONE); // render_bomb_karts_wrap(PLAYER_ONE);
// if (gGamestate == ENDING) {
// //func_80055F48(PLAYER_ONE);
// //func_80056160(PLAYER_ONE);
// //func_8005217C(PLAYER_ONE);
// //func_80054BE8(PLAYER_ONE);
// return;
// }
render_object_for_player(PLAYER_ONE);
}
@@ -582,9 +578,6 @@ void render_object_p2(void) {
G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
CourseManager_DrawBombKarts(PLAYER_TWO);
//render_bomb_karts_wrap(PLAYER_TWO);
if (!gDemoMode) {
render_lakitu(PLAYER_TWO);
}
render_object_for_player(PLAYER_TWO);
}
@@ -596,9 +589,6 @@ void render_object_p3(void) {
G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
CourseManager_DrawBombKarts(PLAYER_THREE);
//render_bomb_karts_wrap(PLAYER_THREE);
if (!gDemoMode) {
render_lakitu(PLAYER_THREE);
}
render_object_for_player(PLAYER_THREE);
}
@@ -612,7 +602,7 @@ void render_object_p4(void) {
CourseManager_DrawBombKarts(PLAYER_FOUR);
//render_bomb_karts_wrap(PLAYER_FOUR);
if ((!gDemoMode) && (gPlayerCountSelection1 == 4)) {
render_lakitu(PLAYER_FOUR);
//render_lakitu(PLAYER_FOUR);
}
render_object_for_player(PLAYER_FOUR);
}
@@ -699,11 +689,8 @@ void render_player_snow_effect_four(void) {
}
void render_object_for_player(s32 cameraId) {
CourseManager_RenderCourseObjects(cameraId);
CourseManager_TrainSmokeDraw(cameraId);
CourseManager_DrawThwomps(cameraId);
CourseManager_DrawPenguins(cameraId);
CourseManager_DrawObjects(cameraId);
CM_DrawParticles(cameraId);
// switch (gCurrentCourseId) {
// case COURSE_MARIO_RACEWAY:
@@ -802,7 +789,7 @@ void render_object_for_player(s32 cameraId) {
}
}
void render_snowing_effect(s32 arg0) {
void render_snowing_effect(s32 playerId) {
if (GetCourse() == GetFrappeSnowland()) {
if (gGamestate != 9) {
if ((D_8015F894 == 0) && (gPlayerCountSelection1 == 1)) {
@@ -811,8 +798,9 @@ void render_snowing_effect(s32 arg0) {
} else {
render_object_snowflakes_particles();
}
} else if (GetCourse() == GetSherbetLand()) {
render_ice_block(arg0);
}
if (CourseManager_GetProps()->LakituTowType == 1) {
render_ice_block(playerId);
}
}
@@ -1250,7 +1238,7 @@ void func_8005995C(void) {
void func_80059A88(s32 playerId) {
func_80059820(playerId);
if (!gDemoMode) {
update_object_lakitu(playerId);
//update_object_lakitu(playerId); // Moved to CourseManager_TickObjects60fps
func_8007BB9C(playerId);
}
}
@@ -1267,7 +1255,7 @@ void func_80059AC8(void) {
}
switch (gScreenModeSelection) {
case SCREEN_MODE_1P:
if (gGamestate != 9) {
if (gGamestate != CREDITS_SEQUENCE) {
func_80059A88(PLAYER_ONE);
if (gModeSelection == TIME_TRIALS) {
func_8005995C();
@@ -1291,8 +1279,8 @@ void func_80059AC8(void) {
func_80059A88(PLAYER_FOUR);
break;
}
CourseManager_TickThwomps(); // func_8005A71C();
CourseManager_TickObjects60fps();
}
}
@@ -1325,7 +1313,7 @@ void func_80059D00(void) {
func_80059820(PLAYER_ONE);
func_8005B914();
if (!gDemoMode) {
func_8007AA44(0);
//func_8007AA44(0);
}
func_80078C70(0);
if (playerHUD[PLAYER_ONE].raceCompleteBool == 0) {
@@ -1338,7 +1326,6 @@ void func_80059D00(void) {
func_80059820(PLAYER_TWO);
func_80078C70(2);
}
update_object();
break;
case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL:
randomize_seed_from_controller(PLAYER_ONE);
@@ -1346,18 +1333,17 @@ void func_80059D00(void) {
func_80059820(PLAYER_ONE);
func_8005D0FC(PLAYER_ONE);
if (!gDemoMode) {
func_8007AA44(0);
//func_8007AA44(0);
}
func_80078C70(1);
func_8005D1F4(0);
func_80059820(PLAYER_TWO);
func_8005D0FC(PLAYER_TWO);
if (!gDemoMode) {
func_8007AA44(1);
//func_8007AA44(1);
}
func_80078C70(2);
func_8005D1F4(1);
update_object();
break;
case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL:
randomize_seed_from_controller(PLAYER_ONE);
@@ -1365,18 +1351,17 @@ void func_80059D00(void) {
func_80059820(PLAYER_ONE);
func_8005D0FC(PLAYER_ONE);
if (!gDemoMode) {
func_8007AA44(0);
//func_8007AA44(0);
}
func_80078C70(3);
func_8005D1F4(0);
func_80059820(PLAYER_TWO);
func_8005D0FC(PLAYER_TWO);
if (!gDemoMode) {
func_8007AA44(1);
//func_8007AA44(1);
}
func_80078C70(4);
func_8005D1F4(1);
update_object();
break;
case SCREEN_MODE_3P_4P_SPLITSCREEN:
randomize_seed_from_controller(PLAYER_ONE);
@@ -1386,32 +1371,34 @@ void func_80059D00(void) {
func_80059820(PLAYER_ONE);
func_8005D0FC(PLAYER_ONE);
if (!gDemoMode) {
func_8007AA44(0);
//func_8007AA44(0);
}
func_8005D1F4(0);
func_80059820(PLAYER_TWO);
func_8005D0FC(PLAYER_TWO);
if (!gDemoMode) {
func_8007AA44(1);
//func_8007AA44(1);
}
func_8005D1F4(1);
func_80059820(PLAYER_THREE);
func_8005D0FC(PLAYER_THREE);
if (!gDemoMode) {
func_8007AA44(2);
//func_8007AA44(2);
}
func_8005D1F4(2);
if (gPlayerCountSelection1 == 4) {
func_80059820(PLAYER_FOUR);
func_8005D0FC(PLAYER_FOUR);
if ((!gDemoMode) && (gPlayerCountSelection1 == 4)) {
func_8007AA44(3);
//func_8007AA44(3);
}
func_8005D1F4(3);
}
update_object();
break;
}
update_object();
CourseManager_TickObjects();
CM_TickParticles();
func_800744CC();
}
}
@@ -1424,15 +1411,18 @@ void func_8005A070(void) {
if (gIsGamePaused == false) {
func_8005C728();
if (gGamestate == ENDING) {
func_80086604();
func_80086D80();
update_cheep_cheep(1);
func_80077640();
//func_80086604();
//func_80086D80();
//update_cheep_cheep(1);
//func_80077640();
CourseManager_TickObjects();
CM_TickParticles();
} else if (gGamestate == CREDITS_SEQUENCE) {
func_80059820(PLAYER_ONE);
func_80078C70(0);
update_object();
} else {
CourseManager_TickObjects();
CM_TickParticles();
} else { // normal gameplay
func_80059D00();
}
}
@@ -1573,15 +1563,13 @@ void func_8005A3C0(void) {
void func_8005A71C(void) {
//if (GetCourse() == GetBowsersCastle()) {
func_80081210();
//func_80081210();
//}
}
void update_object(void) {
CourseManager_UpdateCourseObjects();
CourseManager_TrainSmokeTick();
CourseManager_TickPenguins();
// switch (gCurrentCourseId) {
// case COURSE_MARIO_RACEWAY:
@@ -1720,7 +1708,7 @@ void func_8005AAF0(void) {
void func_8005AB20(void) {
if ((gModeSelection == GRAND_PRIX) && (gPlayerCountSelection1 == 1)) {
func_8005AA6C(0x14);
func_8005AA6C(20);
}
}
@@ -2395,7 +2383,7 @@ void func_8005B914(void) {
} else if (D_8018D1CC < 0xC8) {
func_8005B7A0();
}
if ((D_8018D1CC != 0) && (D_8018D1CC >= 0x14) && (D_8018D1CC < 0x1E)) {
if ((D_8018D1CC != 0) && (D_8018D1CC >= 20) && (D_8018D1CC < 0x1E)) {
for (i = 0; i < 4; i++) {
f32_step_towards(&D_8018D028[i], D_8018D0C8[i], D_8018D078[i]);
if (D_8018D028[i] == D_8018D0C8[i]) {
@@ -2603,7 +2591,7 @@ void func_8005CB60(s32 playerId, s32 lapCount) {
case 0: /* switch 1 */
break;
case 1: /* switch 1 */
func_80079084(playerId);
CM_ActivateSecondLapLakitu(playerId); // func_80079084(playerId);
func_800C9060(playerId, SOUND_ARG_LOAD(0x19, 0x00, 0xF0, 0x15));
if ((GetCourse() == GetLuigiRaceway()) && (D_80165898 == 0) &&
(gModeSelection != (s32) TIME_TRIALS)) {
@@ -2611,7 +2599,7 @@ void func_8005CB60(s32 playerId, s32 lapCount) {
}
break;
case 2: /* switch 1 */
func_800790B4(playerId);
CM_ActivateFinalLapLakitu(playerId); // func_800790B4(playerId);
break;
case 3: /* switch 1 */
if ((D_8018D114 == 0) || (D_8018D114 == 1)) {
@@ -2636,7 +2624,7 @@ void func_8005CB60(s32 playerId, s32 lapCount) {
playerHUD[playerId].totalTimeX = 0x0320;
D_8016587C = (s32) 1;
if (D_8018D20C == 0) {
func_80079054(playerId);
CM_ActivateFinishLakitu(playerId); // func_80079054(playerId);
D_8018D20C = 1;
if (gPlayerCount == (s8) 1) {
D_8018D1CC = 0x00000064;
@@ -6093,11 +6081,11 @@ void render_battle_balloon(Player* player, s8 arg1, s16 arg2, s8 arg3) {
AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_WRAP | ZMODE_XLU | CVG_X_ALPHA | FORCE_BL |
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA));
gDPLoadTextureBlock(gDisplayListHead++, D_8018D4BC, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP,
gDPLoadTextureBlock(gDisplayListHead++, gTextureBalloon1, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPVertex(gDisplayListHead++, gBalloonVertexPlane1, 4, 0);
gSPDisplayList(gDisplayListHead++, common_square_plain_render);
gDPLoadTextureBlock(gDisplayListHead++, D_8018D4C0 - 0x40, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0,
gDPLoadTextureBlock(gDisplayListHead++, gTextureBalloon2, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOLOD);
gSPVertex(gDisplayListHead++, gBalloonVertexPlane2, 4, 0);
@@ -6215,13 +6203,13 @@ void render_balloon(Vec3f arg0, f32 arg1, s16 arg2, s16 arg3) {
AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_WRAP | ZMODE_XLU | CVG_X_ALPHA | FORCE_BL |
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA));
gDPLoadTextureBlock(gDisplayListHead++, D_8018D4BC, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP,
gDPLoadTextureBlock(gDisplayListHead++, gTextureBalloon1, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPVertex(gDisplayListHead++, gBalloonVertexPlane1, 4, 0);
gSPDisplayList(gDisplayListHead++, common_square_plain_render);
// D_8018D4C0 is correct. But interestingly, IDO seems to set "-0x40" to a different register so the texture still
// looks fine.
gDPLoadTextureBlock(gDisplayListHead++, D_8018D4C0 - 0x40, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0,
gDPLoadTextureBlock(gDisplayListHead++, gTextureBalloon2, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOLOD);
gSPVertex(gDisplayListHead++, gBalloonVertexPlane2, 4, 0);
+2 -3
View File
@@ -162,8 +162,7 @@ void init_item_window(s32 objectIndex) {
}
void func_8006EEE8(s32 courseId) {
D_8018D240 = (uintptr_t) dma_textures(CourseManager_GetProps()->MinimapTexture, D_800E5520[courseId],
ResourceGetTexSizeByName(CourseManager_GetProps()->MinimapTexture));
D_8018D240 = (uintptr_t) CourseManager_GetProps()->MinimapTexture;
// This is incredibly dumb. D_800E5548 ought to be something more like
// `u16 D_800E5548[][2]` but that doesn't match for some insane reason
D_8018D2B0 = CourseManager_GetProps()->D_800E5548[0]; // D_800E5548[courseId * 2];
@@ -179,7 +178,7 @@ void func_8006EF60(void) {
wut = D_8018D9B4 + 0xFFFF0000;
// clang-format off
// God forgive me for my sins...
huh = 0x14; if (0) {} for (i = 0; i < huh; i++) { D_8018D248[i] = func_8006ED94(CourseManager_GetProps()->MinimapTexture, wut, ResourceGetTexSizeByName(CourseManager_GetProps()->MinimapTexture), D_800E5520[i]); wut += D_800E5520[i]; }
huh = 0x14; if (0) {} for (i = 0; i < huh; i++) { D_8018D248[i] = CourseManager_GetProps()->MinimapTexture; wut += ResourceGetTexSizeByName(CourseManager_GetProps()->MinimapTexture); }
// clang-format on
}
+63 -78
View File
@@ -19,13 +19,13 @@
void func_80086E70(s32 objectIndex) {
gObjectList[objectIndex].unk_0AE = 1; // * 0xE0)) = 1;
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
}
void func_80086EAC(s32 objectIndex, s32 arg1, s16 arg2) {
gObjectList[objectIndex].unk_0DD = arg1;
gObjectList[objectIndex].unk_0AE = arg2;
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
}
void func_80086EF0(s32 objectIndex) {
@@ -42,7 +42,7 @@ void func_80086F60(s32 objectIndex) {
gObjectList[objectIndex].unk_0AE = 0;
gObjectList[objectIndex].unk_0DD = 0;
gObjectList[objectIndex].unk_0DE = 0;
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
}
bool func_80086FA4(s32 objectIndex) {
@@ -54,12 +54,12 @@ bool func_80086FA4(s32 objectIndex) {
}
void func_80086FD4(s32 objectIndex) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
gObjectList[objectIndex].unk_0AE += 1;
}
void func_8008701C(s32 objectIndex, s32 arg1) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
gObjectList[objectIndex].unk_0AE = arg1;
}
@@ -68,12 +68,12 @@ s32 func_80087060(s32 objectIndex, s32 arg1) {
sp1C = 0;
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
set_object_flag_status_true(objectIndex, 8);
set_object_flag(objectIndex, 8);
gObjectList[objectIndex].unk_0B0 = arg1;
}
gObjectList[objectIndex].unk_0B0--;
if (gObjectList[objectIndex].unk_0B0 < 0) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
sp1C = 1;
}
return sp1C;
@@ -84,12 +84,12 @@ s32 func_80087104(s32 objectIndex, u16 arg1) {
sp24 = 0;
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
set_object_flag_status_true(objectIndex, 8);
set_object_flag(objectIndex, 8);
gObjectList[objectIndex].unk_0B0 = random_int(arg1);
}
gObjectList[objectIndex].unk_0B0--;
if (gObjectList[objectIndex].unk_0B0 < 0) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
sp24 = 1;
}
return sp24;
@@ -100,12 +100,12 @@ s32 func_800871AC(s32 objectIndex, s32 arg1) {
sp24 = 0;
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
set_object_flag_status_true(objectIndex, 8);
set_object_flag(objectIndex, 8);
gObjectList[objectIndex].unk_0B0 = (s16) arg1;
}
gObjectList[objectIndex].unk_0B0--;
if (gObjectList[objectIndex].unk_0B0 < 0) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
func_80086FD4(objectIndex);
sp24 = 1;
}
@@ -235,13 +235,13 @@ s32 func_8008789C(s32 objectIndex, s32 arg1) {
sp24 = 0;
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
set_object_flag_status_true(objectIndex, 8);
set_object_flag(objectIndex, 8);
func_8008751C(objectIndex);
gObjectList[objectIndex].unk_0B0 = arg1;
}
gObjectList[objectIndex].unk_0B0--;
if (gObjectList[objectIndex].unk_0B0 < 0) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
sp24 = 1;
} else {
object_add_velocity_offset_xz(objectIndex);
@@ -254,13 +254,13 @@ s32 func_80087954(s32 objectIndex, s32 arg1) {
sp24 = 0;
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
set_object_flag_status_true(objectIndex, 8);
set_object_flag(objectIndex, 8);
func_80087620(objectIndex);
gObjectList[objectIndex].unk_0B0 = arg1;
}
gObjectList[objectIndex].unk_0B0--;
if (gObjectList[objectIndex].unk_0B0 < 0) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
sp24 = 1;
} else {
object_add_velocity_offset_xz(objectIndex);
@@ -276,7 +276,7 @@ bool func_80087A0C(s32 objectIndex, s16 arg1, s16 arg2, s16 arg3, s16 arg4) {
sp2C = false;
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
set_object_flag_status_true(objectIndex, 8);
set_object_flag(objectIndex, 8);
temp_v0 = arg2 - arg1;
temp_a0 = arg4 - arg3;
dist = sqrtf((temp_v0 * temp_v0) + (temp_a0 * temp_a0));
@@ -287,7 +287,7 @@ bool func_80087A0C(s32 objectIndex, s16 arg1, s16 arg2, s16 arg3, s16 arg4) {
}
gObjectList[objectIndex].unk_0B0--;
if (gObjectList[objectIndex].unk_0B0 < 0) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
sp2C = true;
} else {
object_add_velocity_offset_xz(objectIndex);
@@ -300,12 +300,12 @@ s32 func_80087B84(s32 objectIndex, f32 arg1, f32 arg2) {
sp24 = 0;
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
set_object_flag_status_true(objectIndex, 8);
set_object_flag(objectIndex, 8);
gObjectList[objectIndex].velocity[1] = -arg1;
}
object_add_velocity_offset_y(objectIndex);
if (gObjectList[objectIndex].pos[1] <= arg2) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
func_80086FD4(objectIndex);
sp24 = 1;
}
@@ -317,13 +317,13 @@ s32 func_80087C48(s32 objectIndex, f32 arg1, f32 arg2, s32 arg3) {
sp24 = 0;
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
set_object_flag_status_true(objectIndex, 8);
set_object_flag(objectIndex, 8);
gObjectList[objectIndex].velocity[1] = arg1;
gObjectList[objectIndex].unk_0B0 = (s16) arg3;
}
gObjectList[objectIndex].unk_0B0--;
if (gObjectList[objectIndex].unk_0B0 < 0) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
func_80086FD4(objectIndex);
sp24 = 1;
} else {
@@ -338,13 +338,13 @@ s32 func_80087D24(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3) {
sp24 = 0;
if (is_obj_index_flag_status_inactive(objectIndex, 8) != 0) {
set_object_flag_status_true(objectIndex, 8);
set_object_flag(objectIndex, 8);
gObjectList[objectIndex].velocity[1] = arg1;
}
gObjectList[objectIndex].velocity[1] -= arg2;
object_add_velocity_offset_y(objectIndex);
if (gObjectList[objectIndex].offset[1] <= arg3) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
gObjectList[objectIndex].offset[1] = arg3;
func_80086FD4(objectIndex);
sp24 = 1;
@@ -358,7 +358,7 @@ bool func_80087E08(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s32
sp2C = false;
if (is_obj_index_flag_status_inactive(objectIndex, 8) != 0) {
set_object_flag_status_true(objectIndex, 8);
set_object_flag(objectIndex, 8);
gObjectList[objectIndex].offset[2] = 0.0f;
gObjectList[objectIndex].offset[1] = 0.0f;
gObjectList[objectIndex].offset[0] = 0.0f;
@@ -370,7 +370,7 @@ bool func_80087E08(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s32
}
gObjectList[objectIndex].unk_0B0--;
if (gObjectList[objectIndex].unk_0B0 < 0) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
func_80086FD4(objectIndex);
sp2C = true;
} else {
@@ -386,7 +386,7 @@ UNUSED s32 func_80087F14(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3, s16 arg4
sp2C = 0;
if (is_obj_index_flag_status_inactive(objectIndex, 8) != 0) {
set_object_flag_status_true(objectIndex, 8);
set_object_flag(objectIndex, 8);
gObjectList[objectIndex].offset[2] = 0.0f;
gObjectList[objectIndex].offset[1] = 0.0f;
gObjectList[objectIndex].offset[0] = 0.0f;
@@ -397,7 +397,7 @@ UNUSED s32 func_80087F14(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3, s16 arg4
gObjectList[objectIndex].unk_0B0 = gVBlankTimer;
}
if (gObjectList[objectIndex].offset[1] <= arg5) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
func_80086FD4(objectIndex);
sp2C = 1;
} else {
@@ -526,13 +526,13 @@ s32 func_8008847C(s32 objectIndex) {
s32 sp2C;
sp2C = 0;
set_object_flag_status_false(objectIndex, 0x00800000);
clear_object_flag(objectIndex, 0x00800000);
if (is_obj_flag_status_active(objectIndex, 0x00000400) != 0) {
check_bounding_collision(&D_8018C3B0, 10.0f, gObjectList[objectIndex].pos[0], 20.0f,
gObjectList[objectIndex].pos[2]);
if (D_8018C3B0.unk34 == 1) {
sp2C = 1;
set_object_flag_status_true(objectIndex, 0x00800000);
set_object_flag(objectIndex, 0x00800000);
}
gObjectList[objectIndex].surfaceHeight = calculate_surface_height(
gObjectList[objectIndex].pos[0], 0.0f, gObjectList[objectIndex].pos[2], D_8018C3B0.meshIndexZX);
@@ -544,13 +544,13 @@ s32 func_80088538(s32 objectIndex) {
s32 sp2C;
sp2C = 0;
set_object_flag_status_false(objectIndex, 0x00800000);
clear_object_flag(objectIndex, 0x00800000);
if (is_obj_flag_status_active(objectIndex, 0x00000400) != 0) {
check_bounding_collision(&D_8018C3B0, 10.0f, gObjectList[objectIndex].pos[0], 20.0f,
gObjectList[objectIndex].pos[2]);
if (D_8018C3B0.unk34 == 1) {
sp2C = 1;
set_object_flag_status_true(objectIndex, 0x00800000);
set_object_flag(objectIndex, 0x00800000);
}
gObjectList[objectIndex].surfaceHeight = calculate_surface_height(
gObjectList[objectIndex].pos[0], 0.0f, gObjectList[objectIndex].pos[2], D_8018C3B0.meshIndexZX);
@@ -565,13 +565,13 @@ s32 func_8008861C(s32 objectIndex) {
s32 sp2C;
sp2C = 0;
set_object_flag_status_false(objectIndex, 0x00800000);
clear_object_flag(objectIndex, 0x00800000);
if (is_obj_flag_status_active(objectIndex, 0x00000400) != 0) {
check_bounding_collision(&D_8018C3B0, 10.0f, gObjectList[objectIndex].pos[0], 20.0f,
gObjectList[objectIndex].pos[2]);
if (D_8018C3B0.unk34 == 1) {
sp2C = 1;
set_object_flag_status_true(objectIndex, 0x00800000);
set_object_flag(objectIndex, 0x00800000);
}
gObjectList[objectIndex].surfaceHeight = calculate_surface_height(
gObjectList[objectIndex].pos[0], 0.0f, gObjectList[objectIndex].pos[2], D_8018C3B0.meshIndexZX);
@@ -586,7 +586,7 @@ void func_800886F4(s32 objectIndex) {
check_bounding_collision(&D_8018C3B0, 10.0f, gObjectList[objectIndex].pos[0], 20.0f,
gObjectList[objectIndex].pos[2]);
if (D_8018C3B0.unk34 == 1) {
set_object_flag_status_true(objectIndex, 0x00800000);
set_object_flag(objectIndex, 0x00800000);
gObjectList[objectIndex].surfaceHeight = calculate_surface_height(
gObjectList[objectIndex].pos[0], 0.0f, gObjectList[objectIndex].pos[2], D_8018C3B0.meshIndexZX);
gObjectList[objectIndex].unk_0B8[0] =
@@ -594,14 +594,14 @@ void func_800886F4(s32 objectIndex) {
gObjectList[objectIndex].unk_0B8[2] = atan2s(D_8018C3B0.orientationVector[0], D_8018C3B0.orientationVector[1]);
return;
}
set_object_flag_status_false(objectIndex, 0x00800000);
clear_object_flag(objectIndex, 0x00800000);
}
void func_800887C0(s32 objectIndex) {
check_bounding_collision(&D_8018C3B0, 10.0f, gObjectList[objectIndex].pos[0], 20.0f,
gObjectList[objectIndex].pos[2]);
if (D_8018C3B0.unk34 == 1) {
set_object_flag_status_true(objectIndex, 0x00800000);
set_object_flag(objectIndex, 0x00800000);
gObjectList[objectIndex].surfaceHeight = calculate_surface_height(
gObjectList[objectIndex].pos[0], 0.0f, gObjectList[objectIndex].pos[2], D_8018C3B0.meshIndexZX);
gObjectList[objectIndex].velocity[0] = D_8018C3B0.orientationVector[0];
@@ -609,7 +609,7 @@ void func_800887C0(s32 objectIndex) {
gObjectList[objectIndex].velocity[2] = D_8018C3B0.orientationVector[2];
return;
}
set_object_flag_status_false(objectIndex, 0x00800000);
clear_object_flag(objectIndex, 0x00800000);
}
/**
@@ -1131,14 +1131,14 @@ void func_80089820(s32 objectIndex, f32 arg1, f32 arg2, u32 arg3) {
s32 var_s1;
player = gPlayerOne;
set_object_flag_status_false(objectIndex, 0x02000000);
clear_object_flag(objectIndex, 0x02000000);
if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) {
for (var_s1 = 0; var_s1 < D_8018D158; var_s1++, player++) {
if ((gObjectList[objectIndex].state != 0) && !(player->effects & BOO_EFFECT)) {
if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_INVISIBLE_OR_BOMB) &&
(has_collided_horizontally_with_player(objectIndex, player) != 0)) {
if (player->effects & STAR_EFFECT) {
set_object_flag_status_true(objectIndex, 0x02000000);
set_object_flag(objectIndex, 0x02000000);
} else {
if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) {
func_80072180();
@@ -1328,7 +1328,7 @@ void func_8008A1D0(s32 objectIndex, s32 cameraId, s32 arg2, s32 arg3) {
Camera* camera;
camera = &camera1[cameraId];
set_object_flag_status_false(objectIndex, 0x00100000 | VISIBLE);
clear_object_flag(objectIndex, 0x00100000 | VISIBLE);
temp_v0 = get_horizontal_distance_to_camera(objectIndex, camera);
if (CVarGetInteger("gNoCulling", 0) == 1) {
temp_v0 = MIN(temp_v0, arg3 * arg3);
@@ -1341,9 +1341,9 @@ void func_8008A1D0(s32 objectIndex, s32 cameraId, s32 arg2, s32 arg3) {
var_a2 = 0x2AAB;
}
if ((is_object_visible_on_camera(objectIndex, camera, var_a2) != 0) && ((u32) (arg3 * arg3) >= temp_v0)) {
set_object_flag_status_true(objectIndex, VISIBLE);
set_object_flag(objectIndex, VISIBLE);
if (temp_v0 >= (u32) (arg2 * arg2)) {
set_object_flag_status_true(objectIndex, 0x00100000);
set_object_flag(objectIndex, 0x00100000);
}
}
}
@@ -1355,7 +1355,7 @@ UNUSED void func_8008A2CC(s32 objectIndex, s32 cameraId, u16 arg2) {
u16 var_a2;
camera = &camera1[cameraId];
set_object_flag_status_false(objectIndex, VISIBLE);
clear_object_flag(objectIndex, VISIBLE);
if (no_init < 0x2711U) {
var_a2 = 0x5555;
} else if (no_init < 0x9C41U) {
@@ -1364,7 +1364,7 @@ UNUSED void func_8008A2CC(s32 objectIndex, s32 cameraId, u16 arg2) {
var_a2 = arg2;
}
if (is_object_visible_on_camera(objectIndex, camera, var_a2) != 0) {
set_object_flag_status_true(objectIndex, VISIBLE);
set_object_flag(objectIndex, VISIBLE);
}
}
@@ -1374,13 +1374,13 @@ s32 func_8008A364(s32 objectIndex, s32 cameraId, u16 arg2, s32 arg3) {
u16 var_a2;
camera = &camera1[cameraId];
set_object_flag_status_false(objectIndex, 0x00020000 | VISIBLE);
clear_object_flag(objectIndex, 0x00020000 | VISIBLE);
dist = get_horizontal_distance_to_camera(objectIndex, camera);
if (CVarGetInteger("gNoCulling", 0) == 1) {
dist = MIN(dist, (arg3 * arg3) - 1);
}
if (dist < (arg3 * arg3)) {
set_object_flag_status_true(objectIndex, 0x00020000);
set_object_flag(objectIndex, 0x00020000);
if (dist < 0x2711U) {
var_a2 = 0x5555;
} else if (dist < 0x9C41U) {
@@ -1389,7 +1389,7 @@ s32 func_8008A364(s32 objectIndex, s32 cameraId, u16 arg2, s32 arg3) {
var_a2 = arg2;
}
if (is_object_visible_on_camera(objectIndex, camera, var_a2) != 0) {
set_object_flag_status_true(objectIndex, VISIBLE);
set_object_flag(objectIndex, VISIBLE);
}
}
return dist;
@@ -1397,30 +1397,9 @@ s32 func_8008A364(s32 objectIndex, s32 cameraId, u16 arg2, s32 arg3) {
void func_8008A454(s32 objectIndex, s32 cameraId, s32 arg2) {
if (get_horizontal_distance_to_camera(objectIndex, &camera1[cameraId]) < (u32) (arg2 * arg2)) {
set_object_flag_status_true(objectIndex, 0x00000020);
set_object_flag(objectIndex, 0x00000020);
} else {
set_object_flag_status_false(objectIndex, 0x00000020);
}
}
void func_8008A4CC(s32 objectIndex) {
s32 loopIndex;
Camera* camera;
set_object_flag_status_false(objectIndex, 0x00070000);
for (loopIndex = 0, camera = camera1; loopIndex < gPlayerCountSelection1; loopIndex++, camera++) {
if (gObjectList[objectIndex].state != 0) {
if ((D_8018CF68[loopIndex] >= (gObjectList[objectIndex].unk_0DF - 1)) &&
((gObjectList[objectIndex].unk_0DF + 1) >= D_8018CF68[loopIndex])) {
set_object_flag_status_true(objectIndex, 0x00010000);
if (D_8018CF68[loopIndex] == gObjectList[objectIndex].unk_0DF) {
set_object_flag_status_true(objectIndex, 0x00020000);
}
if (is_object_visible_on_camera(objectIndex, camera, 0x2AABU) != 0) {
set_object_flag_status_true(objectIndex, VISIBLE);
}
}
}
clear_object_flag(objectIndex, 0x00000020);
}
}
@@ -1428,10 +1407,10 @@ UNUSED void func_8008A610(s32 objectIndex) {
s32 loopIndex;
Camera* camera;
set_object_flag_status_false(objectIndex, VISIBLE);
clear_object_flag(objectIndex, VISIBLE);
for (camera = camera1, loopIndex = 0; loopIndex < gPlayerCountSelection1; loopIndex++, camera++) {
if ((gObjectList[objectIndex].state != 0) && (is_object_visible_on_camera(objectIndex, camera, 0x2AABU) != 0)) {
set_object_flag_status_true(objectIndex, VISIBLE);
set_object_flag(objectIndex, VISIBLE);
}
}
}
@@ -1441,18 +1420,18 @@ void func_8008A6DC(s32 objectIndex, f32 arg1) {
s32 loopIndex;
Camera* camera;
set_object_flag_status_false(objectIndex, 0x00060000);
clear_object_flag(objectIndex, 0x00060000);
for (camera = camera1, loopIndex = 0; loopIndex < gPlayerCountSelection1; loopIndex++, camera++) {
if ((gObjectList[objectIndex].state != 0) &&
(is_within_horizontal_distance_to_camera(objectIndex, camera, arg1) != 0)) {
set_object_flag_status_true(objectIndex, 0x00020000);
set_object_flag(objectIndex, 0x00020000);
if (arg1 <= 500.0) {
var_a2 = 0x4000;
} else {
var_a2 = 0x2AAB;
}
if (is_object_visible_on_camera(objectIndex, camera, var_a2) != 0) {
set_object_flag_status_true(objectIndex, VISIBLE);
set_object_flag(objectIndex, VISIBLE);
}
}
}
@@ -1478,10 +1457,16 @@ s32 func_8008A890(Camera* camera) {
return get_track_section_id(camera->collision.meshIndexZX);
}
s32 func_8008A8B0(s16 arg0, s16 arg1) {
/**
* This function is used to avoid hefty collision checks if players are not near the actor
*/
s32 are_players_in_course_section(s16 arg0, s16 arg1) {
s32 var_v1;
s16* var_v0;
s32 i;
return 1; //! @todo This is the easiest solution otherwise actors would not collide on custom courses.
var_v1 = 0;
for (i = 0; i < gPlayerCountSelection1; i++) {
var_v0 = &D_8018CF68[i];
@@ -1744,7 +1729,7 @@ void func_8008B3E4(s32 objectIndex) {
*/
object->unk_084[8] = *(((s16*) object->controlPoints) - 1);
set_object_flag_status_true(objectIndex, 8);
set_object_flag(objectIndex, 8);
}
}
@@ -1811,7 +1796,7 @@ void func_8008B6A4(s32 objectIndex) {
// Have to do it this way due to the u16 cast
object->unk_084[9] = (u16) object->unk_084[9] + 1;
if ((u16) object->unk_084[9] == (u16) object->unk_084[8]) {
set_object_flag_status_false(objectIndex, 8);
clear_object_flag(objectIndex, 8);
} else {
func_8008B44C(objectIndex);
}
+1 -1
View File
@@ -106,7 +106,7 @@ void func_8008A830(s32);
void func_8008A850(s32);
s32 func_8008A870(Player*);
s32 func_8008A890(Camera*);
s32 func_8008A8B0(s16, s16);
s32 are_players_in_course_section(s16, s16);
void func_8008A920(s32);
void func_8008A9B8(s32);
void func_8008AA3C(s32);
+11 -10
View File
@@ -2617,7 +2617,7 @@ func_80095BD0_label2:
func_80095AE0(&gGfxPool->mtxEffect[gMatrixEffectCount], arg2, arg3, arg6, arg7);
gSPMatrix(displayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount++]),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPLoadTextureTile_4b(displayListHead++, arg1, G_IM_FMT_I, arg4, 0, 0, 0, arg4, arg5, 0, G_TX_NOMIRROR | G_TX_WRAP,
gMKLoadTextureTile_4b(displayListHead++, arg1, G_IM_FMT_I, arg4, 0, 0, 0, arg4, arg5, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
switch (arg4) {
default:
@@ -2715,7 +2715,7 @@ Gfx* func_80095E10(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4,
} else {
var_s2 = var_t0;
}
gDPLoadTextureTile(displayListHead++, argA, arg1, G_IM_SIZ_16b, argB, 0, var_a1_2, var_s3,
gMKLoadTextureTile(displayListHead++, argA, arg1, G_IM_SIZ_16b, argB, 0, var_a1_2, var_s3,
var_a1_2 + var_s2, var_s3 + var_s4, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, sp68, sp64, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(displayListHead++, arg8 * 4, arg9 * 4, (arg8 + var_s2) * 4, (arg9 + var_s4) * 4, 0,
@@ -2814,7 +2814,7 @@ Gfx* func_800963F0(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, f32 arg4,
}
a = var_s2 * arg4;
gDPLoadTextureTile(displayListHead++, argC, arg1, G_IM_SIZ_16b, argD, argE, var_a1_2, var_s3,
gMKLoadTextureTile(displayListHead++, argC, arg1, G_IM_SIZ_16b, argD, argE, var_a1_2, var_s3,
var_a1_2 + var_s2, var_s3 + var_s4, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, sp68, sp64, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(displayListHead++, argA * 4, argB * 4, (argA + a) * 4, (argB + b) * 4, 0,
@@ -2921,7 +2921,7 @@ Gfx* func_80096CD8(Gfx* displayListHead, s32 arg1, s32 arg2, u32 width, u32 arg4
} else {
var_a1 = var_ra;
}
gDPLoadTextureTile(displayListHead++, D_0B002A00 + (random_int(128) * 2), G_IM_FMT_IA, G_IM_SIZ_16b, width,
gMKLoadTextureTile(displayListHead++, D_0B002A00 + (random_int(128) * 2), G_IM_FMT_IA, G_IM_SIZ_16b, width,
arg4, var_s1_3, var_fp, var_s1_3 + var_a1, var_fp + var_v0, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, masks, maskt, G_TX_NOLOD, G_TX_NOLOD);
@@ -3075,14 +3075,14 @@ Gfx* func_80097AE4(Gfx* displayListHead, s8 fmt, s32 arg2, s32 arg3, u8* arg4, s
for (i = 0; i < 64; i += 32) {
temp = 0;
dsdx = 0x8000 / (32 - width);
gDPLoadTextureTile(displayListHead++, arg4, fmt, G_IM_SIZ_16b, 64, 64, temp, i, temp + 32, i + 32, 0,
gMKLoadTextureTile(displayListHead++, arg4, fmt, G_IM_SIZ_16b, 64, 64, temp, i, temp + 32, i + 32, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(displayListHead++, (arg2 + width) << 2, arg3 << 2, (arg2 + 32) << 2, (arg3 + 32) << 2, 0, 0,
0, dsdx, 1024);
arg2 += 32;
gDPLoadTextureTile(displayListHead++, arg4, fmt, G_IM_SIZ_16b, 64, 64, temp + 32, i, temp + 64, i + 32, 0,
gMKLoadTextureTile(displayListHead++, arg4, fmt, G_IM_SIZ_16b, 64, 64, temp + 32, i, temp + 64, i + 32, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(displayListHead++, arg2 << 2, arg3 << 2, ((arg2 - width) + 32) << 2, (arg3 + 32) << 2, 0, 0,
0, dsdx, 1024);
@@ -3126,7 +3126,7 @@ Gfx* func_80097E58(Gfx* displayListHead, s8 fmt, u32 arg2, u32 arg3, u32 arg4, u
temp_v1 = ((32 * lrs) << 10) / (lrs * (32 - width));
// Renders the left side
gDPLoadTextureTile(displayListHead++, someTexture, fmt, G_IM_SIZ_16b, arg9, argA, temp, ult, temp + lrs,
gMKLoadTextureTile(displayListHead++, someTexture, fmt, G_IM_SIZ_16b, arg9, argA, temp, ult, temp + lrs,
ult + var_s2, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD,
G_TX_NOLOD);
gSPTextureRectangle(displayListHead++, (arg6 + lrs * (width) / 32) << 2, arg7 << 2, (((arg6) + lrs) << 2),
@@ -3134,7 +3134,7 @@ Gfx* func_80097E58(Gfx* displayListHead, s8 fmt, u32 arg2, u32 arg3, u32 arg4, u
arg6 += lrs;
temp_v1 = ((32 * spDC) << 10) / (spDC * (32 - width));
// Renders the right side
gDPLoadTextureTile(displayListHead++, someTexture, fmt, G_IM_SIZ_16b, arg9, argA, temp + lrs, ult, temp + arg9,
gMKLoadTextureTile(displayListHead++, someTexture, fmt, G_IM_SIZ_16b, arg9, argA, temp + lrs, ult, temp + arg9,
ult + var_s2, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD,
G_TX_NOLOD);
gSPTextureRectangle(displayListHead++, arg6 << 2, arg7 << 2, ((arg6 + spDC * (32 - (width)) / 32) << 2),
@@ -3154,7 +3154,7 @@ Gfx* func_80098558(Gfx* displayListHead, u32 arg1, u32 arg2, u32 arg3, u32 arg4,
arg5Copy = arg5;
for (var_v0 = arg2; var_v0 < arg4; var_v0 += 0x20) {
for (var_a3 = arg1; var_a3 < arg3; var_a3 += 0x20) {
gDPLoadTextureTile(displayListHead++, D_8018D9B0, G_IM_FMT_RGBA, G_IM_SIZ_16b, arg8, 0, var_a3, var_v0,
gMKLoadTextureTile(displayListHead++, D_8018D9B0, G_IM_FMT_RGBA, G_IM_SIZ_16b, arg8, 0, var_a3, var_v0,
var_a3 + 0x20, var_v0 + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5,
5, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(displayListHead++, arg5 << 2, arg6 << 2, (arg5 + 0x20) << 2, (arg6 + 0x20) << 2, 0, 0,
@@ -3188,7 +3188,7 @@ Gfx* func_800987D0(Gfx* displayListHead, u32 arg1, u32 arg2, u32 width, u32 heig
columnCopy = column;
for (var_v0_2 = arg2; (u32) var_v0_2 < height; var_v0_2 += 0x20) {
for (var_a2 = arg1; (u32) var_a2 < width; var_a2 += 0x20) {
gDPLoadTextureTile(displayListHead++, D_8018D9B0, G_IM_FMT_RGBA, G_IM_SIZ_16b, textureWidth, 0, var_a2,
gMKLoadTextureTile(displayListHead++, D_8018D9B0, G_IM_FMT_RGBA, G_IM_SIZ_16b, textureWidth, 0, var_a2,
var_v0_2, var_a2 + 0x20, var_v0_2 + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
temp_f6 = (temp_f18 * ((temp_f0 * (column - 0xA0)) + (temp_f24 * (row - 0x78)))) + 160.0f;
@@ -6818,6 +6818,7 @@ void func_800A1924(struct_8018D9E0_entry* arg0) {
gDisplayListHead = draw_flash_select_case_slow(gDisplayListHead, 0x57, 0x84, 0x96, 0x95);
gDisplayListHead = func_8009BA74(gDisplayListHead, D_02004A0C, 0x57, 0x84);
}
//! @bug todo: This function will not work in custom courses.
func_8004EF9C(gCupCourseOrder[gTimeTrialDataCourseIndex / 4][gTimeTrialDataCourseIndex % 4]);
do {
gDPSetTextureFilter(gDisplayListHead++, G_TF_BILERP);
+1 -17
View File
@@ -307,18 +307,6 @@ ThwompSpawn gThomwpSpawns150CC[] = {
{ 0x0596, 0xf92f, 0x0006, 0x0000 }, { 0x082a, 0xf9f2, 0x0005, 0x0000 }, { 0x073a, 0xf9f2, 0x0005, 0x0001 },
};
f32 D_800E594C[][2] = {
{ -8.0, 8.0 },
{ 8.0, 8.0 },
{ 0.0, 0.0 },
{ 8.0, -8.0 },
{ -8.0, -8.0 },
// This feels super fake, but it matches
{ -0.0, 0.0 },
};
s16 D_800E597C[] = { 0x0000, 0x0000, 0x4000, 0x8000, 0x8000, 0xc000 };
// Seems to be related to the Boos in Banshee Boardwalk
SplineData D_800E5988 = {
0x0016,
@@ -451,7 +439,7 @@ s8 D_800E5DB4[] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
YVFlagPoleSpawn D_800E5DF4[] = {
YVFlagPoleSpawn gFlagpoleSpawns[] = {
{ { 0xfc7a, 0x0046, 0xfa82 }, 0x3800 },
{ { 0xfc4c, 0x0046, 0xfa03 }, 0x3800 },
{ { 0xf786, 0x0000, 0x02d3 }, 0x0400 },
@@ -573,10 +561,6 @@ SplineData D_800E6280 = { 0x0016,
{ { 0xffce, 0x00aa, 0xfe0c }, 0x0028 },
} };
// Note the use of the plain SplineData type here. Since these are pointers, we don't care
// about their internal array size
SplineData* D_800E633C[] = { &D_800E6034, &D_800E60F0, &D_800E61B4, &D_800E6280 };
// Might be Cheep Cheep related?
Vec3s D_800E634C[] = {
{ 0xf37e, 0x0013, 0xfe22 },
+1 -4
View File
@@ -39,9 +39,7 @@ extern s16 D_800E57F8[];
extern ThwompSpawn gThomwpSpawns50CC[];
extern ThwompSpawn gThwompSpawns100CCExtra[];
extern ThwompSpawn gThomwpSpawns150CC[];
extern f32 D_800E594C[][2];
extern u64 D_800E5974;
extern s16 D_800E597C[];
extern SplineData D_800E5988;
extern SplineData D_800E5A44;
extern SplineData D_800E5B08;
@@ -52,7 +50,7 @@ extern SplineData D_800E5D78;
extern SplineData* D_800E5D9C[];
extern SplineData* D_800E5DB0;
extern s8 D_800E5DB4[];
extern YVFlagPoleSpawn D_800E5DF4[];
extern YVFlagPoleSpawn gFlagpoleSpawns[];
extern HegdehogSpawn gHedgehogSpawns[];
extern Vec3s gHedgehogPatrolPoints[];
extern SnowmanSpawn gSnowmanSpawns[];
@@ -62,7 +60,6 @@ extern SplineData D_800E6034;
extern SplineData D_800E60F0;
extern SplineData D_800E61B4;
extern SplineData D_800E6280;
extern SplineData* D_800E633C[];
extern Vec3s D_800E634C[];
extern MoleSpawnUnion gMoleSpawns;
extern SplineData D_800E641C;
+2 -1
View File
@@ -89,7 +89,7 @@ void func_802818BC(void) {
}
}
void load_ceremony_cutscene(void) {
void setup_podium_ceremony(void) {
Camera* camera = &cameras[0];
gCurrentCourseId = COURSE_ROYAL_RACEWAY;
@@ -164,6 +164,7 @@ void load_ceremony_cutscene(void) {
balloons_and_fireworks_init();
init_camera_podium_ceremony();
func_80093E60();
CourseManager_SpawnActors();
D_801625F8 = (uintptr_t) gHeapEndPtr - gNextFreeMemoryAddress;
D_801625FC = ((f32) D_801625F8 / 1000.0f);
}
+1 -1
View File
@@ -6,7 +6,7 @@
void debug_switch_character_ceremony_cutscene(void);
s32 func_80281880(s32 arg0);
void func_802818BC(void);
void load_ceremony_cutscene(void);
void setup_podium_ceremony(void);
extern s32 D_80287554;
extern f32 D_801647A4;
+1 -1
View File
@@ -131,7 +131,7 @@ void func_80281D00(void) {
render_players_on_screen_one();
gSPDisplayList(gDisplayListHead++, VIRTUAL_TO_PHYSICAL2(&D_80284EE0));
update_actors_loop();
render_object(PLAYER_ONE + SCREEN_MODE_1P);
render_object(RENDER_SCREEN_MODE_1P_PLAYER_ONE);
func_80021B0C();
gSPDisplayList(gDisplayListHead++, VIRTUAL_TO_PHYSICAL2(&D_80284EE0));
func_80093F10();
+1 -3
View File
@@ -2,11 +2,9 @@
#include "Actor.h"
//GameActor()
AActor::AActor() {}
// Virtual functions to be overridden by derived classes
// Virtual functions to be overridden by derived classes
void AActor::Tick() { }
void AActor::Draw(Camera *camera) { }
void AActor::Collision(Player* player, AActor* actor) {}
+3
View File
@@ -7,6 +7,7 @@
#include "path_spawn_metadata.h"
#include "waypoints.h"
#include "sounds.h"
#include "course_offsets.h"
typedef struct {
RGB8 TopRight;
@@ -26,6 +27,7 @@ typedef struct {
const char* CourseLength;
const char* AIBehaviour;
const char* MinimapTexture;
s32 LakituTowType;
s16 D_800E5548[2];
float AIMaximumSeparation;
float AIMinimumSeparation;
@@ -45,6 +47,7 @@ typedef struct {
s32 MinimapFinishlineX;
s32 MinimapFinishlineY;
SkyboxColours Skybox;
const course_texture *textures;
enum MusicSeq Sequence;
} CProperties;
-20
View File
@@ -1,20 +0,0 @@
#include "GameObject.h"
#include <libultraship.h>
#include "World.h"
extern "C" {
#include "camera.h"
}
//GameActor()
GameObject::GameObject() {}
// Virtual functions to be overridden by derived classes
void GameObject::Tick() { }
void GameObject::Draw(Camera* camera) { }
void GameObject::Collision() {}
void GameObject::Expire() { }
void GameObject::Destroy() { }
-24
View File
@@ -1,24 +0,0 @@
#pragma once
#include <libultraship.h>
extern "C" {
#include "camera.h"
#include "objects.h"
}
class GameObject {
public:
uint8_t uuid[16];
Object o;
virtual ~GameObject() = default;
explicit GameObject();
virtual void Tick();
virtual void Draw(Camera* camera);
virtual void Collision();
virtual void Expire();
virtual void Destroy();
};
+31
View File
@@ -0,0 +1,31 @@
#include "GarbageCollector.h"
#include "World.h"
void RunGarbageCollector() {
//CleanActors();
CleanObjects();
}
void CleanActors() {
// for (auto actor = gWorldInstance.Actors.begin(); actor != gWorldInstance.Actors.end();) {
// OObject* act = *actor; // Get a mutable copy
// if (act->PendingDestroy) {
// delete act;
// actor = gWorldInstance.Objects.erase(actor); // Remove from container
// continue;
// }
// actor++;
// }
}
void CleanObjects() {
for (auto object = gWorldInstance.Objects.begin(); object != gWorldInstance.Objects.end();) {
OObject* obj = *object; // Get a mutable copy
if (obj->PendingDestroy) {
delete obj;
object = gWorldInstance.Objects.erase(object); // Remove from container
continue;
}
object++;
}
}
+11
View File
@@ -0,0 +1,11 @@
#pragma once
#include <libultraship.h>
#include <vector>
#include "Object.h"
#include "World.h"
void RunGarbageCollector();
void CleanActors();
void CleanObjects();
+4 -4
View File
@@ -24,7 +24,7 @@ void TrainSmokeTick() {
Object* object;
for (auto& vehicle : gWorldInstance.Vehicles) {
if (auto train = dynamic_cast<ATrain*>(vehicle.get())) {
if (auto train = dynamic_cast<ATrain*>(vehicle)) {
if (train->SmokeTimer != 0) {
train->SmokeTimer -= 1;
}
@@ -48,7 +48,7 @@ void TrainSmokeTick() {
train->SmokeTimer = 100;
}
}
} else if (auto boat = dynamic_cast<ABoat*>(vehicle.get())) {
} else if (auto boat = dynamic_cast<ABoat*>(vehicle)) {
if (boat->SmokeTimer != 0) {
boat->SmokeTimer -= 1;
}
@@ -79,7 +79,7 @@ void TrainSmokeTick() {
void TrainSmokeDraw(s32 cameraId) {
Camera* camera = &camera1[cameraId];
for (auto& vehicle : gWorldInstance.Vehicles) {
if (auto train = dynamic_cast<ATrain*>(vehicle.get())) {
if (auto train = dynamic_cast<ATrain*>(vehicle)) {
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007AE0);
load_texture_block_i8_nomirror((uint8_t*)D_0D029458, 32, 32);
func_8004B72C(255, 255, 255, 255, 255, 255, 255);
@@ -92,7 +92,7 @@ void TrainSmokeDraw(s32 cameraId) {
render_object_train_smoke_particle(train->SmokeParticles[i], cameraId);
}
}
} else if (auto boat = dynamic_cast<ABoat*>(vehicle.get())) {
} else if (auto boat = dynamic_cast<ABoat*>(vehicle)) {
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007AE0);
load_texture_block_i8_nomirror((uint8_t*)D_0D029458, 32, 32);
+1 -1
View File
@@ -30,7 +30,7 @@ void TrainCrossing::CrossingTrigger() {
for (const auto& vehicle : gWorldInstance.Vehicles) {
if (auto train = dynamic_cast<ATrain*>(vehicle.get())) {;
if (auto train = dynamic_cast<ATrain*>(vehicle)) {;
f32 radius = DynamicRadius(train->Locomotive.position, train->Locomotive.velocity, Position);
if (Distance(train->Locomotive.position, Position) < radius) {
+36 -89
View File
@@ -3,16 +3,10 @@
#include "Cup.h"
#include "courses/Course.h"
#include "vehicles/Vehicle.h"
#include "vehicles/Train.h"
#include "vehicles/Boat.h"
#include "vehicles/Truck.h"
#include "vehicles/Bus.h"
#include "vehicles/TankerTruck.h"
#include "vehicles/Car.h"
#include "vehicles/OBombKart.h"
#include "objects/BombKart.h"
#include "TrainCrossing.h"
#include <memory>
#include "objects/Object.h"
extern "C" {
#include "camera.h"
@@ -39,52 +33,13 @@ void World::SetCourseFromCup() {
CurrentCourse = CurrentCup->GetCourse();
}
// Required for spawning vehicles in divisions across path points
static size_t trains;
static size_t trucks;
static size_t busses;
static size_t tankerTrucks;
static size_t cars;
static size_t boats;
static size_t thwomps;
static size_t penguins;
/**
* Note that you can only remove the tender if there are no carriages
* @arg waypoint initial waypoint to spawn at.
*/
void World::AddTrain(ATrain::TenderStatus tender, size_t numCarriages, f32 speed, uint32_t waypoint) {
Vehicles.push_back(std::make_unique<ATrain>(trains, tender, numCarriages, speed, waypoint));
trains++;
}
void World::AddBoat(f32 speed, uint32_t waypoint) {
Vehicles.push_back(std::make_unique<ABoat>(boats, speed, waypoint));
boats++;
}
void World::AddTruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) {
Vehicles.push_back(std::make_unique<ATruck>(trucks, speedA, speedB, path, waypoint));
trucks++;
}
void World::AddBus(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) {
Vehicles.push_back(std::make_unique<ABus>(busses, speedA, speedB, path, waypoint));
busses++;
}
void World::AddTankerTruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) {
Vehicles.push_back(std::make_unique<ATankerTruck>(tankerTrucks, speedA, speedB, path, waypoint));
tankerTrucks++;
}
void World::AddCar(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) {
Vehicles.push_back(std::make_unique<ACar>(cars, speedA, speedB, path, waypoint));
cars++;
AVehicle* World::AddVehicle(AVehicle* vehicle) {
Vehicles.push_back(vehicle);
return Vehicles.back();
}
void World::ClearVehicles(void) {
trains = trucks = busses = tankerTrucks = cars = boats = thwomps = 0;
Vehicles.clear();
}
@@ -95,21 +50,7 @@ TrainCrossing* World::AddCrossing(Vec3f position, u32 waypointMin, u32 waypointM
}
void World::AddBombKart(Vec3f pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C) {
BombKarts.push_back(std::make_unique<OBombKart>(pos, waypoint, waypointIndex, state, unk_3C));
}
void World::AddThwomp(s16 x, s16 z, s16 direction, f32 scale, s16 behaviour, s16 primAlpha, u16 boundingBoxSize) {
Thwomps.push_back(
std::make_unique<OThwomp>(thwomps, x, z, direction, scale, behaviour, primAlpha, boundingBoxSize));
thwomps++;
gNumActiveThwomps = thwomps;
}
std::shared_ptr<OPenguin> World::AddPenguin(Vec3f pos, u16 direction, OPenguin::PenguinType type, OPenguin::Behaviour behaviour) {
auto penguin = std::make_shared<OPenguin>(penguins, pos, direction, type, behaviour);
Penguins.push_back(penguin);
penguins++;
return penguin;
BombKarts.push_back(new OBombKart(pos, waypoint, waypointIndex, state, unk_3C));
}
u32 World::GetCupIndex() {
@@ -184,12 +125,6 @@ void World::PreviousCourse() {
gWorldInstance.CurrentCourse = Courses[CourseIndex];
}
Object* World::AddObject(std::unique_ptr<GameObject> object) {
GameObject* rawPtr = object.get();
GameObjects.push_back(std::move(object));
return &rawPtr->o;
}
AActor* World::AddActor(AActor* actor) {
Actors.push_back(actor);
return Actors.back();
@@ -232,40 +167,52 @@ void World::TickActors() {
}
}
void RemoveExpiredActors() {
// Actors.erase(
// std::remove_if(Actors.begin(), Actors.end(),
// [](const std::unique_ptr<AActor>& actor) { return actor->uuid == 0; }),
// Actors.end());
OObject* World::AddObject(OObject* object) {
Objects.push_back(object);
return Objects.back();
}
void World::TickObjects() {
for (const auto& object : this->GameObjects) {
for (const auto& object : Objects) {
object->Tick();
}
}
void World::DrawObjects(Camera *camera) {
for (const auto& object : this->GameObjects) {
object->Draw(camera);
// Some objects such as lakitu are ticked in process_game_tick.
// This is a fallback to support those objects. Probably don't use this.
void World::TickObjects60fps() {
for (const auto& object : Objects) {
object->Tick60fps();
}
}
void World::ExpiredObjects() {
this->GameObjects.erase(
std::remove_if(this->GameObjects.begin(), this->GameObjects.end(),
[](const std::unique_ptr<GameObject>& object) { return object->uuid == 0; }), // Example condition
this->GameObjects.end());
ParticleEmitter* World::AddEmitter(ParticleEmitter* emitter) {
Emitters.push_back(emitter);
return Emitters.back();
}
void World::DestroyObjects() {
void World::DrawObjects(s32 cameraId) {
for (const auto& object : Objects) {
object->Draw(cameraId);
}
}
void World::TickParticles() {
for (const auto& emitter : Emitters) {
emitter->Tick();
}
}
void World::DrawParticles(s32 cameraId) {
for (const auto& emitter : Emitters) {
emitter->Draw(cameraId);
}
}
Object* World::GetObjectByIndex(size_t index) {
if (index < this->GameObjects.size()) {
//if (index < this->Objects.size()) {
// Assuming GameActor::a is accessible, use reinterpret_cast if needed
return reinterpret_cast<Object*>(&this->GameObjects[index]->o);
}
// return reinterpret_cast<Object*>(&this->Objects[index]->o);
//}
return nullptr; // Or handle the error as needed
}
+100 -28
View File
@@ -1,18 +1,22 @@
#pragma once
#include <libultraship.h>
#include "GameObject.h"
#include "objects/Object.h"
#include "Cup.h"
#include "vehicles/Vehicle.h"
#include "vehicles/Train.h"
#include "vehicles/Car.h"
#include "vehicles/OBombKart.h"
#include "objects/BombKart.h"
#include "vehicles/Train.h"
#include "TrainCrossing.h"
#include "vehicles/OThwomp.h"
#include "vehicles/OPenguin.h"
#include "objects/Thwomp.h"
#include "objects/Penguin.h"
#include "objects/Seagull.h"
#include "objects/Lakitu.h"
#include <memory>
#include <unordered_map>
#include "Actor.h"
#include "particles/ParticleEmitter.h"
extern "C" {
#include "camera.h"
@@ -20,13 +24,87 @@ extern "C" {
#include "engine/Engine.h"
};
struct FVector {
float x, y, z;
FVector& operator=(const FVector& other) {
x = other.x;
y = other.y;
z = other.z;
return *this;
}
};
/**
* For providing X and Z when you do not need Y
* Some actors set themselves on the surface automatically
* which means it does not use a Y coordinate
* The train follows a set Y value. The hedgehog's patrolPoint only uses X and Z.
*/
struct FVector2D {
float x, z;
FVector2D& operator=(const FVector2D& other) {
x = other.x;
z = other.z;
return *this;
}
};
struct FRotation {
float pitch, yaw, roll;
FRotation& operator=(const FRotation& other) {
pitch = other.pitch;
yaw = other.yaw;
roll = other.roll;
return *this;
}
};
/**
* For selecting a section of a course path
* Usage: IPathSpan(point1, point2) --> IPathSpan(40, 65)
*/
struct IPathSpan {
int Start, End;
// Default Constructor
IPathSpan() : Start(0), End(0) {}
// Parameterized Constructor
IPathSpan(int InStart, int InEnd)
: Start(InStart), End(InEnd) {}
// Copy Assignment Operator
IPathSpan& operator=(const IPathSpan& Other) {
if (this != &Other) { // Avoid self-assignment
Start = Other.Start;
End = Other.End;
}
return *this;
}
// Equality Operator
bool operator==(const IPathSpan& Other) const {
return Start == Other.Start && End == Other.End;
}
// Inequality Operator
bool operator!=(const IPathSpan& Other) const {
return !(*this == Other);
}
};
class OObject;
class Cup; // <-- Forward declaration
class Course;
class AVehicle;
class ATrain;
class ACar;
class OBombKart;
class TrainCrossing;
class OThwomp;
class OLakitu;
class World {
@@ -88,19 +166,21 @@ public:
AActor* GetActor(size_t index);
void TickActors();
void RemoveExpiredActors();
AActor* ConvertActorToAActor(Actor* actor);
Actor* ConvertAActorToActor(AActor* actor);
Object* AddObject(std::unique_ptr<GameObject> object);
OObject* AddObject(OObject* object);
CProperties* GetCourseProps();
void TickObjects();
void DrawObjects(Camera *camera);
void ExpiredObjects();
void DestroyObjects();
void TickObjects60fps();
void DrawObjects(s32 cameraId);
Object *GetObjectByIndex(size_t);
void TickParticles();
void DrawParticles(s32 cameraId);
ParticleEmitter* AddEmitter(ParticleEmitter* emitter);
void AddCup(Cup*);
void SetCup(Cup* cup);
const char* GetCupName();
@@ -128,28 +208,20 @@ public:
size_t CupIndex = 1;
std::vector<AActor*> Actors;
std::vector<std::unique_ptr<GameObject>> GameObjects;
std::vector<OObject*> Objects;
std::vector<AVehicle*> Vehicles;
std::vector<OBombKart*> BombKarts;
std::vector<ParticleEmitter*> Emitters;
std::unordered_map<s32, OLakitu*> Lakitus;
AVehicle* AddVehicle(AVehicle* vehicle);
/** Actors */
void AddBoat(f32 speed, uint32_t waypoint);
void AddTrain(ATrain::TenderStatus tender, size_t numCarriages, f32 speed, uint32_t waypoint);
void AddTruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint);
void AddBus(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint);
void AddTankerTruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint);
void AddCar(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint);
std::vector<std::unique_ptr<AVehicle>> Vehicles;
void ClearVehicles(void);
/** Objects **/
std::vector<std::unique_ptr<OBombKart>> BombKarts;
void AddBombKart(Vec3f pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C);
std::vector<std::unique_ptr<OThwomp>> Thwomps;
void AddThwomp(s16 x, s16 z, s16 direction, f32 scale, s16 behaviour, s16 primAlpha, u16 boundingBoxSize = 7);
std::vector<std::shared_ptr<OPenguin>> Penguins;
std::shared_ptr<OPenguin> AddPenguin(Vec3f pos, u16 direction, OPenguin::PenguinType type, OPenguin::Behaviour behaviour);
TrainCrossing* AddCrossing(Vec3f position, u32 waypointMin, u32 waypointMax, f32 approachRadius, f32 exitRadius);
std::vector<std::shared_ptr<TrainCrossing>> Crossings;
+47 -8
View File
@@ -4,10 +4,11 @@
#include <memory>
#include "BansheeBoardwalk.h"
#include "GameObject.h"
#include "World.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "engine/objects/CheepCheep.h"
#include "engine/objects/TrashBin.h"
#include "assets/banshee_boardwalk_data.h"
#include "assets/boo_frames.h"
@@ -31,14 +32,41 @@ extern "C" {
#include "actors.h"
#include "collision.h"
#include "memory.h"
#include "course_offsets.h"
extern const char *banshee_boardwalk_dls[];
}
const course_texture banshee_boardwalk_textures[] = {
{ gTexture6447C4, 0x0106, 0x0800, 0x0 },
{ gTexture676FB0, 0x0525, 0x0800, 0x0 },
{ gTexture643B3C, 0x0798, 0x0800, 0x0 },
{ gTexture64BB60, 0x0169, 0x0800, 0x0 },
{ gTexture64BCCC, 0x0450, 0x0800, 0x0 },
{ gTexture64FBF4, 0x0274, 0x0800, 0x0 },
{ gTexture651B20, 0x041D, 0x0800, 0x0 },
{ gTexture66262C, 0x02F7, 0x0800, 0x0 },
{ gTexture668728, 0x01F5, 0x0800, 0x0 },
{ gTexture66A3DC, 0x07C5, 0x0800, 0x0 },
{ gTexture66CA98, 0x02C9, 0x0800, 0x0 },
{ gTexture66CD64, 0x02C0, 0x0800, 0x0 },
{ gTexture66D698, 0x0370, 0x0800, 0x0 },
{ gTexture66E608, 0x05E8, 0x0800, 0x0 },
{ gTexture67B388, 0x03D2, 0x0800, 0x0 },
{ gTextureSignWelcome0, 0x0A2E, 0x1000, 0x0 },
{ gTextureSignWelcome1, 0x0A0A, 0x1000, 0x0 },
{ gTextureSignWoodenBack0, 0x06EF, 0x1000, 0x0 },
{ gTextureSignWoodenBack1, 0x06D1, 0x1000, 0x0 },
{ gTextureSignWoodRedArrow, 0x04E1, 0x1000, 0x0 },
{ gTexture68D940, 0x057D, 0x0800, 0x0 },
{ gTexture685AC0, 0x07CC, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
BansheeBoardwalk::BansheeBoardwalk() {
this->vtx = d_course_banshee_boardwalk_vertex;
this->gfx = d_course_banshee_boardwalk_packed_dls;
this->gfxSize = 3689;
this->textures = banshee_boardwalk_textures;
Props.textures = banshee_boardwalk_textures;
Props.MinimapTexture = gTextureCourseOutlineBansheeBoardwalk;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
@@ -124,6 +152,22 @@ void BansheeBoardwalk::SpawnActors() {
gWorldInstance.AddActor(new AFinishline());
spawn_all_item_boxes((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_banshee_boardwalk_item_box_spawns));
gWorldInstance.AddObject(new OCheepCheep(FVector(xOrientation * -1650.0, -200.0f, -1650.0f), OCheepCheep::CheepType::RACE, IPathSpan(160, 170)));
OTrashBin::Behaviour bhv;
if (gModeSelection == TIME_TRIALS) {
bhv = OTrashBin::Behaviour::STATIC;
} else {
bhv = OTrashBin::Behaviour::MUNCHING;
}
if (gIsMirrorMode) {
gWorldInstance.AddObject(new OTrashBin(FVector(1765.0f, 45.0f, 195.0f), FRotation(0, 180.0f, 0), 1.0f, bhv));
} else {
gWorldInstance.AddObject(new OTrashBin(FVector(-1765.0f, 45.0f, 70.0f), FRotation(0, 0, 0), 1.0f, bhv));
}
}
void BansheeBoardwalk::SpawnVehicles() {
@@ -160,28 +204,23 @@ void BansheeBoardwalk::InitCourseObjects() {
gObjectList[objectId].orientation[0] = 0;
gObjectList[objectId].orientation[1] = 0;
gObjectList[objectId].orientation[2] = 0x8000;
init_object(indexObjectList1[1], 0);
init_object(indexObjectList1[2], 0);
}
}
void BansheeBoardwalk::UpdateCourseObjects() {
if (gGamestate != CREDITS_SEQUENCE) {
update_trash_bin();
func_8007E4C4();
if (gModeSelection != TIME_TRIALS) {
update_bat();
}
wrapper_update_boos();
update_cheep_cheep(0);
}
}
void BansheeBoardwalk::RenderCourseObjects(s32 cameraId) {
if (gGamestate != CREDITS_SEQUENCE) {
render_object_trash_bin(cameraId);
render_object_bat(cameraId);
func_8005217C(cameraId);
render_object_boos(cameraId);
}
}
+8 -3
View File
@@ -4,9 +4,8 @@
#include <memory>
#include "BigDonut.h"
#include "GameObject.h"
#include "World.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "assets/big_donut_data.h"
extern "C" {
@@ -33,11 +32,17 @@ extern "C" {
extern s16 currentScreenSection;
}
const course_texture big_donut_textures[] = {
{ gTexture66ABA4, 0x0312, 0x0800, 0x0 }, { gTexture6747C4, 0x0145, 0x0800, 0x0 },
{ gTexture67490C, 0x021C, 0x0800, 0x0 }, { gTexture64BA50, 0x0110, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
BigDonut::BigDonut() {
this->vtx = d_course_big_donut_vertex;
this->gfx = d_course_big_donut_packed_dls;
this->gfxSize = 528;
this->textures = big_donut_textures;
Props.textures = big_donut_textures;
Props.MinimapTexture = gTextureCourseOutlineBigDonut;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
+10 -3
View File
@@ -4,9 +4,8 @@
#include <memory>
#include "BlockFort.h"
#include "GameObject.h"
#include "World.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "assets/block_fort_data.h"
extern "C" {
@@ -29,15 +28,23 @@ extern "C" {
#include "actors.h"
#include "collision.h"
#include "memory.h"
#include "course_offsets.h"
extern const char *block_fort_dls[];
extern s16 currentScreenSection;
}
const course_texture block_fort_textures[] = {
{ gTexture64286C, 0x010A, 0x0800, 0x0 }, { gTextureGrayCheckerboard, 0x010C, 0x0800, 0x0 },
{ gTextureGrayCobblestone, 0x010C, 0x0800, 0x0 }, { gTexture64275C, 0x0110, 0x0800, 0x0 },
{ gTexture642978, 0x010D, 0x0800, 0x0 }, { gTexture6747C4, 0x0145, 0x0800, 0x0 },
{ gTexture6442D4, 0x0138, 0x0800, 0x0 }, { 0x00000000, 0x0000, 0x0000, 0x0 },
};
BlockFort::BlockFort() {
this->vtx = d_course_block_fort_vertex;
this->gfx = d_course_block_fort_packed_dls;
this->gfxSize = 699;
this->textures = block_fort_textures;
Props.textures = block_fort_textures;
Props.MinimapTexture = gTextureCourseOutlineBlockFort;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
+76 -44
View File
@@ -4,10 +4,10 @@
#include <memory>
#include "BowsersCastle.h"
#include "GameObject.h"
#include "World.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "engine/objects/Thwomp.h"
#include "bowsers_castle_data.h"
extern "C" {
@@ -34,11 +34,43 @@ extern "C" {
extern const char *bowsers_castle_dls[];
}
const course_texture bowsers_castle_textures[] = {
{ gTexture64313C, 0x01B8, 0x0800, 0x0 },
{ gTexture6528DC, 0x0278, 0x0800, 0x0 },
{ gTexture66ED38, 0x010E, 0x0800, 0x0 },
{ gTexture676C6C, 0x0110, 0x0800, 0x0 },
{ gTexture676EA8, 0x0108, 0x0800, 0x0 },
{ gTexture679D34, 0x0106, 0x0800, 0x0 },
{ gTextureGrass6, 0x023B, 0x0800, 0x0 },
{ gTexture6522E0, 0x05FC, 0x0800, 0x0 },
{ gTexture651F40, 0x039F, 0x0800, 0x0 },
{ gTextureRoofTile, 0x0129, 0x0800, 0x0 },
{ gTextureSignBowser0, 0x07D0, 0x1000, 0x0 },
{ gTextureSignBowser1, 0x064D, 0x1000, 0x0 },
{ gTexture66ABA4, 0x0312, 0x0800, 0x0 },
{ gTexture66EBF0, 0x0146, 0x0800, 0x0 },
{ gTexture6733CC, 0x020E, 0x0800, 0x0 },
{ gTexture673118, 0x02B1, 0x0800, 0x0 },
{ gTexture673FF8, 0x035B, 0x0800, 0x0 },
{ gTexture674B28, 0x0230, 0x0800, 0x0 },
{ gTextureSignGreenArrow, 0x025B, 0x1000, 0x0 },
{ gTexture68D834, 0x010A, 0x0800, 0x0 },
{ gTexture676D7C, 0x012C, 0x0800, 0x0 },
{ gTexture67ADF0, 0x0595, 0x0800, 0x0 },
{ gTexture67EFEC, 0x016F, 0x0800, 0x0 },
{ gTexture653DB0, 0x06AE, 0x0800, 0x0 },
{ gTexture66CA98, 0x02C9, 0x0800, 0x0 },
{ gTexture673990, 0x02D8, 0x0800, 0x0 },
{ gTexture67A370, 0x05AA, 0x0800, 0x0 },
{ gTexture67A91C, 0x04D1, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
BowsersCastle::BowsersCastle() {
this->vtx = d_course_bowsers_castle_vertex;
this->gfx = d_course_bowsers_castle_packed_dls;
this->gfxSize = 4900;
this->textures = bowsers_castle_textures;
Props.textures = bowsers_castle_textures;
Props.MinimapTexture = gTextureCourseOutlineBowsersCastle;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
@@ -122,6 +154,47 @@ void BowsersCastle::SpawnActors() {
spawn_foliage((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_bowsers_castle_tree_spawn));
spawn_all_item_boxes((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_bowsers_castle_item_box_spawns));
switch (gCCSelection) {
case CC_100:
case CC_EXTRA:
gWorldInstance.AddObject(new OThwomp(0x0320, 0xf92a, 0xC000, 1.0f, 1, 0));
gWorldInstance.AddObject(new OThwomp(0x044c, 0xf92a, 0xC000, 1.0f, 1, 1));
gWorldInstance.AddObject(new OThwomp(0x02bc, 0xf95c, 0xC000, 1.0f, 2, 0));
gWorldInstance.AddObject(new OThwomp(0x04b0, 0xf8f8, 0xC000, 1.0f, 2, 1));
gWorldInstance.AddObject(new OThwomp(0x04b0, 0xf5ba, 0xC000, 1.0f, 3, 0));
gWorldInstance.AddObject(new OThwomp(0x04b0, 0xf592, 0xC000, 1.0f, 3, 1));
gWorldInstance.AddObject(new OThwomp(0x091a, 0xf5bf, 0xC000, 1.0f, 4, 0));
gWorldInstance.AddObject(new OThwomp(0x091a, 0xf597, 0xC000, 1.0f, 4, 1));
gWorldInstance.AddObject(new OThwomp(0x0596, 0xf92f, 0xC000, 1.5f, 6, 0));
gWorldInstance.AddObject(new OThwomp(0x082a, 0xf9f2, 0x4000, 1.0f, 5, 0));
gWorldInstance.AddObject(new OThwomp(0x073a, 0xf9f2, 0x4000, 1.0f, 5, 1));
break;
case CC_50:
gWorldInstance.AddObject(new OThwomp(0x3B6, 0xF92A, 0xC000, 1.0f, 1, 0));
gWorldInstance.AddObject(new OThwomp(0x0352, 0xf95c, 0xC000, 1.0f, 2, 0));
gWorldInstance.AddObject(new OThwomp(0x04b0, 0xf5ba, 0xC000, 1.0f, 3, 0));
gWorldInstance.AddObject(new OThwomp(0x04b0, 0xf592, 0xC000, 1.0f, 3, 1));
gWorldInstance.AddObject(new OThwomp(0x091a, 0xf5b0, 0xC000, 1.0f, 4, 0));
gWorldInstance.AddObject(new OThwomp(0x0596, 0xf92f, 0xC000, 1.5f, 6, 0));
gWorldInstance.AddObject(new OThwomp(0x082a, 0xf9f2, 0x4000, 1.0f, 5, 0));
gWorldInstance.AddObject(new OThwomp(0x073a, 0xf9f2, 0x4000, 1.0f, 5, 1));
break;
case CC_150:
gWorldInstance.AddObject(new OThwomp(0x0320, 0xf92a, 0xC000, 1.0f, 1, 0));
gWorldInstance.AddObject(new OThwomp(0x044c, 0xf92a, 0xC000, 1.0f, 1, 1));
gWorldInstance.AddObject(new OThwomp(0x02bc, 0xf95c, 0xC000, 1.0f, 2, 0));
gWorldInstance.AddObject(new OThwomp(0x04b0, 0xf8f8, 0xC000, 1.0f, 2, 1));
gWorldInstance.AddObject(new OThwomp(0x04b0, 0xf5ba, 0xC000, 1.0f, 3, 0));
gWorldInstance.AddObject(new OThwomp(0x04b0, 0xf592, 0xC000, 1.0f, 3, 1));
gWorldInstance.AddObject(new OThwomp(0x091a, 0xf5c9, 0xC000, 1.0f, 4, 0));
gWorldInstance.AddObject(new OThwomp(0x091a, 0xf5ab, 0xC000, 1.0f, 4, 1));
gWorldInstance.AddObject(new OThwomp(0x091a, 0xf58d, 0xC000, 1.0f, 4, 2));
gWorldInstance.AddObject(new OThwomp(0x0596, 0xf92f, 0xC000, 1.5f, 6, 0));
gWorldInstance.AddObject(new OThwomp(0x082a, 0xf9f2, 0x4000, 1.0f, 5, 0));
gWorldInstance.AddObject(new OThwomp(0x073a, 0xf9f2, 0x4000, 1.0f, 5, 1));
break;
}
}
void BowsersCastle::SpawnVehicles() {
@@ -150,47 +223,6 @@ void BowsersCastle::InitCourseObjects() {
size_t objectId;
size_t i;
switch (gCCSelection) {
case CC_100:
case CC_EXTRA:
gWorldInstance.AddThwomp(0x0320, 0xf92a, 0xC000, 1.0f, 1, 0);
gWorldInstance.AddThwomp(0x044c, 0xf92a, 0xC000, 1.0f, 1, 1);
gWorldInstance.AddThwomp(0x02bc, 0xf95c, 0xC000, 1.0f, 2, 0);
gWorldInstance.AddThwomp(0x04b0, 0xf8f8, 0xC000, 1.0f, 2, 1);
gWorldInstance.AddThwomp(0x04b0, 0xf5ba, 0xC000, 1.0f, 3, 0);
gWorldInstance.AddThwomp(0x04b0, 0xf592, 0xC000, 1.0f, 3, 1);
gWorldInstance.AddThwomp(0x091a, 0xf5bf, 0xC000, 1.0f, 4, 0);
gWorldInstance.AddThwomp(0x091a, 0xf597, 0xC000, 1.0f, 4, 1);
gWorldInstance.AddThwomp(0x0596, 0xf92f, 0xC000, 1.5f, 6, 0);
gWorldInstance.AddThwomp(0x082a, 0xf9f2, 0x4000, 1.0f, 5, 0);
gWorldInstance.AddThwomp(0x073a, 0xf9f2, 0x4000, 1.0f, 5, 1);
break;
case CC_50:
gWorldInstance.AddThwomp(0x3B6, 0xF92A, 0xC000, 1.0f, 1, 0);
gWorldInstance.AddThwomp(0x0352, 0xf95c, 0xC000, 1.0f, 2, 0);
gWorldInstance.AddThwomp(0x04b0, 0xf5ba, 0xC000, 1.0f, 3, 0);
gWorldInstance.AddThwomp(0x04b0, 0xf592, 0xC000, 1.0f, 3, 1);
gWorldInstance.AddThwomp(0x091a, 0xf5b0, 0xC000, 1.0f, 4, 0);
gWorldInstance.AddThwomp(0x0596, 0xf92f, 0xC000, 1.5f, 6, 0);
gWorldInstance.AddThwomp(0x082a, 0xf9f2, 0x4000, 1.0f, 5, 0);
gWorldInstance.AddThwomp(0x073a, 0xf9f2, 0x4000, 1.0f, 5, 1);
break;
case CC_150:
gWorldInstance.AddThwomp(0x0320, 0xf92a, 0xC000, 1.0f, 1, 0);
gWorldInstance.AddThwomp(0x044c, 0xf92a, 0xC000, 1.0f, 1, 1);
gWorldInstance.AddThwomp(0x02bc, 0xf95c, 0xC000, 1.0f, 2, 0);
gWorldInstance.AddThwomp(0x04b0, 0xf8f8, 0xC000, 1.0f, 2, 1);
gWorldInstance.AddThwomp(0x04b0, 0xf5ba, 0xC000, 1.0f, 3, 0);
gWorldInstance.AddThwomp(0x04b0, 0xf592, 0xC000, 1.0f, 3, 1);
gWorldInstance.AddThwomp(0x091a, 0xf5c9, 0xC000, 1.0f, 4, 0);
gWorldInstance.AddThwomp(0x091a, 0xf5ab, 0xC000, 1.0f, 4, 1);
gWorldInstance.AddThwomp(0x091a, 0xf58d, 0xC000, 1.0f, 4, 2);
gWorldInstance.AddThwomp(0x0596, 0xf92f, 0xC000, 1.5f, 6, 0);
gWorldInstance.AddThwomp(0x082a, 0xf9f2, 0x4000, 1.0f, 5, 0);
gWorldInstance.AddThwomp(0x073a, 0xf9f2, 0x4000, 1.0f, 5, 1);
break;
}
// Handle the big statue's fire breath
objectId = indexObjectList2[0];
init_object(objectId, 0);
+27 -3
View File
@@ -4,9 +4,8 @@
#include <memory>
#include "ChocoMountain.h"
#include "GameObject.h"
#include "World.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "choco_mountain_data.h"
#include "engine/actors/AFinishline.h"
@@ -31,14 +30,39 @@ extern "C" {
#include "collision.h"
#include "code_8003DC40.h"
#include "memory.h"
#include "course_offsets.h"
extern const char *choco_mountain_dls[];
}
const course_texture choco_mountain_textures[] = {
{ gTexture64619C, 0x0124, 0x0800, 0x0 },
{ gTexture64647C, 0x0829, 0x1000, 0x0 },
{ gTexture647F4C, 0x05BC, 0x1000, 0x0 },
{ gTexture64FBF4, 0x0274, 0x0800, 0x0 },
{ gTexture653DB0, 0x06AE, 0x0800, 0x0 },
{ gTexture652B54, 0x0606, 0x0800, 0x0 },
{ gTexture65315C, 0x04A9, 0x0800, 0x0 },
{ gTexture6684F8, 0x010D, 0x0800, 0x0 },
{ gTextureSignLuigis0, 0x0287, 0x1000, 0x0 },
{ gTextureSignLuigis1, 0x02AF, 0x1000, 0x0 },
{ gTextureSignNintendoRed0, 0x02A6, 0x1000, 0x0 },
{ gTextureSignNintendoRed1, 0x02F7, 0x1000, 0x0 },
{ gTexture6774D8, 0x0113, 0x0800, 0x0 },
{ gTextureSignFallingRocks, 0x012C, 0x0800, 0x0 },
{ gTextureSignBackside, 0x011E, 0x0800, 0x0 },
{ gTexture679C04, 0x012F, 0x0800, 0x0 },
{ gTexture67B864, 0x014C, 0x0800, 0x0 },
{ gTexture67DC20, 0x03EF, 0x0800, 0x0 },
{ gTextureSignYoshi, 0x04DF, 0x1000, 0x0 },
{ gTextureCheckerboardBlueGray, 0x04A1, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
ChocoMountain::ChocoMountain() {
this->vtx = d_course_choco_mountain_vertex;
this->gfx = d_course_choco_mountain_packed_dls;
this->gfxSize = 2910;
this->textures = choco_mountain_textures;
Props.textures = choco_mountain_textures;
Props.MinimapTexture = gTextureCourseOutlineChocoMountain;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
+6 -4
View File
@@ -28,6 +28,7 @@ Course::Course() {
// Props.CourseLength = "567m";
// Props.Cup = FLOWER_CUP;
// Props.CupIndex = 3;
Props.LakituTowType = (s32)OLakitu::LakituTowType::NORMAL;
Props.AIBehaviour = D_0D008F28;
Props.AIMaximumSeparation = 50.0f;
Props.AIMinimumSeparation = 0.3f;
@@ -94,7 +95,7 @@ void Course::Load() {
func_802A86A8(reinterpret_cast<CourseVtx*>(LOAD_ASSET_RAW(this->vtx)), vtx, vtxSize / sizeof(Vtx));
// Load and allocate memory for course textures
const course_texture* asset = this->textures;
const course_texture* asset = this->Props.textures;
u8* freeMemory = NULL;
u8* texture = NULL;
size_t size = 0;
@@ -103,12 +104,13 @@ void Course::Load() {
size = ResourceGetTexSizeByName(asset->addr);
freeMemory = (u8*) allocate_memory(size);
texture = reinterpret_cast<u8*>(LOAD_ASSET_RAW(asset->addr));
texture = (u8*)(asset->addr);
if (texture) {
if (asset == &textures[0]) {
if (asset == &this->Props.textures[0]) {
gSegmentTable[5] = reinterpret_cast<uintptr_t>(&freeMemory[0]);
}
memcpy(freeMemory, texture, size);
strcpy(reinterpret_cast<char*>(freeMemory), asset->addr);
//memcpy(freeMemory, texture, size);
texSegSize += size;
// printf("Texture Addr: 0x%llX, size 0x%X\n", &freeMemory[0], size);
}
+3 -1
View File
@@ -6,7 +6,7 @@
// C-compatible function declaration
#ifdef __cplusplus
//#include "World.h"
#include "engine/objects/Lakitu.h"
extern "C" {
#endif
@@ -56,6 +56,7 @@ public:
const char* CourseLength;
const char* AIBehaviour;
const char* MinimapTexture;
s32 LakituTowType;
s16 D_800E5548[2];
float AIMaximumSeparation;
float AIMinimumSeparation;
@@ -75,6 +76,7 @@ public:
int32_t MinimapFinishlineX;
int32_t MinimapFinishlineY;
SkyboxColours Skybox;
const course_texture *textures;
MusicSeq Sequence;
} Properties;
+32 -4
View File
@@ -4,12 +4,12 @@
#include <memory>
#include "DKJungle.h"
#include "GameObject.h"
#include "World.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "assets/dks_jungle_parkway_data.h"
#include "engine/vehicles/Boat.h"
#include "engine/vehicles/Utils.h"
extern "C" {
@@ -38,11 +38,39 @@ extern "C" {
extern s16 currentScreenSection;
}
const course_texture dks_jungle_parkway_textures[] = {
{ gTexture648508, 0x01FE, 0x1000, 0x0 },
{ gTexture6684F8, 0x010D, 0x0800, 0x0 },
{ gTextureWoodBridgeSlats, 0x0DAB, 0x1000, 0x0 },
{ gTexture654460, 0x0B12, 0x1000, 0x0 },
{ gTexture654F74, 0x0A24, 0x1000, 0x0 },
{ gTexture655998, 0x059F, 0x0800, 0x0 },
{ gTexture655F38, 0x0BB9, 0x1000, 0x0 },
{ gTexture656AF4, 0x0AD3, 0x1000, 0x0 },
{ gTexture6575C8, 0x0DA7, 0x1000, 0x0 },
{ gTexture658370, 0x0DBA, 0x1000, 0x0 },
{ gTexture65912C, 0x0DBC, 0x1000, 0x0 },
{ gTexture659EE8, 0x0EF5, 0x1000, 0x0 },
{ gTexture65ADE0, 0x0D5A, 0x1000, 0x0 },
{ gTexture65BB3C, 0x0D9E, 0x1000, 0x0 },
{ gTexture65C8DC, 0x0CF5, 0x1000, 0x0 },
{ gTexture65D5D4, 0x0D18, 0x1000, 0x0 },
{ gTexture65E2EC, 0x02B0, 0x0800, 0x0 },
{ gTexture65EAEC, 0x034A, 0x0800, 0x0 },
{ gTexture65E59C, 0x054F, 0x1000, 0x0 },
{ gTexture65EE38, 0x0CDE, 0x1000, 0x0 },
{ gTexture65FB18, 0x03EE, 0x0800, 0x0 },
{ gTextureSignPinkArrow, 0x0198, 0x0800, 0x0 },
{ gTextureWaves0, 0x04D0, 0x0800, 0x0 },
{ gTexture683844, 0x0655, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
DKJungle::DKJungle() {
this->vtx = d_course_dks_jungle_parkway_vertex;
this->gfx = d_course_dks_jungle_parkway_packed_dls;
this->gfxSize = 4997;
this->textures = dks_jungle_parkway_textures;
Props.textures = dks_jungle_parkway_textures;
Props.MinimapTexture = gTextureCourseOutlineDksJungleParkway;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
@@ -251,7 +279,7 @@ void DKJungle::SpawnVehicles() {
// The original game only ran vehicle logic every second frame.
// Thus the speed gets divided by two to set speed to match properly
gWorldInstance.AddBoat((0.6666666f)/4, 0);
gWorldInstance.AddVehicle(new ABoat((0.6666666f)/4, 0));
if (gModeSelection == VERSUS) {
Vec3f pos = {0, 0, 0};
+8 -3
View File
@@ -4,9 +4,8 @@
#include <memory>
#include "DoubleDeck.h"
#include "GameObject.h"
#include "World.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "assets/double_deck_data.h"
extern "C" {
@@ -33,11 +32,17 @@ extern "C" {
extern s16 currentScreenSection;
}
const course_texture double_deck_textures[] = {
{ gTextureGrayCobblestone, 0x010C, 0x0800, 0x0 },
{ gTexture642978, 0x010D, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
DoubleDeck::DoubleDeck() {
this->vtx = d_course_double_deck_vertex;
this->gfx = d_course_double_deck_packed_dls;
this->gfxSize = 699;
this->textures = double_deck_textures;
Props.textures = double_deck_textures;
Props.MinimapTexture = gTextureCourseOutlineDoubleDeck;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
+34 -24
View File
@@ -4,10 +4,10 @@
#include <memory>
#include "FrappeSnowland.h"
#include "GameObject.h"
#include "World.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "engine/objects/Snowman.h"
#include "assets/frappe_snowland_data.h"
#include "assets/boo_frames.h"
@@ -32,15 +32,24 @@ extern "C" {
#include "collision.h"
#include "memory.h"
#include "update_objects.h"
#include "course_offsets.h"
extern const char *d_course_frappe_snowland_dl_list[];
extern s8 gPlayerCount;
}
const course_texture frappe_snowland_textures[] = {
{ gTexture6684F8, 0x010D, 0x0800, 0x0 }, { gTexture66CA98, 0x02C9, 0x0800, 0x0 },
{ gTexture66EBF0, 0x0146, 0x0800, 0x0 }, { gTexture675434, 0x0245, 0x0800, 0x0 },
{ gTexture677F04, 0x0213, 0x0800, 0x0 }, { gTexture678118, 0x0314, 0x0800, 0x0 },
{ gTexture679258, 0x04E3, 0x1000, 0x0 }, { gTexture67973C, 0x04C6, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
FrappeSnowland::FrappeSnowland() {
this->vtx = d_course_frappe_snowland_vertex;
this->gfx = d_course_frappe_snowland_packed_dls;
this->gfxSize = 4140;
this->textures = frappe_snowland_textures;
Props.textures = frappe_snowland_textures;
Props.MinimapTexture = gTextureCourseOutlineFrappeSnowland;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
@@ -123,6 +132,28 @@ void FrappeSnowland::SpawnActors() {
spawn_foliage((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_frappe_snowland_tree_spawns));
spawn_all_item_boxes((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_frappe_snowland_item_box_spawns));
if (gGamestate != CREDITS_SEQUENCE) {
gWorldInstance.AddObject(new OSnowman(FVector(697, 0, -1684)));
gWorldInstance.AddObject(new OSnowman(FVector(82, 0, -2245)));
gWorldInstance.AddObject(new OSnowman(FVector(27, 5, -2067)));
gWorldInstance.AddObject(new OSnowman(FVector(-656, 0, -1735)));
gWorldInstance.AddObject(new OSnowman(FVector(-1497, 0, -83)));
gWorldInstance.AddObject(new OSnowman(FVector(-1643, 0, -25)));
gWorldInstance.AddObject(new OSnowman(FVector(-1547, 0, -20)));
gWorldInstance.AddObject(new OSnowman(FVector(-1445, 0, -10)));
gWorldInstance.AddObject(new OSnowman(FVector(-1502, 0, 61)));
gWorldInstance.AddObject(new OSnowman(FVector(-1429, 0, 79)));
gWorldInstance.AddObject(new OSnowman(FVector(-1586, 0, 71)));
gWorldInstance.AddObject(new OSnowman(FVector(-1471, 0, 157)));
gWorldInstance.AddObject(new OSnowman(FVector(-1539, 0, 175)));
gWorldInstance.AddObject(new OSnowman(FVector(-1484, 0, 303)));
gWorldInstance.AddObject(new OSnowman(FVector(-1442, 0, 358)));
gWorldInstance.AddObject(new OSnowman(FVector(-1510, 0, 426)));
gWorldInstance.AddObject(new OSnowman(FVector(-665, 0, 830)));
gWorldInstance.AddObject(new OSnowman(FVector(-701, 3, 853)));
gWorldInstance.AddObject(new OSnowman(FVector(-602, 0, 929)));
}
}
void FrappeSnowland::SpawnVehicles() {
@@ -176,34 +207,13 @@ void FrappeSnowland::InitCourseObjects() {
for (i = 0; i < NUM_SNOWFLAKES; i++) {
find_unused_obj_index(&gObjectParticle1[i]);
}
if (gGamestate != CREDITS_SEQUENCE) {
for (i = 0; i < NUM_SNOWMEN; i++) {
objectId = indexObjectList2[i];
init_object(objectId, 0);
gObjectList[objectId].origin_pos[0] = gSnowmanSpawns[i].pos[0] * xOrientation;
gObjectList[objectId].origin_pos[1] = gSnowmanSpawns[i].pos[1] + 5.0 + 3.0;
gObjectList[objectId].origin_pos[2] = gSnowmanSpawns[i].pos[2];
objectId = indexObjectList1[i];
init_object(objectId, 0);
gObjectList[objectId].origin_pos[0] = gSnowmanSpawns[i].pos[0] * xOrientation;
gObjectList[objectId].origin_pos[1] = gSnowmanSpawns[i].pos[1] + 3.0;
gObjectList[objectId].origin_pos[2] = gSnowmanSpawns[i].pos[2];
gObjectList[objectId].unk_0D5 = gSnowmanSpawns[i].unk_6;
}
}
}
void FrappeSnowland::UpdateCourseObjects() {
if (gGamestate != CREDITS_SEQUENCE) {
update_snowmen();
}
update_snowflakes();
}
void FrappeSnowland::RenderCourseObjects(s32 cameraId) {
if (gGamestate != CREDITS_SEQUENCE) {
render_object_snowmans(cameraId);
}
}
void FrappeSnowland::SomeSounds() {
+20 -4
View File
@@ -4,13 +4,13 @@
#include <memory>
#include "KalimariDesert.h"
#include "GameObject.h"
#include "World.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "kalimari_desert_data.h"
#include "engine/vehicles/Utils.h"
#include "engine/vehicles/Train.h"
#include "engine/vehicles/Vehicle.h"
extern "C" {
@@ -36,11 +36,27 @@ extern "C" {
extern const char *kalimari_desert_dls[];
}
const course_texture kalimari_desert_textures[] = {
{ gTexture6684F8, 0x010D, 0x0800, 0x0 }, { gTextureSignLuigis0, 0x0287, 0x1000, 0x0 },
{ gTextureSignLuigis1, 0x02AF, 0x1000, 0x0 }, { gTextureSignMarioStar0, 0x02D2, 0x1000, 0x0 },
{ gTextureSignMarioStar1, 0x02B1, 0x1000, 0x0 }, { gTextureSignNintendoRed0, 0x02A6, 0x1000, 0x0 },
{ gTextureSignNintendoRed1, 0x02F7, 0x1000, 0x0 }, { gTexture67490C, 0x021C, 0x0800, 0x0 },
{ gTextureSignYoshi, 0x04DF, 0x1000, 0x0 }, { gTextureCheckerboardBlueGray, 0x04A1, 0x1000, 0x0 },
{ gTexture646CA8, 0x073A, 0x1000, 0x0 }, { gTexture6473E4, 0x05AD, 0x1000, 0x0 },
{ gTexture647994, 0x05B5, 0x1000, 0x0 }, { gTexture668920, 0x03D9, 0x0800, 0x0 },
{ gTextureRailroadTrack, 0x0B5B, 0x1000, 0x0 }, { gTextureRailroadCrossingTrack, 0x0208, 0x1000, 0x0 },
{ gTexture67291C, 0x059C, 0x0800, 0x0 }, { gTextureFenceBarbedWire, 0x021E, 0x1000, 0x0 },
{ gTexture67D304, 0x091C, 0x1000, 0x0 }, { gTexture67E010, 0x0415, 0x0800, 0x0 },
{ gTexture67EEAC, 0x0140, 0x0800, 0x0 }, { gTextureSignShellShot0, 0x038C, 0x1000, 0x0 },
{ gTextureSignShellShot1, 0x0247, 0x1000, 0x0 }, { gTextureSignKoopaAir0, 0x0360, 0x1000, 0x0 },
{ gTextureSignKoopaAir1, 0x0304, 0x1000, 0x0 }, { 0x00000000, 0x0000, 0x0000, 0x0 },
};
KalimariDesert::KalimariDesert() {
this->vtx = d_course_kalimari_desert_vertex;
this->gfx = d_course_kalimari_desert_packed_dls;
this->gfxSize = 5328;
this->textures = kalimari_desert_textures;
Props.textures = kalimari_desert_textures;
Props.MinimapTexture = gTextureCourseOutlineKalimariDesert;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 96;
@@ -222,7 +238,7 @@ void KalimariDesert::SpawnVehicles() {
}
}
gWorldInstance.AddTrain(_tender, _numCarriages, 2.5f, waypoint);
gWorldInstance.AddVehicle(new ATrain(_tender, _numCarriages, 2.5f, waypoint));
}
if (gModeSelection == VERSUS) {
+61 -32
View File
@@ -4,10 +4,10 @@
#include <memory>
#include "KoopaTroopaBeach.h"
#include "GameObject.h"
#include "World.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "engine/objects/Crab.h"
#include "assets/koopa_troopa_beach_data.h"
extern "C" {
@@ -35,11 +35,31 @@ extern "C" {
extern s8 gPlayerCount;
}
const course_texture koopa_troopa_beach_textures[] = {
{ gTexture643B3C, 0x0798, 0x0800, 0x0 },
{ gTexture66A3DC, 0x07C5, 0x0800, 0x0 },
{ gTextureSignWoodRedArrow, 0x04E1, 0x1000, 0x0 },
{ gTexture66DD38, 0x0330, 0x1000, 0x0 },
{ gTexture643430, 0x0604, 0x0800, 0x0 },
{ gTexture660D8C, 0x0126, 0x0800, 0x0 },
{ gTexture6609D0, 0x03BB, 0x1000, 0x0 },
{ gTextureGrass12, 0x0874, 0x0800, 0x0 },
{ gTexture66CA98, 0x02C9, 0x0800, 0x0 },
{ gTexture66EBF0, 0x0146, 0x0800, 0x0 },
{ gTexture67BEE8, 0x02D0, 0x0800, 0x0 },
{ gTextureSandFinish, 0x022E, 0x0800, 0x0 },
{ gTextureWheelSteamEngine, 0x020F, 0x0800, 0x0 },
{ gTexture669570, 0x0E6B, 0x1000, 0x0 },
{ gTextureWaves1, 0x05C4, 0x0800, 0x0 },
{ gTextureWaves2, 0x0488, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
KoopaTroopaBeach::KoopaTroopaBeach() {
this->vtx = d_course_koopa_troopa_beach_vertex;
this->gfx = d_course_koopa_troopa_beach_packed_dls;
this->gfxSize = 5720;
this->textures = koopa_troopa_beach_textures;
Props.textures = koopa_troopa_beach_textures;
Props.MinimapTexture = gTextureCourseOutlineKoopaTroopaBeach;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
@@ -125,6 +145,39 @@ void KoopaTroopaBeach::SpawnActors() {
init_actor_hot_air_balloon_item_box(328.0f * gCourseDirection, 70.0f, 2541.0f);
spawn_all_item_boxes((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_koopa_troopa_beach_item_box_spawns));
spawn_palm_trees((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_koopa_troopa_beach_tree_spawn));
if (gGamestate != CREDITS_SEQUENCE) {
gWorldInstance.AddObject(new OCrab(FVector2D(-1809, 625), FVector2D(-1666, 594)));
gWorldInstance.AddObject(new OCrab(FVector2D(-1852, 757), FVector2D(-1620, 740)));
gWorldInstance.AddObject(new OCrab(FVector2D(-1478, 1842), FVector2D(-1453, 1833)));
gWorldInstance.AddObject(new OCrab(FVector2D(-1418, 1967), FVector2D(-1455, 1962)));
gWorldInstance.AddObject(new OCrab(FVector2D(-1472, 2112), FVector2D(-1417, 2100)));
gWorldInstance.AddObject(new OCrab(FVector2D(-1389, 2152), FVector2D(-1335, 2136)));
gWorldInstance.AddObject(new OCrab(FVector2D(218, 693), FVector2D(69, 696)));
gWorldInstance.AddObject(new OCrab(FVector2D(235, 528), FVector2D(24, 501)));
gWorldInstance.AddObject(new OCrab(FVector2D(268, 406), FVector2D(101, 394)));
gWorldInstance.AddObject(new OCrab(FVector2D(223, 318), FVector2D(86, 308)));
}
if (gGamestate == CREDITS_SEQUENCE) {
for (size_t i = 0; i < NUM_SEAGULLS; i++) {
//gWorldInstance.AddObject(new OSeagull(FVector(-360.0f, 60.0f, -1300.0f)));
Vec3f pos = {-360.0f, 60.0f, -1300.0f};
gWorldInstance.AddObject(new OSeagull(pos));
}
} else { // Normal gameplay
for (size_t i = 0; i < 4; i++) {
Vec3f pos = {-985.0f, 15.0f, 1200.0f};
gWorldInstance.AddObject(new OSeagull(pos));
//gWorldInstance.AddObject(new OSeagull(FVector(-985.0f, 15.0f, 1200.0f)));
}
for (size_t i = 0; i < 6; i++) {
//gWorldInstance.AddObject(new OSeagull(FVector(328.0f, 20.0f, 2541.0f)));
Vec3f pos2 = {328.0f, 20.0f, 2541.0f};
gWorldInstance.AddObject(new OSeagull(pos2));
}
}
}
void KoopaTroopaBeach::SpawnVehicles() {
@@ -151,52 +204,28 @@ void KoopaTroopaBeach::MinimapSettings() {
}
void KoopaTroopaBeach::InitCourseObjects() {
size_t objectId;
size_t i;
if (gGamestate != CREDITS_SEQUENCE) {
for (i = 0; i < NUM_CRABS; i++) {
objectId = indexObjectList1[i];
init_object(objectId, 0);
gObjectList[objectId].pos[0] = gObjectList[objectId].origin_pos[0] =
gCrabSpawns[i].startX * xOrientation;
gObjectList[objectId].unk_01C[0] = gCrabSpawns[i].patrolX * xOrientation;
gObjectList[objectId].pos[2] = gObjectList[objectId].origin_pos[2] = gCrabSpawns[i].startZ;
gObjectList[objectId].unk_01C[2] = gCrabSpawns[i].patrolZ;
}
}
for (i = 0; i < NUM_SEAGULLS; i++) {
objectId = indexObjectList2[i];
init_object(objectId, 0);
if (i < (NUM_SEAGULLS / 2)) {
gObjectList[objectId].unk_0D5 = 0;
} else {
gObjectList[objectId].unk_0D5 = 1;
}
}
}
void KoopaTroopaBeach::UpdateCourseObjects() {
if (gGamestate != CREDITS_SEQUENCE) {
update_crabs();
//update_crabs();
}
if ((gPlayerCount == 1) || (gPlayerCount == 2) || (gGamestate == CREDITS_SEQUENCE)) {
update_seagulls();
//update_seagulls();
}
}
void KoopaTroopaBeach::RenderCourseObjects(s32 cameraId) {
if (gGamestate != CREDITS_SEQUENCE) {
render_object_crabs(cameraId);
//render_object_crabs(cameraId);
}
if (gGamestate != CREDITS_SEQUENCE) {
if ((gPlayerCount == 1) || (gPlayerCount == 2)) {
render_object_seagulls(cameraId);
//render_object_seagulls(cameraId);
}
} else {
render_object_seagulls(cameraId);
//render_object_seagulls(cameraId);
}
}
+2
View File
@@ -3,6 +3,8 @@
#include <libultraship.h>
#include "Course.h"
#include "World.h"
extern "C" {
#include "assets/koopa_troopa_beach_vertices.h"
#include "assets/koopa_troopa_beach_displaylists.h"
+54 -11
View File
@@ -4,10 +4,10 @@
#include <memory>
#include "LuigiRaceway.h"
#include "GameObject.h"
#include "World.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "assets/luigi_raceway_data.h"
#include "engine/objects/HotAirBalloon.h"
#include "engine/actors/AFinishline.h"
extern "C" {
@@ -38,11 +38,55 @@ extern "C" {
extern s16 currentScreenSection;
}
const course_texture luigi_raceway_textures[] = {
{ gTextureSignShellShot0, 0x038C, 0x1000, 0x0 },
{ gTextureSignShellShot1, 0x0247, 0x1000, 0x0 },
{ gTextureCheckerboardYellowBlue, 0x013A, 0x0800, 0x0 },
{ gTexture64619C, 0x0124, 0x0800, 0x0 },
{ gTextureCheckerboardBlueGreen, 0x0139, 0x0800, 0x0 },
{ gTextureGrass3, 0x0372, 0x0800, 0x0 },
{ gTextureFlagRed, 0x019E, 0x0800, 0x0 },
{ gTexture65100C, 0x0120, 0x0800, 0x0 },
{ gTexture65112C, 0x0150, 0x0800, 0x0 },
{ gTexture653608, 0x07A7, 0x0800, 0x0 },
{ gTextureGrass11, 0x01F8, 0x0800, 0x0 },
{ gTextureSignLuigiFace0, 0x05C9, 0x1000, 0x0 },
{ gTextureSignLuigiFace1, 0x065F, 0x1000, 0x0 },
{ gTexture66C7A8, 0x0149, 0x0800, 0x0 },
{ gTexture670AC8, 0x0FBF, 0x1000, 0x0 },
{ gTexture671A88, 0x012D, 0x0800, 0x0 },
{ gTexture6735DC, 0x03B1, 0x0800, 0x0 },
{ gTexture673C68, 0x038D, 0x0800, 0x0 },
{ gTexture6747C4, 0x0145, 0x0800, 0x0 },
{ gTextureRoad1, 0x02D2, 0x1000, 0x0 },
{ gTextureRoad2, 0x02AE, 0x1000, 0x0 },
{ gTextureRoadFinish1, 0x026B, 0x1000, 0x0 },
{ gTexture67BBD8, 0x0310, 0x0800, 0x0 },
{ gTexture68272C, 0x01F9, 0x1000, 0x0 },
{ gTexture682928, 0x01F9, 0x1000, 0x0 },
{ gTexture682B24, 0x01F9, 0x1000, 0x0 },
{ gTexture682D20, 0x01F9, 0x1000, 0x0 },
{ gTexture682F1C, 0x01F9, 0x1000, 0x0 },
{ gTexture683118, 0x01F9, 0x1000, 0x0 },
{ gTextureSignBlue64, 0x0567, 0x1000, 0x0 },
{ gTextureSignKoopaAir0, 0x0360, 0x1000, 0x0 },
{ gTextureSignKoopaAir1, 0x0304, 0x1000, 0x0 },
{ gTextureSignLuigis0, 0x0287, 0x1000, 0x0 },
{ gTextureSignLuigis1, 0x02AF, 0x1000, 0x0 },
{ gTextureSignMarioStar0, 0x02D2, 0x1000, 0x0 },
{ gTextureSignMarioStar1, 0x02B1, 0x1000, 0x0 },
{ gTextureSignNintendoRed0, 0x02A6, 0x1000, 0x0 },
{ gTextureSignNintendoRed1, 0x02F7, 0x1000, 0x0 },
{ gTextureSignYoshi, 0x04DF, 0x1000, 0x0 },
{ gTextureCheckerboardBlueGray, 0x04A1, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
LuigiRaceway::LuigiRaceway() {
this->vtx = d_course_luigi_raceway_vertex;
this->gfx = d_course_luigi_raceway_packed_dls;
this->gfxSize = 6377;
this->textures = luigi_raceway_textures;
Props.textures = luigi_raceway_textures;
Props.MinimapTexture = gTextureCourseOutlineLuigiRaceway;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 96;
@@ -125,6 +169,12 @@ void LuigiRaceway::SpawnActors() {
gWorldInstance.AddActor(new AFinishline());
spawn_foliage((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_luigi_raceway_tree_spawn));
spawn_all_item_boxes((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_luigi_raceway_item_box_spawns));
if (gGamestate == CREDITS_SEQUENCE) {
gWorldInstance.AddObject(new OHotAirBalloon(FVector(-1250.0f, 0.0f, 1110.0f)));
} else { // Normal gameplay
gWorldInstance.AddObject(new OHotAirBalloon(FVector(-176.0, 0.0f, -2323.0f)));
}
}
void LuigiRaceway::SpawnVehicles() {
@@ -159,8 +209,7 @@ void LuigiRaceway::InitCourseObjects() {
if (gModeSelection == GRAND_PRIX) {
func_80070714();
}
D_80165898 = 0;
init_object(indexObjectList1[0], 0);
for (i = 0; i < D_80165738; i++) {
find_unused_obj_index(&gObjectParticle3[i]);
init_object(gObjectParticle3[i], 0);
@@ -169,15 +218,9 @@ void LuigiRaceway::InitCourseObjects() {
}
void LuigiRaceway::UpdateCourseObjects() {
if (D_80165898 != 0) {
update_hot_air_balloon();
}
}
void LuigiRaceway::RenderCourseObjects(s32 cameraId) {
if (D_80165898 != 0) {
render_object_hot_air_balloon(cameraId);
}
}
void LuigiRaceway::SomeSounds() {
+36 -3
View File
@@ -4,10 +4,9 @@
#include <memory>
#include "MarioRaceway.h"
#include "GameObject.h"
#include "World.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
extern "C" {
#include "main.h"
@@ -34,11 +33,45 @@ extern "C" {
extern const char *mario_raceway_dls[];
}
const course_texture mario_raceway_textures[] = {
{ gTextureCheckerboardYellowPink, 0x0149, 0x0800, 0x0 },
{ gTexture64619C, 0x0124, 0x0800, 0x0 },
{ gTextureGrass1, 0x0125, 0x0800, 0x0 },
{ gTexture64BB60, 0x0169, 0x0800, 0x0 },
{ gTextureGrass7, 0x05DE, 0x0800, 0x0 },
{ gTextureGrass5, 0x023F, 0x0800, 0x0 },
{ gTextureFlagRed, 0x019E, 0x0800, 0x0 },
{ gTexture663F90, 0x0122, 0x0800, 0x0 },
{ gTexture6642A4, 0x0162, 0x0800, 0x0 },
{ gTexture6640B4, 0x01EF, 0x0800, 0x0 },
{ gTextureGrass10, 0x01F8, 0x0800, 0x0 },
{ gTexture6684F8, 0x010D, 0x0800, 0x0 },
{ gTextureSignLuigis0, 0x0287, 0x1000, 0x0 },
{ gTextureSignLuigis1, 0x02AF, 0x1000, 0x0 },
{ gTextureSignMarioStar0, 0x02D2, 0x1000, 0x0 },
{ gTextureSignMarioStar1, 0x02B1, 0x1000, 0x0 },
{ gTexture66C8F4, 0x01A1, 0x0800, 0x0 },
{ gTextureSignNintendoRed0, 0x02A6, 0x1000, 0x0 },
{ gTextureSignNintendoRed1, 0x02F7, 0x1000, 0x0 },
{ gTexture670AC8, 0x0FBF, 0x1000, 0x0 },
{ gTexture674354, 0x046F, 0x0800, 0x0 },
{ gTextureRoad0, 0x0300, 0x1000, 0x0 },
{ gTextureRoadFinish0, 0x0338, 0x1000, 0x0 },
{ gTexture67B9B0, 0x0225, 0x0800, 0x0 },
{ gTextureSignYoshi, 0x04DF, 0x1000, 0x0 },
{ gTextureCheckerboardBlueGray, 0x04A1, 0x1000, 0x0 },
{ gTextureSignShellShot0, 0x038C, 0x1000, 0x0 },
{ gTextureSignShellShot1, 0x0247, 0x1000, 0x0 },
{ gTextureSignKoopaAir0, 0x0360, 0x1000, 0x0 },
{ gTextureSignKoopaAir1, 0x0304, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
MarioRaceway::MarioRaceway() {
this->vtx = d_course_mario_raceway_vertex;
this->gfx = d_course_mario_raceway_packed_dls;
this->gfxSize = 3367;
this->textures = mario_raceway_textures;
Props.textures = mario_raceway_textures;
Props.MinimapTexture = gTextureCourseOutlineMarioRaceway;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
+66 -24
View File
@@ -4,11 +4,11 @@
#include <memory>
#include "MooMooFarm.h"
#include "GameObject.h"
#include "World.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "assets/moo_moo_farm_data.h"
#include "engine/objects/Mole.h"
extern "C" {
#include "main.h"
@@ -36,11 +36,43 @@ extern "C" {
extern s8 gPlayerCount;
}
const course_texture moo_moo_farm_textures[] = {
{ gTextureWoodDoor0, 0x0294, 0x1000, 0x0 },
{ gTextureGrass2, 0x0415, 0x0800, 0x0 },
{ gTexture64AF50, 0x0140, 0x0800, 0x0 },
{ gTexture64B090, 0x0365, 0x0800, 0x0 },
{ gTexture64B54C, 0x038C, 0x0800, 0x0 },
{ gTexture64B3F8, 0x0153, 0x0800, 0x0 },
{ gTextureSignNintendo0, 0x0541, 0x1000, 0x0 },
{ gTextureSignNintendo1, 0x0512, 0x1000, 0x0 },
{ gTexture6684F8, 0x010D, 0x0800, 0x0 },
{ gTextureSignLuigis0, 0x0287, 0x1000, 0x0 },
{ gTextureSignLuigis1, 0x02AF, 0x1000, 0x0 },
{ gTextureSignMarioStar0, 0x02D2, 0x1000, 0x0 },
{ gTextureSignMarioStar1, 0x02B1, 0x1000, 0x0 },
{ gTexture674D58, 0x030C, 0x1000, 0x0 },
{ gTexture675064, 0x01BB, 0x0800, 0x0 },
{ gTexture675220, 0x0212, 0x0800, 0x0 },
{ gTexture6775EC, 0x0233, 0x1000, 0x0 },
{ gTexture683314, 0x02DC, 0x1000, 0x0 },
{ gTexture68CDA0, 0x0110, 0x0800, 0x0 },
{ gTexture6442D4, 0x0138, 0x0800, 0x0 },
{ gTexture64440C, 0x029D, 0x1000, 0x0 },
{ gTexture6446AC, 0x0116, 0x0800, 0x0 },
{ gTextureMooMooFarmSignLeft, 0x0A66, 0x1000, 0x0 },
{ gTextureMooMooFarmSignRight, 0x0A64, 0x1000, 0x0 },
{ gTexture64ACAC, 0x02A3, 0x0800, 0x0 },
{ gTexture66D698, 0x0370, 0x0800, 0x0 },
{ gTexture66EBF0, 0x0146, 0x0800, 0x0 },
{ gTextureWheelSteamEngineReal, 0x022F, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
MooMooFarm::MooMooFarm() {
this->vtx = d_course_moo_moo_farm_vertex;
this->gfx = d_course_moo_moo_farm_packed_dls;
this->gfxSize = 3304;
this->textures = moo_moo_farm_textures;
Props.textures = moo_moo_farm_textures;
Props.MinimapTexture = gTextureCourseOutlineMooMooFarm;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
@@ -192,27 +224,37 @@ void MooMooFarm::InitCourseObjects() {
D_8018D1D0 = 6;
D_8018D1D8 = 6;
}
for (i = 0; i < NUM_GROUP1_MOLES; i++) {
Vec3f pos = {0, 22, 0};
for (size_t i = 0; i < NUM_GROUP1_MOLES; i++) {
D_8018D198[i] = 0;
find_unused_obj_index(&indexObjectList1[i]);
}
for (i = 0; i < NUM_GROUP2_MOLES; i++) {
D_8018D1A8[i] = 0;
find_unused_obj_index(&indexObjectList1[i]);
}
for (i = 0; i < NUM_GROUP3_MOLES; i++) {
D_8018D1B8[i] = 0;
find_unused_obj_index(&indexObjectList1[i]);
}
for (i = 0; i < NUM_TOTAL_MOLES; i++) {
find_unused_obj_index(&gObjectParticle1[i]);
objectId = gObjectParticle1[i];
init_object(objectId, 0);
gObjectList[objectId].pos[0] = gMoleSpawns.asVec3sList[i][0] * xOrientation;
gObjectList[objectId].pos[2] = gMoleSpawns.asVec3sList[i][2];
func_800887C0(objectId);
gObjectList[objectId].sizeScaling = 0.7f;
gWorldInstance.AddObject(new OMole(pos));
}
// for (i = 0; i < NUM_GROUP1_MOLES; i++) {
// D_8018D198[i] = 0;
// find_unused_obj_index(&indexObjectList1[i]);
// }
// for (i = 0; i < NUM_GROUP2_MOLES; i++) {
// D_8018D1A8[i] = 0;
// find_unused_obj_index(&indexObjectList1[i]);
// }
// for (i = 0; i < NUM_GROUP3_MOLES; i++) {
// D_8018D1B8[i] = 0;
// find_unused_obj_index(&indexObjectList1[i]);
// }
// for (i = 0; i < NUM_TOTAL_MOLES; i++) {
// find_unused_obj_index(&gObjectParticle1[i]);
// objectId = gObjectParticle1[i];
// init_object(objectId, 0);
// gObjectList[objectId].pos[0] = gMoleSpawns.asVec3sList[i][0] * xOrientation;
// gObjectList[objectId].pos[2] = gMoleSpawns.asVec3sList[i][2];
// func_800887C0(objectId);
// gObjectList[objectId].sizeScaling = 0.7f;
// }
for (i = 0; i < gObjectParticle2_SIZE; i++) {
find_unused_obj_index(&gObjectParticle2[i]);
}
@@ -221,13 +263,13 @@ void MooMooFarm::InitCourseObjects() {
void MooMooFarm::UpdateCourseObjects() {
if (gGamestate != CREDITS_SEQUENCE) {
update_moles();
//update_moles();
}
}
void MooMooFarm::RenderCourseObjects(s32 cameraId) {
if (gGamestate != CREDITS_SEQUENCE) {
render_object_moles(cameraId);
//render_object_moles(cameraId);
}
}
+3
View File
@@ -2,6 +2,7 @@
#include <libultraship.h>
#include "Course.h"
#include "engine/objects/Mole.h"
extern "C" {
#include "assets/moo_moo_farm_vertices.h"
@@ -15,6 +16,8 @@ extern "C" {
extern const course_texture moo_moo_farm_textures[];
}
class OMole;
class MooMooFarm : public Course {
public:
virtual ~MooMooFarm() = default; // Virtual destructor for proper cleanup in derived classes
+90 -3
View File
@@ -4,11 +4,13 @@
#include <memory>
#include "PodiumCeremony.h"
#include "GameObject.h"
#include "World.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "assets/royal_raceway_data.h"
#include "assets/ceremony_data.h"
#include "engine/objects/Trophy.h"
#include "engine/objects/Podium.h"
#include "engine/objects/CheepCheep.h"
extern "C" {
#include "main.h"
@@ -31,14 +33,62 @@ extern "C" {
#include "collision.h"
#include "memory.h"
#include "courses/staff_ghost_data.h"
#include "podium_ceremony_actors.h"
extern const char *royal_raceway_dls[];
}
const course_texture podium_ceremony_textures[] = {
{ gTexture64619C, 0x0124, 0x0800, 0x0 },
{ gTexture645134, 0x052C, 0x0800, 0x0 },
{ gTextureWoodDoor1, 0x0903, 0x1000, 0x0 },
{ gTexture64BB60, 0x0169, 0x0800, 0x0 },
{ gTextureGrass3, 0x0372, 0x0800, 0x0 },
{ gTexture64F9E8, 0x020B, 0x1000, 0x0 },
{ gTextureFlagRed, 0x019E, 0x0800, 0x0 },
{ gTextureCrownJewelBlue, 0x0301, 0x0800, 0x0 },
{ gTextureCrown, 0x0106, 0x0800, 0x0 },
{ gTextureCrownJewelPink, 0x0313, 0x0800, 0x0 },
{ gTextureSignKoopaAir0, 0x0360, 0x1000, 0x0 },
{ gTextureSignKoopaAir1, 0x0304, 0x1000, 0x0 },
{ gTexture6684F8, 0x010D, 0x0800, 0x0 },
{ gTextureSignLuigis0, 0x0287, 0x1000, 0x0 },
{ gTextureSignLuigis1, 0x02AF, 0x1000, 0x0 },
{ gTextureSignMarioStar0, 0x02D2, 0x1000, 0x0 },
{ gTextureSignMarioStar1, 0x02B1, 0x1000, 0x0 },
{ gTexture66CA98, 0x02C9, 0x0800, 0x0 },
{ gTextureCheckerboardPink, 0x0157, 0x0800, 0x0 },
{ gTexture670AC8, 0x0FBF, 0x1000, 0x0 },
{ gTextureRoad0, 0x0300, 0x1000, 0x0 },
{ gTextureRoadFinish0, 0x0338, 0x1000, 0x0 },
{ gTextureSignYoshi, 0x04DF, 0x1000, 0x0 },
{ gTextureCheckerboardBlueGray, 0x04A1, 0x1000, 0x0 },
{ gTextureCastleBricks, 0x0B33, 0x1000, 0x0 },
{ gTextureCastleBridge, 0x0428, 0x0800, 0x0 },
{ gTextureGrass8, 0x02CB, 0x0800, 0x0 },
{ gTextureGrass9, 0x0421, 0x0800, 0x0 },
{ gTexture6646B8, 0x0298, 0x1000, 0x0 },
{ gTexture664408, 0x02AE, 0x1000, 0x0 },
{ gTextureBricksRed, 0x0C55, 0x1000, 0x0 },
{ gTexture665C0C, 0x059D, 0x0800, 0x0 },
{ gTexture6661AC, 0x01F7, 0x0800, 0x0 },
{ gTexture6663A4, 0x05F6, 0x0800, 0x0 },
{ gTexture667BAC, 0x067A, 0x0800, 0x0 },
{ gTextureFlagRed2, 0x0186, 0x0800, 0x0 },
{ gTexture66DB60, 0x01D6, 0x0800, 0x0 },
{ gTextureStainglassPeach0, 0x0ED1, 0x1000, 0x0 },
{ gTextureStainglassPeach1, 0x0DA9, 0x1000, 0x0 },
{ gTextureFencePostWooden, 0x083D, 0x1000, 0x0 },
{ gTexture648508, 0x01FE, 0x1000, 0x0 },
{ gTexture6449D4, 0x075D, 0x0800, 0x0 },
{ gTexture67FE0C, 0x02DE, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
PodiumCeremony::PodiumCeremony() {
this->vtx = d_course_royal_raceway_vertex;
this->gfx = d_course_royal_raceway_packed_dls;
this->gfxSize = 5670;
this->textures = royal_raceway_textures;
Props.textures = podium_ceremony_textures;
Props.D_800E5548[0] = 0;
Props.D_800E5548[1] = 0;
@@ -114,6 +164,43 @@ void PodiumCeremony::SpawnActors() {
spawn_foliage((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_royal_raceway_tree_spawn));
spawn_all_item_boxes((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_royal_raceway_item_box_spawns));
spawn_piranha_plants((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_royal_raceway_piranha_plant_spawn));
gWorldInstance.AddObject(new OCheepCheep(FVector((f32)-3202, (f32)19, (f32)-478), OCheepCheep::CheepType::PODIUM_CEREMONY, IPathSpan(0, 0)));
gWorldInstance.AddObject(new OPodium(FVector((f32)-3202, (f32)19, (f32)-478)));
FVector pos = {0, 90.0f, 0};
OTrophy::TrophyType type = OTrophy::TrophyType::BRONZE;
switch(D_802874D8.unk1D) {
case 0: // Bronze
if (gCCSelection == CC_150) {
OTrophy::TrophyType::BRONZE_150;
} else {
OTrophy::TrophyType::BRONZE;
}
break;
case 1: // Silver
pos.x -= 3.0;
pos.z += 15.0;
if (gCCSelection == CC_150) {
OTrophy::TrophyType::SILVER_150;
} else {
OTrophy::TrophyType::SILVER;
}
break;
case 2: // Gold
pos.x -= 2.0;
pos.z -= 15.0;
if (gCCSelection == CC_150) {
OTrophy::TrophyType::GOLD_150;
} else {
OTrophy::TrophyType::GOLD;
}
break;
}
gWorldInstance.AddObject(new OTrophy(pos, type, OTrophy::Behaviour::PODIUM_CEREMONY));
}
void PodiumCeremony::SpawnVehicles() {
+12 -3
View File
@@ -4,10 +4,9 @@
#include <memory>
#include "RainbowRoad.h"
#include "GameObject.h"
#include "World.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "assets/rainbow_road_data.h"
extern "C" {
@@ -33,11 +32,21 @@ extern "C" {
extern const char *rainbow_road_dls[];
}
const course_texture rainbow_road_textures[] = {
{ gTextureStarOutline, 0x037A, 0x0800, 0x0 },
{ gTexture67A1B8, 0x01B7, 0x0800, 0x0 },
{ gTextureCheckerboardBlackWhite, 0x0107, 0x0800, 0x0 },
{ gTexture662A34, 0x0106, 0x0800, 0x0 },
{ gTextureRainbow, 0x025D, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
RainbowRoad::RainbowRoad() {
this->vtx = d_course_rainbow_road_vertex;
this->gfx = d_course_rainbow_road_packed_dls;
this->gfxSize = 5670;
this->textures = rainbow_road_textures;
Props.textures = rainbow_road_textures;
Props.MinimapTexture = gTextureCourseOutlineRainbowRoad;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 96;
+49 -3
View File
@@ -4,10 +4,9 @@
#include <memory>
#include "RoyalRaceway.h"
#include "GameObject.h"
#include "World.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "assets/royal_raceway_data.h"
extern "C" {
@@ -34,11 +33,58 @@ extern "C" {
extern const char *royal_raceway_dls[];
}
const course_texture royal_raceway_textures[] = {
{ gTexture64619C, 0x0124, 0x0800, 0x0 },
{ gTexture645134, 0x052C, 0x0800, 0x0 },
{ gTextureWoodDoor1, 0x0903, 0x1000, 0x0 },
{ gTexture64BB60, 0x0169, 0x0800, 0x0 },
{ gTextureGrass3, 0x0372, 0x0800, 0x0 },
{ gTexture64F9E8, 0x020B, 0x1000, 0x0 },
{ gTextureFlagRed, 0x019E, 0x0800, 0x0 },
{ gTextureCrownJewelBlue, 0x0301, 0x0800, 0x0 },
{ gTextureCrown, 0x0106, 0x0800, 0x0 },
{ gTextureCrownJewelPink, 0x0313, 0x0800, 0x0 },
{ gTextureSignKoopaAir0, 0x0360, 0x1000, 0x0 },
{ gTextureSignKoopaAir1, 0x0304, 0x1000, 0x0 },
{ gTexture6684F8, 0x010D, 0x0800, 0x0 },
{ gTextureSignLuigis0, 0x0287, 0x1000, 0x0 },
{ gTextureSignLuigis1, 0x02AF, 0x1000, 0x0 },
{ gTextureSignMarioStar0, 0x02D2, 0x1000, 0x0 },
{ gTextureSignMarioStar1, 0x02B1, 0x1000, 0x0 },
{ gTexture66CA98, 0x02C9, 0x0800, 0x0 },
{ gTextureCheckerboardPink, 0x0157, 0x0800, 0x0 },
{ gTexture670AC8, 0x0FBF, 0x1000, 0x0 },
{ gTextureRoad0, 0x0300, 0x1000, 0x0 },
{ gTextureRoadFinish0, 0x0338, 0x1000, 0x0 },
{ gTextureSignYoshi, 0x04DF, 0x1000, 0x0 },
{ gTextureCheckerboardBlueGray, 0x04A1, 0x1000, 0x0 },
{ gTextureCastleBricks, 0x0B33, 0x1000, 0x0 },
{ gTextureCastleBridge, 0x0428, 0x0800, 0x0 },
{ gTextureGrass8, 0x02CB, 0x0800, 0x0 },
{ gTextureGrass9, 0x0421, 0x0800, 0x0 },
{ gTexture6646B8, 0x0298, 0x1000, 0x0 },
{ gTexture664408, 0x02AE, 0x1000, 0x0 },
{ gTextureBricksRed, 0x0C55, 0x1000, 0x0 },
{ gTexture665C0C, 0x059D, 0x0800, 0x0 },
{ gTexture6661AC, 0x01F7, 0x0800, 0x0 },
{ gTexture6663A4, 0x05F6, 0x0800, 0x0 },
{ gTexture667BAC, 0x067A, 0x0800, 0x0 },
{ gTextureFlagRed2, 0x0186, 0x0800, 0x0 },
{ gTexture66DB60, 0x01D6, 0x0800, 0x0 },
{ gTextureStainglassPeach0, 0x0ED1, 0x1000, 0x0 },
{ gTextureStainglassPeach1, 0x0DA9, 0x1000, 0x0 },
{ gTextureFencePostWooden, 0x083D, 0x1000, 0x0 },
{ gTexture648508, 0x01FE, 0x1000, 0x0 },
{ gTexture6449D4, 0x075D, 0x0800, 0x0 },
{ gTexture67FE0C, 0x02DE, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
RoyalRaceway::RoyalRaceway() {
this->vtx = d_course_royal_raceway_vertex;
this->gfx = d_course_royal_raceway_packed_dls;
this->gfxSize = 5670;
this->textures = royal_raceway_textures;
Props.textures = royal_raceway_textures;
Props.MinimapTexture = gTextureCourseOutlineRoyalRaceway;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
+81 -66
View File
@@ -4,11 +4,11 @@
#include <memory>
#include "SherbetLand.h"
#include "GameObject.h"
#include "World.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "assets/sherbet_land_data.h"
#include "engine/objects/Penguin.h"
extern "C" {
#include "main.h"
@@ -34,11 +34,20 @@ extern "C" {
extern const char *sherbet_land_dls_2[];
}
const course_texture sherbet_land_textures[] = {
{ gTexture643B3C, 0x0798, 0x0800, 0x0 }, { gTexture66D024, 0x04EA, 0x0800, 0x0 },
{ gTexture678118, 0x0314, 0x0800, 0x0 }, { gTextureSignWoodRedArrow, 0x04E1, 0x1000, 0x0 },
{ gTexture678CC8, 0x058E, 0x0800, 0x0 }, { gTexture67842C, 0x050E, 0x0800, 0x0 },
{ gTexture67893C, 0x038B, 0x0800, 0x0 }, { gTexture651984, 0x019C, 0x0800, 0x0 },
{ gTexture651428, 0x055B, 0x0800, 0x0 }, { gTexture662924, 0x0110, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
SherbetLand::SherbetLand() {
this->vtx = d_course_sherbet_land_vertex;
this->gfx = d_course_sherbet_land_packed_dls;
this->gfxSize = 1803;
this->textures = sherbet_land_textures;
Props.textures = sherbet_land_textures;
Props.MinimapTexture = gTextureCourseOutlineSherbetLand;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
@@ -46,6 +55,9 @@ SherbetLand::SherbetLand() {
Props.Name = "sherbet land";
Props.DebugName = "sherbet";
Props.CourseLength = "756m";
Props.LakituTowType = (s32)OLakitu::LakituTowType::ICE;
Props.AIBehaviour = D_0D009280;
Props.AIMaximumSeparation = 50.0f;
Props.AIMinimumSeparation = 0.3f;
@@ -122,6 +134,72 @@ void SherbetLand::SpawnActors() {
gWorldInstance.AddActor(new AFinishline());
spawn_all_item_boxes((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_sherbet_land_item_box_spawns));
// Originally, multiplayer did not spawn the big penguin
// if (gPlayerCountSelection1 == 1) {
Vec3f pos = {-383.0f, 2.0f, -690.0f};
gWorldInstance.AddObject(new OPenguin(pos, 0, OPenguin::PenguinType::EMPEROR, OPenguin::Behaviour::STRUT));
// }
//! @bug Skip spawning penguins due to animation crash for now
if (gGamestate == CREDITS_SEQUENCE) {
return;
}
Vec3f pos2 = {-2960.0f, -80.0f, 1521.0f};
auto penguin = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos2, 0x150, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE)));
auto penguin2 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos2, 0x150, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE)));
penguin->Diameter = penguin2->Diameter = 100.0f;
Vec3f pos3 = {-2490.0f, -80.0f, 1612.0f};
auto penguin3 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos3, 0x100, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE)));
auto penguin4 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos3, 0x100, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE)));
penguin3->Diameter = penguin4->Diameter = 80.0f;
Vec3f pos4 = {-2098.0f, -80.0f, 1624.0f};
auto penguin5 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos4, 0xFF00, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE)));
auto penguin6 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos4, 0xFF00, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE)));
penguin5->Diameter = penguin6->Diameter = 80.0f;
Vec3f pos5 = {-2080.0f, -80.0f, 1171.0f};
auto penguin7 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos5, 0x150, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE)));
auto penguin8 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos5, 0x150, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE)));
penguin7->Diameter = penguin8->Diameter = 80.0f;
if (gGamestate == CREDITS_SEQUENCE) {
Vec3f pos6 = {380.0, 0.0f, -535.0f};
auto penguin9 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos6, 0x9000, OPenguin::PenguinType::CREDITS, OPenguin::Behaviour::SLIDE3)));
penguin9->MirrorModeAngleOffset = -0x4000;
} else {
Vec3f pos6 = {146.0f, 0.0f, -380.0f};
auto penguin9 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos6, 0x9000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE3)));
penguin9->MirrorModeAngleOffset = -0x4000;
}
Vec3f pos7 = {380.0f, 0.0f, -766.0f};
auto penguin10 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos7, 0x5000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE4)));
penguin10->MirrorModeAngleOffset = 0x8000;
Vec3f pos8 = {-2300.0f, 0.0f, -210.0f};
auto penguin11 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos8, 0xC000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE6)));
penguin11->MirrorModeAngleOffset = 0x8000;
Vec3f pos9 = {-2500.0f, 0.0f, -250.0f};
auto penguin12 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos9, 0x4000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE6)));
penguin12->MirrorModeAngleOffset = 0x8000;
Vec3f pos10 = {-535.0f, 0.0f, 875.0f};
auto penguin13 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos10, 0x8000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE6)));
penguin13->MirrorModeAngleOffset = -0x4000;
Vec3f pos11 = {-250.0f, 0.0f, 953.0f};
auto penguin14 = reinterpret_cast<OPenguin*>(gWorldInstance.AddObject(new OPenguin(pos11, 0x9000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE6)));
penguin14->MirrorModeAngleOffset = -0x4000;
}
void SherbetLand::SpawnVehicles() {
@@ -151,69 +229,6 @@ void SherbetLand::MinimapSettings() {
}
void SherbetLand::InitCourseObjects() {
//! @bug Skip spawning penguins due to animation crash for now
if (gGamestate == CREDITS_SEQUENCE) {
return;
}
// Originally, multiplayer did not spawn the big penguin
// if (gPlayerCountSelection1 == 1) {
Vec3f pos = {-383.0f, 2.0f, -690.0f};
gWorldInstance.AddPenguin(pos, 0, OPenguin::PenguinType::EMPEROR, OPenguin::Behaviour::STRUT);
// }
Vec3f pos2 = {-2960.0f, -80.0f, 1521.0f};
auto penguin = gWorldInstance.AddPenguin(pos2, 0x150, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE);
auto penguin2 = gWorldInstance.AddPenguin(pos2, 0x150, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE);
penguin->Diameter = penguin2->Diameter = 100.0f;
Vec3f pos3 = {-2490.0f, -80.0f, 1612.0f};
auto penguin3 = gWorldInstance.AddPenguin(pos3, 0x100, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE);
auto penguin4 = gWorldInstance.AddPenguin(pos3, 0x100, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE);
penguin3->Diameter = penguin4->Diameter = 80.0f;
Vec3f pos4 = {-2098.0f, -80.0f, 1624.0f};
auto penguin5 = gWorldInstance.AddPenguin(pos4, 0xFF00, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE);
auto penguin6 = gWorldInstance.AddPenguin(pos4, 0xFF00, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE);
penguin5->Diameter = penguin6->Diameter = 80.0f;
Vec3f pos5 = {-2080.0f, -80.0f, 1171.0f};
auto penguin7 = gWorldInstance.AddPenguin(pos5, 0x150, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE);
auto penguin8 = gWorldInstance.AddPenguin(pos5, 0x150, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE);
penguin7->Diameter = penguin8->Diameter = 80.0f;
if (gGamestate == CREDITS_SEQUENCE) {
Vec3f pos6 = {380.0, 0.0f, -535.0f};
auto penguin9 = gWorldInstance.AddPenguin(pos6, 0x9000, OPenguin::PenguinType::CREDITS, OPenguin::Behaviour::SLIDE3);
penguin9->MirrorModeAngleOffset = -0x4000;
} else {
Vec3f pos6 = {146.0f, 0.0f, -380.0f};
auto penguin9 = gWorldInstance.AddPenguin(pos6, 0x9000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE3);
penguin9->MirrorModeAngleOffset = -0x4000;
}
Vec3f pos7 = {380.0f, 0.0f, -766.0f};
auto penguin10 = gWorldInstance.AddPenguin(pos7, 0x5000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE4);
penguin10->MirrorModeAngleOffset = 0x8000;
Vec3f pos8 = {-2300.0f, 0.0f, -210.0f};
auto penguin11 = gWorldInstance.AddPenguin(pos8, 0xC000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE6);
penguin11->MirrorModeAngleOffset = 0x8000;
Vec3f pos9 = {-2500.0f, 0.0f, -250.0f};
auto penguin12 = gWorldInstance.AddPenguin(pos9, 0x4000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE6);
penguin12->MirrorModeAngleOffset = 0x8000;
Vec3f pos10 = {-535.0f, 0.0f, 875.0f};
auto penguin13 = gWorldInstance.AddPenguin(pos10, 0x8000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE6);
penguin13->MirrorModeAngleOffset = -0x4000;
Vec3f pos11 = {-250.0f, 0.0f, 953.0f};
auto penguin14 = gWorldInstance.AddPenguin(pos11, 0x9000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE6);
penguin14->MirrorModeAngleOffset = -0x4000;
}
void SherbetLand::UpdateCourseObjects() {
+29 -3
View File
@@ -4,9 +4,8 @@
#include <memory>
#include "Skyscraper.h"
#include "GameObject.h"
#include "World.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "assets/skyscraper_data.h"
extern "C" {
@@ -33,11 +32,38 @@ extern "C" {
extern s16 currentScreenSection;
}
const course_texture skyscraper_textures[] = {
{ gTexture6457D8, 0x0160, 0x0800, 0x0 },
{ gTexture6462C0, 0x01B9, 0x0800, 0x0 },
{ gTexture6864E8, 0x0807, 0x1000, 0x0 },
{ gTexture686CF0, 0x08B7, 0x1000, 0x0 },
{ gTexture6875A8, 0x093F, 0x1000, 0x0 },
{ gTexture687EE8, 0x0883, 0x1000, 0x0 },
{ gTexture68876C, 0x0AC2, 0x1000, 0x0 },
{ gTexture689230, 0x09CE, 0x1000, 0x0 },
{ gTexture689C00, 0x0884, 0x1000, 0x0 },
{ gTexture68A484, 0x07D6, 0x1000, 0x0 },
{ gTexture68AC5C, 0x0A47, 0x1000, 0x0 },
{ gTexture68B6A4, 0x07C5, 0x1000, 0x0 },
{ gTexture68BE6C, 0x04A1, 0x1000, 0x0 },
{ gTexture68C310, 0x030D, 0x1000, 0x0 },
{ gTexture64B8D8, 0x0177, 0x0800, 0x0 },
{ gTexture645660, 0x0176, 0x0800, 0x0 },
{ gTextureNumberYellowBlue1, 0x01AE, 0x0800, 0x0 },
{ gTextureNumberYellowBlue2, 0x01C6, 0x0800, 0x0 },
{ gTextureNumberYellowBlue3, 0x01CC, 0x0800, 0x0 },
{ gTextureNumberYellowBlue4, 0x01E4, 0x0800, 0x0 },
{ gTexture668608, 0x0120, 0x0800, 0x0 },
{ gTexture67B75C, 0x0108, 0x0800, 0x0 },
{ gTexture6835F0, 0x0252, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
Skyscraper::Skyscraper() {
this->vtx = d_course_skyscraper_vertex;
this->gfx = d_course_skyscraper_packed_dls;
this->gfxSize = 548;
this->textures = skyscraper_textures;
Props.textures = skyscraper_textures;
Props.MinimapTexture = gTextureCourseOutlineSkyscraper;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
+31 -4
View File
@@ -4,16 +4,25 @@
#include <memory>
#include "TestCourse.h"
#include "GameObject.h"
#include "World.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/Object.h"
#include "engine/objects/BombKart.h"
#include "assets/mario_raceway_data.h"
#include "assets/bowsers_castle_data.h"
#include "assets/bowsers_castle_displaylists.h"
#include "engine/actors/ATree.h"
#include "engine/actors/ACloud.h"
#include "engine/vehicles/Train.h"
#include "engine/objects/Trophy.h"
#include "engine/objects/CheepCheep.h"
#include "engine/objects/Snowman.h"
#include "engine/objects/TrashBin.h"
#include "engine/objects/Hedgehog.h"
#include "engine/objects/Flagpole.h"
#include "engine/objects/HotAirBalloon.h"
#include "engine/objects/Crab.h"
#include "engine/particles/StarEmitter.h"
extern "C" {
#include "main.h"
@@ -52,6 +61,8 @@ TestCourse::TestCourse() {
this->gfxSize = 100;
this->textures = NULL;
Props.MinimapTexture = gTextureCourseOutlineMarioRaceway;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.Id = "mk:test_course";
Props.Name = "Test Course";
@@ -186,8 +197,24 @@ void TestCourse::SpawnActors() {
ACTOR_RAILROAD_CROSSING));
rrxing->crossingTrigger = crossing1;
//Vec3f pos = {-80, 7, -20};
//gWorldInstance.AddActor(new ACloud(pos));
Vec3f pos = {0, 80, 0};
// gWorldInstance.AddActor(new ACloud(pos));
// gWorldInstance.AddActor(new OSeagull(0, pos));
// gWorldInstance.AddActor(new OSeagull(1, pos));
// gWorldInstance.AddActor(new OSeagull(2, pos));
// gWorldInstance.AddActor(new OSeagull(3, pos));
// gWorldInstance.AddObject(new OCheepCheep(FVector(0, 40, 0), OCheepCheep::CheepType::RACE, IPathSpan(0, 10)));
// gWorldInstance.AddObject(new OTrophy(FVector(0,0,0), OTrophy::TrophyType::GOLD, OTrophy::Behaviour::GO_FISH));
//gWorldInstance.AddObject(new OSnowman(FVector(0, 0, 0)));
//gWorldInstance.AddObject(new OTrashBin(FVector(0.0f, 0.0f, 0.0f), FRotation(0, 90, 0), 1.0f));
//gWorldInstance.AddEmitter(new StarEmitter(FVector(0,50,0)));
//gWorldInstance.AddObject(new OHedgehog(FVector(0, 0, 0), FVector2D(0, -200), 9));
//gWorldInstance.AddObject(new OFlagpole(FVector(0, 0, -200), 0x400));
// gWorldInstance.AddObject(new OHotAirBalloon(FVector(0.0, 20.0f, -200.0f)));
gWorldInstance.AddObject(new OCrab(FVector2D(0, 0), FVector2D(0, -200)));
}
// Likely sets minimap boundaries
+33 -7
View File
@@ -4,11 +4,14 @@
#include <memory>
#include "ToadsTurnpike.h"
#include "GameObject.h"
#include "World.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "assets/toads_turnpike_data.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/Bus.h"
#include "engine/vehicles/Car.h"
#include "engine/vehicles/Truck.h"
#include "engine/vehicles/TankerTruck.h"
#include "engine/vehicles/Utils.h"
@@ -38,11 +41,34 @@ extern "C" {
extern s8 gPlayerCount;
}
const course_texture toads_turnpike_textures[] = {
{ gTexture645134, 0x052C, 0x0800, 0x0 },
{ gTexture64FE68, 0x0258, 0x1000, 0x0 },
{ gTexture6607C0, 0x0105, 0x0800, 0x0 },
{ gTexture6608C8, 0x0106, 0x0800, 0x0 },
{ gTextureGrass11, 0x01F8, 0x0800, 0x0 },
{ gTextureSignNintendoRed0, 0x02A6, 0x1000, 0x0 },
{ gTextureSignNintendoRed1, 0x02F7, 0x1000, 0x0 },
{ gTexture671A88, 0x012D, 0x0800, 0x0 },
{ gTextureRoad2, 0x02AE, 0x1000, 0x0 },
{ gTextureRoad3, 0x0286, 0x1000, 0x0 },
{ gTextureRoad4, 0x0282, 0x1000, 0x0 },
{ gTextureRoadFinish0, 0x0338, 0x1000, 0x0 },
{ gTextureSignToadYellow, 0x0723, 0x1000, 0x0 },
{ gTextureSignToadGreen, 0x071F, 0x1000, 0x0 },
{ gTextureSignMergingLanes, 0x0118, 0x0800, 0x0 },
{ gTexture65127C, 0x01AB, 0x0800, 0x0 },
{ gTextureRoad5, 0x02B9, 0x1000, 0x0 },
{ gTextureSignToadRed, 0x0610, 0x1000, 0x0 },
{ gTexture668228, 0x0130, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
ToadsTurnpike::ToadsTurnpike() {
this->vtx = d_course_toads_turnpike_vertex;
this->gfx = d_course_toads_turnpike_packed_dls;
this->gfxSize = 3427;
this->textures = toads_turnpike_textures;
Props.textures = toads_turnpike_textures;
Props.MinimapTexture = gTextureCourseOutlineToadsTurnpike;
Props.D_800E5548[0] = 128;
Props.D_800E5548[1] = 64;
@@ -235,22 +261,22 @@ void ToadsTurnpike::SpawnVehicles() {
for (size_t i = 0; i < _numTrucks; i++) {
waypoint = CalculateWaypointDistribution(i, _numTrucks, gWaypointCountByPathIndex[0], 0);
gWorldInstance.AddTruck(a, b, &D_80164550[0][0], waypoint);
gWorldInstance.AddVehicle(new ATruck(a, b, &D_80164550[0][0], waypoint));
}
for (size_t i = 0; i < _numBuses; i++) {
waypoint = CalculateWaypointDistribution(i, _numBuses, gWaypointCountByPathIndex[0], 75);
gWorldInstance.AddBus(a, b,&D_80164550[0][0], waypoint);
gWorldInstance.AddVehicle(new ABus(a, b,&D_80164550[0][0], waypoint));
}
for (size_t i = 0; i < _numTankerTrucks; i++) {
waypoint = CalculateWaypointDistribution(i, _numTankerTrucks, gWaypointCountByPathIndex[0], 50);
gWorldInstance.AddTankerTruck(a, b, &D_80164550[0][0], waypoint);
gWorldInstance.AddVehicle(new ATankerTruck(a, b, &D_80164550[0][0], waypoint));
}
for (size_t i = 0; i < _numCars; i++) {
waypoint = CalculateWaypointDistribution(i, _numCars, gWaypointCountByPathIndex[0], 25);
gWorldInstance.AddCar(a, b, &D_80164550[0][0], waypoint);
gWorldInstance.AddVehicle(new ACar(a, b, &D_80164550[0][0], waypoint));
}
if (gModeSelection == VERSUS) {
+26 -3
View File
@@ -4,9 +4,8 @@
#include <memory>
#include "WarioStadium.h"
#include "GameObject.h"
#include "World.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "assets/wario_stadium_data.h"
#include "engine/actors/AWarioSign.h"
#include "engine/actors/AFinishline.h"
@@ -37,11 +36,35 @@ extern "C" {
extern s16 currentScreenSection;
}
const course_texture wario_stadium_textures[] = {
{ gTexture67F15C, 0x02F1, 0x0800, 0x0 },
{ gTexture67F450, 0x0194, 0x0800, 0x0 },
{ gTextureSignWarioFace, 0x0825, 0x1000, 0x0 },
{ gTexture670AC8, 0x0FBF, 0x1000, 0x0 },
{ gTextureCheckerboardBlackWhite, 0x0107, 0x0800, 0x0 },
{ gTexture64C11C, 0x0695, 0x0800, 0x0 },
{ gTexture64C7B4, 0x046C, 0x0800, 0x0 },
{ gTexture668228, 0x0130, 0x0800, 0x0 },
{ gTexture668358, 0x01A0, 0x0800, 0x0 },
{ gTexture66AEB8, 0x0201, 0x0800, 0x0 },
{ gTexture677A40, 0x0275, 0x0800, 0x0 },
{ gTexture67E428, 0x0A81, 0x1000, 0x0 },
{ gTexture643A34, 0x0106, 0x0800, 0x0 },
{ gTexture66EBF0, 0x0146, 0x0800, 0x0 },
{ gTexture68272C, 0x01F9, 0x1000, 0x0 },
{ gTexture682928, 0x01F9, 0x1000, 0x0 },
{ gTexture682B24, 0x01F9, 0x1000, 0x0 },
{ gTexture682D20, 0x01F9, 0x1000, 0x0 },
{ gTexture682F1C, 0x01F9, 0x1000, 0x0 },
{ gTexture683118, 0x01F9, 0x1000, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
WarioStadium::WarioStadium() {
this->vtx = d_course_wario_stadium_vertex;
this->gfx = d_course_wario_stadium_packed_dls;
this->gfxSize = 5272;
this->textures = wario_stadium_textures;
Props.textures = wario_stadium_textures;
Props.MinimapTexture = gTextureCourseOutlineWarioStadium;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
+47 -36
View File
@@ -4,10 +4,11 @@
#include <memory>
#include "YoshiValley.h"
#include "GameObject.h"
#include "World.h"
#include "engine/actors/AFinishline.h"
#include "engine/vehicles/OBombKart.h"
#include "engine/objects/BombKart.h"
#include "engine/objects/Hedgehog.h"
#include "engine/objects/Flagpole.h"
#include "assets/yoshi_valley_data.h"
#include "assets/boo_frames.h"
@@ -34,11 +35,30 @@ extern "C" {
extern const char *d_course_yoshi_valley_dl_list[];
}
const course_texture yoshi_valley_textures[] = {
{ gTexture66EBF0, 0x0146, 0x0800, 0x0 },
{ gTextureWoodBridgeSlats, 0x0DAB, 0x1000, 0x0 },
{ gTexture65E2EC, 0x02B0, 0x0800, 0x0 },
{ gTexture6846DC, 0x04EA, 0x0800, 0x0 },
{ gTextureFenceRope, 0x0540, 0x0800, 0x0 },
{ gTexture685108, 0x04D4, 0x0800, 0x0 },
{ gTexture64CC20, 0x0EC3, 0x1000, 0x0 },
{ gTextureGrass4, 0x05C3, 0x0800, 0x0 },
{ gTexture6775EC, 0x0233, 0x1000, 0x0 },
{ gTexture68E2D0, 0x087F, 0x0800, 0x0 },
{ gTextureCheckerboardBlackWhite, 0x0107, 0x0800, 0x0 },
{ gTexture643B3C, 0x0798, 0x0800, 0x0 },
{ gTextureSignWoodRedArrow, 0x04E1, 0x1000, 0x0 },
{ gTexture68DEC0, 0x0410, 0x0800, 0x0 },
{ 0x00000000, 0x0000, 0x0000, 0x0 },
};
YoshiValley::YoshiValley() {
this->vtx = d_course_yoshi_valley_vertex;
this->gfx = d_course_yoshi_valley_packed_dls;
this->gfxSize = 4140;
this->textures = yoshi_valley_textures;
Props.textures = yoshi_valley_textures;
Props.MinimapTexture = gTextureCourseOutlineYoshiValley;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
@@ -129,6 +149,30 @@ void YoshiValley::SpawnActors() {
vec3f_set(position, -2300.0f, 0.0f, 634.0f);
position[0] *= gCourseDirection;
add_actor_to_empty_slot(position, rotation, velocity, ACTOR_YOSHI_EGG);
if (gGamestate != CREDITS_SEQUENCE) {
//! @bug Skip spawning in credits due to animation crash for now
gWorldInstance.AddObject(new OFlagpole(FVector(-902, 70, -1406), 0x3800));
gWorldInstance.AddObject(new OFlagpole(FVector(-948, 70, -1533), 0x3800));
gWorldInstance.AddObject(new OFlagpole(FVector(-2170, 0, 723), 0x400));
gWorldInstance.AddObject(new OFlagpole(FVector(-2193, 0, 761), 0x400));
gWorldInstance.AddObject(new OHedgehog(FVector(-1683, -80, -88), FVector2D(-1650, -114), 9));
gWorldInstance.AddObject(new OHedgehog(FVector(-1636, -93, -147), FVector2D(-1661, -151), 9));
gWorldInstance.AddObject(new OHedgehog(FVector(-1628, -86, -108), FVector2D(-1666, -58), 9));
gWorldInstance.AddObject(new OHedgehog(FVector(-1676, -69, -30), FVector2D(-1651, -26), 9));
gWorldInstance.AddObject(new OHedgehog(FVector(-1227, -27, -989), FVector2D(-1194, -999), 26));
gWorldInstance.AddObject(new OHedgehog(FVector(-1261, -41, -880), FVector2D(-1213, -864), 26));
gWorldInstance.AddObject(new OHedgehog(FVector(-1342, -60, -830), FVector2D(-1249, -927), 26));
gWorldInstance.AddObject(new OHedgehog(FVector(-1429, -78, -849), FVector2D(-1347, -866), 26));
gWorldInstance.AddObject(new OHedgehog(FVector(-1492, -94, -774), FVector2D(-1427, -891), 26));
gWorldInstance.AddObject(new OHedgehog(FVector(-1453, -87, -784), FVector2D(-1509, -809), 26));
gWorldInstance.AddObject(new OHedgehog(FVector(-1488, 89, -852), FVector2D(-1464, -822), 26));
gWorldInstance.AddObject(new OHedgehog(FVector(-1301, 47, -904), FVector2D(-1537, -854), 26));
gWorldInstance.AddObject(new OHedgehog(FVector(-2587, 56, -259), FVector2D(-2624, -241), 28));
gWorldInstance.AddObject(new OHedgehog(FVector(-2493, 94, -454), FVector2D(-2505, -397), 28));
gWorldInstance.AddObject(new OHedgehog(FVector(-2477, 3, -57), FVector2D(-2539, -66), 28));
}
}
// Likely sets minimap boundaries
@@ -140,31 +184,6 @@ void YoshiValley::MinimapSettings() {
}
void YoshiValley::InitCourseObjects() {
size_t objectId;
size_t i;
//! @bug Skip spawning due to animation crash for now
if (gGamestate == CREDITS_SEQUENCE) {
return;
}
for (i = 0; i < NUM_YV_FLAG_POLES; i++) {
init_object(indexObjectList1[i], 0);
}
if (gGamestate != CREDITS_SEQUENCE) {
for (i = 0; i < NUM_HEDGEHOGS; i++) {
objectId = indexObjectList2[i];
init_object(objectId, 0);
gObjectList[objectId].pos[0] = gObjectList[objectId].origin_pos[0] =
gHedgehogSpawns[i].pos[0] * xOrientation;
gObjectList[objectId].pos[1] = gObjectList[objectId].surfaceHeight =
gHedgehogSpawns[i].pos[1] + 6.0;
gObjectList[objectId].pos[2] = gObjectList[objectId].origin_pos[2] = gHedgehogSpawns[i].pos[2];
gObjectList[objectId].unk_0D5 = gHedgehogSpawns[i].unk_06;
gObjectList[objectId].unk_09C = gHedgehogPatrolPoints[i][0] * xOrientation;
gObjectList[objectId].unk_09E = gHedgehogPatrolPoints[i][2];
}
}
}
void YoshiValley::SpawnVehicles() {
@@ -192,17 +211,9 @@ void YoshiValley::SpawnVehicles() {
}
void YoshiValley::UpdateCourseObjects() {
func_80083080();
if (gGamestate != CREDITS_SEQUENCE) {
update_hedgehogs();
}
}
void YoshiValley::RenderCourseObjects(s32 cameraId) {
func_80055228(cameraId);
if (gGamestate != CREDITS_SEQUENCE) {
render_object_hedgehogs(cameraId);
}
}
void YoshiValley::SomeSounds() {
@@ -1,5 +1,5 @@
#include <libultraship.h>
#include "engine/vehicles/OBombKart.h"
#include "BombKart.h"
#include <vector>
#include "port/Game.h"
@@ -26,8 +26,10 @@ extern "C" {
extern s8 gPlayerCount;
}
OBombKart::OBombKart(Vec3f pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C) {
size_t OBombKart::_count = 0;
OBombKart::OBombKart(Vec3f pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C) {
_idx = _count;
Vec3f _pos = {0, 0, 0};
if (waypoint) { // Spawn kart on waypoint
@@ -68,6 +70,8 @@ OBombKart::OBombKart(Vec3f pos, TrackWaypoint* waypoint, uint16_t waypointIndex,
WheelPos[3][1] = _pos[1];
WheelPos[3][2] = _pos[2];
check_bounding_collision(&_Collision, 2.0f, _pos[0], _pos[1], _pos[2]);
_count++;
}
void OBombKart::Spawn() {
@@ -334,9 +338,7 @@ void OBombKart::Draw(s32 cameraId) {
}
if (GetCourse() == GetPodiumCeremony()) {
// This isn't functionally equivallent.
// Technicaly it should be if (kart[0].WaypointIndex < 16)
if (WaypointIndex < 16) {
if ((_idx == 0) && (WaypointIndex < 16)) {
return;
} else {
cameraId = PLAYER_FOUR;
@@ -358,7 +360,7 @@ void OBombKart::Draw(s32 cameraId) {
} else if (gGamestate != ENDING) {
Unk_4A = 1;
}
set_object_flag_status_false(ObjectIndex, 0x00200000);
clear_object_flag(ObjectIndex, 0x00200000);
}
// huh???
@@ -369,7 +371,7 @@ void OBombKart::Draw(s32 cameraId) {
gObjectList[ObjectIndex].pos[2] = Pos[2];
temp_s4 = func_8008A364(ObjectIndex, cameraId, 0x31C4U, 0x000001F4);
if (is_obj_flag_status_active(ObjectIndex, VISIBLE) != 0) {
set_object_flag_status_true(ObjectIndex, 0x00200000);
set_object_flag(ObjectIndex, 0x00200000);
D_80183E80[0] = 0;
D_80183E80[1] = func_800418AC(Pos[0], Pos[2], camera->pos);
D_80183E80[2] = 0x8000;
@@ -1,10 +1,12 @@
#pragma once
#include <libultraship.h>
#include "Vehicle.h"
#include "src/engine/vehicles/Vehicle.h"
#include <vector>
#include "engine/Matrix.h"
#include "World.h"
extern "C" {
#include "macros.h"
#include "main.h"
@@ -53,16 +55,26 @@ public:
// Set waypoint to NULL if using a spawn position and not a waypoint.
explicit OBombKart(Vec3f pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C);
~OBombKart() {
_count--;
}
static size_t GetCount() {
return _count;
}
void Spawn();
void BeginPlay();
void Tick();
void Draw(s32 playerId);
void Draw(s32 cameraId);
void DrawBattle(s32 cameraId);
void Collision(s32 playerId, Player* player);
void SomeRender(Vec3f arg1);
void LoadMtx();
void Waypoint(s32 screenId);
private:
static size_t _count;
s32 _idx;
Player* FindTarget();
void Chase(Player*, Vec3f pos);
+243
View File
@@ -0,0 +1,243 @@
#include "CheepCheep.h"
#include "assets/banshee_boardwalk_data.h"
#include "assets/common_data.h"
extern "C" {
#include "math_util.h"
#include "math_util_2.h"
#include "render_objects.h"
#include "update_objects.h"
#include "code_800029B0.h"
#include "code_80086E70.h"
#include "waypoints.h"
#include "code_80057C60.h"
#include "some_data.h"
extern Vec3s D_800E634C[];
extern Lights1 D_800E45C0[];
}
OCheepCheep::OCheepCheep(const FVector& pos, CheepType type, IPathSpan span) {
_type = type;
_spawnPos = pos;
_span = span;
}
void OCheepCheep::Tick() { // update_cheep_cheep
s32 objectIndex;
switch (_type) {
case CheepType::RACE:
UNUSED s32 pad;
OCheepCheep::func_8007BD04(0);
objectIndex = indexObjectList2[0];
OCheepCheep::func_8007BBBC(objectIndex);
object_calculate_new_pos_offset(objectIndex);
break;
case CheepType::PODIUM_CEREMONY:
objectIndex = indexObjectList2[0];
if (D_801658BC == 1) {
D_801658BC = 0;
init_object(objectIndex, 0);
}
if (gObjectList[objectIndex].state != 0) {
OCheepCheep::func_8007BEC8(objectIndex);
OCheepCheep::func_8007BFB0(objectIndex);
}
break;
}
}
void OCheepCheep::Draw(s32 cameraId) { // func_8005217C
Lights1* D_800E45C0l = (Lights1*) (D_800E45C0);
Object* object;
s32 temp_a3;
temp_a3 = indexObjectList2[0];
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);
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);
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);
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);
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);
}
}
}
void OCheepCheep::func_8007BBBC(s32 objectIndex) {
f32 var_f14;
Object* object;
object = &gObjectList[objectIndex];
switch (object->state) {
case 1:
func_800735BC(objectIndex, (Gfx*)d_course_banshee_boardwalk_dl_cheep_cheep, 2.0f);
set_object_flag(objectIndex, 0x00000010);
object->unk_0D5 = 0;
break;
case 2:
if (gIsMirrorMode != 0) {
func_80087E08(objectIndex, 18.0f, 0.7f, 25.0f, (s16) -0x00005800, 0x0000012C);
} else {
func_80087E08(objectIndex, 18.0f, 0.7f, 25.0f, (s16) 0x00005800, 0x0000012C);
}
if (object->velocity[2] < 0.0f) {
var_f14 = -object->velocity[2];
} else {
var_f14 = object->velocity[2];
}
object->direction_angle[0] = func_80041658(object->velocity[1], var_f14);
set_and_run_timer_object(objectIndex, 0x00000046);
break;
case 3:
func_80072428(objectIndex);
break;
case 0:
break;
}
}
void OCheepCheep::func_8007BD04(s32 playerId) {
s32 objectIndex;
objectIndex = indexObjectList2[0];
if (gObjectList[objectIndex].state == 0) {
if (((s32) gNearestWaypointByPlayerId[playerId] >= _span.Start) &&
((s32) gNearestWaypointByPlayerId[playerId] <= _span.End)) {
set_obj_origin_pos(objectIndex, xOrientation * _spawnPos.x, _spawnPos.y, _spawnPos.z);
init_object(objectIndex, 1);
}
}
}
void OCheepCheep::init_var_cheep_cheep(s32 objectIndex) {
Object* object;
object = &gObjectList[objectIndex];
object->unk_0D5 = 1;
object->status = 0;
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]);
set_obj_origin_offset(objectIndex, 0.0f, 30.0f, 0.0f);
set_obj_direction_angle(objectIndex, 0U, 0x3800U, 0U);
}
void OCheepCheep::func_8007BEC8(s32 objectIndex) {
Object* object;
object = &gObjectList[objectIndex];
switch (object->state) {
case 1:
OCheepCheep::init_var_cheep_cheep(objectIndex);
break;
case 2:
if (set_and_run_timer_object(objectIndex, 0x0000003C) != 0) {
set_object_flag(objectIndex, 0x00000010);
func_80086E70(objectIndex);
}
break;
case 3:
if (object->unk_0AE == 0) {
object_next_state(objectIndex);
}
break;
case 4:
if (set_and_run_timer_object(objectIndex, 0x0000000A) != 0) {
func_8008701C(objectIndex, 2);
}
break;
case 5:
if (object->unk_0AE == 0) {
func_80072428(objectIndex);
}
break;
case 0:
default:
break;
}
}
void OCheepCheep::func_8007BFB0(s32 objectIndex) {
Object* object;
object = &gObjectList[objectIndex];
switch (object->unk_0AE) {
case 0:
break;
case 1:
object->velocity[1] = -0.2f;
if ((f64) object->offset[1] <= 0.0) {
object->offset[1] = 0.0f;
object->velocity[1] = 0.0f;
func_80086F60(objectIndex);
}
break;
case 2:
if (func_800871AC(objectIndex, 0x00000014) != 0) {
object->unk_084[7] = 0x0040;
}
break;
case 3:
object->sizeScaling = (f32) ((f64) object->sizeScaling - 0.0015);
if ((s32) object->direction_angle[0] >= 0xA01) {
object->unk_084[7] -= 4;
}
if (u16_step_up_towards(object->direction_angle, 0x0C00U, (u16) object->unk_084[7]) != 0) {
func_80086FD4(objectIndex);
}
break;
case 4:
object->sizeScaling = (f32) ((f64) object->sizeScaling - 0.0015);
object->unk_034 = 0.001f;
func_80086FD4(objectIndex);
object->unk_084[7] = 0;
break;
case 5:
if (object->unk_034 <= 0.004) {
object->unk_034 += 0.0002;
}
object->sizeScaling += object->unk_034;
s16_step_up_towards(&object->unk_084[7], 0x0100, 0x0010);
object->direction_angle[0] -= object->unk_084[7];
if (func_80087060(objectIndex, 0x00000035) != 0) {
func_80086FD4(objectIndex);
}
break;
case 6:
if (func_80087060(objectIndex, 0x0000000F) != 0) {
func_80086FD4(objectIndex);
D_801658CE = 1;
}
break;
case 7:
object->sizeScaling = (f32) ((f64) object->sizeScaling - 0.05);
if ((f64) object->sizeScaling <= 0.01) {
clear_object_flag(objectIndex, 0x00000010);
object->sizeScaling = 0.000001f;
func_80086FD4(objectIndex);
}
break;
case 8:
func_80086F60(objectIndex);
break;
}
if (object->unk_0AE < 0xA) {
func_80074344(objectIndex, &object->sizeScaling, 0.2f, 0.21f, 0.001f, 0, -1);
}
object_add_velocity_offset_y(objectIndex);
object_calculate_new_pos_offset(objectIndex);
}
+48
View File
@@ -0,0 +1,48 @@
#pragma once
#include <libultraship.h>
#include <vector>
#include "Object.h"
#include "World.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "common_structs.h"
#include "objects.h"
#include "course_offsets.h"
#include "some_data.h"
}
class OCheepCheep : public OObject {
public:
enum CheepType {
RACE,
PODIUM_CEREMONY
};
enum Behaviour : uint16_t {
};
public:
explicit OCheepCheep(const FVector& pos, CheepType type, IPathSpan span);
virtual void Tick() override;
virtual void Draw(s32 cameraId) override;
void func_8007BBBC(s32 objectIndex);
void func_8007BD04(s32 playerId);
void init_var_cheep_cheep(s32 objectIndex);
void func_8007BEC8(s32 objectIndex);
void func_8007BFB0(s32 objectIndex);
private:
s32 _idx;
CheepType _type;
FVector _spawnPos;
IPathSpan _span;
};
+175
View File
@@ -0,0 +1,175 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "Crab.h"
#include <vector>
#include "port/Game.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "defines.h"
#include "camera.h"
#include "update_objects.h"
#include "render_objects.h"
#include "actors.h"
#include "code_80057C60.h"
#include "code_80086E70.h"
#include "math_util.h"
#include "math_util_2.h"
#include "code_80005FD0.h"
#include "some_data.h"
#include "ceremony_and_credits.h"
#include "assets/koopa_troopa_beach_data.h"
}
size_t OCrab::_count = 0;
OCrab::OCrab(const FVector2D& start, const FVector2D& end) {
s32 objectId;
_idx = _count;
_start = start;
_end = end;
objectId = indexObjectList1[_idx];
init_object(objectId, 0);
gObjectList[objectId].pos[0] = gObjectList[objectId].origin_pos[0] = start.x * xOrientation;
gObjectList[objectId].pos[2] = gObjectList[objectId].origin_pos[2] = start.z;
gObjectList[objectId].unk_01C[0] = end.x * xOrientation;
gObjectList[objectId].unk_01C[2] = end.z;
_count++;
}
void OCrab::Tick(void) {
s32 objectIndex;
objectIndex = indexObjectList1[_idx];
if (gObjectList[objectIndex].state != 0) {
OCrab::func_80082B34(objectIndex);
func_8008A6DC(objectIndex, 500.0f);
OCrab::func_80082C30(objectIndex);
OCrab::func_80082E18(objectIndex);
}
}
void OCrab::Draw(s32 cameraId) {
Camera* camera;
s32 objectIndex = indexObjectList1[_idx];
if (gObjectList[objectIndex].state >= 2) {
Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(common_vtx_hedgehog);
camera = &camera1[cameraId];
func_8004A6EC(objectIndex, 0.5f);
gObjectList[objectIndex].orientation[1] =
func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
draw_2d_texture_at(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation,
gObjectList[objectIndex].sizeScaling, (u8*) gObjectList[objectIndex].activeTLUT,
(uint8_t*)gObjectList[objectIndex].activeTexture, vtx, 64, 64,
64, 32);
}
}
void OCrab::DrawModel(s32 cameraId) {
s32 someIndex;
s32 test;
test = indexObjectList1[_idx];
func_8008A364(test, cameraId, 0x2AABU, 800);
if (is_obj_flag_status_active(test, VISIBLE) != 0) {
Camera *camera;
s32 objectIndex;
if (gObjectList[objectIndex].state >= 2) {
camera = &camera1[cameraId];
func_8004A6EC(objectIndex, 0.5f);
gObjectList[objectIndex].orientation[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
draw_2d_texture_at(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation, gObjectList[objectIndex].sizeScaling, (u8*) gObjectList[objectIndex].activeTLUT, (u8*)gObjectList[objectIndex].activeTexture, (Vtx*)common_vtx_hedgehog, 0x00000040, 0x00000040, 0x00000040, 0x00000020);
}
}
}
void OCrab::init_ktb_crab(s32 objectIndex) {
Object* object;
init_texture_object(objectIndex, (uint8_t*) d_course_koopa_troopa_beach_crab_tlut,
(const char**) d_course_koopa_troopa_beach_crab_frames, 64, (u16) 64);
object = &gObjectList[objectIndex];
object->sizeScaling = 0.15f;
object->textureListIndex = 0;
object_next_state(objectIndex);
object->boundingBoxSize = 1;
set_object_flag(objectIndex, 0x04000420);
func_80086EAC(objectIndex, 0, 1);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
set_obj_orientation(objectIndex, 0U, 0U, 0x8000U);
object->unk_034 = 1.5f;
set_object_flag(objectIndex, 0x00000200);
}
void OCrab::func_80082B34(s32 objectIndex) {
switch (gObjectList[objectIndex].state) { /* irregular */
case 0:
break;
case 1:
OCrab::init_ktb_crab(objectIndex);
break;
case 2:
func_80072E54(objectIndex, 0, 3, 1, 2, -1);
break;
case 3:
func_80072E54(objectIndex, 4, 6, 1, 2, -1);
break;
}
if (gObjectList[objectIndex].state >= 2) {
func_80073514(objectIndex);
}
}
void OCrab::func_80082C30(s32 objectIndex) {
switch (gObjectList[objectIndex].unk_0AE) {
case 1:
if (func_80087A0C(objectIndex, gObjectList[objectIndex].origin_pos[0], gObjectList[objectIndex].unk_01C[0],
gObjectList[objectIndex].origin_pos[2], gObjectList[objectIndex].unk_01C[2]) != 0) {
func_800726CC(objectIndex, 3);
func_80086FD4(objectIndex);
}
break;
case 2:
if (func_80087104(objectIndex, 0x003CU) != 0) {
gObjectList[objectIndex].unk_034 = 0.8f;
func_800726CC(objectIndex, 2);
func_80086FD4(objectIndex);
}
break;
case 3:
if (func_80087954(objectIndex, 0x0000003C) != 0) {
func_80086FD4(objectIndex);
func_800726CC(objectIndex, 3);
}
break;
case 4:
if (func_80087104(objectIndex, 0x003CU) != 0) {
func_800726CC(objectIndex, 2);
func_80086FD4(objectIndex);
}
break;
case 5:
if (func_8008789C(objectIndex, 0x0000003C) != 0) {
func_800726CC(objectIndex, 3);
func_8008701C(objectIndex, 2);
}
break;
}
object_calculate_new_pos_offset(objectIndex);
if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) {
func_80088538(objectIndex);
gObjectList[objectIndex].pos[1] = (f32) (gObjectList[objectIndex].surfaceHeight + 2.5);
}
}
void OCrab::func_80082E18(s32 objectIndex) {
if (gObjectList[objectIndex].state >= 2) {
func_80089F24(objectIndex);
}
}
+48
View File
@@ -0,0 +1,48 @@
#pragma once
#include <libultraship.h>
#include <vector>
#include "engine/objects/Object.h"
#include "World.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "vehicles.h"
#include "waypoints.h"
#include "common_structs.h"
#include "objects.h"
#include "course_offsets.h"
#include "some_data.h"
}
/**
* @arg start x and z spawn location
* @arg end x and z patrol location
*
* Crab patrols between start and end.
* The game automatically places the actor on the course surface.
* Therefore, providing a Y height is unnecessary.
*
* Crab appears to have a maximum patrolling distance and will patrol between
* end --> max distance rather than start --> end or start --> max distance.
*/
class OCrab : public OObject {
public:
explicit OCrab(const FVector2D& start, const FVector2D& end);
virtual void Tick() override;
virtual void Draw(s32 cameraId) override;
void DrawModel(s32 cameraId);
void init_ktb_crab(s32 objectIndex);
void func_80082B34(s32 objectIndex);
void func_80082C30(s32 objectIndex);
void func_80082E18(s32 objectIndex);
private:
FVector2D _start;
FVector2D _end;
static size_t _count;
s32 _idx;
};
+85
View File
@@ -0,0 +1,85 @@
#include "Flagpole.h"
#include "World.h"
extern "C" {
#include "code_800029B0.h"
#include "render_objects.h"
#include "update_objects.h"
#include "assets/yoshi_valley_data.h"
#include "assets/common_data.h"
#include "math_util.h"
#include "math_util_2.h"
#include "code_80086E70.h"
#include "code_80057C60.h"
}
size_t OFlagpole::_count = 0;
OFlagpole::OFlagpole(const FVector& pos, s16 direction) {
_idx = _count;
_pos = pos;
_direction = direction;
init_object(indexObjectList1[_idx], 0);
_count++;
}
void OFlagpole::Tick() { // func_80083080
s32 objectIndex = indexObjectList1[_idx];
if (gObjectList[objectIndex].state != 0) {
OFlagpole::func_80083018(objectIndex);
OFlagpole::func_80083060(objectIndex);
}
}
void OFlagpole::Draw(s32 cameraId) { // func_80055228
s32 objectIndex = indexObjectList1[_idx];
func_8008A364(objectIndex, cameraId, 0x4000U, 0x000005DC);
if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) {
OFlagpole::func_80055164(objectIndex);
}
}
void OFlagpole::func_80055164(s32 objectIndex) { // func_80055164
if (gObjectList[objectIndex].state >= 2) {
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0077A0);
rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].direction_angle,
gObjectList[objectIndex].sizeScaling);
if (gIsGamePaused == 0) {
gObjectList[objectIndex].unk_0A2 = render_animated_model((Armature*) gObjectList[objectIndex].model,
(Animation**) gObjectList[objectIndex].vertex, 0,
gObjectList[objectIndex].unk_0A2);
} else {
render_animated_model((Armature*) gObjectList[objectIndex].model,
(Animation**) gObjectList[objectIndex].vertex, 0, gObjectList[objectIndex].unk_0A2);
}
}
}
void OFlagpole::func_80082F1C(s32 objectIndex) {
gObjectList[objectIndex].model = (Gfx*) d_course_yoshi_valley_unk5;
gObjectList[objectIndex].vertex = (Vtx*) d_course_yoshi_valley_unk4;
gObjectList[objectIndex].sizeScaling = 0.027f;
object_next_state(objectIndex);
set_obj_origin_pos(objectIndex, _pos.x * xOrientation, _pos.y, _pos.z);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
set_obj_direction_angle(objectIndex, 0U, _direction, 0U);
}
void OFlagpole::func_80083018(s32 objectIndex) {
switch (gObjectList[objectIndex].state) {
case 1:
OFlagpole::func_80082F1C(objectIndex);
break;
case 0:
default:
break;
}
}
void OFlagpole::func_80083060(s32 objectIndex) {
object_calculate_new_pos_offset(objectIndex);
}
+45
View File
@@ -0,0 +1,45 @@
#pragma once
#include <libultraship.h>
#include <vector>
#include "Object.h"
#include "World.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "vehicles.h"
#include "waypoints.h"
#include "common_structs.h"
#include "objects.h"
#include "camera.h"
#include "some_data.h"
}
class OFlagpole : public OObject {
public:
explicit OFlagpole(const FVector& pos, s16 direction);
~OFlagpole() {
_count--;
}
static size_t GetCount() {
return _count;
}
virtual void Tick() override;
virtual void Draw(s32 cameraId) override;
void func_80055164(s32 objectIndex);
void func_80082F1C(s32 objectIndex);
void func_80083018(s32 objectIndex);
void func_80083060(s32 objectIndex);
private:
FVector _pos;
s16 _direction;
static size_t _count;
size_t _idx;
};
+183
View File
@@ -0,0 +1,183 @@
#include "Hedgehog.h"
#include "World.h"
extern "C" {
#include "render_objects.h"
#include "update_objects.h"
#include "assets/yoshi_valley_data.h"
#include "assets/common_data.h"
#include "math_util.h"
#include "math_util_2.h"
#include "code_80086E70.h"
#include "code_80057C60.h"
}
size_t OHedgehog::_count = 0;
OHedgehog::OHedgehog(const FVector& pos, const FVector2D& patrolPoint, s16 unk) {
_idx = _count;
_pos = pos;
s32 objectId = indexObjectList2[_idx];
init_object(objectId, 0);
gObjectList[objectId].pos[0] = gObjectList[objectId].origin_pos[0] = pos.x * xOrientation;
gObjectList[objectId].pos[1] = gObjectList[objectId].surfaceHeight = pos.y + 6.0;
gObjectList[objectId].pos[2] = gObjectList[objectId].origin_pos[2] = pos.z;
gObjectList[objectId].unk_0D5 = (u8)unk;
gObjectList[objectId].unk_09C = patrolPoint.x * xOrientation;
gObjectList[objectId].unk_09E = patrolPoint.z;
_count++;
}
void OHedgehog::Tick() {
s32 objectIndex = indexObjectList2[_idx];
OHedgehog::func_800833D0(objectIndex, _idx);
OHedgehog::func_80083248(objectIndex);
OHedgehog::func_80083474(objectIndex);
// This func clears a bit from all hedgehogs. This results in setting the height of all hedgehogs to zero.
// The solution is to only clear the bit from the current instance; `self` or `this`
//func_80072120(indexObjectList2, NUM_HEDGEHOGS);
clear_object_flag(objectIndex, 0x00600000); // The fix
}
void OHedgehog::Draw(s32 cameraId) {
s32 objectIndex = indexObjectList2[_idx];
u32 something = func_8008A364(objectIndex, cameraId, 0x4000U, 0x000003E8);
if (CVarGetInteger("gNoCulling", 0) == 1) {
something = MIN(something, 0x52211U - 1);
}
if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) {
set_object_flag(objectIndex, 0x00200000);
if (something < 0x2711U) {
set_object_flag(objectIndex, 0x00000020);
} else {
clear_object_flag(objectIndex, 0x00000020);
}
if (something < 0x57E41U) {
set_object_flag(objectIndex, 0x00400000);
}
if (something < 0x52211U) {
OHedgehog::func_800555BC(objectIndex, cameraId);
}
}
}
void OHedgehog::func_800555BC(s32 objectIndex, s32 cameraId) {
Camera* camera;
if (gObjectList[objectIndex].state >= 2) {
camera = &camera1[cameraId];
OHedgehog::func_8004A870(objectIndex, 0.7f);
gObjectList[objectIndex].orientation[1] =
func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
draw_2d_texture_at(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation,
gObjectList[objectIndex].sizeScaling, (u8*) gObjectList[objectIndex].activeTLUT,
(u8*)gObjectList[objectIndex].activeTexture, gObjectList[objectIndex].vertex, 64, 64, 64, 32);
}
}
void OHedgehog::func_8004A870(s32 objectIndex, f32 arg1) {
Mat4 mtx;
Object* object;
if ((is_obj_flag_status_active(objectIndex, 0x00000020) != 0) &&
(is_obj_flag_status_active(objectIndex, 0x00800000) != 0)) {
object = &gObjectList[objectIndex];
D_80183E50[0] = object->pos[0];
D_80183E50[1] = object->surfaceHeight + 0.8;
D_80183E50[2] = object->pos[2];
set_transform_matrix(mtx, object->unk_01C, D_80183E50, 0U, arg1);
// convert_to_fixed_point_matrix(&gGfxPool->mtxHud[gMatrixHudCount], mtx);
// gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]),
// G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
AddHudMatrix(mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007B98);
}
}
const char* sHedgehogTexList[] = { d_course_yoshi_valley_hedgehog };
void OHedgehog::func_8008311C(s32 objectIndex, s32 arg1) {
Object* object;
Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(common_vtx_hedgehog);
init_texture_object(objectIndex, (u8*)d_course_yoshi_valley_hedgehog_tlut, sHedgehogTexList, 0x40U, (u16) 0x00000040);
object = &gObjectList[objectIndex];
object->activeTLUT = d_course_yoshi_valley_hedgehog_tlut;
object->activeTexture = d_course_yoshi_valley_hedgehog;
object->vertex = vtx;
object->sizeScaling = 0.2f;
object->textureListIndex = 0;
object_next_state(objectIndex);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
set_obj_orientation(objectIndex, 0U, 0U, 0x8000U);
object->unk_034 = ((arg1 % 6) * 0.1) + 0.5;
func_80086E70(objectIndex);
set_object_flag(objectIndex, 0x04000600);
object->boundingBoxSize = 2;
}
void OHedgehog::func_80083248(s32 objectIndex) {
switch (gObjectList[objectIndex].unk_0AE) {
case 0:
break;
case 1:
if (func_80087A0C(objectIndex, gObjectList[objectIndex].origin_pos[0], gObjectList[objectIndex].unk_09C,
gObjectList[objectIndex].origin_pos[2], gObjectList[objectIndex].unk_09E) != 0) {
func_80086FD4(objectIndex);
}
break;
case 2:
func_800871AC(objectIndex, 0x0000003C);
break;
case 3:
if (func_80087A0C(objectIndex, gObjectList[objectIndex].unk_09C, gObjectList[objectIndex].origin_pos[0],
gObjectList[objectIndex].unk_09E, gObjectList[objectIndex].origin_pos[2]) != 0) {
func_80086FD4(objectIndex);
}
break;
case 4:
if (func_80087060(objectIndex, 0x0000003C) != 0) {
func_8008701C(objectIndex, 1);
}
break;
}
object_calculate_new_pos_offset(objectIndex);
if (is_obj_flag_status_active(objectIndex, 0x00200000) != 0) {
if (is_obj_flag_status_active(objectIndex, 0x00400000) != 0) {
func_8008861C(objectIndex);
}
gObjectList[objectIndex].pos[1] = gObjectList[objectIndex].surfaceHeight + 6.0;
}
}
void OHedgehog::func_800833D0(s32 objectIndex, s32 arg1) {
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
OHedgehog::func_8008311C(objectIndex, arg1);
break;
case 2:
func_80072D3C(objectIndex, 0, 1, 4, -1);
break;
}
if (gObjectList[objectIndex].textureListIndex == 0) {
Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(common_vtx_hedgehog);
gObjectList[objectIndex].vertex = vtx;
} else {
Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(D_0D006130);
gObjectList[objectIndex].vertex = vtx;
}
}
void OHedgehog::func_80083474(s32 objectIndex) {
if (gObjectList[objectIndex].state >= 2) {
func_80089F24(objectIndex);
}
}
+53
View File
@@ -0,0 +1,53 @@
#pragma once
#include <libultraship.h>
#include <vector>
#include "Object.h"
#include "engine/World.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "vehicles.h"
#include "waypoints.h"
#include "common_structs.h"
#include "objects.h"
#include "camera.h"
#include "some_data.h"
}
/**
* @arg pos FVector xyz spawn position
* @arg patrolPoint FVector2D xz patrol to location. Actor automatically calculates the Y value
* @arg unk unknown. Likely actor type.
*/
class OHedgehog : public OObject {
public:
explicit OHedgehog(const FVector& pos, const FVector2D& patrolPoint, s16 unk);
~OHedgehog() {
_count--;
}
static size_t GetCount() {
return _count;
}
virtual void Tick() override;
virtual void Draw(s32 cameraId) override;
void func_800555BC(s32 objectIndex, s32 cameraId);
void func_8004A870(s32 objectIndex, f32 arg1);
void func_8008311C(s32 objectIndex, s32 arg1);
void func_80083248(s32 objectIndex);
void func_800833D0(s32 objectIndex, s32 arg1);
void func_80083474(s32 objectIndex);
private:
FVector _pos;
static size_t _count;
size_t _idx;
};
+174
View File
@@ -0,0 +1,174 @@
#include "HotAirBalloon.h"
#include "World.h"
#include "port/Game.h"
extern "C" {
#include "render_objects.h"
#include "update_objects.h"
#include "assets/luigi_raceway_data.h"
#include "assets/common_data.h"
#include "math_util.h"
#include "math_util_2.h"
#include "code_80086E70.h"
#include "code_80057C60.h"
#include "actors.h"
}
OHotAirBalloon::OHotAirBalloon(const FVector& pos) {
_pos = pos;
D_80165898 = 0;
// Spawn balloon on second lap.
if (GetCourse() == GetLuigiRaceway()) {
_visible = (bool*)&D_80165898;
} else { // Spawn balloon on race start
bool mod = true;
_visible = &mod;
}
init_object(indexObjectList1[0], 0);
}
void OHotAirBalloon::Tick() {
s32 objectIndex = indexObjectList1[0];
if (*_visible) {
if (gObjectList[objectIndex].state != 0) {
OHotAirBalloon::func_80085768(objectIndex);
OHotAirBalloon::func_80085534(objectIndex);
object_calculate_new_pos_offset(objectIndex);
if (gObjectList[objectIndex].state >= 2) {
gActorHotAirBalloonItemBox->pos[0] = gObjectList[objectIndex].pos[0];
gActorHotAirBalloonItemBox->pos[1] = gObjectList[objectIndex].pos[1] - 10.0;
gActorHotAirBalloonItemBox->pos[2] = gObjectList[objectIndex].pos[2];
}
}
}
}
void OHotAirBalloon::Draw(s32 cameraId) {
s32 objectIndex;
objectIndex = indexObjectList1[0];
if (*_visible) {
if (gGamestate != CREDITS_SEQUENCE) {
func_8008A1D0(objectIndex, cameraId, 0x000005DC, 0x00000BB8);
if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) {
OHotAirBalloon::func_80055CCC(objectIndex, cameraId);
}
} else {
clear_object_flag(objectIndex, 0x00100000);
OHotAirBalloon::func_80055CCC(objectIndex, cameraId);
}
}
}
void OHotAirBalloon::func_80055CCC(s32 objectIndex, s32 cameraId) {
UNUSED s32 pad;
f32 test;
Camera* camera;
camera = &camera1[cameraId];
if (gObjectList[objectIndex].state >= 2) {
func_8008A454(objectIndex, cameraId, 0x0000012C);
test = gObjectList[objectIndex].pos[1] - gObjectList[objectIndex].surfaceHeight;
func_8004A6EC(objectIndex, (20.0 / test) + 0.5);
if (is_obj_index_flag_status_inactive(objectIndex, 0x00100000) != 0) {
func_80043328(gObjectList[objectIndex].pos, (u16*) gObjectList[objectIndex].direction_angle,
gObjectList[objectIndex].sizeScaling, (Gfx*)d_course_luigi_raceway_dl_F960);
gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_luigi_raceway_dl_F650);
} else {
D_80183E80[0] = (s16) gObjectList[objectIndex].direction_angle[0];
D_80183E80[1] =
(s16) (func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos) +
0x8000);
D_80183E80[2] = (u16) gObjectList[objectIndex].direction_angle[2];
func_80043328(gObjectList[objectIndex].pos, D_80183E80, gObjectList[objectIndex].sizeScaling,
(Gfx*)d_course_luigi_raceway_dl_FBE0);
gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_luigi_raceway_dl_FA20);
if (gPlayerCountSelection1 == 1) {
gObjectList[objectIndex].direction_angle[1] = 0;
}
}
}
}
void OHotAirBalloon::init_hot_air_balloon(s32 objectIndex) {
gObjectList[objectIndex].sizeScaling = 1.0f;
gObjectList[objectIndex].model = (Gfx*)d_course_luigi_raceway_dl_F960;
if (gGamestate != CREDITS_SEQUENCE) {
set_obj_origin_pos(objectIndex, xOrientation * _pos.x, _pos.y, _pos.z);
set_obj_origin_offset(objectIndex, 0.0f, 300.0f, 0.0f);
} else {
set_obj_origin_pos(objectIndex, xOrientation * _pos.x, _pos.y, _pos.z);
set_obj_origin_offset(objectIndex, 0.0f, 300.0f, 0.0f);
}
func_8008B844(objectIndex);
func_800886F4(objectIndex);
func_80086EF0(objectIndex);
gObjectList[objectIndex].velocity[1] = -2.0f;
init_actor_hot_air_balloon_item_box(0.0f, 0.0f, 0.0f);
object_next_state(objectIndex);
}
void OHotAirBalloon::func_80085534(s32 objectIndex) {
switch (gObjectList[objectIndex].unk_0AE) {
case 1:
if (gObjectList[objectIndex].offset[1] <= 18.0) {
func_80086FD4(objectIndex);
}
break;
case 2:
f32_step_towards(&gObjectList[objectIndex].velocity[1], 0.0f, 0.05f);
if (gObjectList[objectIndex].velocity[1] == 0.0) {
func_80086FD4(objectIndex);
}
break;
case 3:
func_800871AC(objectIndex, 1);
break;
case 4:
f32_step_towards(&gObjectList[objectIndex].velocity[1], 1.0f, 0.05f);
if (gObjectList[objectIndex].velocity[1] == 1.0) {
func_80086FD4(objectIndex);
}
break;
case 5:
func_800871AC(objectIndex, 90);
break;
case 6:
f32_step_towards(&gObjectList[objectIndex].velocity[1], 0.0f, 0.05f);
if (gObjectList[objectIndex].velocity[1] == 0.0) {
func_80086FD4(objectIndex);
}
break;
case 7:
f32_step_towards(&gObjectList[objectIndex].velocity[1], -1.0f, 0.05f);
if (gObjectList[objectIndex].velocity[1] == -1.0) {
func_80086FD4(objectIndex);
}
break;
case 8:
func_800871AC(objectIndex, 90);
break;
case 9:
f32_step_towards(&gObjectList[objectIndex].velocity[1], 0.0f, 0.05f);
if (func_80087060(objectIndex, 90) != 0) {
func_8008701C(objectIndex, 3);
}
break;
}
object_add_velocity_offset_y(objectIndex);
gObjectList[objectIndex].direction_angle[1] += 0x100;
}
void OHotAirBalloon::func_80085768(s32 objectIndex) {
switch (gObjectList[objectIndex].state) { /* irregular */
case 1:
OHotAirBalloon::init_hot_air_balloon(objectIndex);
break;
case 0:
case 2:
break;
}
}
+34
View File
@@ -0,0 +1,34 @@
#pragma once
#include <libultraship.h>
#include <vector>
#include "Object.h"
#include "World.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "vehicles.h"
#include "waypoints.h"
#include "common_structs.h"
#include "objects.h"
#include "camera.h"
#include "some_data.h"
}
class OHotAirBalloon : public OObject {
public:
explicit OHotAirBalloon(const FVector& pos);
virtual void Tick() override;
virtual void Draw(s32 cameraId) override;
void func_80055CCC(s32 objectIndex, s32 cameraId);
void init_hot_air_balloon(s32 objectIndex);
void func_80085534(s32 objectIndex);
void func_80085768(s32 objectIndex);
private:
FVector _pos;
bool *_visible;
};
+856
View File
@@ -0,0 +1,856 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "Lakitu.h"
#include <vector>
#include "port/Game.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "actors.h"
#include "math_util.h"
#include "sounds.h"
#include "update_objects.h"
#include "render_player.h"
#include "external.h"
#include "bomb_kart.h"
#include "collision.h"
#include "code_80086E70.h"
#include "render_objects.h"
#include "code_80057C60.h"
#include "defines.h"
#include "code_80005FD0.h"
#include "math_util_2.h"
#include "collision.h"
#include "assets/bowsers_castle_data.h"
#include "ceremony_and_credits.h"
#include "objects.h"
#include "update_objects.h"
#include "render_objects.h"
#include "course_offsets.h"
#include "data/some_data.h"
#include "race_logic.h"
#include "effects.h"
#include "memory.h"
extern s8 gPlayerCount;
}
OLakitu::OLakitu(s32 playerId, LakituType type) {
_playerId = playerId;
init_object(gIndexLakituList[playerId], (s32)type);
}
void OLakitu::Activate(LakituType type) {
init_object(gIndexLakituList[_playerId], (s32)type);
}
void OLakitu::Tick() {
OLakitu::func_8007AA44(_playerId);
}
void OLakitu::Tick60fps() { // update_object_lakitu
s32 playerId = _playerId;
s32 objectIndex = gIndexLakituList[playerId];
switch (gObjectList[objectIndex].unk_0D8) {
case 0:
break;
case 1:
OLakitu::update_object_lakitu_starter(objectIndex, playerId);
func_8008BFFC(objectIndex);
break;
case 2:
OLakitu::update_object_lakitu_checkered_flag(objectIndex, playerId);
func_8008BFFC(objectIndex);
break;
case 3:
OLakitu::update_object_lakitu_fishing(objectIndex, playerId);
break;
case 4:
OLakitu::update_object_lakitu_second_lap(objectIndex, playerId);
func_8008BFFC(objectIndex);
break;
case 5:
OLakitu::update_object_lakitu_final_lap(objectIndex, playerId);
func_8008BFFC(objectIndex);
break;
case 6:
OLakitu::update_object_lakitu_reverse(objectIndex, playerId);
func_8008BFFC(objectIndex);
break;
case 7:
OLakitu::update_object_lakitu_fishing2(objectIndex, playerId);
break;
}
}
void OLakitu::Draw(s32 cameraId) {
UNUSED s32 stackPadding;
Camera* camera;
f32 var_f0;
f32 var_f2;
s32 objectIndex;
Object* object;
objectIndex = gIndexLakituList[cameraId];
camera = &camera1[cameraId];
if (is_obj_flag_status_active(objectIndex, 0x00000010) != 0) {
object = &gObjectList[objectIndex];
object->orientation[0] = 0;
object->orientation[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos);
object->orientation[2] = 0x8000;
if (func_80072354(objectIndex, 2) != 0) {
draw_2d_texture_at(object->pos, object->orientation, object->sizeScaling, (u8*) object->activeTLUT,
(u8*)object->activeTexture, object->vertex, (s32) object->textureWidth,
(s32) object->textureHeight, (s32) object->textureWidth,
(s32) object->textureHeight / 2);
} else {
func_800485C4(object->pos, object->orientation, object->sizeScaling, (s32) object->primAlpha,
(u8*) object->activeTLUT, (u8*)object->activeTexture, object->vertex, (s32) object->textureWidth,
(s32) object->textureHeight, (s32) object->textureWidth, (s32) object->textureHeight / 2);
}
if (gScreenModeSelection == SCREEN_MODE_1P) {
var_f0 = object->pos[0] - camera->pos[0];
var_f2 = object->pos[2] - camera->pos[2];
if (var_f0 < 0.0f) {
var_f0 = -var_f0;
}
if (var_f2 < 0.0f) {
var_f2 = -var_f2;
}
if ((var_f0 + var_f2) <= 200.0) {
func_8004A630(&D_8018C0B0[cameraId], object->pos, 0.35f);
}
}
}
}
void OLakitu::func_80079114(s32 objectIndex, s32 playerId, s32 arg2) {
s32 a;
if (gObjectList[objectIndex].state >= 2) {
if ((u8) gObjectList[objectIndex].unk_0D8 == 1) {
if (playerId == 0) {
func_80074894(objectIndex, gLakituTexturePtr);
return;
}
a = gIndexLakituList[0];
gObjectList[objectIndex].activeTLUT = gObjectList[a].activeTLUT;
gObjectList[objectIndex].activeTexture = gObjectList[a].activeTexture;
if (0) {}
return;
}
switch (arg2) {
case 0:
func_800748F4(objectIndex, gLakituTexturePtr);
break;
case 1:
func_800748C4(objectIndex, gLakituTexturePtr);
break;
case 2:
func_80074894(objectIndex, gLakituTexturePtr);
break;
}
}
}
void OLakitu::func_800791F0(s32 objectIndex, s32 playerId) {
Player* player = &gPlayerOne[playerId];
if ((gObjectList[objectIndex].unk_0D8 != 3) && (gObjectList[objectIndex].unk_0D8 != 7)) {
func_800722CC(objectIndex, 1);
if (CourseManager_GetProps()->LakituTowType == LakituTowType::ICE) {
player->unk_0CA &= 0xFFEF;
}
}
if (CourseManager_GetProps()->LakituTowType == LakituTowType::ICE) {
func_800722CC(objectIndex, 0x00000010);
player->unk_0CA &= 0xFFDF;
}
func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28));
}
static const char* sLakituTextures[] = {
gTextureLakituNoLights1, gTextureLakituNoLights2, gTextureLakituNoLights3, gTextureLakituNoLights4,
gTextureLakituNoLights5, gTextureLakituNoLights6, gTextureLakituNoLights7, gTextureLakituNoLights8,
gTextureLakituRedLights01, gTextureLakituRedLights02, gTextureLakituRedLights03, gTextureLakituRedLights04,
gTextureLakituRedLights05, gTextureLakituRedLights06, gTextureLakituRedLights07, gTextureLakituRedLights08,
gTextureLakituRedLights09, gTextureLakituRedLights10, gTextureLakituRedLights11, gTextureLakituRedLights12,
gTextureLakituRedLights13, gTextureLakituRedLights14, gTextureLakituRedLights15, gTextureLakituRedLights16,
gTextureLakituBlueLight1, gTextureLakituBlueLight2, gTextureLakituBlueLight3, gTextureLakituBlueLight4,
gTextureLakituBlueLight5, gTextureLakituBlueLight6, gTextureLakituBlueLight7, gTextureLakituBlueLight8,
};
void OLakitu::init_obj_lakitu_starter_and_checkered_flag(s32 objectIndex, s32 playerId) {
if (playerId == 0) {
D_801656F0 = 0;
D_8018D168 = 0;
}
// u8 *tlut = (u8 *) LOAD_ASSET_RAW(common_tlut_lakitu_countdown);
// u8 *lights = (u8 *) LOAD_ASSET_RAW(gTextureLakituNoLights1);
init_texture_object(
objectIndex,
(u8*) load_lakitu_tlut_x64(common_tlut_lakitu_countdown, ARRAY_COUNT(common_tlut_lakitu_countdown)),
sLakituTextures, 56, (u16) 72);
Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(common_vtx_lakitu);
gObjectList[objectIndex].vertex = vtx;
gObjectList[objectIndex].sizeScaling = 0.15f;
clear_object_flag(objectIndex, 0x00000010);
object_next_state(objectIndex);
gObjectList[objectIndex].unk_048 = D_8018D180;
}
void OLakitu::update_object_lakitu_starter(s32 objectIndex, s32 arg1) {
UNUSED s32 pad;
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
OLakitu::init_obj_lakitu_starter_and_checkered_flag(objectIndex, arg1);
break;
case 2:
set_and_run_timer_object(objectIndex, gObjectList[objectIndex].unk_048);
if ((gObjectList[objectIndex].timer == 0x00000055) && (gPlayerCount == 3) && (arg1 == 0)) {
D_8018D168 = 1;
}
break;
case 3:
set_object_flag(objectIndex, 0x00000010);
func_80086F10(objectIndex, 1, &D_800E67B8); // set a spline
object_next_state(objectIndex);
break;
case 4:
if ((set_and_run_timer_object(objectIndex, 0x0000001E) != false) && (gPlayerCount != 3) && (arg1 == 0)) {
D_8018D168 = 1;
}
break;
case 5:
set_and_run_timer_object(objectIndex, 0x0000001E);
break;
case 6:
func_80072E54(objectIndex, 1, 7, 1, 2, 0);
break;
case 7:
if (set_and_run_timer_object(objectIndex, 0x00000014) != 0) {
gObjectList[objectIndex].tlutList += 0x200;
if (arg1 == 0) {
play_sound2(SOUND_ACTION_COUNTDOWN_LIGHT);
}
}
break;
case 8:
func_80072E54(objectIndex, 8, 0x0000000F, 1, 6, 0);
break;
case 9:
if ((set_and_run_timer_object(objectIndex, 8) != 0) && (arg1 == 0)) {
play_sound2(SOUND_ACTION_COUNTDOWN_LIGHT);
}
break;
case 10:
if ((func_80072E54(objectIndex, 0x00000010, 0x00000017, 1, 6, 0) != 0) && (arg1 == 0)) {
D_801656F0 = 1;
}
break;
case 11:
if (set_and_run_timer_object(objectIndex, 8) != 0) {
gObjectList[objectIndex].tlutList += 0x200;
if (arg1 == 0) {
play_sound2(SOUND_ACTION_GREEN_LIGHT);
}
}
break;
case 12:
func_80072E54(objectIndex, 0x00000018, 0x0000001B, 1, 6, 0);
break;
case 13:
if (arg1 == 0) {
OLakitu::func_800729EC(objectIndex);
D_8018D160 = 1;
break;
}
object_next_state(objectIndex);
break;
case 14:
set_and_run_timer_object(objectIndex, 0x00000078);
break;
case 15:
func_80072428(objectIndex);
break;
}
}
void OLakitu::func_800729EC(s32 objectIndex) {
u32 temp_v1 = 1;
s32 i;
start_race();
object_next_state(objectIndex);
D_8018D2BC = 1;
D_8018D2A4 = 1;
if (GetCourse() != GetYoshiValley()) {
for (i = 0; i < gPlayerCount; i++) {
playerHUD[i].unk_81 = temp_v1;
}
}
func_8005AB20();
}
static const char* sLakituCheckeredList[] = {
gTextureLakituCheckeredFlag01, gTextureLakituCheckeredFlag02, gTextureLakituCheckeredFlag03,
gTextureLakituCheckeredFlag04, gTextureLakituCheckeredFlag05, gTextureLakituCheckeredFlag06,
gTextureLakituCheckeredFlag07, gTextureLakituCheckeredFlag08, gTextureLakituCheckeredFlag09,
gTextureLakituCheckeredFlag10, gTextureLakituCheckeredFlag11, gTextureLakituCheckeredFlag12,
gTextureLakituCheckeredFlag13, gTextureLakituCheckeredFlag14, gTextureLakituCheckeredFlag15,
gTextureLakituCheckeredFlag16, gTextureLakituCheckeredFlag17, gTextureLakituCheckeredFlag18,
gTextureLakituCheckeredFlag19, gTextureLakituCheckeredFlag20, gTextureLakituCheckeredFlag21,
gTextureLakituCheckeredFlag22, gTextureLakituCheckeredFlag23, gTextureLakituCheckeredFlag24,
gTextureLakituCheckeredFlag25, gTextureLakituCheckeredFlag26, gTextureLakituCheckeredFlag27,
gTextureLakituCheckeredFlag28, gTextureLakituCheckeredFlag29, gTextureLakituCheckeredFlag30,
gTextureLakituCheckeredFlag31, gTextureLakituCheckeredFlag32
};
void OLakitu::init_obj_lakitu_checkered_flag(s32 objectIndex, s32 playerIndex) {
Object* object;
OLakitu::func_800791F0(objectIndex, playerIndex);
u8* tex = (u8*) LOAD_ASSET_RAW(common_tlut_lakitu_checkered_flag);
Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(common_vtx_also_lakitu);
init_texture_object(objectIndex, (u8*) tex, sLakituCheckeredList, 0x48U, (u16) 0x00000038);
object = &gObjectList[objectIndex];
object->activeTexture = *gObjectList[objectIndex].textureList;
object->vertex = vtx;
object->pos[2] = 5000.0f;
object->pos[1] = 5000.0f;
object->pos[0] = 5000.0f;
object->sizeScaling = 0.15f;
func_80086F10(objectIndex, 2, &D_800E6834);
clear_object_flag(objectIndex, 0x00000010);
object_next_state(objectIndex);
}
void OLakitu::update_object_lakitu_checkered_flag(s32 objectIndex, s32 playerIndex) {
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
OLakitu::init_obj_lakitu_checkered_flag(objectIndex, playerIndex);
break;
case 2:
set_object_flag(objectIndex, 0x00000010);
object_next_state(objectIndex);
break;
case 3:
func_80072E54(objectIndex, 0, 0x0000001F, 1, 2, -1);
break;
case 4:
func_80072428(objectIndex);
break;
}
}
void OLakitu::func_800797AC(s32 playerId) {
s32 objectIndex;
Player* player;
objectIndex = gIndexLakituList[playerId];
player = &gPlayerOne[playerId];
//if ((GetCourse() == GetSherbetLand()) && (player->unk_0CA & 1)) {
if ((CourseManager_GetProps()->LakituTowType == LakituTowType::ICE) && (player->unk_0CA & 1)) {
init_object(objectIndex, 7);
player->unk_0CA |= 0x10;
} else {
init_object(objectIndex, 3);
}
func_800722A4(objectIndex, 1);
}
void OLakitu::func_80079860(s32 playerId) {
s32 objectIndex;
Player* player;
objectIndex = gIndexLakituList[playerId];
player = &gPlayerOne[playerId];
if ((func_80072354(objectIndex, 1) != 0) &&
(((func_802ABDF4(player->collision.meshIndexZX) != 0) && (player->collision.surfaceDistance[2] <= 3.0f)) ||
(player->unk_0CA & 1) || ((player->surfaceType == OUT_OF_BOUNDS) && !(player->effects & 8)))) {
func_80090778(player);
OLakitu::func_800797AC(playerId);
}
}
void OLakitu::func_8007993C(s32 objectIndex, Player* player) {
if (player->unk_0CA & 4) {
func_800722A4(objectIndex, 2);
gObjectList[objectIndex].primAlpha = player->unk_0C6;
return;
}
func_800722CC(objectIndex, 2);
}
static const char* sLakituFishingTextures[] = { gTextureLakituFishing1, gTextureLakituFishing2, gTextureLakituFishing3,
gTextureLakituFishing4 };
void OLakitu::init_obj_lakitu_red_flag_fishing(s32 objectIndex, s32 arg1) {
u8* tlut = (u8*) LOAD_ASSET_RAW(common_tlut_lakitu_fishing);
Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(D_0D005F30);
OLakitu::func_800791F0(objectIndex, arg1);
init_texture_object(objectIndex, tlut, sLakituFishingTextures, 0x38U, (u16) 0x00000048);
gObjectList[objectIndex].vertex = vtx;
gObjectList[objectIndex].sizeScaling = 0.15f;
func_80086E70(objectIndex);
clear_object_flag(objectIndex, 0x00000010);
func_80073720(objectIndex);
object_next_state(objectIndex);
func_800C8F80((u8) arg1, 0x0100FA28);
}
void OLakitu::func_80079A5C(s32 objectIndex, UNUSED Player* player) {
switch (gObjectList[objectIndex].unk_0AE) {
case 0:
break;
case 1:
gObjectList[objectIndex].origin_pos[2] = 0.0f;
gObjectList[objectIndex].origin_pos[1] = 0.0f;
gObjectList[objectIndex].origin_pos[0] = 0.0f;
gObjectList[objectIndex].offset[2] = 0.0f;
gObjectList[objectIndex].offset[0] = 0.0f;
gObjectList[objectIndex].offset[1] = 80.0f;
func_80086FD4(objectIndex);
break;
case 2:
if (f32_step_down_towards(&gObjectList[objectIndex].offset[1], 5.0f, 1.0f) != 0) {
func_80086F60(objectIndex);
}
break;
case 3:
if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 100.0f, 1.0f) != 0) {
func_80086F60(objectIndex);
}
break;
}
}
void OLakitu::update_object_lakitu_fishing(s32 objectIndex, s32 playerId) {
Player* player = &gPlayerOne[playerId];
switch (gObjectList[objectIndex].state) { /* switch 1; irregular */
case 0: /* switch 1 */
break;
case 1: /* switch 1 */
OLakitu::init_obj_lakitu_red_flag_fishing(objectIndex, playerId);
break;
case 2: /* switch 1 */
set_object_flag(objectIndex, 0x00000010);
func_800736E0(objectIndex);
object_next_state(objectIndex);
break;
case 3: /* switch 1 */
func_800730BC(objectIndex, 0, 3, 1, 2, -1);
break;
}
switch (gObjectList[objectIndex].unk_0D6) {
case 0:
break;
case 1:
if (func_80086FA4(objectIndex) != 0) {
func_80073654(objectIndex);
}
break;
case 2:
func_80090868(player);
func_80073654(objectIndex);
break;
case 3:
if (!(player->unk_0CA & 2)) {
func_80086EAC(objectIndex, 0, 3);
func_80073654(objectIndex);
}
break;
case 4:
if (func_80086FA4(objectIndex) != 0) {
func_80073654(objectIndex);
}
break;
case 5:
func_800722CC(objectIndex, 1);
func_800C9018((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28));
func_80072428(objectIndex);
func_80073720(objectIndex);
break;
}
if (gObjectList[objectIndex].state >= 2) {
OLakitu::func_8007993C(objectIndex, player);
}
OLakitu::func_80079A5C(objectIndex, player);
}
void OLakitu::update_object_lakitu_fishing2(s32 objectIndex, s32 playerId) {
Player* player = &gPlayerOne[playerId];
switch (gObjectList[objectIndex].state) { /* switch 1; irregular */
case 0: /* switch 1 */
break;
case 1: /* switch 1 */
OLakitu::init_obj_lakitu_red_flag_fishing(objectIndex, playerId);
break;
case 2: /* switch 1 */
set_object_flag(objectIndex, 0x00000010);
func_800736E0(objectIndex);
player->unk_0CA |= 0x80;
object_next_state(objectIndex);
break;
case 3: /* switch 1 */
func_800730BC(objectIndex, 0, 3, 1, 2, -1);
break;
}
switch (gObjectList[objectIndex].unk_0D6) {
case 1:
if (func_80086FA4(objectIndex) != 0) {
func_800C9060((u8) playerId, 0x1900A055U);
func_80073654(objectIndex);
}
break;
case 2:
func_80090868(player);
func_800722A4(objectIndex, 4);
func_80073654(objectIndex);
break;
case 3:
if ((player->surfaceType == ICE) && !(player->unk_0CA & 1) &&
((f64) player->collision.surfaceDistance[2] <= 30.0)) {
func_800722A4(objectIndex, 8);
}
if (!(player->unk_0CA & 2)) {
func_80086EAC(objectIndex, 0, 3);
func_80073654(objectIndex);
}
break;
case 4:
func_8007375C(objectIndex, 0x0000001E);
break;
case 5:
player->unk_0CA &= 0xFF7F;
func_800722A4(objectIndex, 0x00000010);
func_800722A4(objectIndex, 0x00000020);
func_800722CC(objectIndex, 4);
func_800722CC(objectIndex, 8);
func_80073654(objectIndex);
func_800C9060((u8) playerId, 0x1900A056U);
break;
case 6:
if (func_8007375C(objectIndex, 0x000000A0) != 0) {
func_800722CC(objectIndex, 0x00000010);
player->unk_0CA &= 0xFFEF;
player->unk_0CA |= 0x20;
}
break;
case 7:
func_8007375C(objectIndex, 0x0000003C);
break;
case 8:
func_80073720(objectIndex);
func_80072428(objectIndex);
player->unk_0CA &= 0xFFDF;
func_800722CC(objectIndex, 1);
func_800C9018((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28));
break;
}
if (gObjectList[objectIndex].state >= 2) {
OLakitu::func_8007993C(objectIndex, player);
}
OLakitu::func_80079A5C(objectIndex, player);
}
static const char* sLakituSecondLapTextures[] = {
gTextureLakituSecondLap01, gTextureLakituSecondLap02, gTextureLakituSecondLap03, gTextureLakituSecondLap04,
gTextureLakituSecondLap05, gTextureLakituSecondLap06, gTextureLakituSecondLap07, gTextureLakituSecondLap08,
gTextureLakituSecondLap09, gTextureLakituSecondLap10, gTextureLakituSecondLap11, gTextureLakituSecondLap12,
gTextureLakituSecondLap13, gTextureLakituSecondLap14, gTextureLakituSecondLap15, gTextureLakituSecondLap16
};
void OLakitu::func_8007A060(s32 objectIndex, s32 playerIndex) {
Object* object;
OLakitu::func_800791F0(objectIndex, playerIndex);
u8* tlut = (u8*) LOAD_ASSET_RAW(common_tlut_lakitu_second_lap);
Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(common_vtx_also_lakitu);
init_texture_object(objectIndex, tlut, sLakituSecondLapTextures, 0x48U, (u16) 0x00000038);
object = &gObjectList[objectIndex];
object->activeTexture = *gObjectList[objectIndex].textureList;
object->vertex = vtx;
object->pos[2] = 5000.0f;
object->pos[1] = 5000.0f;
object->pos[0] = 5000.0f;
object->sizeScaling = 0.15f;
clear_object_flag(objectIndex, 0x00000010);
func_80086F10(objectIndex, 5, &D_800E694C);
object_next_state(objectIndex);
}
void OLakitu::update_object_lakitu_second_lap(s32 objectIndex, s32 playerIndex) {
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
OLakitu::func_8007A060(objectIndex, playerIndex);
break;
case 2:
set_object_flag(objectIndex, 0x00000010);
object_next_state(objectIndex);
break;
case 3:
set_and_run_timer_object(objectIndex, 0x00000014);
break;
case 4:
func_80072E54(objectIndex, 0, 0x0000000F, 1, 2, 1);
break;
case 5:
set_and_run_timer_object(objectIndex, 0x0000003C);
break;
case 6:
func_80072F88(objectIndex, 0x0000000F, 0, 1, 2, 1);
break;
case 7:
if (gObjectList[objectIndex].unk_0AE == 0) {
func_80072428(objectIndex);
}
break;
}
}
static const char* sLakituFinalLapTextures[] = {
gTextureLakituFinalLap01, gTextureLakituFinalLap02, gTextureLakituFinalLap03, gTextureLakituFinalLap04,
gTextureLakituFinalLap05, gTextureLakituFinalLap06, gTextureLakituFinalLap07, gTextureLakituFinalLap08,
gTextureLakituFinalLap09, gTextureLakituFinalLap10, gTextureLakituFinalLap11, gTextureLakituFinalLap12,
gTextureLakituFinalLap13, gTextureLakituFinalLap14, gTextureLakituFinalLap15, gTextureLakituFinalLap16,
};
void OLakitu::func_8007A228(s32 objectIndex, s32 playerIndex) {
Object* object;
OLakitu::func_800791F0(objectIndex, playerIndex);
u8* tlut = (u8*) LOAD_ASSET_RAW(common_tlut_lakitu_final_lap);
Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(common_vtx_also_lakitu);
init_texture_object(objectIndex, tlut, sLakituFinalLapTextures, 0x48U, (u16) 0x00000038);
object = &gObjectList[objectIndex];
object->activeTexture = *gObjectList[objectIndex].textureList;
object->vertex = vtx;
object->pos[2] = 5000.0f;
object->pos[1] = 5000.0f;
object->pos[0] = 5000.0f;
object->sizeScaling = 0.15f;
clear_object_flag(objectIndex, 0x00000010);
func_80086F10(objectIndex, 5, &D_800E694C);
object_next_state(objectIndex);
}
void OLakitu::update_object_lakitu_final_lap(s32 objectIndex, s32 playerIndex) {
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
OLakitu::func_8007A228(objectIndex, playerIndex);
break;
case 2:
set_object_flag(objectIndex, 0x00000010);
object_next_state(objectIndex);
break;
case 3:
set_and_run_timer_object(objectIndex, 0x00000014);
break;
case 4:
func_80072E54(objectIndex, 0, 0x0000000F, 1, 2, 1);
break;
case 5:
set_and_run_timer_object(objectIndex, 0x0000003C);
break;
case 6:
func_80072F88(objectIndex, 0x0000000F, 0, 1, 2, 1);
break;
case 7:
if (gObjectList[objectIndex].unk_0AE == 0) {
func_80072428(objectIndex);
}
break;
}
}
static const char* sLakituReverseTextures[] = {
gTextureLakituReverse01, gTextureLakituReverse02, gTextureLakituReverse03, gTextureLakituReverse04,
gTextureLakituReverse05, gTextureLakituReverse06, gTextureLakituReverse07, gTextureLakituReverse08,
gTextureLakituReverse09, gTextureLakituReverse10, gTextureLakituReverse11, gTextureLakituReverse12,
gTextureLakituReverse13, gTextureLakituReverse14, gTextureLakituReverse15, gTextureLakituReverse16
};
void OLakitu::func_8007A3F0(s32 objectIndex, s32 arg1) {
f32 var = 5000.0f;
OLakitu::func_800791F0(objectIndex, arg1);
u8* tlut = (u8*) LOAD_ASSET_RAW(common_tlut_lakitu_reverse);
Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(common_vtx_also_lakitu);
init_texture_object(objectIndex, tlut, sLakituReverseTextures, 72, (u16) 56);
gObjectList[objectIndex].activeTexture = *gObjectList[objectIndex].textureList;
gObjectList[objectIndex].vertex = vtx;
gObjectList[objectIndex].pos[2] = var;
gObjectList[objectIndex].pos[1] = var;
gObjectList[objectIndex].pos[0] = var;
gObjectList[objectIndex].sizeScaling = 0.15f;
clear_object_flag(objectIndex, 0x00000010);
func_80086F10(objectIndex, 6, &D_800E69B0);
gObjectList[objectIndex].unk_0D6 = 0;
object_next_state(objectIndex);
func_800C8F80((u8) arg1, 0x0100FA28);
}
void OLakitu::update_object_lakitu_reverse(s32 objectIndex, s32 playerId) {
Player* sp2C = &gPlayerOne[playerId];
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
OLakitu::func_8007A3F0(objectIndex, playerId);
break;
case 2:
set_object_flag(objectIndex, 0x00000010);
gObjectList[objectIndex].unk_0D6 = 1;
object_next_state(objectIndex);
break;
case 3:
func_800730BC(objectIndex, 0, 0x0000000F, 1, 2, -1);
break;
case 4:
func_80072428(objectIndex);
break;
}
switch (gObjectList[objectIndex].unk_0D6) {
case 1:
if ((gObjectList[objectIndex].state >= 3) && (!(sp2C->effects & 0x400000))) {
func_80086F10(objectIndex, 6, &D_800E69F4);
gObjectList[objectIndex].unk_0D6 = 2;
gObjectList[objectIndex].unk_04C = 0x00000050;
func_800C9018((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28));
return;
}
return;
case 2:
gObjectList[objectIndex].unk_04C--;
if (gObjectList[objectIndex].unk_04C == 0) {
object_next_state(objectIndex);
gObjectList[objectIndex].unk_0D6 = 0;
}
break;
}
}
void OLakitu::func_8007A66C(s32 objectIndex) {
Player* player = &gPlayers[_playerId];
Camera* camera = &cameras[_playerId];
u16 rot = 0x8000 - camera->rot[1];
gObjectList[objectIndex].pos[0] =
(player->pos[0] +
(coss(rot) * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]))) -
(sins(rot) * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2]));
gObjectList[objectIndex].pos[1] =
player->unk_074 + gObjectList[objectIndex].origin_pos[1] + gObjectList[objectIndex].offset[1];
gObjectList[objectIndex].pos[2] =
(player->pos[2] +
(sins(rot) * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]))) +
(coss(rot) * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2]));
}
void OLakitu::func_8007A778(s32 objectIndex) {
Player* player = &gPlayers[_playerId];
Camera* camera = &cameras[_playerId];
u16 rot = 0x8000 - camera->rot[1];
gObjectList[objectIndex].pos[0] =
(player->pos[0] +
(coss(rot) * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]))) -
(sins(rot) * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2]));
gObjectList[objectIndex].pos[1] =
player->pos[1] + gObjectList[objectIndex].origin_pos[1] + gObjectList[objectIndex].offset[1];
gObjectList[objectIndex].pos[2] =
(player->pos[2] +
(sins(rot) * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]))) +
(coss(rot) * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2]));
}
void OLakitu::func_8007A88C(s32 playerId) {
s32 objectIndex;
Player* player;
objectIndex = gIndexLakituList[playerId];
player = &gPlayerOne[playerId];
if ((gObjectList[objectIndex].state == 0) && (player->effects & 0x400000)) {
//func_800790E4(playerId);
init_object(gIndexLakituList[playerId], 6);
}
}
void OLakitu::func_8007A910(s32 arg0) {
if (D_801657B4 == 0) {
OLakitu::func_8007A88C(arg0);
}
func_80079860(arg0);
}
// animate lakitu?
void OLakitu::func_8007AA44(s32 playerId) {
s32 objectIndex;
OLakitu::func_8007A910(playerId);
objectIndex = gIndexLakituList[playerId];
gLakituTexturePtr = (const char**)&gLakituTextureBuffer[playerId];
switch (gObjectList[objectIndex].unk_0D8) {
case 1:
OLakitu::func_80079114(objectIndex, playerId, 2);
OLakitu::func_8007A66C(objectIndex);
break;
case 2:
OLakitu::func_80079114(objectIndex, playerId, 0);
OLakitu::func_8007A66C(objectIndex);
break;
case 3:
OLakitu::func_80079114(objectIndex, playerId, 0);
OLakitu::func_8007A778(objectIndex);
break;
case 4:
OLakitu::func_80079114(objectIndex, playerId, 0);
OLakitu::func_8007A66C(objectIndex);
break;
case 5:
OLakitu::func_80079114(objectIndex, playerId, 0);
OLakitu::func_8007A66C(objectIndex);
break;
case 6:
OLakitu::func_80079114(objectIndex, playerId, 0);
OLakitu::func_8007A66C(objectIndex);
break;
case 7:
OLakitu::func_80079114(objectIndex, playerId, 0);
OLakitu::func_8007A778(objectIndex);
break;
case 0:
default:
break;
}
}
+82
View File
@@ -0,0 +1,82 @@
#pragma once
#include <libultraship.h>
#include <vector>
#include "Object.h"
#include "World.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "vehicles.h"
#include "waypoints.h"
#include "common_structs.h"
#include "objects.h"
#include "course_offsets.h"
}
/**
* Note that you only want 1 lakitu spawned in per human player
* Otherwise Lakitu will animate faster than normal.
*/
class OLakitu : public OObject {
public:
enum LakituType : uint32_t {
STARTER = 1,
FINISH, // Checkered flag
TOW, // Picks up an out of bounds player
SECOND_LAP,
FINAL_LAP,
REVERSE,
TOW_ICE_CUBE, // Picks up an out of bounds player in sherbet land as an ice-cube
};
enum LakituTowType : uint16_t {
NORMAL,
ICE, // Used in sherbet land to put an ice-cube on the player
};
public:
explicit OLakitu(s32 playerId, LakituType type);
void Activate(LakituType type); // Triggers Lakitu into a behaviour
virtual void Tick() override;
virtual void Tick60fps() override;
virtual void Draw(s32 playerId) override;
void func_80078F64();
void func_80079054(s32 playerId);
void func_80079084(s32 playerId);
void func_800790B4(s32 playerId);
void func_800790E4(s32 playerId);
void func_80079114(s32 objectIndex, s32 playerId, s32 arg2);
void func_800791F0(s32 objectIndex, s32 playerId);
void init_obj_lakitu_starter_and_checkered_flag(s32 objectIndex, s32 playerId);
void update_object_lakitu_starter(s32 objectIndex, s32 arg1);
void func_800729EC(s32 objectIndex);
void init_obj_lakitu_checkered_flag(s32 objectIndex, s32 playerIndex);
void update_object_lakitu_checkered_flag(s32 objectIndex, s32 playerIndex);
void func_800797AC(s32 playerId);
void func_80079860(s32 playerId);
void func_8007993C(s32 objectIndex, Player* player);
void init_obj_lakitu_red_flag_fishing(s32 objectIndex, s32 arg1);
void func_80079A5C(s32 objectIndex, UNUSED Player* player);
void update_object_lakitu_fishing(s32 objectIndex, s32 playerId);
void update_object_lakitu_fishing2(s32 objectIndex, s32 playerId);
void func_8007A060(s32 objectIndex, s32 playerIndex);
void update_object_lakitu_second_lap(s32 objectIndex, s32 playerIndex);
void func_8007A228(s32 objectIndex, s32 playerIndex);
void update_object_lakitu_final_lap(s32 objectIndex, s32 playerIndex);
void func_8007A3F0(s32 objectIndex, s32 arg1);
void update_object_lakitu_reverse(s32 objectIndex, s32 playerId);
void func_8007A66C(s32 objectIndex);
void func_8007A778(s32 objectIndex);
void func_8007A88C(s32 playerId);
void func_8007A910(s32 arg0);
void func_8007AA44(s32 playerId); // animate lakitu
private:
LakituType _type;
s32 _playerId;
};
+422
View File
@@ -0,0 +1,422 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "Mole.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "defines.h"
#include "camera.h"
#include "update_objects.h"
#include "render_objects.h"
#include "actors.h"
#include "code_80057C60.h"
#include "code_80086E70.h"
#include "math_util.h"
#include "math_util_2.h"
#include "code_80005FD0.h"
#include "some_data.h"
#include "ceremony_and_credits.h"
#include "assets/moo_moo_farm_data.h"
#include "sounds.h"
#include "external.h"
}
OMole::OMole(Vec3f pos) {
find_unused_obj_index(&indexObjectList1[0]);
}
void OMole::Tick() {
s32 var_s1;
s32 objectIndex;
for (var_s1 = 0; var_s1 < D_8018D1C8; var_s1++) {
objectIndex = indexObjectList1[var_s1];
if (gObjectList[objectIndex].state == 0) {
if (are_players_in_course_section(8, 9) != 0) {
func_80081FF4(objectIndex, 1);
}
} else {
OMole::func_800821AC(objectIndex, 1);
}
}
for (var_s1 = 0; var_s1 < D_8018D1D0; var_s1++) {
objectIndex = indexObjectList2[var_s1];
if (gObjectList[objectIndex].state == 0) {
if (are_players_in_course_section(0x0010, 0x0013) != 0) {
OMole::func_80081FF4(objectIndex, 2);
}
} else {
OMole::func_800821AC(objectIndex, 2);
}
}
for (var_s1 = 0; var_s1 < D_8018D1D8; var_s1++) {
objectIndex = indexObjectList3[var_s1];
if (gObjectList[objectIndex].state == 0) {
if (are_players_in_course_section(0x0011, 0x0014) != 0) {
func_80081FF4(objectIndex, 3);
}
} else {
OMole::func_800821AC(objectIndex, 3);
}
}
for (var_s1 = 0; var_s1 < gObjectParticle2_SIZE; var_s1++) {
objectIndex = gObjectParticle2[var_s1];
if (gObjectList[objectIndex].state != 0) {
OMole::func_80081790(objectIndex);
}
}
}
void OMole::Draw(s32 cameraId) {
}
void OMole::func_80081790(s32 objectIndex) {
switch (gObjectList[objectIndex].state) {
case 0:
break; /* irregular */
case 1:
if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.3f, gObjectList[objectIndex].unk_034,
gObjectList[objectIndex].orientation[1], 0x00000032) != 0) {
object_next_state(objectIndex);
}
object_calculate_new_pos_offset(objectIndex);
break;
case 2:
func_80072428(objectIndex);
func_80086F60(objectIndex);
break;
}
}
void OMole::func_80081AFC(s32 objectIndex, s32 arg1) {
s8* sp2C;
Object* object;
object = &gObjectList[objectIndex];
switch (object->state) {
case 0x1:
OMole::func_80081848(objectIndex);
break;
case 0x2:
if (object->unk_04C == 0) {
func_80086EAC(objectIndex, 2, 1);
object_next_state(objectIndex);
set_object_flag(objectIndex, 0x00000200);
} else {
object->unk_04C--;
}
break;
case 0x3:
if (object->unk_0AE == 0) {
func_80086EAC(objectIndex, 2, 4);
func_8008153C(objectIndex);
object_next_state(objectIndex);
func_800C98B8(object->pos, object->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x07));
}
break;
case 0x4:
if (func_80072E54(objectIndex, 1, 6, 1, 2, 0) != 0) {
func_800726CC(objectIndex, 0x00000064);
}
break;
case 0xA:
func_80072E54(objectIndex, 1, 6, 1, 0, -1);
if (object->unk_0AE == 0) {
func_800726CC(objectIndex, 0x00000064);
}
break;
case 0x64:
if (object->unk_0AE == 0) {
clear_object_flag(objectIndex, 0x00000200);
func_80072428(objectIndex);
switch (arg1) { /* switch 1; irregular */
case 1: /* switch 1 */
sp2C = D_8018D198;
break;
case 2: /* switch 1 */
sp2C = D_8018D1A8;
break;
case 3: /* switch 1 */
sp2C = D_8018D1B8;
break;
}
sp2C[object->type] = 0;
}
break;
case 0:
default:
break;
}
if (object->state >= 2) {
func_80073514(objectIndex);
}
}
void OMole::func_80081D34(s32 objectIndex) {
Player* player;
Camera* var_s4;
s32 var_s2;
s32 var_s5;
Object* object;
var_s5 = 0;
player = gPlayerOne;
var_s4 = camera1;
for (var_s2 = 0; var_s2 < D_8018D158; var_s2++, player++, var_s4++) {
if ((is_obj_flag_status_active(objectIndex, 0x00000200) != 0) && !(player->effects & 0x80000000) &&
(has_collided_with_player(objectIndex, player) != 0)) {
if ((player->type & 0x8000) && !(player->type & 0x100)) {
var_s5 = 1;
object = &gObjectList[objectIndex];
if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) {
func_80072180();
}
if (player->effects & 0x200) {
func_800C9060(var_s2, 0x1900A046U);
} else {
player->soundEffects |= 2;
}
object->direction_angle[1] = var_s4->rot[1];
object->velocity[1] = (player->unk_094 / 2) + 3.0;
object->unk_034 = player->unk_094 + 1.0;
if (object->velocity[1] >= 5.0) {
object->velocity[1] = 5.0f;
}
if (object->unk_034 >= 4.0) {
object->velocity[1] = 4.0f;
}
}
}
}
if (var_s5 != 0) {
object = &gObjectList[objectIndex];
clear_object_flag(objectIndex, 0x00000200);
func_80086F60(objectIndex);
set_obj_origin_pos(objectIndex, object->pos[0], object->pos[1], object->pos[2]);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
func_80086EAC(objectIndex, 2, 0x000A);
func_800726CC(objectIndex, 0x0000000A);
}
}
void OMole::func_80081FF4(s32 objectIndex, s32 arg1) {
UNUSED s32 stackPadding0;
UNUSED s32 stackPadding1;
s32 moleCount;
s16 var_v1;
s16 offset;
s32 var_a0;
s8* var_a2;
init_object(objectIndex, 0);
gObjectList[objectIndex].unk_04C = random_int(0x001EU) + 5;
switch (arg1) { /* irregular */
case 1:
var_a2 = D_8018D198;
moleCount = NUM_GROUP1_MOLES;
offset = 0;
break;
case 2:
var_a2 = D_8018D1A8;
moleCount = NUM_GROUP2_MOLES;
offset = 24;
// offset = NUM_GROUP1_MOLES;
break;
case 3:
var_a2 = D_8018D1B8;
moleCount = NUM_GROUP3_MOLES;
offset = 57;
// offset = NUM_GROUP1_MOLES + NUM_GROUP2_MOLES;
break;
}
var_v1 = random_int(moleCount);
for (var_a0 = 0; var_a0 < moleCount; var_a0++) {
if (var_a2[var_v1] != 0) {
var_v1++;
if (var_v1 == moleCount) {
var_v1 = 0;
}
} else {
var_a2[var_v1] = 1;
gObjectList[objectIndex].type = var_v1;
break;
}
}
/*
Ideally `gMoleSpawns` wouldn't be a union at all and its just be a list of Vec3s
Even more ideally each mole group would have its own array for its spawns
gObjectList[objectIndex].origin_pos[0] = gMoleSpawns.asVec3sList[offset + var_v1][0] * xOrientation;
gObjectList[objectIndex].origin_pos[1] = gMoleSpawns.asVec3sList[offset + var_v1][1] - 9.0;
gObjectList[objectIndex].origin_pos[2] = gMoleSpawns.asVec3sList[offset + var_v1][2];
*/
gObjectList[objectIndex].origin_pos[0] = gMoleSpawns.asFlatList[offset + (var_v1 * 3) + 0] * xOrientation;
gObjectList[objectIndex].origin_pos[1] = gMoleSpawns.asFlatList[offset + (var_v1 * 3) + 1] - 9.0;
gObjectList[objectIndex].origin_pos[2] = gMoleSpawns.asFlatList[offset + (var_v1 * 3) + 2];
}
void OMole::func_80081848(s32 objectIndex) {
u8* mole = (u8*) LOAD_ASSET_RAW(d_course_moo_moo_farm_mole_frames);
u8* tlut = (u8*) LOAD_ASSET_RAW(d_course_moo_moo_farm_mole_tlut);
init_texture_object(objectIndex, (u8*)d_course_moo_moo_farm_mole_tlut, (const char**) mole, 0x20U, (u16) 0x00000040);
gObjectList[objectIndex].sizeScaling = 0.15f;
gObjectList[objectIndex].textureListIndex = 0;
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
set_obj_orientation(objectIndex, 0U, 0U, 0x8000U);
gObjectList[objectIndex].boundingBoxSize = 6;
gObjectList[objectIndex].velocity[1] = 4.0f;
set_object_flag(objectIndex, 0x04000000);
object_next_state(objectIndex);
}
void OMole::func_80081924(s32 objectIndex) {
switch (gObjectList[objectIndex].unk_0AE) {
case 1:
if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 9.0f, 0.7f) != 0) {
func_80086FD4(objectIndex);
}
break;
case 2:
func_800871AC(objectIndex, 0x0000000A);
break;
case 3:
if (f32_step_down_towards(&gObjectList[objectIndex].offset[1], 3.0f, 1.0f) != 0) {
func_80086F60(objectIndex);
}
break;
case 4:
func_80087D24(objectIndex, 3.6f, 0.25f, 0.0f);
break;
case 5:
func_80086F60(objectIndex);
break;
case 10:
gObjectList[objectIndex].orientation[2] += 0x1000;
gObjectList[objectIndex].velocity[1] -= 0.184;
func_8008751C(objectIndex);
object_add_velocity_offset_xyz(objectIndex);
if (gObjectList[objectIndex].pos[1] <= -10.0) {
func_80086F60(objectIndex);
}
break;
case 0:
default:
break;
}
}
void OMole::func_80081A88(s32 objectIndex) {
switch (gObjectList[objectIndex].unk_0DD) { /* irregular */
case 0:
break;
case 1:
func_8008B724(objectIndex);
break;
case 2:
OMole::func_80081924(objectIndex);
break;
}
object_calculate_new_pos_offset(objectIndex);
}
void OMole::func_800821AC(s32 objectIndex, s32 arg1) {
if (gObjectList[objectIndex].state != 0) {
OMole::func_80081AFC(objectIndex, arg1);
OMole::func_80081A88(objectIndex);
OMole::func_80081D34(objectIndex);
}
}
void OMole::func_80054E10(s32 objectIndex) {
if (gObjectList[objectIndex].state > 0) {
if (is_obj_flag_status_active(objectIndex, 0x00800000) != 0) {
D_80183E50[0] = gObjectList[objectIndex].pos[0];
D_80183E50[1] = gObjectList[objectIndex].surfaceHeight + 0.8;
D_80183E50[2] = gObjectList[objectIndex].pos[2];
D_80183E70[0] = gObjectList[objectIndex].velocity[0];
D_80183E70[1] = gObjectList[objectIndex].velocity[1];
D_80183E70[2] = gObjectList[objectIndex].velocity[2];
func_8004A9B8(gObjectList[objectIndex].sizeScaling);
}
}
}
// Almost certainly responsible for spawning/handling the moles on Moo Moo farm
void OMole::func_80054EB8() {
s32 someIndex;
for (someIndex = 0; someIndex < NUM_TOTAL_MOLES; someIndex++) {
func_80054E10(gObjectParticle1[someIndex]);
}
}
void OMole::func_80054D00(s32 objectIndex, s32 cameraId) {
Camera* camera;
camera = &camera1[cameraId];
if (gObjectList[objectIndex].state >= 3) {
func_8008A364(objectIndex, cameraId, 0x2AABU, 0x0000012C);
if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) {
D_80183E80[0] = (s16) gObjectList[objectIndex].orientation[0];
D_80183E80[1] =
func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
D_80183E80[2] = (u16) gObjectList[objectIndex].orientation[2];
func_80048130(gObjectList[objectIndex].pos, (u16*) D_80183E80, gObjectList[objectIndex].sizeScaling,
(u8*) gObjectList[objectIndex].activeTLUT, (u8*)gObjectList[objectIndex].activeTexture,
(Vtx*)LOAD_ASSET_RAW(D_0D0062B0), 0x00000020, 0x00000040, 0x00000020, 0x00000040, 5);
}
}
}
void OMole::func_80054F04(s32 cameraId) {
s32 var_s2;
s32 objectIndex;
Camera* sp44;
Object* object;
sp44 = &camera1[cameraId];
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0079C8);
load_texture_block_rgba16_mirror((u8*) LOAD_ASSET_RAW(d_course_moo_moo_farm_mole_dirt), 0x00000010, 0x00000010);
for (var_s2 = 0; var_s2 < gObjectParticle2_SIZE; var_s2++) {
objectIndex = gObjectParticle2[var_s2];
object = &gObjectList[objectIndex];
if (object->state > 0) {
func_8008A364(objectIndex, cameraId, 0x2AABU, 0x000000C8);
if ((is_obj_flag_status_active(objectIndex, VISIBLE) != 0) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) {
object->orientation[1] = func_800418AC(object->pos[0], object->pos[2], sp44->pos);
rsp_set_matrix_gObjectList(objectIndex);
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D006980);
}
}
}
gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF);
}
void OMole::render_object_moles(s32 cameraId) {
s32 i;
for (i = 0; i < NUM_GROUP1_MOLES; i++) {
OMole::func_80054D00(indexObjectList1[i], cameraId);
}
for (i = 0; i < NUM_GROUP2_MOLES; i++) {
OMole::func_80054D00(indexObjectList2[i], cameraId);
}
for (i = 0; i < NUM_GROUP3_MOLES; i++) {
OMole::func_80054D00(indexObjectList3[i], cameraId);
}
OMole::func_80054EB8();
OMole::func_80054F04(cameraId);
}
+52
View File
@@ -0,0 +1,52 @@
#pragma once
#include <libultraship.h>
#include <vector>
#include "Object.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "vehicles.h"
#include "waypoints.h"
#include "common_structs.h"
#include "objects.h"
#include "course_offsets.h"
#include "some_data.h"
}
class OMole : public OObject {
public:
enum Behaviour : uint16_t {
};
public:
explicit OMole(Vec3f pos);
virtual void Tick() override;
virtual void Draw(s32 cameraId) override;
void func_80054E10(s32 objectIndex);
void func_80054EB8();
void func_80054F04(s32 cameraId);
void render_object_moles(s32 cameraId);
void func_80054D00(s32 objectIndex, s32 cameraId);
void func_800821AC(s32 objectIndex, s32 arg1);
void func_80081FF4(s32 objectIndex, s32 arg1);
void func_80081D34(s32 objectIndex);
void func_80081AFC(s32 objectIndex, s32 arg1);
void func_80081A88(s32 objectIndex);
void func_80081924(s32 objectIndex);
void func_80081848(s32 objectIndex);
void func_80081790(s32 objectIndex);
private:
s32 _idx;
s32 _state;
s32 _timer;
s32 _status;
bool _toggle;
SplineData *spline;
};
+23
View File
@@ -0,0 +1,23 @@
#include <libultraship.h>
#include "Object.h"
#include "World.h"
extern "C" {
#include "camera.h"
}
//GameActor()
OObject::OObject() {}
// Virtual functions to be overridden by derived classes
void OObject::Tick() { }
void OObject::Tick60fps() {}
void OObject::Draw(s32 cameraId) { }
void OObject::Collision() {}
void OObject::Expire() { }
void OObject::Destroy() {
PendingDestroy = true;
}
+26
View File
@@ -0,0 +1,26 @@
#pragma once
#include <libultraship.h>
extern "C" {
#include "camera.h"
#include "objects.h"
}
class OObject {
public:
uint8_t uuid[16];
Object o;
bool PendingDestroy = false;
virtual ~OObject() = default;
explicit OObject();
virtual void Tick();
virtual void Tick60fps();
virtual void Draw(s32 cameraId);
virtual void Collision();
virtual void Expire();
virtual void Destroy(); // Mark object for deletion at the start of the next frame
};
@@ -1,6 +1,6 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "engine/vehicles/OPenguin.h"
#include "Penguin.h"
#include <vector>
#include "port/Game.h"
@@ -33,16 +33,19 @@ extern "C" {
extern s8 gPlayerCount;
}
OPenguin::OPenguin(s32 i, Vec3f pos, u16 direction, PenguinType type, Behaviour behaviour) {
if (i >= 32) {
printf("MAX penguin REACHED (32), skipping\n");
return;
}
_idx = i;
size_t OPenguin::_count = 0;
OPenguin::OPenguin(Vec3f pos, u16 direction, PenguinType type, Behaviour behaviour) {
_idx = _count;
_type = type;
_bhv = behaviour;
s32 objectIndex = indexObjectList1[i];
if (_idx >= 32) {
printf("MAX penguin REACHED (32), skipping\n");
return;
}
s32 objectIndex = indexObjectList1[_idx];
init_object(objectIndex, 0);
Object *object = &gObjectList[objectIndex];
@@ -73,6 +76,7 @@ OPenguin::OPenguin(s32 i, Vec3f pos, u16 direction, PenguinType type, Behaviour
break;
}
_count++;
}
void OPenguin::Tick(void) {
@@ -98,7 +102,7 @@ void OPenguin::Tick(void) {
if ((is_obj_flag_status_active(objectIndex, 0x02000000) != 0) &&
(func_80072354(objectIndex, 0x00000020) != 0)) {
func_800722A4(objectIndex, 0x00000060);
set_object_flag_status_false(objectIndex, 0x02000000);
clear_object_flag(objectIndex, 0x02000000);
}
}
@@ -144,28 +148,28 @@ void OPenguin::Draw(s32 cameraId) {
}
}
void OPenguin::Behaviours(s32 objectIndex, s32 arg1) {
void OPenguin::Behaviours(s32 objectIndex, s32 arg1) { // func_800850B0
Object* object;
object = &gObjectList[objectIndex];
switch (_bhv) {
case 1: // emperor
func_80085080(objectIndex);
OPenguin::func_80085080(objectIndex);
break;
case 2:
func_8008502C(objectIndex, arg1);
OPenguin::func_8008502C(objectIndex, arg1);
break;
case 3:
func_80084D2C(objectIndex, 0);
OPenguin::func_80084D2C(objectIndex, 0);
break;
case 4:
func_80084D2C(objectIndex, 1);
OPenguin::func_80084D2C(objectIndex, 1);
break;
case 5:
func_80084D2C(objectIndex, 2);
OPenguin::func_80084D2C(objectIndex, 2);
break;
case 6:
func_80084D2C(objectIndex, 3);
OPenguin::func_80084D2C(objectIndex, 3);
break;
}
if (func_80072320(objectIndex, 0x00000020) != 0) {
@@ -189,6 +193,105 @@ void OPenguin::Behaviours(s32 objectIndex, s32 arg1) {
}
}
void OPenguin::func_80084D2C(s32 objectIndex, s32 arg1) {
f32 sp24;
switch (gObjectList[objectIndex].unk_0AE) {
case 0:
break;
case 1:
gObjectList[objectIndex].direction_angle[1] =
func_800417B4(gObjectList[objectIndex].direction_angle[1], gObjectList[objectIndex].unk_0C6);
if (gObjectList[objectIndex].direction_angle[1] == gObjectList[objectIndex].unk_0C6) {
gObjectList[objectIndex].unk_09C = 4;
gObjectList[objectIndex].unk_034 = 0.4f;
func_80086FD4(objectIndex);
}
break;
case 2:
f32_step_towards(&gObjectList[objectIndex].unk_034, 0.8f, 0.02f);
if (func_80087060(objectIndex, 0x0000000F) != 0) {
func_800722A4(objectIndex, 1);
func_800722A4(objectIndex, 2);
gObjectList[objectIndex].unk_09C = 1;
gObjectList[objectIndex].unk_0D8 = 1;
gObjectList[objectIndex].textureListIndex = 0;
gObjectList[objectIndex].type =
get_animation_length(d_course_sherbet_land_unk_data11, gObjectList[objectIndex].unk_0D8);
func_800726CC(objectIndex, 3);
func_80086FD4(objectIndex);
if (func_80072354(objectIndex, 0x00000020) != 0) {
func_800722A4(objectIndex, 0x00000080);
}
}
break;
case 3:
switch (arg1) { /* switch 1; irregular */
case 0: /* switch 1 */
sp24 = 1.0f;
break;
case 1: /* switch 1 */
sp24 = 1.5f;
break;
case 2: /* switch 1 */
sp24 = 2.0f;
break;
case 3: /* switch 1 */
sp24 = 2.5f;
break;
}
f32_step_towards(&gObjectList[objectIndex].unk_034, sp24, 0.15f);
if ((func_80072354(objectIndex, 2) != 0) && (sp24 == gObjectList[objectIndex].unk_034)) {
func_80086FD4(objectIndex);
}
break;
case 4:
if (func_80087060(objectIndex, 0x0000001E) != 0) {
func_800722CC(objectIndex, 1);
func_80086FD4(objectIndex);
}
break;
case 5:
f32_step_towards(&gObjectList[objectIndex].unk_034, 0.4f, 0.2f);
if (func_80087060(objectIndex, 0x0000000A) != 0) {
func_800722A4(objectIndex, 2);
gObjectList[objectIndex].unk_0D8 = 2;
gObjectList[objectIndex].textureListIndex = 0;
gObjectList[objectIndex].type =
get_animation_length(d_course_sherbet_land_unk_data11, gObjectList[objectIndex].unk_0D8);
func_800726CC(objectIndex, 3);
func_80086FD4(objectIndex);
}
break;
case 6:
if (func_80072354(objectIndex, 2) != 0) {
gObjectList[objectIndex].unk_0D8 = 0;
gObjectList[objectIndex].textureListIndex = 0;
gObjectList[objectIndex].type =
get_animation_length(d_course_sherbet_land_unk_data11, gObjectList[objectIndex].unk_0D8);
gObjectList[objectIndex].unk_0C6 += 0x8000;
func_800726CC(objectIndex, 2);
func_8008701C(objectIndex, 1);
}
break;
}
func_8008781C(objectIndex);
object_calculate_new_pos_offset(objectIndex);
}
void OPenguin::func_80085080(s32 objectIndex) {
func_8008B78C(objectIndex);
object_calculate_new_pos_offset(objectIndex);
func_800873F4(objectIndex);
}
void OPenguin::func_8008502C(s32 objectIndex, s32 arg1) {
func_80088038(objectIndex, gObjectList[objectIndex].unk_01C[1], gObjectList[objectIndex].unk_0C6);
object_calculate_new_pos_offset(objectIndex);
func_800873F4(objectIndex);
}
void OPenguin::EmperorPenguin(s32 objectIndex) {
switch (gObjectList[objectIndex].state) {
case 0:
@@ -216,7 +319,7 @@ void OPenguin::InitEmperorPenguin(s32 objectIndex) {
object->unk_0DD = 1;
func_80086EF0(objectIndex);
object->spline = D_800E672C[0];
set_object_flag_status_true(objectIndex, 0x04000800);
set_object_flag(objectIndex, 0x04000800);
object->type = get_animation_length(d_course_sherbet_land_unk_data11, 0);
object_next_state(objectIndex);
}
@@ -278,8 +381,10 @@ void OPenguin::InitOtherPenguin(s32 objectIndex) {
//object->boundingBoxSize = 4;
object->unk_09C = 2;
object->unk_04C = random_int(0x012CU);
set_object_flag_status_true(objectIndex, 0x04000220);
set_object_flag(objectIndex, 0x04000220);
// This code has been significantly refactored from the original func_800845C8
// Into a switch statement instead of checking for the index of the penguin
switch(_bhv) {
case Behaviour::CIRCLE:
object->unk_01C[1] = Diameter;
@@ -301,81 +406,6 @@ void OPenguin::InitOtherPenguin(s32 objectIndex) {
break;
}
if ((_idx > 0) && (_idx < 9)) {
if ((_idx == 1) || (_idx == 2)) {
//object->unk_0C6 = 0x0150;
//object->unk_01C[1] = 100.0f;
} else if ((_idx == 3) || (_idx == 4)) {
//object->unk_0C6 = 0x0100;
//object->unk_01C[1] = 80.0f;
} else if ((_idx == 5) || (_idx == 6)) {
//object->unk_0C6 = 0xFF00;
//object->unk_01C[1] = 80.0f;
} else if ((_idx == 7) || (_idx == 8)) {
//object->unk_0C6 = 0x0150;
//object->unk_01C[1] = 80.0f;
}
//object->unk_0C4 = (_idx << 0xF) & 0xFFFF;
//object->surfaceHeight = -80.0f;
//object->sizeScaling = 0.08f;
//object->unk_0DD = 2;
//func_800722A4(objectIndex, 8);
} else if ((_idx > 8) && (_idx < 15)) {
switch (_idx) {
case 9:
if (gGamestate != CREDITS_SEQUENCE) {
} else {
//object->sizeScaling = 0.15f;
}
//object->unk_0C6 = 0x9000;
if (gIsMirrorMode != 0) {
//object->unk_0C6 -= 0x4000;
}
//object->unk_0DD = 3;
break;
case 10:
//object->unk_0C6 = 0x5000;
if (gIsMirrorMode != 0) {
//object->unk_0C6 += 0x8000;
}
//object->unk_0DD = 4;
break;
case 11:
//object->unk_0C6 = 0xC000;
//object->unk_0DD = 6;
if (gIsMirrorMode != 0) {
//object->unk_0C6 += 0x8000;
}
break;
case 12:
//object->unk_0C6 = 0x4000;
//object->unk_0DD = 6;
if (gIsMirrorMode != 0) {
//object->unk_0C6 += 0x8000;
}
break;
case 13:
// object->unk_0C6 = 0x8000;
//object->unk_0DD = 6;
if (gIsMirrorMode != 0) {
//object->unk_0C6 -= 0x4000;
}
break;
case 14:
//object->unk_0C6 = 0x9000;
//object->unk_0DD = 6;
if (gIsMirrorMode != 0) {
//object->unk_0C6 -= 0x4000;
}
break;
default:
break;
}
//set_obj_direction_angle(objectIndex, 0U, object->unk_0C6 + 0x8000, 0U);
//object->surfaceHeight = 5.0f;
//object->sizeScaling = 0.04f;
//func_800722A4(objectIndex, 0x00000014);
}
func_80086EF0(objectIndex);
object->unk_034 = 0.0f;
object->type = get_animation_length(d_course_sherbet_land_unk_data11, 0);
@@ -2,7 +2,8 @@
#include <libultraship.h>
#include <vector>
#include "engine/vehicles/OPenguin.h"
#include "engine/World.h"
#include "engine/objects/Object.h"
extern "C" {
#include "macros.h"
@@ -11,22 +12,10 @@ extern "C" {
#include "waypoints.h"
#include "common_structs.h"
#include "objects.h"
#include "course_offsets.h"
}
//! @todo Make shadow size bigger if thwomp is scaled up
//! @todo make adjustable properties for squishSize and boundingBoxSize
/**
* Thwomp GameObject
*
* The game automatically places the actor on the ground so you do not need to provide a Y coordinate value.
*
* @arg direction the rotational direction the thwomp is facing.
* @arg behaviour the behaviour of the thwomp, uses values 1-6.
* @arg primAlpha unknown
* @arg boundingBoxSize optional. The size of the bounding box for the thwomp. Default value is 12
*/
class OPenguin {
class OPenguin : public OObject {
public:
enum PenguinType : uint32_t {
CHICK,
@@ -49,17 +38,31 @@ public:
f32 Diameter = 0.0f; // Waddle in a circle around the spawn point at this diameter.
uint16_t MirrorModeAngleOffset;
explicit OPenguin(s32 i, Vec3f pos, u16 direction, PenguinType type, Behaviour behaviour);
explicit OPenguin(Vec3f pos, u16 direction, PenguinType type, Behaviour behaviour);
void Tick();
void Draw(s32 playerId);
~OPenguin() {
_count--;
}
static size_t GetCount() {
return _count;
}
virtual void Tick() override;
virtual void Draw(s32 cameraId) override;
private:
void Behaviours(s32 objectIndex, s32 arg1);
void EmperorPenguin(s32 objectIndex);
void func_80085080(s32 objectIndex);
void func_8008502C(s32 objectIndex, s32 arg1);
void func_80084D2C(s32 objectIndex, s32 arg1);
void InitEmperorPenguin(s32 objectIndex);
void OtherPenguin(s32 objectIndex);
void InitOtherPenguin(s32 objectIndex);
static size_t _count;
s32 _idx;
PenguinType _type;
Behaviour _bhv;
+142
View File
@@ -0,0 +1,142 @@
#include "Podium.h"
#include "assets/ceremony_data.h"
extern "C" {
#include "main.h"
#include "defines.h"
#include "update_objects.h"
#include "render_objects.h"
#include "code_80057C60.h"
#include "podium_ceremony_actors.h"
#include "math_util.h"
#include "math_util_2.h"
#include "assets/common_data.h"
#include "some_data.h"
#include "code_80091440.h"
#include "code_80086E70.h"
#include "code_80086E70.h"
extern Vec3s D_800E634C[];
}
// Might be Cheep Cheep related?
// Vec3s D_800E634C[] = {
// { 0xf37e, 0x0013, 0xfe22 },
// { 0xf37b, 0x0013, 0xfe31 },
// { 0xf380, 0x0013, 0xfe14 },
// };
OPodium::OPodium(const FVector& pos) {
_pos = pos;
for (size_t i = 0; i < NUM_PODIUMS; i++) {
s32 objectIndex = indexObjectList1[i];
//init_object(objectIndex, 0);
//set_obj_origin_pos(objectIndex, pos.x - 1.5, pos.y, pos.z);
}
}
void OPodium::Tick() { // func_80086604
s32 objectIndex;
if ((D_8016347C != 0) && (D_802874D8.unk1D < 3)) {
if (D_801658C6 == 0) {
for (size_t i = 0; i < 3; i++) {
objectIndex = indexObjectList1[i];
init_object(objectIndex, 0);
}
D_801658C6 = 1;
}
}
for (size_t i = 0; i != NUM_PODIUMS; i++) {
objectIndex = indexObjectList1[i];
if (gObjectList[objectIndex].state != 0) {
OPodium::func_80086528(objectIndex, i);
OPodium::func_80086424(objectIndex);
}
}
}
void OPodium::Draw(s32 cameraId) { // func_80055F48
for (size_t i = 0; i < NUM_PODIUMS; i++) {
Object* object;
object = &gObjectList[indexObjectList1[i]];
if (object->state >= 2) {
//func_80043220(object->pos, object->direction_angle, object->sizeScaling, object->model);
rsp_set_matrix_transformation(object->pos, object->direction_angle, object->sizeScaling);
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0077A0);
gSPDisplayList(gDisplayListHead++, object->model);
}
}
}
void OPodium::func_8008629C(s32 objectIndex, s32 arg1) {
switch (arg1) { /* irregular */
case 0:
gObjectList[objectIndex].model = (Gfx*)podium_dl3;
gObjectList[objectIndex].unk_04C = 0x00000038;
break;
case 1:
gObjectList[objectIndex].model = (Gfx*)podium2_dl3;
gObjectList[objectIndex].unk_04C = 0x0000002B;
break;
case 2:
gObjectList[objectIndex].model = (Gfx*)podium3_dl3;
gObjectList[objectIndex].unk_04C = 0x0000001E;
break;
default:
break;
}
gObjectList[objectIndex].sizeScaling = 1.0f;
set_obj_origin_pos(objectIndex, _pos.x - 1.5, _pos.y, _pos.z);
set_obj_origin_offset(objectIndex, 0.0f, -10.0f, 0.0f);
set_obj_direction_angle(objectIndex, 0U, 0xF8E4U, 0U);
gObjectList[objectIndex].unk_048 = 0;
object_next_state(objectIndex);
}
void OPodium::func_80086424(s32 objectIndex) {
switch (gObjectList[objectIndex].unk_0AE) {
case 0:
break;
case 1:
gObjectList[objectIndex].velocity[1] = 0.75f;
func_80086FD4(objectIndex);
break;
case 2:
if (gObjectList[objectIndex].offset[1] >= -2.0) {
gObjectList[objectIndex].velocity[1] -= 0.1;
}
object_add_velocity_offset_y(objectIndex);
if (gObjectList[objectIndex].offset[1] >= 0.0) {
gObjectList[objectIndex].offset[1] = 0.0f;
gObjectList[objectIndex].velocity[1] = 0.0f;
func_80086F60(objectIndex);
}
break;
}
object_calculate_new_pos_offset(objectIndex);
}
void OPodium::func_80086528(s32 objectIndex, s32 arg1) {
switch (gObjectList[objectIndex].state) { /* irregular */
case 1:
func_8008629C(objectIndex, arg1);
break;
case 2:
if (set_and_run_timer_object(objectIndex, gObjectList[objectIndex].unk_04C) != 0) {
func_80091440(arg1);
func_80086E70(objectIndex);
object_next_state(objectIndex);
}
break;
case 0:
break;
case 3:
if (gObjectList[objectIndex].unk_0AE == 0) {
gObjectList[objectIndex].unk_048 = 1;
object_next_state(objectIndex);
}
break;
}
}
+39
View File
@@ -0,0 +1,39 @@
#pragma once
#include <libultraship.h>
#include <vector>
#include "World.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "vehicles.h"
#include "waypoints.h"
#include "common_structs.h"
#include "objects.h"
#include "course_offsets.h"
#include "some_data.h"
}
class OPodium : public OObject {
public:
enum Behaviour : uint16_t {
};
public:
explicit OPodium(const FVector& pos);
virtual void Tick() override;
virtual void Draw(s32 cameraId) override;
void func_8008629C(s32 objectIndex, s32 arg1);
void func_80086424(s32 objectIndex);
void func_80086528(s32 objectIndex, s32 arg1);
private:
s32 _idx;
FVector _pos;
};
+194
View File
@@ -0,0 +1,194 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "Seagull.h"
#include <vector>
#include "World.h"
#include "port/Game.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "defines.h"
#include "camera.h"
#include "update_objects.h"
#include "render_objects.h"
#include "actors.h"
#include "code_80057C60.h"
#include "code_80086E70.h"
#include "math_util.h"
#include "math_util_2.h"
#include "code_80005FD0.h"
#include "some_data.h"
#include "ceremony_and_credits.h"
extern SplineData D_800E6034;
extern SplineData D_800E60F0;
extern SplineData D_800E61B4;
extern SplineData D_800E6280;
}
SplineData* D_800E633C[] = { &D_800E6034, &D_800E60F0, &D_800E61B4, &D_800E6280 };
size_t OSeagull::_count = 0;
OSeagull::OSeagull(Vec3f pos) {
size_t objectIndex;
_idx = _count;
_pos[0] = pos[0];
_pos[1] = pos[1];
_pos[2] = pos[2];
s16 randZ;
s16 randX;
s16 randY;
randX = random_int(200) + -100.0;
randY = random_int(20);
randZ = random_int(200) + -100.0;
//for (i = 0; i < NUM_SEAGULLS; i++) {
objectIndex = indexObjectList2[_idx];
init_object(objectIndex, 0);
set_obj_origin_pos(objectIndex, pos[0], pos[1], pos[2]);
if (_idx < (NUM_SEAGULLS / 2)) {
gObjectList[objectIndex].unk_0D5 = 0;
} else {
gObjectList[objectIndex].unk_0D5 = 1;
}
_count++;
}
void OSeagull::Tick() {
Object* object;
s32 objectIndex = indexObjectList2[_idx];
object = &gObjectList[objectIndex];
if (object->state == 0) {
return;
}
OSeagull::func_80082714(objectIndex, _idx);
OSeagull::func_8008275C(objectIndex);
if (func_80072320(objectIndex, 2) != 0) {
func_800722CC(objectIndex, 2);
if (D_80165A90 != 0) {
D_80165A90 = 0;
D_80183E40[0] = 0.0f;
D_80183E40[1] = 0.0f;
D_80183E40[2] = 0.0f;
if (gGamestate != CREDITS_SEQUENCE) {
func_800C98B8(object->pos, D_80183E40, SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x43));
} else {
objectIndex = indexObjectList2[1];
if (gCutsceneShotTimer <= 150) {
object = &gObjectList[objectIndex];
func_800C98B8(object->pos, D_80183E40, SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x43));
}
}
}
}
//}
if (D_80165900 != 0) {
D_80165900 -= 1;
} else {
if (gGamestate != CREDITS_SEQUENCE) {
D_80165900 = 60;
} else {
D_80165900 = 15;
}
if ((D_80165908 != 0) && (D_80165A90 == 0)) {
D_80165A90 = 1;
}
}
D_80165908 = 0;
}
void OSeagull::Draw(s32 cameraId) { // render_object_seagulls
s32 objectIndex = indexObjectList2[_idx];
if (func_8008A364(objectIndex, cameraId, 0x5555U, 0x000005DC) < 0x9C401 && CVarGetInteger("gNoCulling", 0) == 0) {
D_80165908 = 1;
_toggle = true;
}
if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) {
OSeagull::func_800552BC(objectIndex);
}
}
void OSeagull::func_800552BC(s32 objectIndex) {
if (gObjectList[objectIndex].state >= 2) {
rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].direction_angle,
gObjectList[objectIndex].sizeScaling);
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0077D0);
if (gIsGamePaused == 0) {
gObjectList[objectIndex].unk_0A2 = render_animated_model((Armature*) gObjectList[objectIndex].model,
(Animation**) gObjectList[objectIndex].vertex, 0,
gObjectList[objectIndex].unk_0A2);
} else {
render_animated_model((Armature*) gObjectList[objectIndex].model,
(Animation**) gObjectList[objectIndex].vertex, 0, gObjectList[objectIndex].unk_0A2);
}
}
}
void OSeagull::func_8008275C(s32 objectIndex) {
UNUSED s32 stackPadding;
switch (gObjectList[objectIndex].unk_0DD) {
case 1:
func_8008B78C(objectIndex);
object_calculate_new_pos_offset(objectIndex);
break;
case 2:
func_8008B78C(objectIndex);
vec3f_copy(gObjectList[objectIndex].unk_01C, gObjectList[objectIndex].pos);
func_8000D940(gObjectList[objectIndex].origin_pos, (s16*) &gObjectList[objectIndex].unk_0C6,
gObjectList[objectIndex].unk_034, 0.0f, 0);
gObjectList[objectIndex].offset[0] *= 2.0;
gObjectList[objectIndex].offset[1] *= 2.5;
gObjectList[objectIndex].offset[2] *= 2.0;
object_calculate_new_pos_offset(objectIndex);
gObjectList[objectIndex].direction_angle[1] =
get_angle_between_two_vectors(gObjectList[objectIndex].unk_01C, gObjectList[objectIndex].pos);
break;
}
func_800873F4(objectIndex);
}
void OSeagull::func_8008241C(s32 objectIndex, s32 arg1) {
s16 randZ;
s16 randX;
s16 randY;
gObjectList[objectIndex].unk_0D8 = 1;
gObjectList[objectIndex].model = (Gfx*) d_course_koopa_troopa_beach_unk4;
gObjectList[objectIndex].vertex = (Vtx*) d_course_koopa_troopa_beach_unk_data5;
gObjectList[objectIndex].sizeScaling = 0.2f;
gObjectList[objectIndex].unk_0DD = 1;
randX = random_int(0x00C8) + -100.0;
randY = random_int(0x0014);
randZ = random_int(0x00C8) + -100.0;
set_obj_origin_pos(objectIndex, (randX + _pos[0]) * xOrientation, randY + _pos[1], randZ + _pos[2]);
set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
gObjectList[objectIndex].unk_034 = 1.0f;
func_80086EF0(objectIndex);
gObjectList[objectIndex].spline = D_800E633C[arg1 % 4];
set_object_flag(objectIndex, 0x00000800);
object_next_state(objectIndex);
}
void OSeagull::func_80082714(s32 objectIndex, s32 arg1) {
switch (gObjectList[objectIndex].state) {
case 1:
OSeagull::func_8008241C(objectIndex, arg1);
break;
case 0:
default:
break;
}
}
+47
View File
@@ -0,0 +1,47 @@
#pragma once
#include <libultraship.h>
#include <vector>
#include "Object.h"
#include "engine/World.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "vehicles.h"
#include "waypoints.h"
#include "common_structs.h"
#include "objects.h"
#include "camera.h"
}
//! @todo unk_0D5 needs to be a struct variable probably. What does it do? Behaviour?
class OSeagull : public OObject {
public:
explicit OSeagull(Vec3f pos);
~OSeagull() {
_count--;
}
static size_t GetCount() {
return _count;
}
virtual void Tick() override;
virtual void Draw(s32 cameraId) override;
void func_800552BC(s32 objectIndex);
void func_8008275C(s32 objectIndex);
void func_8008241C(s32 objectIndex, s32 arg1);
void func_80082714(s32 objectIndex, s32 arg1);
private:
Vec3f _pos;
static size_t _count;
s32 _idx;
bool _toggle;
SplineData *spline;
};
+343
View File
@@ -0,0 +1,343 @@
#include "Snowman.h"
#include "World.h"
extern "C" {
#include "render_objects.h"
#include "update_objects.h"
#include "assets/frappe_snowland_data.h"
#include "assets/common_data.h"
#include "math_util.h"
#include "math_util_2.h"
#include "code_80086E70.h"
#include "code_80057C60.h"
}
static const char* sSnowmanHeadList[] = { d_course_frappe_snowland_snowman_head };
size_t OSnowman::_count = 0;
OSnowman::OSnowman(const FVector& pos) {
_idx = _count;
_pos = pos;
s32 objectId = indexObjectList2[_idx];
init_object(objectId, 0);
gObjectList[objectId].origin_pos[0] = pos.x * xOrientation;
gObjectList[objectId].origin_pos[1] = pos.y + 5.0 + 3.0;
gObjectList[objectId].origin_pos[2] = pos.z;
gObjectList[objectId].pos[0] = pos.x * xOrientation;
gObjectList[objectId].pos[1] = pos.y + 5.0 + 3.0;
gObjectList[objectId].pos[2] = pos.z;
objectId = indexObjectList1[_idx];
init_object(objectId, 0);
gObjectList[objectId].origin_pos[0] = pos.x * xOrientation;
gObjectList[objectId].origin_pos[1] = pos.y + 3.0;
gObjectList[objectId].origin_pos[2] = pos.z;
gObjectList[objectId].unk_0D5 = 0; // Section Id no longer used.
gObjectList[objectId].pos[0] = pos.x * xOrientation;
gObjectList[objectId].pos[1] = pos.y + 3.0;
gObjectList[objectId].pos[2] = pos.z;
_count++;
}
void OSnowman::Tick() {
s32 var_s0;
s32 var_s3;
s32 var_s4;
s32 objectIndex;
Object* object;
//! @todo quick hack to add the snow particles on hit. Need to separate into its own class
if (_idx == 0) {
for (var_s0 = 0; var_s0 < gObjectParticle2_SIZE; var_s0++) {
objectIndex = gObjectParticle2[var_s0];
if (objectIndex == DELETED_OBJECT_ID) {
continue;
}
if (gObjectList[objectIndex].state == 0) {
continue;
}
func_8008379C(objectIndex);
if (gObjectList[objectIndex].state != 0) {
continue;
}
delete_object_wrapper(&gObjectParticle2[var_s0]);
if (var_s0) {} // ??
}
}
//for (var_s0 = 0; var_s0 < NUM_SNOWMEN; var_s0++) {
var_s4 = indexObjectList1[_idx];
var_s3 = indexObjectList2[_idx];
OSnowman::func_80083A94(var_s3); // snowman head
OSnowman::func_80083C04(var_s4); // snowman body
if (is_obj_index_flag_status_inactive(var_s4, 0x00001000) != 0) {
object = &gObjectList[var_s4];
if ((are_players_in_course_section(object->unk_0D5 - 1, object->unk_0D5 + 1) != 0) && (func_80089B50(var_s4) != 0)) {
set_object_flag(var_s4, 0x00001000);
clear_object_flag(var_s4, 0x00000010);
func_800726CC(var_s4, 0x0000000A);
func_8008701C(var_s3, 0x0000000A);
OSnowman::func_800836F0(object->pos);
}
} else if (func_80072320(var_s4, 2) != 0) {
func_800722CC(var_s4, 2);
func_8008701C(var_s3, 0x00000014);
}
//}
}
void OSnowman::Draw(s32 cameraId) {
OSnowman::DrawHead(cameraId);
OSnowman::DrawBody(cameraId);
}
void OSnowman::func_800836F0(Vec3f pos) {
s32 objectIndex;
s32 i;
for (i = 0; i < D_8018D3BC; i++) {
objectIndex = add_unused_obj_index(&gObjectParticle2[0], &gNextFreeObjectParticle2, gObjectParticle2_SIZE);
if (objectIndex == NULL_OBJECT_ID) {
break;
}
OSnowman::func_80083538(objectIndex, pos, i, D_8018D3BC);
}
}
void OSnowman::DrawHead(s32 cameraId) {
s32 objectIndex;
Camera* camera = &camera1[cameraId];
objectIndex = indexObjectList1[_idx];
if (gObjectList[objectIndex].state >= 2) {
func_8008A364(objectIndex, cameraId, 0x2AABU, 0x00000258);
if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) {
D_80183E80[0] = (s16) gObjectList[objectIndex].orientation[0];
D_80183E80[1] =
func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
D_80183E80[2] = (u16) gObjectList[objectIndex].orientation[2];
if (is_obj_flag_status_active(objectIndex, 0x00000010) != 0) {
draw_2d_texture_at(gObjectList[objectIndex].pos, (u16*) D_80183E80,
gObjectList[objectIndex].sizeScaling, (u8*) gObjectList[objectIndex].activeTLUT,
(u8*)gObjectList[objectIndex].activeTexture, gObjectList[objectIndex].vertex,
0x00000040, 0x00000040, 0x00000040, 0x00000020);
}
objectIndex = indexObjectList2[_idx];
D_80183E80[0] = (s16) gObjectList[objectIndex].orientation[0];
D_80183E80[2] = (u16) gObjectList[objectIndex].orientation[2];
draw_2d_texture_at(gObjectList[objectIndex].pos, (u16*) D_80183E80,
gObjectList[objectIndex].sizeScaling, (u8*) gObjectList[objectIndex].activeTLUT,
(u8*)gObjectList[objectIndex].activeTexture, gObjectList[objectIndex].vertex, 0x00000040,
0x00000040, 0x00000040, 0x00000020);
}
}
}
void OSnowman::DrawBody(s32 cameraId) {
UNUSED s32 stackPadding[2];
Camera* sp44;
s32 someIndex;
s32 objectIndex;
Object* object;
sp44 = &camera1[cameraId];
load_texture_and_tlut((u8*)d_course_frappe_snowland_snow_tlut, (u8*)d_course_frappe_snowland_snow, 0x00000020, 0x00000020);
//! @todo quick hack to add the snow particles on hit. Need to separate into its own class
if (_idx == 0) {
for (someIndex = 0; someIndex < gObjectParticle2_SIZE; someIndex++) {
objectIndex = gObjectParticle2[someIndex];
if (objectIndex != NULL_OBJECT_ID) {
object = &gObjectList[objectIndex];
if (object->state > 0) {
func_8008A364(objectIndex, cameraId, 0x2AABU, 0x000001F4);
if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) {
object->orientation[1] = func_800418AC(object->pos[0], object->pos[2], sp44->pos);
rsp_set_matrix_gObjectList(objectIndex);
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0069E0);
}
}
}
}
}
gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF);
}
void OSnowman::func_80083C04(s32 objectIndex) {
Object* object;
object = &gObjectList[objectIndex];
switch (object->state) {
case 0:
break;
case 1:
OSnowman::func_80083B0C(objectIndex);
break;
case 2:
set_and_run_timer_object(objectIndex, 0x00000096);
break;
case 10:
if (set_and_run_timer_object(objectIndex, 0x0000012C) != 0) {
func_800722A4(objectIndex, 2);
}
break;
case 11:
if (set_and_run_timer_object(objectIndex, 0x0000000A) != 0) {
set_object_flag(objectIndex, 0x00000010);
object->sizeScaling = 0.001f;
}
break;
case 12:
if (func_80074118(objectIndex, &object->sizeScaling, 0.001f, 0.1f, 0.0025f, 0, 0) != 0) {
object_next_state(objectIndex);
}
break;
case 13:
func_800726CC(objectIndex, 2);
clear_object_flag(objectIndex, 0x00001000);
break;
}
if (object->state >= 2) {
func_80073514(objectIndex);
}
OSnowman::func_80083BE4(objectIndex);
}
void OSnowman::func_80083BE4(s32 objectIndex) {
object_calculate_new_pos_offset(objectIndex);
}
void OSnowman::func_80083868(s32 objectIndex) {
Object* object;
Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(D_0D0061B0);
init_texture_object(objectIndex, (u8*)d_course_frappe_snowland_snowman_tlut, (const char**)sSnowmanHeadList, 0x40U, (u16) 0x00000040);
object = &gObjectList[objectIndex];
object->vertex = vtx;
object->sizeScaling = 0.1f;
object->textureListIndex = 0;
object_next_state(objectIndex);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
object->orientation[0] = 0;
object->orientation[1] = 0;
object->orientation[2] = 0x8000;
object->primAlpha = random_int(0x2000U) - 0x1000;
func_80086E70(objectIndex);
object->unk_034 = 1.5f;
set_object_flag(objectIndex, 0x00000200);
}
void OSnowman::func_80083948(s32 objectIndex) {
switch (gObjectList[objectIndex].unk_0AE) {
case 1:
func_80086FD4(objectIndex);
break;
case 2:
func_800871AC(objectIndex, 0x00000014);
break;
case 3:
func_8008701C(objectIndex, 1);
break;
case 10:
func_80087C48(objectIndex, 10.0f, 0.5f, 0x0000000A);
break;
case 11:
func_80087D24(objectIndex, 0.0f, 0.2f, -7.0f);
break;
case 20:
if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 0.0f, 0.2f) != 0) {
func_80073800(objectIndex, 0);
func_8008701C(objectIndex, 1);
}
break;
case 0:
default:
break;
}
object_calculate_new_pos_offset(objectIndex);
OSnowman::func_80073D0C(objectIndex, &gObjectList[objectIndex].primAlpha, -0x00001000, 0x00001000, 0x00000400, 1, -1);
gObjectList[objectIndex].orientation[2] = gObjectList[objectIndex].primAlpha + 0x8000;
}
bool OSnowman::func_80073D0C(s32 objectIndex, s16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
return func_80073B78(0, objectIndex, arg1, arg2, arg3, arg4, arg5, arg6);
}
void OSnowman::func_80083A94(s32 objectIndex) {
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
OSnowman::func_80083868(objectIndex);
break;
}
if (gObjectList[objectIndex].state >= 2) {
func_80073514(objectIndex);
}
OSnowman::func_80083948(objectIndex);
}
static const char* sSnowmanBodyList[] = { d_course_frappe_snowland_snowman_body };
void OSnowman::func_80083B0C(s32 objectIndex) {
Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(common_vtx_hedgehog);
init_texture_object(objectIndex, (u8*)d_course_frappe_snowland_snowman_tlut, (const char**)sSnowmanBodyList, 0x40U, (u16) 0x00000040);
gObjectList[objectIndex].vertex = vtx;
gObjectList[objectIndex].sizeScaling = 0.1f;
gObjectList[objectIndex].textureListIndex = 0;
object_next_state(objectIndex);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
gObjectList[objectIndex].orientation[0] = 0;
gObjectList[objectIndex].orientation[1] = 0;
gObjectList[objectIndex].orientation[2] = 0x8000;
gObjectList[objectIndex].boundingBoxSize = 2;
gObjectList[objectIndex].unk_034 = 1.5f;
set_object_flag(objectIndex, 0x04000210);
}
void OSnowman::func_80083538(s32 objectIndex, Vec3f arg1, s32 arg2, s32 arg3) {
Object* object;
init_object(objectIndex, 0);
object = &gObjectList[objectIndex];
object->activeTexture = (const char*)d_course_frappe_snowland_snow;
object->textureList = (const char**)d_course_frappe_snowland_snow;
object->activeTLUT = d_course_frappe_snowland_snow_tlut;
object->tlutList = (u8*)d_course_frappe_snowland_snow_tlut;
object->sizeScaling = random_int(0x0064U);
object->sizeScaling = (object->sizeScaling * 0.001) + 0.05;
object->velocity[1] = random_int(0x0014U);
object->velocity[1] = (object->velocity[1] * 0.5) + 2.6;
object->unk_034 = random_int(0x000AU);
object->unk_034 = (object->unk_034 * 0.1) + 4.5;
object->direction_angle[1] = (arg2 << 0x10) / arg3;
object->origin_pos[0] = arg1[0];
object->origin_pos[1] = arg1[1];
object->origin_pos[2] = arg1[2];
object->primAlpha = random_int(0x4000U) + 0x1000;
}
void OSnowman::func_8008379C(s32 objectIndex) {
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.74f,
gObjectList[objectIndex].unk_034, gObjectList[objectIndex].direction_angle[1],
0x00000064) != 0) {
object_next_state(objectIndex);
}
break;
case 2:
func_80086F60(objectIndex);
func_80072428(objectIndex);
break;
}
object_calculate_new_pos_offset(objectIndex);
gObjectList[objectIndex].orientation[2] += gObjectList[objectIndex].primAlpha;
}

Some files were not shown because too many files have changed in this diff Show More