diff options
Diffstat (limited to 'src/engine/courses/Course.cpp')
| -rw-r--r-- | src/engine/courses/Course.cpp | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/src/engine/courses/Course.cpp b/src/engine/courses/Course.cpp index f844adcdf..bdec26404 100644 --- a/src/engine/courses/Course.cpp +++ b/src/engine/courses/Course.cpp @@ -17,6 +17,8 @@ extern "C" { #include "save.h" #include "staff_ghosts.h" #include "Engine.h" + #include "code_800029B0.h" + #include "render_courses.h" extern StaffGhost* d_mario_raceway_staff_ghost; } @@ -76,6 +78,8 @@ Course::Course() { void Course::Load(Vtx* vtx, Gfx* gfx) { gSegmentTable[4] = reinterpret_cast<uintptr_t>(&vtx[0]); gSegmentTable[7] = reinterpret_cast<uintptr_t>(&gfx[0]); + + Course::Init(); } void Course::Load() { @@ -86,7 +90,6 @@ void Course::Load() { // Convert course vtx to vtx Vtx* vtx = reinterpret_cast<Vtx*>(allocate_memory(vtxSize)); gSegmentTable[4] = reinterpret_cast<uintptr_t>(&vtx[0]); - printf("\nVtxsize: 0x%X\n\n",vtxSize); func_802A86A8(reinterpret_cast<CourseVtx*>(LOAD_ASSET_RAW(this->vtx)), vtx, vtxSize / sizeof(Vtx)); // Load and allocate memory for course textures @@ -117,6 +120,28 @@ void Course::Load() { assert(gfx != NULL); gSegmentTable[7] = reinterpret_cast<uintptr_t>(&gfx[0]); displaylist_unpack(reinterpret_cast<uintptr_t *>(gfx), reinterpret_cast<uintptr_t>(packed), 0); + + Course::Init(); +} + +void Course::Init() { + gNumActors = 0; + gCourseMinX = 0; + gCourseMinY = 0; + gCourseMinZ = 0; + + gCourseMaxX = 0; + gCourseMaxY = 0; + gCourseMaxZ = 0; + + D_8015F59C = 0; + D_8015F5A0 = 0; + func_80295D6C(); + D_8015F58C = 0; + gCollisionMeshCount = 0; + gCollisionMesh = (CollisionTriangle*) gNextFreeMemoryAddress; + D_800DC5BC = 0; + D_800DC5C8 = 0; } void Course::LoadTextures() { } @@ -172,7 +197,7 @@ void Course::SomeSounds() { } -void Course::SetCourseVtxColours() { +void Course::CreditsSpawnActors() { } @@ -195,9 +220,6 @@ void Course::SetStaffGhost() { D_80162DF4 = 1; } -void Course::SpawnBombKarts() { -} - void Course::Waypoints(Player* player, int8_t playerId) { player->nearestWaypointId = gNearestWaypointByPlayerId[playerId]; if (player->nearestWaypointId < 0) { @@ -208,12 +230,11 @@ void Course::Waypoints(Player* player, int8_t playerId) { void Course::SpawnVehicles() {} void Course::UpdateVehicles() {} -void Course::BeginPlay() {} void Course::Render(struct UnkStruct_800DC5EC* arg0) {} void Course::RenderCredits() {} void Course::Collision() {} -void Course::GenerateCollision() {} -void Course::Water() {} +void Course::ScrollingTextures() {} +void Course::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) {} void Course::Destroy() { } |
