diff --git a/models/README.MD b/models/README.MD index 6e36b1312..48550acbb 100644 --- a/models/README.MD +++ b/models/README.MD @@ -9,4 +9,4 @@ run `make model_extract -j` to extract assets in multithreaded. And waits (for m you can run `make fast64_blender` to run blender with fast64 enable without downloading it. ## Organisation -In Tracks there is all track json and folder (once extracted). In each track folder you can find three folder objects, sections, preview, collision_sections. Objects are all assets who are use for object/actor. Sections are all sections reference in a Gfx list who are use with render_course_segments. And preview are the version of the track who are use in func_8029569C who the complete track or a big part (some are broken). Collision sections are just collision who are use in mk64. \ No newline at end of file +In Tracks there is all track json and folder (once extracted). In each track folder you can find three folder objects, sections, preview, collision_sections. Objects are all assets who are use for object/actor. Sections are all sections reference in a Gfx list who are use with render_course_segments. And preview are the version of the track who are use in render_credits who the complete track or a big part (some are broken). Collision sections are just collision who are use in mk64. \ No newline at end of file diff --git a/src/engine/AllActors.h b/src/engine/AllActors.h new file mode 100644 index 000000000..e9b74cad5 --- /dev/null +++ b/src/engine/AllActors.h @@ -0,0 +1,37 @@ +#pragma once + +#include "actors/MarioSign.h" +#include "actors/WarioSign.h" +#include "actors/Cloud.h" +#include "actors/Finishline.h" +#include "actors/SpaghettiShip.h" +#include "actors/Starship.h" +#include "actors/Ship.h" +#include "actors/Tree.h" +#include "vehicles/Train.h" +#include "vehicles/Boat.h" +#include "vehicles/Bus.h" +#include "vehicles/Truck.h" +#include "vehicles/Car.h" +#include "vehicles/Truck.h" +#include "vehicles/TankerTruck.h" + +#include "objects/Bat.h" +#include "objects/BombKart.h" +#include "objects/Boos.h" +#include "objects/CheepCheep.h" +#include "objects/Crab.h" +#include "objects/ChainChomp.h" +#include "objects/Flagpole.h" +#include "objects/Hedgehog.h" +#include "objects/HotAirBalloon.h" +#include "objects/Lakitu.h" +#include "objects/Mole.h" +#include "objects/Penguin.h" +#include "objects/Seagull.h" +#include "objects/Thwomp.h" +#include "objects/Seagull.h" +#include "objects/Trashbin.h" +#include "objects/Trophy.h" +#include "objects/Snowman.h" +#include "objects/Podium.h" diff --git a/src/engine/actors/ABanana.cpp b/src/engine/actors/Banana.cpp similarity index 98% rename from src/engine/actors/ABanana.cpp rename to src/engine/actors/Banana.cpp index 6ff7b0dcf..6c7f837d1 100644 --- a/src/engine/actors/ABanana.cpp +++ b/src/engine/actors/Banana.cpp @@ -1,6 +1,6 @@ #include -#include "ABanana.h" +#include "Banana.h" #include "engine/Actor.h" extern "C" { diff --git a/src/engine/actors/ABanana.h b/src/engine/actors/Banana.h similarity index 100% rename from src/engine/actors/ABanana.h rename to src/engine/actors/Banana.h diff --git a/src/engine/actors/ACloud.cpp b/src/engine/actors/Cloud.cpp similarity index 97% rename from src/engine/actors/ACloud.cpp rename to src/engine/actors/Cloud.cpp index 040b45f5e..cae55e342 100644 --- a/src/engine/actors/ACloud.cpp +++ b/src/engine/actors/Cloud.cpp @@ -1,6 +1,6 @@ #include -#include "ACloud.h" +#include "Cloud.h" #include "engine/Actor.h" #include "World.h" @@ -14,11 +14,11 @@ extern f32 gKartHopInitialVelocityTable[]; extern f32 gKartGravityTable[]; } -ACloud::ACloud(Vec3f pos) { +ACloud::ACloud(FVector pos) { Name = "Cloud"; - Pos[0] = pos[0]; - Pos[1] = pos[1]; - Pos[2] = pos[2]; + Pos[0] = pos.x; + Pos[1] = pos.y; + Pos[2] = pos.z; Rot[0] = 0; Rot[1] = 0; Rot[2] = 0; diff --git a/src/engine/actors/ACloud.h b/src/engine/actors/Cloud.h similarity index 93% rename from src/engine/actors/ACloud.h rename to src/engine/actors/Cloud.h index 3d266243c..4805c08b9 100644 --- a/src/engine/actors/ACloud.h +++ b/src/engine/actors/Cloud.h @@ -2,6 +2,7 @@ #include #include "engine/Actor.h" +#include "CoreMath.h" extern "C" { #include "macros.h" @@ -15,7 +16,7 @@ public: // Constructor - ACloud(Vec3f pos); + ACloud(FVector pos); virtual ~ACloud() override = default; diff --git a/src/engine/actors/AFinishline.cpp b/src/engine/actors/Finishline.cpp similarity index 98% rename from src/engine/actors/AFinishline.cpp rename to src/engine/actors/Finishline.cpp index dfa89ef73..0680e60bd 100644 --- a/src/engine/actors/AFinishline.cpp +++ b/src/engine/actors/Finishline.cpp @@ -2,7 +2,7 @@ #include #include "CoreMath.h" -#include "AFinishline.h" +#include "Finishline.h" #include "engine/Actor.h" #include "World.h" #include "assets/common_data.h" diff --git a/src/engine/actors/AFinishline.h b/src/engine/actors/Finishline.h similarity index 100% rename from src/engine/actors/AFinishline.h rename to src/engine/actors/Finishline.h diff --git a/src/engine/actors/MarioSign.cpp b/src/engine/actors/MarioSign.cpp new file mode 100644 index 000000000..f39e4f69b --- /dev/null +++ b/src/engine/actors/MarioSign.cpp @@ -0,0 +1,56 @@ +#include "MarioSign.h" + +#include +#include + +extern "C" { +#include "common_structs.h" +#include "math_util.h" +#include "main.h" +#include "actor_types.h" +} + +AMarioSign::AMarioSign(FVector pos) { + Type = ACTOR_MARIO_SIGN; + Name = "Mario Sign"; + Pos[0] = pos.x; + Pos[1] = pos.y; + Pos[2] = pos.z; + Flags |= 0x4000; +} + +void AMarioSign::Tick() { + if ((Flags & 0x800) == 0) { + if ((Flags & 0x400) != 0) { + Pos[1] += 4.0f; + if (Pos[1] > 800.0f) { + Flags |= 0x800; + Rot[1] += 1820; + } + } else { + Rot[1] += 182; + } + } +} + +void AMarioSign::Draw(Camera *camera) { + Mat4 sp40; + f32 unk; + + if (Flags & 0x800) { + return; + } + + unk = is_within_render_distance(camera->pos, Pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 16000000.0f); + if (CVarGetInteger("gNoCulling", 0) == 1) { + unk = MAX(unk, 0.0f); + } + if (!(unk < 0.0f)) { + gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); + gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); + mtxf_pos_rotation_xyz(sp40, Pos, Rot); + if (render_set_position(sp40, 0) != 0) { + gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_mario_raceway_dl_sign); + } + } +} diff --git a/src/engine/actors/MarioSign.h b/src/engine/actors/MarioSign.h new file mode 100644 index 000000000..099894dc1 --- /dev/null +++ b/src/engine/actors/MarioSign.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include "engine/Actor.h" +#include "CoreMath.h" + +extern "C" { +#include "common_structs.h" +} + +class AMarioSign : public AActor { +public: + + virtual ~AMarioSign() = default; + explicit AMarioSign(FVector pos); + + virtual void Tick() override; + virtual void Draw(Camera*) override; +}; diff --git a/src/engine/actors/Ship.cpp b/src/engine/actors/Ship.cpp index 3948edecd..3670a122d 100644 --- a/src/engine/actors/Ship.cpp +++ b/src/engine/actors/Ship.cpp @@ -13,18 +13,20 @@ extern "C" { } AShip::AShip(FVector pos, AShip::Skin skin) { - Name = "Ship"; Spawn = pos; Spawn.y += 10; - + switch(skin) { case GHOSTSHIP: + Name = "Ghostship"; _skin = ghostship_Plane_mesh; break; case SHIP2: + Name = "Ship_1"; _skin = ship2_SoH_mesh; break; case SHIP3: + Name = "Ship_2"; _skin = ship3_2Ship_mesh; break; } diff --git a/src/engine/actors/ATree.cpp b/src/engine/actors/Tree.cpp similarity index 98% rename from src/engine/actors/ATree.cpp rename to src/engine/actors/Tree.cpp index 85a1d70f4..faffd0798 100644 --- a/src/engine/actors/ATree.cpp +++ b/src/engine/actors/Tree.cpp @@ -1,4 +1,4 @@ -#include "ATree.h" +#include "Tree.h" #include diff --git a/src/engine/actors/ATree.h b/src/engine/actors/Tree.h similarity index 100% rename from src/engine/actors/ATree.h rename to src/engine/actors/Tree.h diff --git a/src/engine/actors/AWarioSign.cpp b/src/engine/actors/WarioSign.cpp similarity index 82% rename from src/engine/actors/AWarioSign.cpp rename to src/engine/actors/WarioSign.cpp index 7e59e431b..0e83e114f 100644 --- a/src/engine/actors/AWarioSign.cpp +++ b/src/engine/actors/WarioSign.cpp @@ -1,4 +1,4 @@ -#include "AWarioSign.h" +#include "WarioSign.h" #include #include @@ -7,13 +7,15 @@ extern "C" { #include "common_structs.h" #include "math_util.h" #include "main.h" +#include "actor_types.h" } -AWarioSign::AWarioSign(Vec3f pos) { +AWarioSign::AWarioSign(FVector pos) { + Type = ACTOR_WARIO_SIGN; Name = "Wario Sign"; - Pos[0] = pos[0]; - Pos[1] = pos[1]; - Pos[2] = pos[2]; + Pos[0] = pos.x; + Pos[1] = pos.y; + Pos[2] = pos.z; } void AWarioSign::Tick() { @@ -28,7 +30,6 @@ void AWarioSign::Draw(Camera *camera) { if (CVarGetInteger("gNoCulling", 0) == 1) { unk = MAX(unk, 0.0f); } - if (!(unk < 0.0f)) { gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); diff --git a/src/engine/actors/AWarioSign.h b/src/engine/actors/WarioSign.h similarity index 81% rename from src/engine/actors/AWarioSign.h rename to src/engine/actors/WarioSign.h index 31d9b9434..634b2132e 100644 --- a/src/engine/actors/AWarioSign.h +++ b/src/engine/actors/WarioSign.h @@ -2,6 +2,7 @@ #include #include "engine/Actor.h" +#include "CoreMath.h" extern "C" { #include "common_structs.h" @@ -10,9 +11,8 @@ extern "C" { class AWarioSign : public AActor { public: - virtual ~AWarioSign() = default; - explicit AWarioSign(Vec3f pos); + explicit AWarioSign(FVector pos); virtual void Tick() override; virtual void Draw(Camera*) override; diff --git a/src/engine/courses/BansheeBoardwalk.cpp b/src/engine/courses/BansheeBoardwalk.cpp index a2f9b22d9..1ad03c41a 100644 --- a/src/engine/courses/BansheeBoardwalk.cpp +++ b/src/engine/courses/BansheeBoardwalk.cpp @@ -5,7 +5,7 @@ #include "BansheeBoardwalk.h" #include "World.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/objects/BombKart.h" #include "engine/objects/CheepCheep.h" #include "engine/objects/TrashBin.h" @@ -176,7 +176,7 @@ void BansheeBoardwalk::BeginPlay() { } if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][110], 110, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][190], 190, 1, 0.8333333f)); diff --git a/src/engine/courses/BigDonut.cpp b/src/engine/courses/BigDonut.cpp index e95a0f222..530cbdf74 100644 --- a/src/engine/courses/BigDonut.cpp +++ b/src/engine/courses/BigDonut.cpp @@ -127,7 +127,7 @@ void BigDonut::BeginPlay() { spawn_all_item_boxes((ActorSpawnData*)LOAD_ASSET_RAW(d_course_big_donut_item_box_spawns)); if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = {0, 0, 0}; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][20], 20, 0, 1.0f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][40], 40, 0, 1.0f)); diff --git a/src/engine/courses/BlockFort.cpp b/src/engine/courses/BlockFort.cpp index d10a0a1e6..a7efc2ddc 100644 --- a/src/engine/courses/BlockFort.cpp +++ b/src/engine/courses/BlockFort.cpp @@ -123,7 +123,7 @@ void BlockFort::BeginPlay() { spawn_all_item_boxes((ActorSpawnData*)LOAD_ASSET_RAW(d_course_block_fort_item_box_spawns)); if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][20], 20, 0, 1.0f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][40], 40, 0, 1.0f)); diff --git a/src/engine/courses/BowsersCastle.cpp b/src/engine/courses/BowsersCastle.cpp index e12cee10b..0042ec7be 100644 --- a/src/engine/courses/BowsersCastle.cpp +++ b/src/engine/courses/BowsersCastle.cpp @@ -5,7 +5,7 @@ #include "BowsersCastle.h" #include "World.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/objects/BombKart.h" #include "engine/objects/Thwomp.h" #include "bowsers_castle_data.h" @@ -195,7 +195,7 @@ void BowsersCastle::BeginPlay() { } if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][50], 50, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][150], 150, 1, 0.8333333f)); diff --git a/src/engine/courses/ChocoMountain.cpp b/src/engine/courses/ChocoMountain.cpp index d5b38e24c..046f8778d 100644 --- a/src/engine/courses/ChocoMountain.cpp +++ b/src/engine/courses/ChocoMountain.cpp @@ -7,7 +7,7 @@ #include "World.h" #include "engine/objects/BombKart.h" #include "choco_mountain_data.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" extern "C" { #include "main.h" @@ -168,7 +168,7 @@ void ChocoMountain::BeginPlay() { spawn_falling_rocks((struct ActorSpawnData*)LOAD_ASSET_RAW((const char*)d_course_choco_mountain_falling_rock_spawns)); if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][140], 140, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][165], 165, 1, 0.8333333f)); diff --git a/src/engine/courses/DKJungle.cpp b/src/engine/courses/DKJungle.cpp index 8a901c07c..9d4d0674a 100644 --- a/src/engine/courses/DKJungle.cpp +++ b/src/engine/courses/DKJungle.cpp @@ -5,7 +5,7 @@ #include "DKJungle.h" #include "World.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/objects/BombKart.h" #include "assets/dks_jungle_parkway_data.h" @@ -164,7 +164,7 @@ void DKJungle::BeginPlay() { gWorldInstance.AddActor(new ABoat((0.6666666f)/4, 0)); if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][50], 50, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][100], 100, 1, 0.8333333f)); diff --git a/src/engine/courses/DoubleDeck.cpp b/src/engine/courses/DoubleDeck.cpp index 852f88aa9..236f9b4d5 100644 --- a/src/engine/courses/DoubleDeck.cpp +++ b/src/engine/courses/DoubleDeck.cpp @@ -122,7 +122,7 @@ void DoubleDeck::BeginPlay() { spawn_all_item_boxes((ActorSpawnData*)LOAD_ASSET_RAW(d_course_double_deck_item_box_spawns)); if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][20], 20, 0, 1.0f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][40], 40, 0, 1.0f)); diff --git a/src/engine/courses/FrappeSnowland.cpp b/src/engine/courses/FrappeSnowland.cpp index b8dda2319..4885d1f53 100644 --- a/src/engine/courses/FrappeSnowland.cpp +++ b/src/engine/courses/FrappeSnowland.cpp @@ -6,7 +6,7 @@ #include "FrappeSnowland.h" #include "World.h" #include "CoreMath.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/objects/BombKart.h" #include "engine/objects/Snowman.h" #include "assets/frappe_snowland_data.h" @@ -154,7 +154,7 @@ void FrappeSnowland::BeginPlay() { } if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][50], 50, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][100], 100, 1, 0.8333333f)); diff --git a/src/engine/courses/Harbour.cpp b/src/engine/courses/Harbour.cpp index 5f4b8a170..6653f6f0a 100644 --- a/src/engine/courses/Harbour.cpp +++ b/src/engine/courses/Harbour.cpp @@ -6,7 +6,7 @@ #include "Harbour.h" #include "World.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/actors/BowserStatue.h" #include "engine/actors/Ship.h" #include "engine/actors/SpaghettiShip.h" @@ -16,8 +16,8 @@ #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/actors/Tree.h" +#include "engine/actors/Cloud.h" #include "engine/vehicles/Train.h" #include "engine/objects/Trophy.h" #include "engine/objects/CheepCheep.h" diff --git a/src/engine/courses/KalimariDesert.cpp b/src/engine/courses/KalimariDesert.cpp index ec86ca419..20f06df71 100644 --- a/src/engine/courses/KalimariDesert.cpp +++ b/src/engine/courses/KalimariDesert.cpp @@ -5,7 +5,7 @@ #include "KalimariDesert.h" #include "World.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/objects/BombKart.h" #include "kalimari_desert_data.h" #include "engine/vehicles/Utils.h" @@ -202,7 +202,7 @@ void KalimariDesert::BeginPlay() { } if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][50], 50, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][138], 138, 1, 0.8333333f)); diff --git a/src/engine/courses/KoopaTroopaBeach.cpp b/src/engine/courses/KoopaTroopaBeach.cpp index ec2891748..f9a081097 100644 --- a/src/engine/courses/KoopaTroopaBeach.cpp +++ b/src/engine/courses/KoopaTroopaBeach.cpp @@ -6,7 +6,7 @@ #include "KoopaTroopaBeach.h" #include "World.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/objects/BombKart.h" #include "engine/objects/Crab.h" #include "assets/koopa_troopa_beach_data.h" @@ -172,7 +172,7 @@ void KoopaTroopaBeach::BeginPlay() { } if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][60], 60, 1, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][120], 120, 1, 0.8333333f)); diff --git a/src/engine/courses/LuigiRaceway.cpp b/src/engine/courses/LuigiRaceway.cpp index 7149e37ea..07ea87dff 100644 --- a/src/engine/courses/LuigiRaceway.cpp +++ b/src/engine/courses/LuigiRaceway.cpp @@ -8,7 +8,7 @@ #include "engine/objects/BombKart.h" #include "assets/luigi_raceway_data.h" #include "engine/objects/HotAirBalloon.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" extern "C" { #include "main.h" @@ -175,7 +175,7 @@ void LuigiRaceway::BeginPlay() { } if (gModeSelection == VERSUS) { - Vec3f pos = { 0, 0, 0 }; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][50], 50, 1, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][200], 200, 3, 0.8333333f)); diff --git a/src/engine/courses/MarioRaceway.cpp b/src/engine/courses/MarioRaceway.cpp index 7c83a6d41..e54714d77 100644 --- a/src/engine/courses/MarioRaceway.cpp +++ b/src/engine/courses/MarioRaceway.cpp @@ -5,7 +5,7 @@ #include "MarioRaceway.h" #include "World.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/objects/Object.h" #include "engine/objects/BombKart.h" @@ -191,7 +191,7 @@ void MarioRaceway::BeginPlay() { add_actor_to_empty_slot(position, rotation, velocity, ACTOR_MARIO_SIGN); if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][40], 40, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][100], 100, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][265], 265, 3, 0.8333333f)); diff --git a/src/engine/courses/MooMooFarm.cpp b/src/engine/courses/MooMooFarm.cpp index 577c5bb45..4b5fdea67 100644 --- a/src/engine/courses/MooMooFarm.cpp +++ b/src/engine/courses/MooMooFarm.cpp @@ -5,7 +5,7 @@ #include "MooMooFarm.h" #include "World.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/objects/BombKart.h" #include "assets/moo_moo_farm_data.h" #include "engine/objects/MoleGroup.h" @@ -311,7 +311,7 @@ void MooMooFarm::BeginPlay() { } if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][50], 50, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][140], 140, 3, 0.8333333f)); diff --git a/src/engine/courses/PodiumCeremony.cpp b/src/engine/courses/PodiumCeremony.cpp index 6d352546d..e461a2636 100644 --- a/src/engine/courses/PodiumCeremony.cpp +++ b/src/engine/courses/PodiumCeremony.cpp @@ -189,7 +189,7 @@ void PodiumCeremony::BeginPlay() { OTrophy* trophy = reinterpret_cast(gWorldInstance.AddObject(new OTrophy(pos, type, OTrophy::Behaviour::PODIUM_CEREMONY))); - Vec3f kart = {0, 0, 0}; + FVector kart = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[3][3], 3, 5, 1.25f)); gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[3][40], 40, 0, 1.0f)); gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[3][60], 60, 0, 1.0f)); diff --git a/src/engine/courses/RainbowRoad.cpp b/src/engine/courses/RainbowRoad.cpp index e73a8f53c..2f6e2e070 100644 --- a/src/engine/courses/RainbowRoad.cpp +++ b/src/engine/courses/RainbowRoad.cpp @@ -5,7 +5,7 @@ #include "RainbowRoad.h" #include "World.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/objects/ChainChomp.h" #include "engine/objects/BombKart.h" #include "assets/rainbow_road_data.h" @@ -147,7 +147,7 @@ void RainbowRoad::BeginPlay() { } if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][50], 50, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][100], 100, 1, 0.8333333f)); diff --git a/src/engine/courses/RoyalRaceway.cpp b/src/engine/courses/RoyalRaceway.cpp index 2bbabb85d..1394cc981 100644 --- a/src/engine/courses/RoyalRaceway.cpp +++ b/src/engine/courses/RoyalRaceway.cpp @@ -5,7 +5,7 @@ #include "RoyalRaceway.h" #include "World.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/objects/BombKart.h" #include "assets/royal_raceway_data.h" @@ -176,7 +176,7 @@ void RoyalRaceway::BeginPlay() { spawn_piranha_plants((struct ActorSpawnData*)LOAD_ASSET_RAW(d_course_royal_raceway_piranha_plant_spawn)); if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][50], 50, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][100], 100, 3, 0.8333333f)); diff --git a/src/engine/courses/SherbetLand.cpp b/src/engine/courses/SherbetLand.cpp index 818e3dabd..5c0fa7f8c 100644 --- a/src/engine/courses/SherbetLand.cpp +++ b/src/engine/courses/SherbetLand.cpp @@ -5,7 +5,7 @@ #include "SherbetLand.h" #include "World.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/objects/BombKart.h" #include "assets/sherbet_land_data.h" #include "engine/objects/Penguin.h" @@ -133,65 +133,65 @@ void SherbetLand::BeginPlay() { // Multiplayer does not spawn the big penguin // if (gPlayerCountSelection1 == 1) { - Vec3f pos = {-383.0f, 2.0f, -690.0f}; + FVector pos = {-383.0f, 2.0f, -690.0f}; gWorldInstance.AddObject(new OPenguin(pos, 0, OPenguin::PenguinType::EMPEROR, OPenguin::Behaviour::STRUT)); // } - Vec3f pos2 = {-2960.0f, -80.0f, 1521.0f}; + FVector pos2 = { -2960.0f, -80.0f, 1521.0f }; auto penguin = reinterpret_cast(gWorldInstance.AddObject(new OPenguin(pos2, 0x150, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE))); auto penguin2 = reinterpret_cast(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}; + FVector pos3 = { -2490.0f, -80.0f, 1612.0f }; auto penguin3 = reinterpret_cast(gWorldInstance.AddObject(new OPenguin(pos3, 0x100, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE))); auto penguin4 = reinterpret_cast(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}; + FVector pos4 = { -2098.0f, -80.0f, 1624.0f }; auto penguin5 = reinterpret_cast(gWorldInstance.AddObject(new OPenguin(pos4, 0xFF00, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE))); auto penguin6 = reinterpret_cast(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}; + FVector pos5 = { -2080.0f, -80.0f, 1171.0f }; auto penguin7 = reinterpret_cast(gWorldInstance.AddObject(new OPenguin(pos5, 0x150, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE))); auto penguin8 = reinterpret_cast(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}; + FVector pos6 = { 380.0, 0.0f, -535.0f }; auto penguin9 = reinterpret_cast(gWorldInstance.AddObject(new OPenguin(pos6, 0x9000, OPenguin::PenguinType::CREDITS, OPenguin::Behaviour::SLIDE3))); penguin9->MirrorModeAngleOffset = -0x4000; } else { - Vec3f pos6 = {146.0f, 0.0f, -380.0f}; + FVector pos6 = { 146.0f, 0.0f, -380.0f }; auto penguin9 = reinterpret_cast(gWorldInstance.AddObject(new OPenguin(pos6, 0x9000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE3))); penguin9->MirrorModeAngleOffset = -0x4000; } - Vec3f pos7 = {380.0f, 0.0f, -766.0f}; + FVector pos7 = { 380.0f, 0.0f, -766.0f }; auto penguin10 = reinterpret_cast(gWorldInstance.AddObject(new OPenguin(pos7, 0x5000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE4))); penguin10->MirrorModeAngleOffset = 0x8000; - Vec3f pos8 = {-2300.0f, 0.0f, -210.0f}; + FVector pos8 = { -2300.0f, 0.0f, -210.0f }; auto penguin11 = reinterpret_cast(gWorldInstance.AddObject(new OPenguin(pos8, 0xC000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE6))); penguin11->MirrorModeAngleOffset = 0x8000; - Vec3f pos9 = {-2500.0f, 0.0f, -250.0f}; + FVector pos9 = { -2500.0f, 0.0f, -250.0f }; auto penguin12 = reinterpret_cast(gWorldInstance.AddObject(new OPenguin(pos9, 0x4000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE6))); penguin12->MirrorModeAngleOffset = 0x8000; - Vec3f pos10 = {-535.0f, 0.0f, 875.0f}; + FVector pos10 = { -535.0f, 0.0f, 875.0f }; auto penguin13 = reinterpret_cast(gWorldInstance.AddObject(new OPenguin(pos10, 0x8000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE6))); penguin13->MirrorModeAngleOffset = -0x4000; - Vec3f pos11 = {-250.0f, 0.0f, 953.0f}; + FVector pos11 = { -250.0f, 0.0f, 953.0f }; auto penguin14 = reinterpret_cast(gWorldInstance.AddObject(new OPenguin(pos11, 0x9000, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE6))); penguin14->MirrorModeAngleOffset = -0x4000; if (gGamestate != CREDITS_SEQUENCE) { if (gModeSelection == VERSUS) { - Vec3f kart = {0, 0, 0}; + FVector kart = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[0][50], 50, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[0][100], 100, 1, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(kart, &D_80164550[0][150], 150, 3, 0.8333333f)); diff --git a/src/engine/courses/Skyscraper.cpp b/src/engine/courses/Skyscraper.cpp index ca1c02cef..e87dfa280 100644 --- a/src/engine/courses/Skyscraper.cpp +++ b/src/engine/courses/Skyscraper.cpp @@ -146,7 +146,7 @@ void Skyscraper::BeginPlay() { spawn_all_item_boxes((ActorSpawnData*)LOAD_ASSET_RAW(d_course_skyscraper_item_box_spawns)); if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][20], 20, 0, 1.0f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][40], 40, 0, 1.0f)); diff --git a/src/engine/courses/TestCourse.cpp b/src/engine/courses/TestCourse.cpp index 7bbb3c1a5..1d35cfcc4 100644 --- a/src/engine/courses/TestCourse.cpp +++ b/src/engine/courses/TestCourse.cpp @@ -6,7 +6,7 @@ #include "TestCourse.h" #include "World.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/actors/BowserStatue.h" #include "engine/actors/Ship.h" #include "engine/actors/SpaghettiShip.h" @@ -16,8 +16,8 @@ #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/actors/Tree.h" +#include "engine/actors/Cloud.h" #include "engine/vehicles/Train.h" #include "engine/objects/Trophy.h" #include "engine/objects/CheepCheep.h" @@ -285,7 +285,7 @@ void TestCourse::BeginPlay() { //gWorldInstance.AddTrain(ATrain::TenderStatus::HAS_TENDER, 5, 2.5f, 0); //gWorldInstance.AddTrain(ATrain::TenderStatus::HAS_TENDER, 5, 2.5f, 8); - Vec3f pos2 = {0, 0, 0}; + FVector pos2 = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos2, &D_80164550[0][25], 25, 4, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos2, &D_80164550[0][45], 45, 4, 0.8333333f)); diff --git a/src/engine/courses/ToadsTurnpike.cpp b/src/engine/courses/ToadsTurnpike.cpp index 752e7c919..38e659a26 100644 --- a/src/engine/courses/ToadsTurnpike.cpp +++ b/src/engine/courses/ToadsTurnpike.cpp @@ -7,7 +7,7 @@ #include "World.h" #include "engine/objects/BombKart.h" #include "assets/toads_turnpike_data.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/vehicles/Bus.h" #include "engine/vehicles/Car.h" #include "engine/vehicles/Truck.h" @@ -195,7 +195,7 @@ void ToadsTurnpike::BeginPlay() { } if (gModeSelection == VERSUS) { - Vec3f pos = {0, 0, 0}; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][50], 50, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][100], 100, 1, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][150], 150, 3, 0.8333333f)); diff --git a/src/engine/courses/WarioStadium.cpp b/src/engine/courses/WarioStadium.cpp index c07eef1e7..71c1b1e28 100644 --- a/src/engine/courses/WarioStadium.cpp +++ b/src/engine/courses/WarioStadium.cpp @@ -7,8 +7,8 @@ #include "World.h" #include "engine/objects/BombKart.h" #include "assets/wario_stadium_data.h" -#include "engine/actors/AWarioSign.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/WarioSign.h" +#include "engine/actors/Finishline.h" extern "C" { #include "main.h" @@ -166,20 +166,20 @@ void WarioStadium::LoadTextures() { void WarioStadium::BeginPlay() { spawn_all_item_boxes((struct ActorSpawnData*) LOAD_ASSET_RAW(d_course_wario_stadium_item_box_spawns)); - Vec3f pos = { -131.0f, 83.0f, 286.0f }; - pos[0] *= gCourseDirection; + FVector pos = { -131.0f, 83.0f, 286.0f }; + pos.x *= gCourseDirection; gWorldInstance.AddActor(new AWarioSign(pos)); - Vec3f pos2 = { -2353.0f, 72.0f, -1608.0f }; - pos2[0] *= gCourseDirection; + FVector pos2 = { -2353.0f, 72.0f, -1608.0f }; + pos2.x *= gCourseDirection; gWorldInstance.AddActor(new AWarioSign(pos2)); - Vec3f pos3 = { -2622.0f, 79.0f, 739.0f }; - pos3[0] *= gCourseDirection; + FVector pos3 = { -2622.0f, 79.0f, 739.0f }; + pos3.x *= gCourseDirection; gWorldInstance.AddActor(new AWarioSign(pos3)); if (gModeSelection == VERSUS) { - Vec3f pos = { 0, 0, 0 }; + FVector pos = { 0, 0, 0 }; gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][50], 50, 3, 0.8333333f)); gWorldInstance.AddObject(new OBombKart(pos, &D_80164550[0][100], 100, 1, 0.8333333f)); diff --git a/src/engine/courses/YoshiValley.cpp b/src/engine/courses/YoshiValley.cpp index 889e6a4f7..a328678bd 100644 --- a/src/engine/courses/YoshiValley.cpp +++ b/src/engine/courses/YoshiValley.cpp @@ -6,7 +6,7 @@ #include "YoshiValley.h" #include "World.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/objects/BombKart.h" #include "engine/objects/Hedgehog.h" #include "engine/objects/Flagpole.h" @@ -177,19 +177,19 @@ void YoshiValley::BeginPlay() { // the original data has values here. // Note that the Y height is calculated automatically to place the kart on the surface - Vec3f pos = {-1533, 0, -682}; + FVector pos = { -1533, 0, -682 }; gWorldInstance.AddObject(new OBombKart(pos, NULL, 0, 0, 0.8333333f)); - Vec3f pos2 = {-1565, 0, -619}; + FVector pos2 = { -1565, 0, -619 }; gWorldInstance.AddObject(new OBombKart(pos2, NULL, 10, 0, 0.8333333f)); - Vec3f pos3 = {-1529, 0, -579}; + FVector pos3 = { -1529, 0, -579 }; gWorldInstance.AddObject(new OBombKart(pos3, NULL, 20, 0, 0.8333333f)); - Vec3f pos4 = {-1588, 0, -534}; + FVector pos4 = { -1588, 0, -534 }; gWorldInstance.AddObject(new OBombKart(pos4, NULL, 30, 0, 0.8333333f)); - Vec3f pos5 = {-1598, 0, -207}; + FVector pos5 = { -1598, 0, -207 }; gWorldInstance.AddObject(new OBombKart(pos5, NULL, 40, 0, 0.8333333f)); - Vec3f pos6 = {-1646, 0, -147}; + FVector pos6 = { -1646, 0, -147 }; gWorldInstance.AddObject(new OBombKart(pos6, NULL, 50, 0, 0.8333333f)); - Vec3f pos7 = {-2532, 0, -445}; + FVector pos7 = { -2532, 0, -445 }; gWorldInstance.AddObject(new OBombKart(pos7, NULL, 60, 0, 0.8333333f)); } } diff --git a/src/engine/editor/Editor.h b/src/engine/editor/Editor.h index 9dd412279..0109b2e90 100644 --- a/src/engine/editor/Editor.h +++ b/src/engine/editor/Editor.h @@ -20,7 +20,6 @@ public: void Tick(); void Draw(); - void MouseClick(); void Load(); void AddObject(const char* name, FVector* pos, Vec3s* rot, FVector* scale, Gfx* model, float collScale, GameObject::CollisionType collision, float boundingBoxSize, int32_t* despawnFlag, int32_t despawnValue); void AddLight(const char* name, FVector* pos, s8* rot); diff --git a/src/engine/editor/EditorMath.cpp b/src/engine/editor/EditorMath.cpp index baeaa535c..69f92722e 100644 --- a/src/engine/editor/EditorMath.cpp +++ b/src/engine/editor/EditorMath.cpp @@ -339,3 +339,24 @@ void SetDirectionFromRotator(s16 rotator[3], s8 direction[3]) { //printf("Light dir %d %d %d (from rot 0x%X 0x%X 0x%X)\n", direction[0], direction[1], direction[2], rotator[0], rotator[1], rotator[2]); } + +FVector GetPositionAheadOfCamera(f32 dist) { + FVector pos = FVector(cameras[0].pos[0], cameras[0].pos[1], cameras[0].pos[2]); + + f32 pitch = (cameras[0].rot[2] / 65535.0f) * 360.0f; + f32 yaw = (cameras[0].rot[1] / 65535.0f) * 360.0f; + + // Convert degrees to radians + pitch = pitch * M_PI / 180.0f; + yaw = yaw * M_PI / 180.0f; + + // Compute forward vector + FVector forward( + -sinf(yaw), // X + -sinf(pitch), // Y + cosf(yaw) // Z (vertical component) + ); + + // Move 1000 units forward from the camera position + return pos + (forward * dist); +} diff --git a/src/engine/editor/EditorMath.h b/src/engine/editor/EditorMath.h index b377c38a4..8e607aa2c 100644 --- a/src/engine/editor/EditorMath.h +++ b/src/engine/editor/EditorMath.h @@ -45,3 +45,4 @@ bool IntersectRaySphere(const Ray& ray, const FVector& sphereCenter, float radiu void Editor_AddMatrix(Mat4 mtx, int32_t flags); float CalculateAngle(const FVector& start, const FVector& end); void SetDirectionFromRotator(s16 rotator[3], s8 direction[3]); +FVector GetPositionAheadOfCamera(f32 dist); diff --git a/src/engine/objects/BombKart.cpp b/src/engine/objects/BombKart.cpp index 6d5099dc4..53b4a4262 100644 --- a/src/engine/objects/BombKart.cpp +++ b/src/engine/objects/BombKart.cpp @@ -29,7 +29,7 @@ extern s8 gPlayerCount; size_t OBombKart::_count = 0; -OBombKart::OBombKart(Vec3f pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C) { +OBombKart::OBombKart(FVector pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C) { Name = "Bomb Kart"; _idx = _count; Vec3f _pos = {0, 0, 0}; @@ -42,10 +42,10 @@ OBombKart::OBombKart(Vec3f pos, TrackWaypoint* waypoint, uint16_t waypointIndex, // Set height to the default value of 2000.0f unless Pos[1] is higher. // This allows placing these on very high surfaces. - f32 height = (pos[1] > 2000.0f) ? pos[1] : 2000.0f; - _pos[0] = pos[0]; - _pos[1] = spawn_actor_on_surface(pos[0], height, pos[2]); - _pos[2] = pos[2]; + f32 height = (pos.y > 2000.0f) ? pos.y : 2000.0f; + _pos[0] = pos.x; + _pos[1] = spawn_actor_on_surface(pos.x, height, pos.z); + _pos[2] = pos.z; } WaypointIndex = waypointIndex; diff --git a/src/engine/objects/BombKart.h b/src/engine/objects/BombKart.h index d703a06a4..29069a00f 100644 --- a/src/engine/objects/BombKart.h +++ b/src/engine/objects/BombKart.h @@ -50,7 +50,7 @@ public: Collision _Collision; // 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); + explicit OBombKart(FVector pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C); ~OBombKart() { _count--; diff --git a/src/engine/objects/Penguin.cpp b/src/engine/objects/Penguin.cpp index f7f2f12c8..d283101b3 100644 --- a/src/engine/objects/Penguin.cpp +++ b/src/engine/objects/Penguin.cpp @@ -34,7 +34,7 @@ extern s8 gPlayerCount; } -OPenguin::OPenguin(Vec3f pos, u16 direction, PenguinType type, Behaviour behaviour) { +OPenguin::OPenguin(FVector pos, u16 direction, PenguinType type, Behaviour behaviour) { Name = "Penguin"; _type = type; _bhv = behaviour; @@ -44,9 +44,9 @@ OPenguin::OPenguin(Vec3f pos, u16 direction, PenguinType type, Behaviour behavio init_object(_objectIndex, 0); Object *object = &gObjectList[_objectIndex]; - object->origin_pos[0] = pos[0] * xOrientation; - object->origin_pos[1] = pos[1]; - object->origin_pos[2] = pos[2]; + object->origin_pos[0] = pos.x * xOrientation; + object->origin_pos[1] = pos.y; + object->origin_pos[2] = pos.z; object->unk_0C6 = direction; switch(type) { diff --git a/src/engine/objects/Penguin.h b/src/engine/objects/Penguin.h index f8931a7d4..91d5687b9 100644 --- a/src/engine/objects/Penguin.h +++ b/src/engine/objects/Penguin.h @@ -38,7 +38,7 @@ public: f32 Diameter = 0.0f; // Waddle in a circle around the spawn point at this diameter. uint16_t MirrorModeAngleOffset; - explicit OPenguin(Vec3f pos, u16 direction, PenguinType type, Behaviour behaviour); + explicit OPenguin(FVector pos, u16 direction, PenguinType type, Behaviour behaviour); virtual void Tick() override; virtual void Draw(s32 cameraId) override; diff --git a/src/enhancements/freecam/freecam.cpp b/src/enhancements/freecam/freecam.cpp index 7a49ccd60..0d3c3f9bd 100644 --- a/src/enhancements/freecam/freecam.cpp +++ b/src/enhancements/freecam/freecam.cpp @@ -125,6 +125,7 @@ void freecam_loop(Camera* camera, Player* player, s8 index) { void freecam_mouse_manager(Camera* camera, Vec3f forwardVector) { auto wnd = GameEngine::Instance->context->GetWindow(); Ship::Coords mouse = wnd->GetMouseDelta(); + wnd->SetMouseCapture(false); f32 yawChange = 0.0f; f32 pitchChange = 0.0f; diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index d966ec445..b2d38b184 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -22,6 +22,7 @@ #include #include "window/gui/resource/Font.h" #include "window/gui/resource/FontFactory.h" +#include "SpaghettiGui.h" #include #include @@ -94,7 +95,10 @@ GameEngine::GameEngine() { this->context->InitResourceManager(archiveFiles, {}, 3); // without this line InitWindow fails in Gui::Init() this->context->InitConsole(); // without this line the GuiWindow constructor fails in ConsoleWindow::InitElement() - auto wnd = std::make_shared(std::vector>({})); + auto gui = std::make_shared(std::vector>({})); + auto wnd = std::make_shared(gui); + + //auto wnd = std::make_shared(std::vector>({})); //auto wnd = std::dynamic_pointer_cast(Ship::Context::GetInstance()->GetWindow()); this->context->Init(archiveFiles, {}, 3, { 26800, 512, 1100 }, wnd, controlDeck); diff --git a/src/port/Game.cpp b/src/port/Game.cpp index cc74f983c..cd5800092 100644 --- a/src/port/Game.cpp +++ b/src/port/Game.cpp @@ -28,7 +28,7 @@ #include "engine/courses/BigDonut.h" #include "engine/courses/Harbour.h" #include "engine/courses/TestCourse.h" -#include "engine/actors/AFinishline.h" +#include "engine/actors/Finishline.h" #include "engine/courses/PodiumCeremony.h" diff --git a/src/port/SpaghettiGui.cpp b/src/port/SpaghettiGui.cpp new file mode 100644 index 000000000..20b42084b --- /dev/null +++ b/src/port/SpaghettiGui.cpp @@ -0,0 +1,156 @@ +#include +#include "SpaghettiGui.h" +#include +#include +#include "Config.h" + +#ifdef __APPLE__ +#include +#include + +#include "graphic/Fast3D/gfx_metal.h" +#include +#include +#else +#include +#include +#endif + +#if defined(__ANDROID__) || defined(__IOS__) +#include "port/mobile/MobileImpl.h" +#endif + +#ifdef ENABLE_OPENGL +#include +#include + +#endif + +#if defined(ENABLE_DX11) || defined(ENABLE_DX12) +#include +#include +#include + +// NOLINTNEXTLINE +IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + +#endif + +namespace Ship { +#define TOGGLE_BTN ImGuiKey_F1 +#define TOGGLE_PAD_BTN ImGuiKey_GamepadBack + + void SpaghettiGui::DrawMenu() { + const std::shared_ptr wnd = Context::GetInstance()->GetWindow(); + const std::shared_ptr conf = Context::GetInstance()->GetConfig(); + + ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoBackground | + ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | + ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus | + ImGuiWindowFlags_NoResize; + + if (GetMenuBar() && GetMenuBar()->IsVisible()) { + windowFlags |= ImGuiWindowFlags_MenuBar; + } + + const ImGuiViewport* viewport = ImGui::GetMainViewport(); + ImGui::SetNextWindowPos(viewport->WorkPos); + ImGui::SetNextWindowSize(ImVec2((int)wnd->GetWidth(), (int)wnd->GetHeight())); + ImGui::SetNextWindowViewport(viewport->ID); + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f)); + ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f); + ImGui::PushStyleVar(ImGuiStyleVar_ChildBorderSize, 0.0f); + ImGui::Begin("Main - Deck", nullptr, windowFlags); + ImGui::PopStyleVar(3); + + mTemporaryWindowPos = ImGui::GetWindowPos(); + + const ImGuiID dockId = ImGui::GetID("main_dock"); + if (!ImGui::DockBuilderGetNode(dockId)) { + ImGui::DockBuilderRemoveNode(dockId); + ImGui::DockBuilderAddNode(dockId, ImGuiDockNodeFlags_NoTabBar); + ImGui::DockBuilderSetNodeSize(dockId, ImVec2(viewport->Size.x, viewport->Size.y)); + + ImGui::DockBuilderDockWindow("Main Game", dockId); + + const ImGuiViewport* viewport = ImGui::GetMainViewport(); + const ImGuiID dockId = ImGui::GetID("main_dock"); + + ImGuiID topId = ImGui::DockBuilderSplitNode(dockId, ImGuiDir_Up, 0.15f, nullptr, nullptr); + ImGui::DockBuilderSetNodeSize(topId, ImVec2(viewport->Size.x, 40)); + + ImGuiID bottomId = ImGui::DockBuilderSplitNode(dockId, ImGuiDir_Down, 0.25f, nullptr, nullptr); + ImGui::DockBuilderSetNodeSize(bottomId, ImVec2(viewport->Size.x, viewport->Size.y * 0.1f)); + + ImGuiID rightId = ImGui::DockBuilderSplitNode(dockId, ImGuiDir_Right, 0.25f, nullptr, nullptr); + ImGui::DockBuilderSetNodeSize(rightId, ImVec2(viewport->Size.x * 0.15f, viewport->Size.y)); + + // Order of operations matters here for the properties window to be in the right spot + ImGui::DockBuilderDockWindow("Scene Explorer", rightId); + ImGui::DockBuilderDockWindow("Track Properties", rightId); // Attach as second tab + + ImGuiID rightBottomId = ImGui::DockBuilderSplitNode(rightId, ImGuiDir_Down, 0.25f, nullptr, nullptr); + ImGui::DockBuilderSetNodeSize(rightBottomId, ImVec2(viewport->Size.x, viewport->Size.y * 0.25)); + + ImGui::DockBuilderDockWindow("Properties", rightBottomId); + ImGui::DockBuilderDockWindow("Tools", topId); + ImGui::DockBuilderDockWindow("Content Browser", bottomId); + + ImGui::DockBuilderFinish(dockId); + } + + ImGui::DockSpace(dockId, ImVec2(0.0f, 0.0f), ImGuiDockNodeFlags_None | ImGuiDockNodeFlags_NoDockingInCentralNode); + + if (ImGui::IsKeyPressed(TOGGLE_BTN) || ImGui::IsKeyPressed(ImGuiKey_Escape) || + (ImGui::IsKeyPressed(TOGGLE_PAD_BTN) && CVarGetInteger(CVAR_IMGUI_CONTROLLER_NAV, 0))) { + if ((ImGui::IsKeyPressed(ImGuiKey_Escape) || ImGui::IsKeyPressed(TOGGLE_PAD_BTN)) && GetMenu()) { + GetMenu()->ToggleVisibility(); + } else if ((ImGui::IsKeyPressed(TOGGLE_BTN) || ImGui::IsKeyPressed(TOGGLE_PAD_BTN)) && GetMenuBar()) { + Gui::GetMenuBar()->ToggleVisibility(); + } + if (wnd->IsFullscreen()) { + Context::GetInstance()->GetWindow()->SetMouseCapture( + !(GetMenuOrMenubarVisible() || wnd->ShouldForceCursorVisibility())); + } + if (CVarGetInteger(CVAR_IMGUI_CONTROLLER_NAV, 0) && GetMenuOrMenubarVisible()) { + mImGuiIo->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; + } else { + mImGuiIo->ConfigFlags &= ~ImGuiConfigFlags_NavEnableGamepad; + } + } + + #if __APPLE__ + if ((ImGui::IsKeyDown(ImGuiKey_LeftSuper) || ImGui::IsKeyDown(ImGuiKey_RightSuper)) && + ImGui::IsKeyPressed(ImGuiKey_R, false)) { + std::reinterpret_pointer_cast( + Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console")) + ->Dispatch("reset"); + } + #else + if ((ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)) && + ImGui::IsKeyPressed(ImGuiKey_R, false)) { + std::reinterpret_pointer_cast( + Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console")) + ->Dispatch("reset"); + } + #endif + + if (GetMenuBar()) { + GetMenuBar()->Update(); + GetMenuBar()->Draw(); + } + + if (GetMenu()) { + GetMenu()->Update(); + GetMenu()->Draw(); + } + + for (auto& windowIter : mGuiWindows) { + windowIter.second->Update(); + windowIter.second->Draw(); + } + + ImGui::End(); + } + +} \ No newline at end of file diff --git a/src/port/SpaghettiGui.h b/src/port/SpaghettiGui.h new file mode 100644 index 000000000..aa9988784 --- /dev/null +++ b/src/port/SpaghettiGui.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include "libultraship/src/window/gui/Gui.h" +#include "libultraship/src/window/Window.h" + +class Gui; // <-- forward declare +//class Window; + +namespace Ship { + class SpaghettiGui : public Gui { + public: + SpaghettiGui() : Gui() {} + SpaghettiGui(std::vector> guiWindows) : Gui(guiWindows) {} + + protected: + virtual void DrawMenu() override; + }; +} \ No newline at end of file diff --git a/src/port/ui/ContentBrowser.cpp b/src/port/ui/ContentBrowser.cpp index 24b1561d1..b2d0dee1f 100644 --- a/src/port/ui/ContentBrowser.cpp +++ b/src/port/ui/ContentBrowser.cpp @@ -15,7 +15,7 @@ #include #include "CoreMath.h" #include "World.h" -#include "Crab.h" +#include "AllActors.h" namespace Editor { @@ -25,6 +25,10 @@ namespace Editor { void ContentBrowserWindow::DrawElement() { static bool refresh = true; + static bool actorContent = false; + static bool objectContent = false; + static bool customContent = false; + // List the available mods/o2r files // for (size_t i = 0; i < GameEngine::Instance->archiveFiles.size(); i++) { // auto str = GameEngine::Instance->archiveFiles[i]; @@ -45,10 +49,128 @@ namespace Editor { return; } - AddStockContent(); - // Display entries in Content + + std::string actorText = fmt::format("{0} {1}", actorContent ? ICON_FA_FOLDER_OPEN_O : ICON_FA_FOLDER_O, "Actors"); + if (ImGui::Button(actorText.c_str(), ImVec2(80, 32))) { + actorContent = !actorContent; + objectContent = false; + customContent = false; + } + + std::string objectText = fmt::format("{0} {1}", objectContent ? ICON_FA_FOLDER_OPEN_O : ICON_FA_FOLDER_O, "Objects"); + if (ImGui::Button(objectText.c_str(), ImVec2(80, 32))) { + objectContent = !objectContent; + actorContent = false; + customContent = false; + } + + std::string customText = fmt::format("{0} {1}", customContent ? ICON_FA_FOLDER_OPEN_O : ICON_FA_FOLDER_O, "Custom"); + if (ImGui::Button(customText.c_str(), ImVec2(80, 32))) { + customContent = !customContent; + actorContent = false; + objectContent = false; + } + + if (actorContent) { + AddActorContent(); + } + + if (objectContent) { + AddObjectContent(); + } + + if (customContent) { + AddCustomContent(); + } + } + + std::unordered_map> ActorList = { + { "Mario Sign", [](const FVector& pos) { return new AMarioSign(pos); } }, + { "Wario Sign", [](const FVector& pos) { return new AWarioSign(pos); } }, + { "Cloud", [](const FVector& pos) { return new ACloud(pos); } }, + { "Finishline", [](const FVector& pos) { return new AFinishline(pos); } }, + { "Ghostship", [](const FVector& pos) { return new AShip(pos, AShip::Skin::GHOSTSHIP); } }, + { "Ship_1", [](const FVector& pos) { return new AShip(pos, AShip::Skin::SHIP2); } }, + { "Ship_2", [](const FVector& pos) { return new AShip(pos, AShip::Skin::SHIP3); } }, + { "SpaghettiShip", [](const FVector& pos) { return new ASpaghettiShip(pos); } }, + { "Starship", [](const FVector& pos) { return new AStarship(pos); } }, + { "Train", [](const FVector& pos) { return new ATrain(ATrain::TenderStatus::HAS_TENDER, 4, 2.5f, 0); } }, + { "Boat", [](const FVector& pos) { return new ABoat((0.6666666f)/4, 0); } }, + { "Bus", [](const FVector& pos) { return new ABus(2.0f, 2.5f, &D_80164550[0][0], 0); } }, + { "Car", [](const FVector& pos) { return new ACar(2.0f, 2.5f, &D_80164550[0][0], 0); } }, + { "Truck", [](const FVector& pos) { return new ATruck(2.0f, 2.5f, &D_80164550[0][0], 0); } }, + { "Tanker Truck", [](const FVector& pos) { return new ATankerTruck(2.0f, 2.5f, &D_80164550[0][0], 0); } }, + }; + + std::unordered_map> ObjectList = { + { "Bat", [](const FVector& pos) { return new OBat(pos, IRotator(0, 0, 0)); } }, + { "Bomb Kart", [](const FVector& pos) { return new OBombKart(pos, &D_80164550[0][0], 0, 0, 0.8333333f); } }, + // { "Boos", [](const FVector& pos) { return new OBoos(pos, &D_80164550[0][0], 0, 0, 0.8333333f); } }, + { "CheepCheep", [](const FVector& pos) { return new OCheepCheep(pos, OCheepCheep::CheepType::RACE, IPathSpan(0, 10)); } }, + { "Crab", [](const FVector& pos) { return new OCrab(FVector2D(0, 10), FVector2D(20, 10)); } }, + { "ChainChomp", [](const FVector& pos) { return new OChainChomp(); } }, + { "Flagpole", [](const FVector& pos) { return new OFlagpole(pos, 0); } }, + { "Hedgehog", [](const FVector& pos) { return new OHedgehog(pos, FVector2D(0, 10), 0); } }, + { "HotAirBalloon", [](const FVector& pos) { return new OHotAirBalloon(pos); } }, + { "Lakitu", [](const FVector& pos) { return new OLakitu(0, OLakitu::LakituType::STARTER); } }, + // { "Mole", [](const FVector& pos) { return new OMole(pos, ); } }, // <-- Needs a group + { "Chick Penguin", [](const FVector& pos) { return new OPenguin(pos, 0, OPenguin::PenguinType::CHICK, OPenguin::Behaviour::SLIDE3); } }, + { "Penguin", [](const FVector& pos) { return new OPenguin(pos, 0, OPenguin::PenguinType::ADULT, OPenguin::Behaviour::CIRCLE); } }, + { "Emperor Penguin", [](const FVector& pos) { return new OPenguin(pos, 0, OPenguin::PenguinType::EMPEROR, OPenguin::Behaviour::STRUT); } }, + { "Seagull", [](const FVector& pos) { return new OSeagull(pos); } }, + { "Thwomp", [](const FVector& pos) { return new OThwomp(pos.x, pos.z, 0, 1.0f, 0, 0, 2.0f); } }, + { "Trashbin", [](const FVector& pos) { return new OTrashBin(pos, IRotator(0, 0, 0), 1.0f, OTrashBin::Behaviour::MUNCHING); } }, + { "Trophy", [](const FVector& pos) { return new OTrophy(pos, OTrophy::TrophyType::GOLD_150, OTrophy::Behaviour::ROTATE2); } }, + { "Snowman", [](const FVector& pos) { return new OSnowman(pos); } }, + { "Podium", [](const FVector& pos) { return new OPodium(pos); } }, + }; + + void ContentBrowserWindow::AddActorContent() { + FVector pos = GetPositionAheadOfCamera(300.0f); + + size_t i_actor = 0; + for (const auto& actor : ActorList) { + if ((i_actor != 0) && (i_actor % 10 == 0)) { + } else { + ImGui::SameLine(); + } + + std::string label = fmt::format("{}##{}", actor.first, i_actor); + if (ImGui::Button(label.c_str())) { + gWorldInstance.AddActor(actor.second(pos)); // Pass pos to the lambda + } + i_actor += 1; + } + } + + void ContentBrowserWindow::AddObjectContent() { + FVector pos = GetPositionAheadOfCamera(300.0f); + + size_t i_object = 0; + for (auto& object : ObjectList) { + if ((i_object != 0) && (i_object % 10 == 0)) { + } else { + ImGui::SameLine(); + } + + std::string label = fmt::format("{}##{}", object.first, i_object); + if (ImGui::Button(label.c_str())) { + gWorldInstance.AddObject(object.second(pos)); // Pass pos to the lambda + } + i_object += 1; + } + } + + void ContentBrowserWindow::AddCustomContent() { + size_t i_custom = 0; for (const auto& file : Content) { - if (ImGui::Button(file.c_str())) { + if ((i_custom != 0) && (i_custom % 10 == 0)) { + } else { + ImGui::SameLine(); + } + + std::string label = fmt::format("{}##{}", file, i_custom); + if (ImGui::Button(label.c_str())) { int coll; //printf("ContentBrowser.cpp: name: %s\n", test.c_str()); std::string name = file.substr(file.find_last_of('/') + 1); @@ -57,12 +179,7 @@ namespace Editor { actor->Model = "__OTR__" + file; } - } - } - - void ContentBrowserWindow::AddStockContent() { - if (ImGui::Button("Crab")) { - gWorldInstance.AddObject(new OCrab(FVector2D(0, 0), FVector2D(0, 100))); + i_custom += 1; } } diff --git a/src/port/ui/ContentBrowser.h b/src/port/ui/ContentBrowser.h index d1b89559b..c6a15f35e 100644 --- a/src/port/ui/ContentBrowser.h +++ b/src/port/ui/ContentBrowser.h @@ -13,7 +13,9 @@ protected: void InitElement() override {}; void DrawElement() override; void UpdateElement() override {}; - void AddStockContent(); + void AddActorContent(); + void AddObjectContent(); + void AddCustomContent(); void FindContent(); }; } diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index f6165eda7..c840586cf 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -6,6 +6,7 @@ #include "FreecamWindow.h" #include "Tools.h" #include "SceneExplorer.h" +#include "Properties.h" #include "TrackProperties.h" #include "ContentBrowser.h" @@ -38,6 +39,7 @@ std::shared_ptr mGameInfoWindow; std::shared_ptr mMultiplayerWindow; std::shared_ptr mToolsWindow; std::shared_ptr mSceneExplorerWindow; +std::shared_ptr mPropertiesWindow; std::shared_ptr mTrackPropertiesWindow; std::shared_ptr mContentBrowserWindow; @@ -88,6 +90,9 @@ void SetupGuiElements() { mSceneExplorerWindow = std::make_shared("gEditorEnabled", "Scene Explorer"); gui->AddGuiWindow(mSceneExplorerWindow); + mPropertiesWindow = std::make_shared("gEditorEnabled", "Properties"); + gui->AddGuiWindow(mPropertiesWindow); + mTrackPropertiesWindow = std::make_shared("gEditorEnabled", "Track Properties"); gui->AddGuiWindow(mTrackPropertiesWindow); @@ -106,6 +111,7 @@ void Destroy() { mInputEditorWindow = nullptr; mToolsWindow = nullptr; mSceneExplorerWindow = nullptr; + mPropertiesWindow = nullptr; mTrackPropertiesWindow = nullptr; mContentBrowserWindow = nullptr; } diff --git a/src/port/ui/PortMenu.cpp b/src/port/ui/PortMenu.cpp index 83aeb97e3..9268223e0 100644 --- a/src/port/ui/PortMenu.cpp +++ b/src/port/ui/PortMenu.cpp @@ -87,6 +87,14 @@ void PortMenu::AddSettings() { // General Settings AddSidebarEntry("Settings", "General", 3); WidgetPath path = { "Settings", "General", SECTION_COLUMN_1 }; + + static bool isFullscreen = false; + AddWidget(path, "Toggle Fullscreen", WIDGET_CHECKBOX) + .ValuePointer(&isFullscreen) + .PreFunc([](WidgetInfo& info) { isFullscreen = Ship::Context::GetInstance()->GetWindow()->IsFullscreen(); }) + .Callback([](WidgetInfo& info) { Ship::Context::GetInstance()->GetWindow()->ToggleFullscreen(); }) + .Options(CheckboxOptions().Tooltip("Toggles Fullscreen On/Off.")); + AddWidget(path, "Menu Theme", WIDGET_CVAR_COMBOBOX) .CVar("gSettings.Menu.Theme") .Options(ComboboxOptions() @@ -175,7 +183,6 @@ void PortMenu::AddSettings() { // Graphics Settings static int32_t maxFps; - static bool isFullscreen = false; const char* tooltip = ""; if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) { maxFps = 360; @@ -189,11 +196,8 @@ void PortMenu::AddSettings() { } path.sidebarName = "Graphics"; AddSidebarEntry("Settings", "Graphics", 3); - AddWidget(path, "Toggle Fullscreen", WIDGET_CHECKBOX) - .ValuePointer(&isFullscreen) - .PreFunc([](WidgetInfo& info) { isFullscreen = Ship::Context::GetInstance()->GetWindow()->IsFullscreen(); }) - .Callback([](WidgetInfo& info) { Ship::Context::GetInstance()->GetWindow()->ToggleFullscreen(); }) - .Options(CheckboxOptions().Tooltip("Toggles Fullscreen On/Off.")); + AddWidget(path, "Renderer API (Needs reload)", WIDGET_VIDEO_BACKEND); + #ifndef __APPLE__ AddWidget(path, "Internal Resolution: %.0f%%", WIDGET_CVAR_SLIDER_FLOAT) .CVar(CVAR_INTERNAL_RESOLUTION) @@ -276,7 +280,6 @@ void PortMenu::AddSettings() { .Min(0) .Max(360) .DefaultValue(80)); - AddWidget(path, "Renderer API (Needs reload)", WIDGET_VIDEO_BACKEND); AddWidget(path, "Enable Vsync", WIDGET_CVAR_CHECKBOX) .CVar(CVAR_VSYNC_ENABLED) .PreFunc([](WidgetInfo& info) { info.isHidden = mPortMenu->disabledMap.at(DISABLE_FOR_NO_VSYNC).active; }) diff --git a/src/port/ui/Properties.cpp b/src/port/ui/Properties.cpp new file mode 100644 index 000000000..70a2728e9 --- /dev/null +++ b/src/port/ui/Properties.cpp @@ -0,0 +1,25 @@ +#include "Properties.h" +#include "port/ui/PortMenu.h" +#include "UIWidgets.h" +#include "libultraship/src/Context.h" + +#include +#include +#include +#include +#include "spdlog/formatter.h" +#include +#include + +#include "engine/editor/Editor.h" +#include "port/Game.h" + +namespace Editor { + + PropertiesWindow::~PropertiesWindow() { + SPDLOG_TRACE("destruct scene explorer window"); + } + + void PropertiesWindow::DrawElement() { + } +} diff --git a/src/port/ui/Properties.h b/src/port/ui/Properties.h new file mode 100644 index 000000000..260f89179 --- /dev/null +++ b/src/port/ui/Properties.h @@ -0,0 +1,17 @@ +#pragma once + +#include +#include "port/Game.h" + + +namespace Editor { +class PropertiesWindow : public Ship::GuiWindow { +public: + using Ship::GuiWindow::GuiWindow; + ~PropertiesWindow(); +protected: + void InitElement() override {}; + void DrawElement() override; + void UpdateElement() override {}; +}; +} \ No newline at end of file diff --git a/src/port/ui/SceneExplorer.h b/src/port/ui/SceneExplorer.h index 187d94b88..f9e926148 100644 --- a/src/port/ui/SceneExplorer.h +++ b/src/port/ui/SceneExplorer.h @@ -14,4 +14,4 @@ protected: void DrawElement() override; void UpdateElement() override {}; }; -} \ No newline at end of file +} diff --git a/src/spawn_players.c b/src/spawn_players.c index fa82f0b5a..5e623577b 100644 --- a/src/spawn_players.c +++ b/src/spawn_players.c @@ -882,7 +882,7 @@ void func_8003BE30(void) { void func_8003C0F0(void) { s16 sp5E; s16 sp5C; - s16 sp5A; + s16 sp5A = 0; s32 temp; UNUSED s32 pad[4];