diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2024-12-31 09:50:21 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-31 09:50:21 -0700 |
| commit | 1101dcafb08a1f17b06306ff44a9d869ffeb7862 (patch) | |
| tree | e63c623057b555fedd3d017b5d6c34d12de31098 /src/engine/courses/Course.cpp | |
| parent | 7e6aba50a2a2fa80db153ad154f5ae77cc344650 (diff) | |
| parent | 7ee714e4e93609a5dbf1dc648df0ce504e3d7284 (diff) | |
Merge pull request #133 from MegaMech/next
Fix loadtile, Impl more OObjects
Diffstat (limited to 'src/engine/courses/Course.cpp')
| -rw-r--r-- | src/engine/courses/Course.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/engine/courses/Course.cpp b/src/engine/courses/Course.cpp index 022ee016e..7d8fb3bff 100644 --- a/src/engine/courses/Course.cpp +++ b/src/engine/courses/Course.cpp @@ -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); } |
