mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Apply suggestions from code review
Co-authored-by: AntonioCastelli <aatcastelli@gmail.com>
This commit is contained in:
co-authored by
AntonioCastelli
parent
ad9842a993
commit
25b77e53af
+7
-7
@@ -403,19 +403,19 @@ typedef struct ObjectModel {
|
||||
/* Size: 0x44 bytes */
|
||||
typedef struct LevelModelSegment {
|
||||
/* 0x00 */ Vertex *vertices;
|
||||
/* 0x04 */ Triangle *triangles;
|
||||
u8 pad8[4];
|
||||
/* 0x04 */ Triangle *triangles;
|
||||
u8 pad8[4];
|
||||
/* 0x0C */ TriangleBatchInfo *batches;
|
||||
s32 unk10;
|
||||
u8 *unk14;
|
||||
s16 *unk18;
|
||||
/* 0x10 */ s32 unk10;
|
||||
/* 0x14 */ u8 *unk14;
|
||||
/* 0x18 */ s16 *unk18;
|
||||
/* 0x1C */ s16 numberOfVertices;
|
||||
/* 0x1E */ s16 numberOfTriangles;
|
||||
/* 0x20 */ s16 numberOfBatches;
|
||||
u8 pad22[0x09];
|
||||
/* 0x2B */ s8 unk2B;
|
||||
u8 pad2C[4];
|
||||
s16 unk30;
|
||||
/* 0x30 */ s16 unk30;
|
||||
/* 0x32 */ s16 unk32;
|
||||
s16 *unk34;
|
||||
/* 0x38 */ s16 unk38;
|
||||
@@ -456,7 +456,7 @@ typedef struct LevelModel {
|
||||
u8 pad24[0x14];
|
||||
/* 0x38 */ u32 minimapColor;
|
||||
u8 pad3C[0xC];
|
||||
s32 modelSize;
|
||||
/* 0x48 */ s32 modelSize;
|
||||
} LevelModel;
|
||||
|
||||
typedef struct Object_3C {
|
||||
|
||||
+9
-9
@@ -184,7 +184,7 @@ s32 D_80123560[8];
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// Only has regalloc issues.
|
||||
void func_8006A6B0(void){
|
||||
void func_8006A6B0(void) {
|
||||
s32 i;
|
||||
s32 temp;
|
||||
s32 count;
|
||||
@@ -199,14 +199,14 @@ void func_8006A6B0(void){
|
||||
D_80121180[i++] = 0;
|
||||
}
|
||||
gNumberOfLevelHeaders = 0;
|
||||
while (gTempAssetTable[gNumberOfLevelHeaders] != (-1)) {
|
||||
while (gTempAssetTable[gNumberOfLevelHeaders] != -1) {
|
||||
gNumberOfLevelHeaders++;
|
||||
}
|
||||
gNumberOfLevelHeaders--;
|
||||
D_8012117C = allocate_from_main_pool_safe(gNumberOfLevelHeaders * (sizeof(unk8012117C)), 0xFFFF00FF);
|
||||
D_8012117C = allocate_from_main_pool_safe(gNumberOfLevelHeaders * sizeof(unk8012117C), 0xFFFF00FF);
|
||||
gCurrentLevelHeader = sp44;
|
||||
gNumberOfWorlds = -1;
|
||||
for (i = 0; i < gNumberOfLevelHeaders; i++){
|
||||
for (i = 0; i < gNumberOfLevelHeaders; i++) {
|
||||
load_asset_to_address(ASSET_LEVEL_HEADERS, gCurrentLevelHeader, gTempAssetTable[i], sizeof(LevelHeader));
|
||||
if (gNumberOfWorlds < gCurrentLevelHeader->world) {
|
||||
gNumberOfWorlds = gCurrentLevelHeader->world;
|
||||
@@ -224,11 +224,11 @@ void func_8006A6B0(void){
|
||||
|
||||
gNumberOfWorlds++;
|
||||
D_80121178 = allocate_from_main_pool_safe(gNumberOfWorlds, 0xFFFF00FF);
|
||||
for (i = 0; i < gNumberOfWorlds; i++){
|
||||
*(D_80121178 + i) = -1;
|
||||
for (i = 0; i < gNumberOfWorlds; i++) {
|
||||
D_80121178[i] = -1;
|
||||
}
|
||||
for (i = 0; i < gNumberOfLevelHeaders; i++){
|
||||
if ((D_8012117C[i].unk1 == 5) != 0 ){
|
||||
for (i = 0; i < gNumberOfLevelHeaders; i++) {
|
||||
if ((D_8012117C[i].unk1 == 5) != 0) {
|
||||
D_80121178[D_8012117C[i].unk0] = i;
|
||||
}
|
||||
}
|
||||
@@ -243,7 +243,7 @@ void func_8006A6B0(void){
|
||||
temp = gTempAssetTable[i];
|
||||
temp -= gTempAssetTable[0];
|
||||
|
||||
gLevelNames = allocate_from_main_pool_safe(i * (sizeof(s32)), 0xFFFF00FF);
|
||||
gLevelNames = allocate_from_main_pool_safe(i * sizeof(s32), 0xFFFF00FF);
|
||||
D_800DD310 = allocate_from_main_pool_safe(temp, 0xFFFF00FF);
|
||||
load_asset_to_address(ASSET_LEVEL_NAMES, D_800DD310, 0, temp);
|
||||
for (count = 0; count < i; count++) {
|
||||
|
||||
@@ -921,7 +921,7 @@ void func_8002C0C4(s32 modelId) {
|
||||
}
|
||||
offset = D_8011D310[modelId];
|
||||
size = D_8011D310[modelId + 1] - offset;
|
||||
compressedRamAddr = (u8*)gCurrentLevelModel + (LEVEL_MODEL_MAX_SIZE - size);
|
||||
compressedRamAddr = (u8*)gCurrentLevelModel + LEVEL_MODEL_MAX_SIZE - size;
|
||||
compressedRamAddr = compressedRamAddr - (u8*)((s32)compressedRamAddr % 16);
|
||||
load_asset_to_address(ASSET_LEVEL_MODELS, compressedRamAddr, offset, size);
|
||||
gzip_inflate((u8*) compressedRamAddr, (u8*) gCurrentLevelModel);
|
||||
@@ -960,7 +960,7 @@ void func_8002C0C4(s32 modelId) {
|
||||
}
|
||||
set_free_queue_state(0);
|
||||
free_from_memory_pool(D_8011D30C);
|
||||
allocate_at_address_in_main_pool(temp_s4, (u8* ) D_8011D30C, 0xFFFF00FFU);
|
||||
allocate_at_address_in_main_pool(temp_s4, (u8 *) D_8011D30C, 0xFFFF00FFU);
|
||||
set_free_queue_state(2);
|
||||
func_800A83B4(gCurrentLevelModel);
|
||||
|
||||
@@ -980,7 +980,7 @@ void func_8002C0C4(s32 modelId) {
|
||||
}
|
||||
}
|
||||
}
|
||||
func_8007B374(-0xFF0001);
|
||||
func_8007B374(0xFF00FFFF);
|
||||
}
|
||||
|
||||
#else
|
||||
@@ -1023,7 +1023,7 @@ void func_8002C7D4(void) {
|
||||
free_from_memory_pool(D_8011D30C);
|
||||
free_from_memory_pool(D_8011D370);
|
||||
free_from_memory_pool(D_8011D374);
|
||||
free_sprite((Sprite* ) gCurrentLevelModel->unk20);
|
||||
free_sprite((Sprite *) gCurrentLevelModel->unk20);
|
||||
for(i = 0; i < 4; i++) {
|
||||
free_from_memory_pool(D_8011D350[i]);
|
||||
free_from_memory_pool(D_8011D320[i]);
|
||||
|
||||
@@ -152,7 +152,7 @@ std::mutex enumsMutex;
|
||||
void make_sure_enums_are_loaded() {
|
||||
enumsMutex.lock();
|
||||
if(!hasLoadedEnums) {
|
||||
if(ENUMS_CACHE_PATH == "") {
|
||||
if(ENUMS_CACHE_PATH.empty()) {
|
||||
set_enums_cache_path();
|
||||
}
|
||||
load_enums_cache();
|
||||
|
||||
Reference in New Issue
Block a user