load course dl textures from otr and move objects

This commit is contained in:
MegaMech
2024-12-05 21:41:58 -07:00
parent 7628e98e37
commit 19135c9ee8
60 changed files with 654 additions and 752 deletions
+6 -4
View File
@@ -94,7 +94,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 +103,14 @@ 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);
printf("TEXTURE: 0x%llX\n",texture);
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);
}