This commit is contained in:
MegaMech
2025-02-18 09:03:30 -07:00
18 changed files with 17342 additions and 9403 deletions
File diff suppressed because it is too large Load Diff
+23
View File
@@ -0,0 +1,23 @@
#include <libultraship.h>
extern u8 powered_heart1_ci8[];
extern u8 powered_heart1_pal_rgba16[];
extern Vtx powered_Text_mesh_vtx_cull[8];
extern Vtx powered_Text_mesh_vtx_0[2673];
extern Gfx powered_Text_mesh_tri_0[];
extern Gfx mat_powered__64[];
extern Gfx mat_revert_powered__64[];
extern Gfx powered_Text_mesh[];
extern u8 hm64_grayishtoblue_rgba16[];
extern u8 hm64_heart1_rgba16[];
extern Vtx hm64_Text_001_mesh_vtx_cull[8];
extern Vtx hm64_Text_001_mesh_vtx_0[367];
extern Gfx hm64_Text_001_mesh_tri_0[];
extern Vtx hm64_Text_001_mesh_vtx_1[710];
extern Gfx hm64_Text_001_mesh_tri_1[];
extern Gfx mat_hm64_HM[];
extern Gfx mat_revert_hm64_HM[];
extern Gfx mat_hm64__64[];
extern Gfx mat_revert_hm64__64[];
extern Gfx hm64_Text_001_mesh[];
+2481 -4576
View File
File diff suppressed because it is too large Load Diff
+42 -46
View File
@@ -2,63 +2,59 @@
extern u8 ship1_wood_rgba16[];
extern u8 ship1_metal1_i8[];
extern u8 ship1__32wood_ci8[];
extern u8 ship1__32wood_pal_rgba16[];
extern u8 ship1_sail2_ci8[];
extern u8 ship1_sail2_pal_rgba16[];
extern u8 ship1_hmpainted_rgba32[];
extern u8 ship1_spag1_rgba32[];
extern u8 ship1_sauce_ci4[];
extern u8 ship1_sauce_pal_rgba16[];
extern u8 ship1__32wood_rgba32[];
extern u8 ship1_sail2_rgba16[];
extern u8 ship1_hmpainted_rgba16[];
extern u8 ship1_spag1_rgba16[];
extern u8 ship1_sauce_rgba16[];
extern u8 ship1__32wood_rgba16[];
extern u8 ship1_flag_rgba16[];
extern u8 ship1_wood2_rgba16[];
extern Vtx ship1_Spaghetti_mesh_vtx_cull[8];
extern Vtx ship1_Spaghetti_mesh_vtx_0[108];
extern Gfx ship1_Spaghetti_mesh_tri_0[];
extern Vtx ship1_Spaghetti_mesh_vtx_1[58];
extern Gfx ship1_Spaghetti_mesh_tri_1[];
extern Vtx ship1_Spaghetti_mesh_vtx_2[357];
extern Gfx ship1_Spaghetti_mesh_tri_2[];
extern Vtx ship1_Spaghetti_mesh_vtx_3[15];
extern Gfx ship1_Spaghetti_mesh_tri_3[];
extern Vtx ship1_Spaghetti_mesh_vtx_4[12];
extern Gfx ship1_Spaghetti_mesh_tri_4[];
extern Vtx ship1_Spaghetti_mesh_vtx_5[43];
extern Gfx ship1_Spaghetti_mesh_tri_5[];
extern Vtx ship1_Spaghetti_mesh_vtx_6[43];
extern Gfx ship1_Spaghetti_mesh_tri_6[];
extern Vtx ship1_Spaghetti_mesh_vtx_7[79];
extern Gfx ship1_Spaghetti_mesh_tri_7[];
extern Vtx ship1_Spaghetti_mesh_vtx_8[12];
extern Gfx ship1_Spaghetti_mesh_tri_8[];
extern Vtx ship1_Spaghetti_mesh_vtx_9[3];
extern Gfx ship1_Spaghetti_mesh_tri_9[];
extern Vtx ship1_Spaghetti_mesh_vtx_10[17];
extern Gfx ship1_Spaghetti_mesh_tri_10[];
extern u8 ship1_shinyengine_ci8[];
extern u8 ship1_shinyengine_pal_rgba16[];
extern u8 ship1_enginepiece_rgba16[];
extern Vtx ship1_spag1_mesh_vtx_cull[8];
extern Vtx ship1_spag1_mesh_vtx_0[86];
extern Gfx ship1_spag1_mesh_tri_0[];
extern Vtx ship1_spag1_mesh_vtx_1[32];
extern Gfx ship1_spag1_mesh_tri_1[];
extern Vtx ship1_spag1_mesh_vtx_2[15];
extern Gfx ship1_spag1_mesh_tri_2[];
extern Vtx ship1_spag1_mesh_vtx_3[12];
extern Gfx ship1_spag1_mesh_tri_3[];
extern Vtx ship1_spag1_mesh_vtx_4[17];
extern Gfx ship1_spag1_mesh_tri_4[];
extern Vtx ship1_spag1_mesh_vtx_5[16];
extern Gfx ship1_spag1_mesh_tri_5[];
extern Vtx ship1_spag1_mesh_vtx_6[79];
extern Gfx ship1_spag1_mesh_tri_6[];
extern Vtx ship1_spag1_mesh_vtx_7[3];
extern Gfx ship1_spag1_mesh_tri_7[];
extern Vtx ship1_spag1_mesh_vtx_8[17];
extern Gfx ship1_spag1_mesh_tri_8[];
extern Vtx ship1_spag1_mesh_vtx_9[254];
extern Gfx ship1_spag1_mesh_tri_9[];
extern Vtx ship1_spag1_mesh_vtx_10[32];
extern Gfx ship1_spag1_mesh_tri_10[];
extern Vtx ship1_spag1_mesh_vtx_11[10];
extern Gfx ship1_spag1_mesh_tri_11[];
extern Gfx mat_ship1_boat1[];
extern Gfx mat_revert_ship1_boat1[];
extern Gfx mat_ship1_metal1[];
extern Gfx mat_revert_ship1_metal1[];
extern Gfx mat_ship1_wood1[];
extern Gfx mat_revert_ship1_wood1[];
extern Gfx mat_ship1_sail[];
extern Gfx mat_revert_ship1_sail[];
extern Gfx mat_ship1_logo[];
extern Gfx mat_revert_ship1_logo[];
extern Gfx mat_ship1_spag1[];
extern Gfx mat_revert_ship1_spag1[];
extern Gfx mat_ship1_sauce1[];
extern Gfx mat_revert_ship1_sauce1[];
extern Gfx mat_ship1_meat1[];
extern Gfx mat_revert_ship1_meat1[];
extern Gfx mat_ship1_fork1[];
extern Gfx mat_revert_ship1_fork1[];
extern Gfx mat_ship1_flag[];
extern Gfx mat_revert_ship1_flag[];
extern Gfx mat_ship1_wood2[];
extern Gfx mat_revert_ship1_wood2[];
extern Gfx ship1_Spaghetti_mesh[];
extern Gfx mat_ship1_engine[];
extern Gfx mat_ship1_black[];
extern Gfx mat_ship1_engine2[];
extern Gfx ship1_spag1_mesh[];
extern u8 wheels_metal1_i8[];
extern u8 wheels_tire_i8[];
+5781 -4770
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -183,6 +183,7 @@ enum { COURSE_ONE, COURSE_TWO, COURSE_THREE, COURSE_FOUR };
#define CHARACTER_SELECT_MENU 12
#define COURSE_SELECT_MENU 13
#define RACING_DUPLICATE 14
#define HARBOUR_MASTERS_MENU 15
/**
* @brief Options for gGameState gGotoMode and gGotoMenu
+195
View File
@@ -0,0 +1,195 @@
#include <libultra/gbi.h>
#include <libultra/gu.h>
#include "HM_Intro.h"
#include "port/Game.h"
extern "C" {
#include "main.h"
#include "memory.h"
#include "math_util.h"
#include "courses/harbour/track.h"
#include "courses/harbour/powered.h"
#include "courses/harbour/ship2_model.h"
#include "courses/harbour/ship3_model.h"
#include "collision.h"
#include "menu_items.h"
#include "external.h"
#include "menus.h"
extern Gfx ship1_spag1_mesh[];
}
HarbourMastersIntro::HarbourMastersIntro() {
}
void HarbourMastersIntro::HM_InitIntro() {
_camera.Pos.x = 0;
_camera.Pos.y = 0;
_camera.Pos.z = 0;
// The camera setup was broken when this was first made. And then it was fixed.
// That's why this file has weird coordinates as the objects were positioned in-front of the camera view
// Instead of moving the camera to the right spot in the scene.
_camera.LookAt.x = 0;
_camera.LookAt.y = 0;
_camera.LookAt.z = -2500;
_cameraSpeed = 0.0f;
_cameraMaxSpeed = 16.0f;
_cameraAcceleration = 1.0f;
_pos = FVector(-1000, -205, -800); // -1000, -210, -800
_rot = FRotation(-5, 100, 0);
_scale = 0.7f;
_trackScale = 2.0f;
_ship2Pos = FVector(300, -210, -1960);
_ship2Rot = FRotation(0, 45, 0);
_shipPos = FVector(20, -210, -1650);
_shipRot = FRotation(0, 45, 0);
_posHM64 = FVector(0, -500, -1000);
_rotHM64 = FRotation(0, -90, -4); // -0x2100
_hPos = FVector(-2000, 100, -4900);
_hRot = FRotation(0, 0, 0);
ground_f3d_material_013_lights = gdSPDefLights1(
0x7F, 0x30, 0x80,
0x60, 20, 10, 0x49, 0x49, 0x49
);
}
const float BOB_AMPLITUDE = 1.1f;
const float BOB_SPEED = 0.05f;
const float TILT_AMPLITUDE = 1.5f;
const float TILT_SPEED = 0.05f;
const float ROLL_AMPLITUDE = 1.0f;
const float ROLL_SPEED = 0.03f;
void HarbourMastersIntro::HM_TickIntro() {
_water += 1;
if (_water > 255) {
_water = 0;
}
HarbourMastersIntro::SpagBob(_pos, _rot, 2.5f, 0.18f, 1.5f, 0.05f, 1.7f, 0.06f);
HarbourMastersIntro::Bob(_shipPos, _shipRot, 1.2f, 0.06f, 1.6f, -0.04f, 1.1f, -0.04f);
HarbourMastersIntro::Bob(_ship2Pos, _ship2Rot, 1.2f, 0.06f, 1.6f, -0.04f, 1.1f, -0.04f);
_pos.x += 9;
_camera.Pos.x -= 1;
if (_pos.x >= 880) {
gMenuFadeType = 0;
gMenuSelection = LOGO_INTRO_MENU;
gFadeModeSelection = FADE_MODE_LOGO;
}
find_and_set_tile_size((uintptr_t) ((void*)mat_water_water1), 0, _water);
find_and_set_tile_size((uintptr_t) ((void*)mat_water_water2), _water, 0);;
}
// @args amplitudes
void HarbourMastersIntro::Bob(FVector& pos, FRotation& rot, f32 bobAmp, f32 bobSpeed, f32 tiltAmp, f32 tiltSpeed, f32 rollAmp, f32 rollSpeed) {
float time = (float)gGlobalTimer;
pos.y = -210 + bobAmp * sin(time * bobSpeed);
rot.pitch = tiltAmp * sin(time * tiltSpeed);
rot.roll = rollAmp * sin(time * rollSpeed);
}
void HarbourMastersIntro::SpagBob(FVector& pos, FRotation& rot, f32 bobAmp, f32 bobSpeed, f32 tiltAmp, f32 tiltSpeed, f32 rollAmp, f32 rollSpeed) {
float time = (float)gGlobalTimer;
pos.y = -205 + bobAmp * sin(time * bobSpeed);
rot.pitch = -5 + tiltAmp * sin(time * tiltSpeed);
rot.roll = rollAmp * sin(time * rollSpeed);
}
void HarbourMastersIntro::HM_DrawIntro() {
const f32 conv = 8192.0f / 45.0f; // Convert to hex degrees
Mtx* mtx = &gGfxPool->mtxObject[0];
HarbourMastersIntro::Setup();
Mat4 someMtx;
gSPMatrix(gDisplayListHead++, &gGfxPool->mtxScreen, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
gSPMatrix(gDisplayListHead++, &gGfxPool->mtxLookAt[0], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(someMtx);
render_set_position(someMtx, 0);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
gDPSetEnvColor(gDisplayListHead++, 0x00, 0x00, 0x00, 0x00);
Vec3f pos = {_pos.x, _pos.y, _pos.z};
Vec3s rot = {_rot.pitch * conv, _rot.yaw * conv, _rot.roll * conv};
Mat4 matrix;
mtxf_pos_rotation_xyz(matrix, pos, rot);
mtxf_scale(matrix, _scale);
render_set_position(matrix, 0);
gSPDisplayList(gDisplayListHead++, ship1_spag1_mesh);
Mat4 matrix2;
Vec3s rot2 = {_ship2Rot.pitch * conv, _ship2Rot.yaw * conv, _ship2Rot.roll * conv};
Vec3f pos2 = {_ship2Pos.x, _ship2Pos.y, _ship2Pos.z};
mtxf_pos_rotation_xyz(matrix2, pos2, rot2);
mtxf_scale(matrix2, _scale);
render_set_position(matrix2, 0);
gSPDisplayList(gDisplayListHead++, ship2_SoH_mesh);
Mat4 matrix3;
Vec3s rot3 = {_shipRot.pitch * conv, _shipRot.yaw * conv, _shipRot.roll * conv};
Vec3f pos3 = {_shipPos.x, _shipPos.y, _shipPos.z};
mtxf_pos_rotation_xyz(matrix3, pos3, rot3);
mtxf_scale(matrix3, _scale);
render_set_position(matrix3, 0);
gSPDisplayList(gDisplayListHead++, ship3_2Ship_mesh);
Mat4 hMatrix;
Vec3f hPos = {_hPos.x, _hPos.y, _hPos.z};
Vec3s hRot = {_hRot.pitch * conv, -0x2100, _hRot.roll * conv};
mtxf_pos_rotation_xyz(hMatrix, hPos, hRot);
mtxf_scale(hMatrix, _trackScale);
render_set_position(hMatrix, 0);
gSPDisplayList(gDisplayListHead++, ground_map_mesh);
gSPDisplayList(gDisplayListHead++, powered_Text_mesh);
gSPDisplayList(gDisplayListHead++, castle_map_002_mesh);
gSPDisplayList(gDisplayListHead++, road_map_001_mesh);
gSPDisplayList(gDisplayListHead++, water_water1_mesh);
HarbourMastersIntro::Sync();
}
void HarbourMastersIntro::Setup() {
u16 perspNorm;
move_segment_table_to_dmem();
gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP);
guPerspective(&gGfxPool->mtxScreen, &perspNorm, 45.0f, 1.3333334f, 100.0f, 12800.0f, 1.0f);
gSPPerspNormalize(gDisplayListHead++, perspNorm);
guLookAt(&gGfxPool->mtxLookAt[0], _camera.Pos.x, _camera.Pos.y, _camera.Pos.z, _camera.LookAt.x, _camera.LookAt.y, _camera.LookAt.z, 0.0f, 1.0f, 0.0f);
gDPSetCycleType(gDisplayListHead++, G_CYC_FILL);
gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER | G_CULL_BACK | G_LIGHTING);
gDPSetFillColor(gDisplayListHead++, 0x00010001);
gDPFillRectangle(gDisplayListHead++, 0, 0, 319, 239);
gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_CULL_BACK | G_LIGHTING);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
gDPSetCycleType(gDisplayListHead++, G_CYC_1CYCLE);
gDPSetCombineMode(gDisplayListHead++, G_CC_SHADE, G_CC_SHADE);
gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH);
gDPPipeSync(gDisplayListHead++);
}
void HarbourMastersIntro::Sync() {
gDPPipeSync(gDisplayListHead++);
gDPSetTexturePersp(gDisplayListHead++, G_TP_NONE);
gDPSetTextureFilter(gDisplayListHead++, G_TF_BILERP);
}
+73
View File
@@ -0,0 +1,73 @@
#ifndef _HM_INTRO_H
#define _HM_INTRO_H
#include <libultraship.h>
#include <libultra/gbi.h>
#include "CoreMath.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "common_structs.h"
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
class HarbourMastersIntro {
public:
HarbourMastersIntro();
void HM_InitIntro();
void HM_TickIntro();
void HM_DrawIntro();
private:
void Setup();
void Sync();
void Bob(FVector& pos, FRotation& rot, f32 bobAmp, f32 bobSpeed, f32 tiltAmp, f32 tiltSpeed, f32 rollAmp, f32 rollSpeed);
void SpagBob(FVector& pos, FRotation& rot, f32 bobAmp, f32 bobSpeed, f32 tiltAmp, f32 tiltSpeed, f32 rollAmp, f32 rollSpeed);
void MoveCloserToCamera(float moveSpeed);
struct HMCamera {
FVector Pos;
FVector LookAt;
};
HMCamera _camera;
f32 _cameraSpeed;
f32 _cameraMaxSpeed;
f32 _cameraAcceleration;
FVector _pos;
f32 _scale;
f32 _trackScale;
FRotation _rot;
FVector _shipPos;
FRotation _shipRot;
FVector _ship2Pos;
FRotation _ship2Rot;
s32 _water = 0;
FVector _posHM64;
FRotation _rotHM64;
FVector _hPos;
FRotation _hRot;
};
extern "C" {
#endif
void HM_InitIntro(void);
void HM_TickIntro(void);
void HM_DrawIntro(void);
#ifdef __cplusplus
}
#endif
#endif // _HM_INTRO_H
+1 -1
View File
@@ -53,7 +53,7 @@ void ASpaghettiShip::Draw(Camera *camera) {
mtxf_translate(objectMtx, hullPos2);
mtxf_multiplication(resultMtx, shipMtx, objectMtx);
if (render_set_position(resultMtx, 3) != 0) {
gSPDisplayList(gDisplayListHead++, ship1_Spaghetti_mesh);
gSPDisplayList(gDisplayListHead++, ship1_spag1_mesh);
}
// Front tyre
+6 -4
View File
@@ -518,10 +518,6 @@ TrackWaypoint harbour_path[] = {
{13,-121,0,0},
{15,-121,-14,0},
{-32768, -32768, -32768, 0}
};
Harbour::Harbour() {
@@ -601,6 +597,12 @@ TrackSections harbour_surfaces[] = {
void Harbour::Load() {
Course::Load(road_map_001_mesh_vtx_0, NULL);
// The light gets overridden in hm_intro, reset to normal
ground_f3d_material_013_lights = gdSPDefLights1(
0x7F, 0x7F, 0x7F,
0xFF, 0xFF, 0xFF, 0x49, 0x49, 0x49
);
generate_collision_mesh_with_default_section_id(ground_map_mesh, 8);
generate_collision_mesh_with_default_section_id(road_map_001_mesh, 1);
generate_collision_mesh_with_defaults(castle_map_002_mesh);
File diff suppressed because it is too large Load Diff
+31
View File
@@ -0,0 +1,31 @@
#ifndef _HABOUR_MASTERS_MODELS_H
#define _HABOUR_MASTERS_MODELS_H
#include <libultraship.h>
extern u8 ok64_ok64_ci8[];
extern u8 ok64_ok64_pal_rgba16[];
extern Vtx ok64_Plane_001_mesh_vtx_cull[8];
extern Vtx ok64_Plane_001_mesh_vtx_0[80];
extern Gfx ok64_Plane_001_mesh_tri_0[];
extern Vtx ok64_Plane_001_mesh_vtx_1[95];
extern Gfx ok64_Plane_001_mesh_tri_1[];
extern Vtx ok64_Plane_001_mesh_vtx_2[583];
extern Gfx ok64_Plane_001_mesh_tri_2[];
extern Vtx ok64_Plane_001_mesh_vtx_3[772];
extern Gfx ok64_Plane_001_mesh_tri_3[];
extern Vtx ok64_Plane_001_mesh_vtx_4[267];
extern Gfx ok64_Plane_001_mesh_tri_4[];
extern Gfx mat_ok64_white[];
extern Gfx mat_revert_ok64_white[];
extern Gfx mat_ok64_black[];
extern Gfx mat_revert_ok64_black[];
extern Gfx mat_ok64_f3dlite_material_001[];
extern Gfx mat_revert_ok64_f3dlite_material_001[];
extern Gfx mat_ok64_f3dlite_material_002[];
extern Gfx mat_revert_ok64_f3dlite_material_002[];
extern Gfx mat_ok64_f3dlite_material_003[];
extern Gfx mat_revert_ok64_f3dlite_material_003[];
extern Gfx ok64_Plane_001_mesh[];
#endif // _HABOUR_MASTERS_MODELS_H
+23 -3
View File
@@ -46,6 +46,7 @@
#include "engine/courses/Course.h"
#include "engine/Matrix.h"
#include "src/engine/HM_Intro.h"
const char* GetCupName(void);
@@ -2312,6 +2313,7 @@ void func_80094A64(struct GfxPool* pool) {
case OPTIONS_MENU:
case DATA_MENU:
case COURSE_DATA_MENU:
case HARBOUR_MASTERS_MENU:
case LOGO_INTRO_MENU:
case CONTROLLER_PAK_MENU:
case MAIN_MENU:
@@ -2372,6 +2374,9 @@ void setup_menus(void) {
add_menu_item(MENU_ITEM_TYPE_0E9, 0, 0, MENU_ITEM_PRIORITY_8);
add_menu_item(MENU_ITEM_TYPE_0EA, 0, 0, MENU_ITEM_PRIORITY_8);
break;
case HARBOUR_MASTERS_MENU:
add_menu_item(MENU_ITEM_UI_HARBOUR_MASTERS, 0, 0, MENU_ITEM_PRIORITY_0);
break;
case LOGO_INTRO_MENU:
add_menu_item(MENU_ITEM_UI_LOGO_INTRO, 0, 0, MENU_ITEM_PRIORITY_0);
break;
@@ -4746,7 +4751,7 @@ void func_8009CE64(s32 arg0) {
gCreditsCourseId = COURSE_LUIGI_RACEWAY;
} else {
gGotoMenu = 1;
gMenuSelection = 0x0000000B;
gMenuSelection = MAIN_MENU;
}
} else if (gGamestate == 4) {
if (D_8018E7AC[arg0] == 2) {
@@ -4864,8 +4869,11 @@ void func_8009CE64(s32 arg0) {
if (gDebugMenuSelection != 0x40) {
switch (gMenuFadeType) {
case 0:
if (gMenuSelection == 8) {
gMenuSelection = 0x0000000A;
if (gMenuSelection == HARBOUR_MASTERS_MENU) {
gMenuSelection = LOGO_INTRO_MENU;
gFadeModeSelection = 0;
} else if (gMenuSelection == LOGO_INTRO_MENU) {
gMenuSelection = START_MENU;
gFadeModeSelection = 2;
} else {
gMenuSelection++;
@@ -5530,6 +5538,11 @@ void add_menu_item(s32 type, s32 column, s32 row, s8 priority) {
var_ra->param1 = 0;
var_ra->param2 = 0;
switch (type) {
case MENU_ITEM_UI_HARBOUR_MASTERS:
HM_InitIntro();
var_ra->param1 = -1;
var_ra->param2 = one;
break;
case MENU_ITEM_UI_LOGO_INTRO:
sIntroLogoTimer = 0;
sIntroModelMotionSpeed = 0.0f;
@@ -5965,6 +5978,9 @@ void render_menus(MenuItem* arg0) {
if ((s8) arg0->visible) {
gDPPipeSync(gDisplayListHead++);
switch (arg0->type) {
case MENU_ITEM_UI_HARBOUR_MASTERS:
HM_DrawIntro();
break;
case MENU_ITEM_UI_LOGO_INTRO:
func_80094660(gGfxPool, arg0->param1);
break;
@@ -8698,6 +8714,10 @@ void handle_menus_with_pri_arg(s32 priSpecial) {
}
switch (type) {
case MENU_ITEM_UI_HARBOUR_MASTERS:
HM_TickIntro();
menuItem->param1++;
break;
case MENU_ITEM_UI_LOGO_INTRO:
if (sIntroLogoTimer < 80) {
sIntroModelSpeed = 3.0f;
+2 -1
View File
@@ -317,7 +317,8 @@ enum MENU_ITEM_TYPE {
MENU_ITEM_TYPE_1CB,
MENU_ITEM_TYPE_1CC,
MENU_ITEM_TYPE_1CD,
MENU_ITEM_TYPE_1CE
MENU_ITEM_TYPE_1CE,
MENU_ITEM_UI_HARBOUR_MASTERS
};
enum LoadImgCompType {
+7 -1
View File
@@ -59,7 +59,7 @@ s8 gCourseIndexInCup;
s8 unref_D_8018EE0C; // Set to 0 but never referenced
/** Data **/
s32 gMenuSelection = LOGO_INTRO_MENU;
s32 gMenuSelection = HARBOUR_MASTERS_MENU;
s32 gFadeModeSelection = FADE_MODE_NONE;
s8 gCharacterSelections[4] = { MARIO, LUIGI, YOSHI, TOAD };
@@ -196,6 +196,9 @@ void update_menus(void) {
case COURSE_DATA_MENU:
course_data_menu_act(&gControllers[controllerIdx], controllerIdx);
break;
case HARBOUR_MASTERS_MENU:
logo_intro_menu_act(&gControllers[controllerIdx], controllerIdx);
break;
case LOGO_INTRO_MENU:
logo_intro_menu_act(&gControllers[controllerIdx], controllerIdx);
break;
@@ -1873,6 +1876,9 @@ void load_menu_states(s32 menuSelection) {
case COURSE_DATA_MENU:
gSubMenuSelection = SUB_MENU_DATA_OPTIONS;
break;
case HARBOUR_MASTERS_MENU:
func_800CA008(0, 0);
break;
case LOGO_INTRO_MENU:
func_800CA008(0, 0);
break;
+30
View File
@@ -43,6 +43,8 @@
#include "Smoke.h"
#include "engine/HM_Intro.h"
extern "C" {
#include "main.h"
#include "audio/load.h"
@@ -95,6 +97,8 @@ Cup* gBattleCup;
ModelLoader gModelLoader;
HarbourMastersIntro gMenuIntro;
s32 gTrophyIndex = NULL;
void CustomEngineInit() {
@@ -190,6 +194,19 @@ void CustomEngineInit() {
extern "C" {
void HM_InitIntro() {
gMenuIntro.HM_InitIntro();
}
void HM_TickIntro() {
gMenuIntro.HM_TickIntro();
}
void HM_DrawIntro() {
gMenuIntro.HM_DrawIntro();
}
World* GetWorld(void) {
return &gWorldInstance;
}
@@ -625,6 +642,19 @@ void CM_DeleteActor(size_t index) {
* Clean up actors and other game objects.
*/
void CM_CleanWorld(void) {
World* world = &gWorldInstance;
for (auto& actor : world->Actors) {
delete actor;
}
for (auto& object : world->Objects) {
delete object;
}
for (auto& emitter : world->Emitters) {
delete emitter;
}
gWorldInstance.Actors.clear();
gWorldInstance.Objects.clear();
gWorldInstance.Emitters.clear();
+5
View File
@@ -3,6 +3,7 @@
#include <libultraship.h>
#include "engine/courses/Course.h"
#include "engine/HM_Intro.h"
#ifdef __cplusplus
class Course;
@@ -16,6 +17,10 @@ extern s32 gTrophyIndex;
Properties* CM_GetProps();
Properties* CM_GetPropsCourseId(s32 courseId);
void HM_InitIntro(void);
void HM_TickIntro(void);
void HM_DrawIntro(void);
void CM_DisplayBattleBombKart(s32 playerId, s32 primAlpha);
void CM_DrawBattleBombKarts(s32 cameraId);
+1 -1
View File
@@ -65,7 +65,7 @@ void RegisterFreecamWidgets() {
mPortMenu->AddWidget(path, "Keyboard: Move: W,A,S,D, Up: Space, Down: Shift\n Faster: Ctrl, Look: Right-mouse button\n Target Player Mode: F, Next: M, Previous: N", WIDGET_TEXT);
mPortMenu->AddWidget(path, "Controller: Up: A, Down: B, Faster: Z\n Target Player Mode: R, Next: Right DPad, Previous: Left DPad\n Driving Mode: L and R Buttons", WIDGET_TEXT);
mPortMenu->AddWidget(path, "Enable Flycam", WIDGET_CVAR_CHECKBOX)
mPortMenu->AddWidget(path, "Enable Freecam", WIDGET_CVAR_CHECKBOX)
.CVar("gFreecam")
.Options(UIWidgets::CheckboxOptions({{ .tooltip = "Allows you to fly around the course"}}));