From e8e2e2d131c06fea787d830ffbf7d003bb398b5a Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 8 Jan 2021 08:10:30 +1000 Subject: [PATCH] Rename prop linked list symbols and functions --- src/game/chr/chr.c | 10 +-- src/game/chr/chraction.c | 4 +- src/game/chr/chraicommands.c | 16 ++-- src/game/explosions/explosions.c | 2 +- src/game/explosions/free.c | 2 +- src/game/game_00c240.c | 6 +- src/game/game_00c490.c | 8 +- src/game/game_011110.c | 4 +- src/game/game_0147d0.c | 2 +- src/game/game_014f10.c | 2 +- src/game/game_02cde0.c | 4 +- src/game/game_0601b0.c | 132 +++++++++++++++---------------- src/game/game_097ba0.c | 2 +- src/game/game_0b63b0.c | 4 +- src/game/game_129210.c | 2 +- src/game/game_157db0.c | 4 +- src/game/mplayer/options.c | 2 +- src/game/mplayer/scenarios.c | 4 +- src/game/propobj.c | 14 ++-- src/game/radar.c | 2 +- src/game/smoke/free.c | 2 +- src/game/smoke/smoke.c | 4 +- src/include/game/game_0601b0.h | 10 +-- src/include/gvars/gvars.h | 6 +- src/include/types.h | 2 +- 25 files changed, 125 insertions(+), 125 deletions(-) diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index 1ee3e80d0..8a01b4fa4 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -146,11 +146,11 @@ void func0f01e250(void) func0f02c9b0(); func0f048398(); - prop = g_Vars.unk00033c; + prop = g_Vars.list1head; do { next = prop->next; - done = next == g_Vars.unk000354; + done = next == g_Vars.list2head; value = 0; if (prop->type == PROPTYPE_CHR) { @@ -169,11 +169,11 @@ void func0f01e250(void) next2 = next; } else { next2 = prop->next; - done = next2 == g_Vars.unk000354; + done = next2 == g_Vars.list2head; if (value == 3) { - func0f0605c4(prop); - func0f060538(prop); + propRemoveFromCurrentList(prop); + propAppendToList1(prop); if (done) { next2 = prop; diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index fe09bbb8b..3c995e5d2 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -23463,7 +23463,7 @@ void func0f0482cc(u32 ailistid) var8009de24 = 0; var8009de28 = 0; - prop = g_Vars.unk00033c; + prop = g_Vars.list1head; while (prop) { prop->unk38 = 0xffff; @@ -26078,7 +26078,7 @@ struct prop *chrSpawnAtCoord(s32 bodynum, s32 headnum, struct coord *pos, s16 *r prop = propAllocateChr(model, &pos2, rooms2, arg4, ailist); if (prop) { - func0f060538(prop); + propAppendToList1(prop); propShow(prop); chr = prop->chr; diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 2ed105b76..b4a4ffc79 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -2341,7 +2341,7 @@ bool aiGiveObjectToChr(void) if (obj->prop->parent) { func0f082f88(obj->prop); func0f06ac90(obj->prop); - func0f0604bc(obj->prop); + propPrependToList1(obj->prop); } something = func0f088840(obj->prop, 0); @@ -2354,7 +2354,7 @@ bool aiGiveObjectToChr(void) func0f082f88(obj->prop); } else { func0f065c44(obj->prop); - func0f0605c4(obj->prop); + propRemoveFromCurrentList(obj->prop); propHide(obj->prop); } @@ -5160,7 +5160,7 @@ bool aiShowChr(void) struct chrdata *chr = chrFindById(g_Vars.chrdata, cmd[2]); if (chr && chr->prop && chr->model) { - func0f0604bc(chr->prop); + propPrependToList1(chr->prop); propShow(chr->prop); func0f0220ac(chr); } @@ -5180,7 +5180,7 @@ bool aiHideChr(void) if (chr && chr->prop && chr->model) { func0f065c44(chr->prop); - func0f0605c4(chr->prop); + propRemoveFromCurrentList(chr->prop); propHide(chr->prop); } @@ -5198,7 +5198,7 @@ bool aiShowObj(void) struct defaultobj *obj = objFindByTagId(cmd[2]); if (obj && obj->prop && obj->model) { - func0f0604bc(obj->prop); + propPrependToList1(obj->prop); propShow(obj->prop); if (g_Vars.currentplayer->eyespy == NULL && obj->type == OBJTYPE_WEAPON) { @@ -5228,7 +5228,7 @@ bool aiHideObj(void) func0f082f88(obj->prop); } else { func0f065c44(obj->prop); - func0f0605c4(obj->prop); + propRemoveFromCurrentList(obj->prop); propHide(obj->prop); } } @@ -9381,7 +9381,7 @@ glabel ai0172 /* f05cad8: 8faa0024 */ lw $t2,0x24($sp) /* f05cadc: 0fc19711 */ jal func0f065c44 /* f05cae0: 02002025 */ or $a0,$s0,$zero -/* f05cae4: 0fc18171 */ jal func0f0605c4 +/* f05cae4: 0fc18171 */ jal propRemoveFromCurrentList /* f05cae8: 02002025 */ or $a0,$s0,$zero /* f05caec: 0fc180c0 */ jal propHide /* f05caf0: 02002025 */ or $a0,$s0,$zero @@ -9412,7 +9412,7 @@ glabel ai0172 // // if (prop && prop->obj && prop->parent == NULL && prop->type == PROPTYPE_WEAPON) { // func0f065c44(prop); -// func0f0605c4(prop); +// propRemoveFromCurrentList(prop); // propHide(prop); // func0f08ae54(prop->obj, g_Vars.chrdata); // } diff --git a/src/game/explosions/explosions.c b/src/game/explosions/explosions.c index b63901873..d0ee0a485 100644 --- a/src/game/explosions/explosions.c +++ b/src/game/explosions/explosions.c @@ -506,7 +506,7 @@ glabel var7f1b5584 /* f12a2c0: 03196021 */ addu $t4,$t8,$t9 /* f12a2c4: afac009c */ sw $t4,0x9c($sp) /* f12a2c8: afaa0158 */ sw $t2,0x158($sp) -/* f12a2cc: 0fc1814e */ jal func0f060538 +/* f12a2cc: 0fc1814e */ jal propAppendToList1 /* f12a2d0: 02a02025 */ or $a0,$s5,$zero /* f12a2d4: 0fc180bc */ jal propShow /* f12a2d8: 02a02025 */ or $a0,$s5,$zero diff --git a/src/game/explosions/free.c b/src/game/explosions/free.c index 09b2ee877..460b2c9ce 100644 --- a/src/game/explosions/free.c +++ b/src/game/explosions/free.c @@ -22,7 +22,7 @@ void explosionsFree(void) if (g_Explosions) { for (i = 0; i < 6; i++) { if (g_Explosions[i].prop) { - func0f0605c4(g_Explosions[i].prop); + propRemoveFromCurrentList(g_Explosions[i].prop); propHide(g_Explosions[i].prop); propFree(g_Explosions[i].prop); diff --git a/src/game/game_00c240.c b/src/game/game_00c240.c index dff701d86..cdd2d096a 100644 --- a/src/game/game_00c240.c +++ b/src/game/game_00c240.c @@ -22,9 +22,9 @@ void gvarsInitProps(void) var80069880 = 1; - g_Vars.unk00033c = NULL; - g_Vars.unk000340 = NULL; - g_Vars.unk000354 = g_Vars.unk000350 = NULL; + g_Vars.list1head = NULL; + g_Vars.list1tail = NULL; + g_Vars.list2head = g_Vars.unk000350 = NULL; g_Vars.tangibleprops[0] = NULL; diff --git a/src/game/game_00c490.c b/src/game/game_00c490.c index e77774737..2198255e8 100644 --- a/src/game/game_00c490.c +++ b/src/game/game_00c490.c @@ -1393,12 +1393,12 @@ glabel var7f1a7f80 /* f00d630: 31f88000 */ andi $t8,$t7,0x8000 /* f00d634: 13000005 */ beqz $t8,.L0f00d64c /* f00d638: 00000000 */ nop -/* f00d63c: 0fc1814e */ jal func0f060538 +/* f00d63c: 0fc1814e */ jal propAppendToList1 /* f00d640: 8fa4007c */ lw $a0,0x7c($sp) /* f00d644: 10000003 */ b .L0f00d654 /* f00d648: 00000000 */ nop .L0f00d64c: -/* f00d64c: 0fc1812f */ jal func0f0604bc +/* f00d64c: 0fc1812f */ jal propPrependToList1 /* f00d650: 8fa4007c */ lw $a0,0x7c($sp) .L0f00d654: /* f00d654: 0fc180bc */ jal propShow @@ -2187,7 +2187,7 @@ glabel var7f1a8064 /* f00e8d4: 0c006bd6 */ jal modelSetUnk14 /* f00e8d8: 00000000 */ nop .L0f00e8dc: -/* f00e8dc: 0fc1812f */ jal func0f0604bc +/* f00e8dc: 0fc1812f */ jal propPrependToList1 /* f00e8e0: 8fa4010c */ lw $a0,0x10c($sp) /* f00e8e4: 0fc180bc */ jal propShow /* f00e8e8: 8fa4010c */ lw $a0,0x10c($sp) @@ -2353,7 +2353,7 @@ glabel var7f1a8064 // modelSetUnk14(door->base.model, door->base.model->unk14 * mult); // } // -// func0f0604bc(prop); +// propPrependToList1(prop); // propShow(prop); // } else { // door->base.prop = NULL; diff --git a/src/game/game_011110.c b/src/game/game_011110.c index 6c082bd02..59003f10a 100644 --- a/src/game/game_011110.c +++ b/src/game/game_011110.c @@ -969,7 +969,7 @@ glabel var7f1a827c /* f011fac: 8f0e00bc */ lw $t6,0xbc($t8) /* f011fb0: a1d90000 */ sb $t9,0x0($t6) /* f011fb4: 8e2f0284 */ lw $t7,0x284($s1) -/* f011fb8: 0fc1812f */ jal func0f0604bc +/* f011fb8: 0fc1812f */ jal propPrependToList1 /* f011fbc: 8de400bc */ lw $a0,0xbc($t7) /* f011fc0: 8e290284 */ lw $t1,0x284($s1) /* f011fc4: 0fc180bc */ jal propShow @@ -1534,7 +1534,7 @@ glabel var7f1a827c // g_Vars.currentplayer->prop->chr = NULL; // g_Vars.currentplayer->prop->type = PROPTYPE_PLAYER; // -// func0f0604bc(g_Vars.currentplayer->prop); +// propPrependToList1(g_Vars.currentplayer->prop); // propShow(g_Vars.currentplayer->prop); // chrInit(g_Vars.currentplayer->prop, NULL); // diff --git a/src/game/game_0147d0.c b/src/game/game_0147d0.c index 8cb658cbc..bd6f57082 100644 --- a/src/game/game_0147d0.c +++ b/src/game/game_0147d0.c @@ -123,7 +123,7 @@ glabel var7f1a82b4 /* f014920: afa20010 */ sw $v0,0x10($sp) /* f014924: 10400155 */ beqz $v0,.L0f014e7c /* f014928: 00402025 */ or $a0,$v0,$zero -/* f01492c: 0fc1812f */ jal func0f0604bc +/* f01492c: 0fc1812f */ jal propPrependToList1 /* f014930: afa20070 */ sw $v0,0x70($sp) /* f014934: 0fc180bc */ jal propShow /* f014938: 8fa40070 */ lw $a0,0x70($sp) diff --git a/src/game/game_014f10.c b/src/game/game_014f10.c index 50fea1f52..339233241 100644 --- a/src/game/game_014f10.c +++ b/src/game/game_014f10.c @@ -23,7 +23,7 @@ void func0f014f10(void) && g_ChrSlots[i].prop && g_ChrSlots[i].prop->type == PROPTYPE_CHR) { func0f020d44(g_ChrSlots[i].prop, true); - func0f0605c4(g_ChrSlots[i].prop); + propRemoveFromCurrentList(g_ChrSlots[i].prop); propHide(g_ChrSlots[i].prop); propFree(g_ChrSlots[i].prop); } diff --git a/src/game/game_02cde0.c b/src/game/game_02cde0.c index 06ccdccef..59804bac0 100644 --- a/src/game/game_02cde0.c +++ b/src/game/game_02cde0.c @@ -616,7 +616,7 @@ glabel chrUnpack /* f02d73c: afa20010 */ sw $v0,0x10($sp) /* f02d740: 10400115 */ beqz $v0,.L0f02db98 /* f02d744: 00402025 */ or $a0,$v0,$zero -/* f02d748: 0fc1812f */ jal func0f0604bc +/* f02d748: 0fc1812f */ jal propPrependToList1 /* f02d74c: afa20050 */ sw $v0,0x50($sp) /* f02d750: 0fc180bc */ jal propShow /* f02d754: 8fa40050 */ lw $a0,0x50($sp) @@ -966,7 +966,7 @@ struct prop *propAllocateEyespy(struct pad *pad, s16 room) prop = propAllocateChr(model, &pad->pos, rooms, 0, ailistFindById(GAILIST_IDLE)); if (prop) { - func0f0604bc(prop); + propPrependToList1(prop); propShow(prop); chr = prop->chr; chrSetChrnum(chr, getNextUnusedChrnum()); diff --git a/src/game/game_0601b0.c b/src/game/game_0601b0.c index b208eabb4..393f65a58 100644 --- a/src/game/game_0601b0.c +++ b/src/game/game_0601b0.c @@ -176,7 +176,7 @@ struct prop *propAllocate(void) prop->unk3e = 0; prop->unk3f_00 = 1; prop->unk3f_02 = 0; - prop->unk3f_03 = 0; + prop->inlist1 = false; prop->unk3f_01 = 0; prop->unk38 = 0xffff; prop->unk3a = 0; @@ -212,83 +212,83 @@ void propFree(struct prop *prop) g_Vars.freeprops = prop; } -void func0f0604bc(struct prop *prop) +void propPrependToList1(struct prop *prop) { - if (g_Vars.unk00033c && g_Vars.unk00033c != g_Vars.unk000354) { - if (prop != g_Vars.unk00033c && !prop->prev) { - g_Vars.unk00033c->prev = prop; - prop->next = g_Vars.unk00033c; + if (g_Vars.list1head && g_Vars.list1head != g_Vars.list2head) { + if (prop != g_Vars.list1head && !prop->prev) { + g_Vars.list1head->prev = prop; + prop->next = g_Vars.list1head; prop->prev = NULL; - g_Vars.unk00033c = prop; + g_Vars.list1head = prop; } } else { - prop->next = g_Vars.unk000354; + prop->next = g_Vars.list2head; if (prop->next) { prop->next->prev = prop; } prop->prev = NULL; - g_Vars.unk00033c = prop; - g_Vars.unk000340 = g_Vars.unk00033c; + g_Vars.list1head = prop; + g_Vars.list1tail = g_Vars.list1head; } prop->unk3e = 0; - prop->unk3f_03 = 1; + prop->inlist1 = true; } -void func0f060538(struct prop *prop) +void propAppendToList1(struct prop *prop) { - if (g_Vars.unk000340 && g_Vars.unk000340 != g_Vars.unk000354) { - if (prop != g_Vars.unk000340 && !prop->next) { - prop->prev = g_Vars.unk000340; - prop->next = g_Vars.unk000340->next; + if (g_Vars.list1tail && g_Vars.list1tail != g_Vars.list2head) { + if (prop != g_Vars.list1tail && !prop->next) { + prop->prev = g_Vars.list1tail; + prop->next = g_Vars.list1tail->next; if (prop->next) { prop->next->prev = prop; } - g_Vars.unk000340->next = prop; - g_Vars.unk000340 = prop; + g_Vars.list1tail->next = prop; + g_Vars.list1tail = prop; } } else { - prop->next = g_Vars.unk000354; + prop->next = g_Vars.list2head; if (prop->next) { prop->next->prev = prop; } prop->prev = NULL; - g_Vars.unk00033c = prop; - g_Vars.unk000340 = g_Vars.unk00033c; + g_Vars.list1head = prop; + g_Vars.list1tail = g_Vars.list1head; } prop->unk3e = 0; - prop->unk3f_03 = 1; + prop->inlist1 = true; } -void func0f0605c4(struct prop *prop) +void propRemoveFromCurrentList(struct prop *prop) { - if (prop->unk3f_03) { - if (prop == g_Vars.unk00033c) { - g_Vars.unk00033c = prop->next; + if (prop->inlist1) { + if (prop == g_Vars.list1head) { + g_Vars.list1head = prop->next; } - if (prop == g_Vars.unk000340) { - if (g_Vars.unk00033c == g_Vars.unk000354) { - g_Vars.unk000340 = g_Vars.unk000354; + if (prop == g_Vars.list1tail) { + if (g_Vars.list1head == g_Vars.list2head) { + g_Vars.list1tail = g_Vars.list2head; } else { - g_Vars.unk000340 = prop->prev; + g_Vars.list1tail = prop->prev; } } } else { - if (prop == g_Vars.unk000354) { - if (g_Vars.unk00033c == g_Vars.unk000354) { - g_Vars.unk000340 = prop->next; - g_Vars.unk00033c = g_Vars.unk000340; + if (prop == g_Vars.list2head) { + if (g_Vars.list1head == g_Vars.list2head) { + g_Vars.list1tail = prop->next; + g_Vars.list1head = g_Vars.list1tail; } - g_Vars.unk000354 = prop->next; + g_Vars.list2head = prop->next; } } @@ -302,7 +302,7 @@ void func0f0605c4(struct prop *prop) prop->next = NULL; prop->prev = NULL; - prop->unk3f_03 = 0; + prop->inlist1 = false; prop->unk3e = 0; } @@ -2917,7 +2917,7 @@ void func0f062b64(struct prop *prop, s32 arg1) { if (arg1 == 1) { if ((prop->type == PROPTYPE_WEAPON || prop->type == PROPTYPE_OBJ) - && prop->obj && (prop->obj->hidden2 & 4)) { + && prop->obj && (prop->obj->hidden2 & OBJH2FLAG_04)) { struct defaultobj *obj = prop->obj; prop->timetoregen = 1200; @@ -2930,22 +2930,22 @@ void func0f062b64(struct prop *prop, s32 arg1) func0f065c44(prop); propHide(prop); - if (prop->unk3f_03 == 0) { - func0f062fac(prop); + if (!prop->inlist1) { + propMoveFromList2To1(prop); } } else { func0f065c44(prop); - func0f0605c4(prop); + propRemoveFromCurrentList(prop); propHide(prop); propFree(prop); } } else if (arg1 == 2) { func0f065c44(prop); - func0f0605c4(prop); + propRemoveFromCurrentList(prop); propHide(prop); } else if (arg1 == 4) { func0f065c44(prop); - func0f0605c4(prop); + propRemoveFromCurrentList(prop); propHide(prop); func0f082f88(prop); func0f06ac90(prop); @@ -3116,50 +3116,50 @@ bool currentPlayerInteract(bool eyespy) return true; } -void func0f062ef8(struct prop *prop) +void propPrependToList2(struct prop *prop) { if ((prop->flags & PROPFLAG_10) == 0) { - func0f0605c4(prop); + propRemoveFromCurrentList(prop); - if (g_Vars.unk000354) { - prop->prev = g_Vars.unk000354->prev; + if (g_Vars.list2head) { + prop->prev = g_Vars.list2head->prev; if (prop->prev) { prop->prev->next = prop; } - g_Vars.unk000354->prev = prop; - prop->next = g_Vars.unk000354; + g_Vars.list2head->prev = prop; + prop->next = g_Vars.list2head; - if (g_Vars.unk00033c == g_Vars.unk000354) { - g_Vars.unk00033c = g_Vars.unk000340 = prop; + if (g_Vars.list1head == g_Vars.list2head) { + g_Vars.list1head = g_Vars.list1tail = prop; } - g_Vars.unk000354 = prop; + g_Vars.list2head = prop; } else { prop->next = NULL; - if (g_Vars.unk000340) { - prop->prev = g_Vars.unk000340; - g_Vars.unk000340->next = prop; + if (g_Vars.list1tail) { + prop->prev = g_Vars.list1tail; + g_Vars.list1tail->next = prop; } else { - g_Vars.unk000340 = prop; - g_Vars.unk00033c = prop; + g_Vars.list1tail = prop; + g_Vars.list1head = prop; } - g_Vars.unk000354 = prop; + g_Vars.list2head = prop; } } } -void func0f062fac(struct prop *prop) +void propMoveFromList2To1(struct prop *prop) { - if (prop == g_Vars.unk000354) { - if (g_Vars.unk00033c == g_Vars.unk000354) { - g_Vars.unk00033c = g_Vars.unk000340 = prop->next; + if (prop == g_Vars.list2head) { + if (g_Vars.list1head == g_Vars.list2head) { + g_Vars.list1head = g_Vars.list1tail = prop->next; } - g_Vars.unk000354 = prop->next; + g_Vars.list2head = prop->next; } if (prop->next) { @@ -3173,7 +3173,7 @@ void func0f062fac(struct prop *prop) prop->next = NULL; prop->prev = NULL; - func0f0604bc(prop); + propPrependToList1(prop); } u32 var80069884 = 0x00000001; @@ -3738,7 +3738,7 @@ glabel func0f06302c /* f0637bc: 01b9082a */ slt $at,$t5,$t9 /* f0637c0: 5020001c */ beqzl $at,.L0f063834 /* f0637c4: 8faf0034 */ lw $t7,0x34($sp) -/* f0637c8: 0fc18bbe */ jal func0f062ef8 +/* f0637c8: 0fc18bbe */ jal propPrependToList2 /* f0637cc: 02002025 */ or $a0,$s0,$zero /* f0637d0: 10000017 */ b .L0f063830 /* f0637d4: 24060005 */ addiu $a2,$zero,0x5 @@ -3819,9 +3819,9 @@ glabel func0f06302c /* f0638dc: 35ee0080 */ ori $t6,$t7,0x80 /* f0638e0: a20e003f */ sb $t6,0x3f($s0) /* f0638e4: afa20060 */ sw $v0,0x60($sp) -/* f0638e8: 0fc18171 */ jal func0f0605c4 +/* f0638e8: 0fc18171 */ jal propRemoveFromCurrentList /* f0638ec: 02002025 */ or $a0,$s0,$zero -/* f0638f0: 0fc1814e */ jal func0f060538 +/* f0638f0: 0fc1814e */ jal propAppendToList1 /* f0638f4: 02002025 */ or $a0,$s0,$zero /* f0638f8: 8fb8004c */ lw $t8,0x4c($sp) /* f0638fc: 8fa20060 */ lw $v0,0x60($sp) diff --git a/src/game/game_097ba0.c b/src/game/game_097ba0.c index c37395c7c..233f41956 100644 --- a/src/game/game_097ba0.c +++ b/src/game/game_097ba0.c @@ -8963,7 +8963,7 @@ glabel func0f09ebcc /* f09ebec: 00808025 */ or $s0,$a0,$zero /* f09ebf0: 5220004a */ beqzl $s1,.L0f09ed1c /* f09ebf4: 8fbf001c */ lw $ra,0x1c($sp) -/* f09ebf8: 0fc1812f */ jal func0f0604bc +/* f09ebf8: 0fc1812f */ jal propPrependToList1 /* f09ebfc: 02202025 */ or $a0,$s1,$zero /* f09ec00: 0fc180bc */ jal propShow /* f09ec04: 02202025 */ or $a0,$s1,$zero diff --git a/src/game/game_0b63b0.c b/src/game/game_0b63b0.c index 1175fa539..b449d9f3a 100644 --- a/src/game/game_0b63b0.c +++ b/src/game/game_0b63b0.c @@ -280,7 +280,7 @@ void func0f0b65f8(void) func0f0b63b0(i, 1); } - prop = g_Vars.unk00033c; + prop = g_Vars.list1head; while (prop) { if (prop->type == PROPTYPE_OBJ) { @@ -1975,7 +1975,7 @@ bool currentPlayerAssumeChrForAnti(struct chrdata *hostchr, bool force) func0f020d44(hostprop, true); func0f065c44(hostprop); - func0f0605c4(hostprop); + propRemoveFromCurrentList(hostprop); propHide(hostprop); propFree(hostprop); diff --git a/src/game/game_129210.c b/src/game/game_129210.c index 97ae3ecd1..b2e1c1f16 100644 --- a/src/game/game_129210.c +++ b/src/game/game_129210.c @@ -24,7 +24,7 @@ void func0f129210(void *find, void *replacement) { u32 stack; - struct prop *prop = g_Vars.unk00033c; + struct prop *prop = g_Vars.list1head; while (prop) { if (prop->type == PROPTYPE_OBJ) { diff --git a/src/game/game_157db0.c b/src/game/game_157db0.c index e4edbabe8..95d68e53a 100644 --- a/src/game/game_157db0.c +++ b/src/game/game_157db0.c @@ -114,12 +114,12 @@ glabel func0f157db0 /* f157e40: 904c0003 */ lbu $t4,0x3($v0) /* f157e44: 566c0008 */ bnel $s3,$t4,.L0f157e68 /* f157e48: 86020002 */ lh $v0,0x2($s0) -/* f157e4c: 0fc18beb */ jal func0f062fac +/* f157e4c: 0fc18beb */ jal propMoveFromList2To1 /* f157e50: 00000000 */ nop /* f157e54: 10000004 */ b .L0f157e68 /* f157e58: 86020002 */ lh $v0,0x2($s0) .L0f157e5c: -/* f157e5c: 0fc18beb */ jal func0f062fac +/* f157e5c: 0fc18beb */ jal propMoveFromList2To1 /* f157e60: 00000000 */ nop /* f157e64: 86020002 */ lh $v0,0x2($s0) .L0f157e68: diff --git a/src/game/mplayer/options.c b/src/game/mplayer/options.c index dbbc1947c..7e80dc31b 100644 --- a/src/game/mplayer/options.c +++ b/src/game/mplayer/options.c @@ -1128,7 +1128,7 @@ glabel func0f186508 /* f186684: 0fc033b9 */ jal setupGenericObject /* f186688: a0490002 */ sb $t1,0x2($v0) /* f18668c: 8fad0018 */ lw $t5,0x18($sp) -/* f186690: 0fc1812f */ jal func0f0604bc +/* f186690: 0fc1812f */ jal propPrependToList1 /* f186694: 8da40014 */ lw $a0,0x14($t5) /* f186698: 8fb90018 */ lw $t9,0x18($sp) /* f18669c: 0fc180bc */ jal propShow diff --git a/src/game/mplayer/scenarios.c b/src/game/mplayer/scenarios.c index 9e9c4c1ec..846342d61 100644 --- a/src/game/mplayer/scenarios.c +++ b/src/game/mplayer/scenarios.c @@ -505,7 +505,7 @@ void scenarioHtbCallback10(void) g_ScenarioData.htb.token = NULL; // Check if briefcase is on the ground - prop = g_Vars.unk00033c; + prop = g_Vars.list1head; while (prop) { if (prop->type == PROPTYPE_WEAPON) { @@ -2939,7 +2939,7 @@ void scenarioHtmCallback10(void) g_ScenarioData.htm.uplink = NULL; // Check if uplink is on the ground - prop = g_Vars.unk00033c; + prop = g_Vars.list1head; while (prop) { if (prop->type == PROPTYPE_WEAPON) { diff --git a/src/game/propobj.c b/src/game/propobj.c index 777f1084c..3968d7ca3 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -2592,7 +2592,7 @@ glabel func0f06803c struct defaultobj *objFindByPadNum(s32 padnum) { - struct prop *prop = g_Vars.unk00033c; + struct prop *prop = g_Vars.list1head; while (prop) { if (prop->type == PROPTYPE_OBJ) { @@ -5981,7 +5981,7 @@ glabel func0f06ad2c /* f06b304: 8faf0064 */ lw $t7,0x64($sp) /* f06b308: 51e00008 */ beqzl $t7,.L0f06b32c /* f06b30c: 8e380014 */ lw $t8,0x14($s1) -/* f06b310: 0fc18171 */ jal func0f0605c4 +/* f06b310: 0fc18171 */ jal propRemoveFromCurrentList /* f06b314: 8e240014 */ lw $a0,0x14($s1) /* f06b318: 0fc180c0 */ jal propHide /* f06b31c: 8e240014 */ lw $a0,0x14($s1) @@ -10298,7 +10298,7 @@ glabel func0f06ef44 /* f06efa0: 37280040 */ ori $t0,$t9,0x40 /* f06efa4: 0fc19711 */ jal func0f065c44 /* f06efa8: ae080040 */ sw $t0,0x40($s0) -/* f06efac: 0fc18171 */ jal func0f0605c4 +/* f06efac: 0fc18171 */ jal propRemoveFromCurrentList /* f06efb0: 02202025 */ or $a0,$s1,$zero /* f06efb4: 0fc180c0 */ jal propHide /* f06efb8: 02202025 */ or $a0,$s1,$zero @@ -28023,7 +28023,7 @@ u32 func0f07e474(struct prop *prop) if (obj->damage == 0 && (obj->hidden2 & OBJH2FLAG_40) == 0) { if (obj->flags & OBJFLAG_00008000) { func0f065c44(prop); - func0f0605c4(prop); + propRemoveFromCurrentList(prop); obj->hidden &= ~OBJHFLAG_00000800; cmdoffset = setupGetCommandOffset(prop); @@ -28480,7 +28480,7 @@ s32 objTick(struct prop *prop) Gfx *propsRenderBulletTails(Gfx *gdl) { - struct prop *prop = g_Vars.unk00033c; + struct prop *prop = g_Vars.list1head; while (prop) { if (prop->type == PROPTYPE_CHR) { @@ -34684,7 +34684,7 @@ glabel var7f1aa978 .L0f083cb4: /* f083cb4: 0fc20be2 */ jal func0f082f88 /* f083cb8: 8fa40140 */ lw $a0,0x140($sp) -/* f083cbc: 0fc1812f */ jal func0f0604bc +/* f083cbc: 0fc1812f */ jal propPrependToList1 /* f083cc0: 8fa40140 */ lw $a0,0x140($sp) /* f083cc4: 0fc180bc */ jal propShow /* f083cc8: 8fa40140 */ lw $a0,0x140($sp) @@ -42123,7 +42123,7 @@ glabel func0f08aa70 struct weaponobj *weaponFindThrown(s32 weaponnum) { - struct prop *prop = g_Vars.unk00033c; + struct prop *prop = g_Vars.list1head; while (prop) { struct weaponobj *weapon = func0f08aa70(weaponnum, prop); diff --git a/src/game/radar.c b/src/game/radar.c index 374d651ac..5a64795cb 100644 --- a/src/game/radar.c +++ b/src/game/radar.c @@ -396,7 +396,7 @@ Gfx *radarRender(Gfx *gdl) Gfx *radarRenderRTrackedProps(Gfx *gdl) { - struct prop *prop = g_Vars.unk00033c; + struct prop *prop = g_Vars.list1head; struct coord *playerpos = &g_Vars.currentplayer->prop->pos; struct defaultobj *obj; struct chrdata *chr; diff --git a/src/game/smoke/free.c b/src/game/smoke/free.c index a7aff4ea2..9fe527d9d 100644 --- a/src/game/smoke/free.c +++ b/src/game/smoke/free.c @@ -18,7 +18,7 @@ void smokeFree(void) if (g_Smokes) { for (i = 0; i < g_MaxSmokes; i++) { if (g_Smokes[i].prop) { - func0f0605c4(g_Smokes[i].prop); + propRemoveFromCurrentList(g_Smokes[i].prop); propHide(g_Smokes[i].prop); propFree(g_Smokes[i].prop); diff --git a/src/game/smoke/smoke.c b/src/game/smoke/smoke.c index 20b235c6f..2941cb617 100644 --- a/src/game/smoke/smoke.c +++ b/src/game/smoke/smoke.c @@ -1163,7 +1163,7 @@ glabel smokeCreate .L0f12e3f8: /* f12e3f8: 02397021 */ addu $t6,$s1,$t9 /* f12e3fc: a5c60028 */ sh $a2,0x28($t6) -/* f12e400: 0fc1814e */ jal func0f060538 +/* f12e400: 0fc1814e */ jal propAppendToList1 /* f12e404: 02202025 */ or $a0,$s1,$zero /* f12e408: 0fc180bc */ jal propShow /* f12e40c: 02202025 */ or $a0,$s1,$zero @@ -1245,7 +1245,7 @@ glabel smokeCreate // } // // prop->rooms[i] = -1; -// func0f060538(prop); +// propAppendToList1(prop); // propShow(prop); // // smoke->prop = prop; diff --git a/src/include/game/game_0601b0.h b/src/include/game/game_0601b0.h index 1e5ad0b30..27b84d663 100644 --- a/src/include/game/game_0601b0.h +++ b/src/include/game/game_0601b0.h @@ -10,9 +10,9 @@ void propShow(struct prop *prop); void propHide(struct prop *prop); struct prop *propAllocate(void); void propFree(struct prop *prop); -void func0f0604bc(struct prop *prop); -void func0f060538(struct prop *prop); -void func0f0605c4(struct prop *prop); +void propPrependToList1(struct prop *prop); +void propAppendToList1(struct prop *prop); +void propRemoveFromCurrentList(struct prop *prop); void propReparent(struct prop *mover, struct prop *adopter); void propDetach(struct prop *prop); Gfx *propRender(Gfx *gdl, struct prop *prop, bool withalpha); @@ -30,8 +30,8 @@ void func0f062b64(struct prop *prop, s32 arg1); struct prop *currentPlayerFindPropForInteract(bool eyespy); u32 func0f062dd0(void); bool currentPlayerInteract(bool eyespy); -void func0f062ef8(struct prop *prop); -void func0f062fac(struct prop *prop); +void propPrependToList2(struct prop *prop); +void propMoveFromList2To1(struct prop *prop); void func0f06302c(ubool arg0); void func0f063dcc(void); void func0f064178(struct prop *prop, s32 enable); diff --git a/src/include/gvars/gvars.h b/src/include/gvars/gvars.h index 8a7cfd7a0..bfa6adecc 100644 --- a/src/include/gvars/gvars.h +++ b/src/include/gvars/gvars.h @@ -88,13 +88,13 @@ struct g_vars { /*000330*/ u32 unk000330; /*000334*/ s32 maxprops; /*000338*/ struct prop *props; // pointer to array - /*00033c*/ struct prop *unk00033c; - /*000340*/ struct prop *unk000340; + /*00033c*/ struct prop *list1head; + /*000340*/ struct prop *list1tail; // next pointer points to list2head /*000344*/ struct prop *freeprops; /*000348*/ struct prop **tangibleprops; /*00034c*/ struct prop **unk00034c; /*000350*/ struct prop *unk000350; - /*000354*/ struct prop *unk000354; + /*000354*/ struct prop *list2head; // prev pointer points to list1tail /*000358*/ u8 numpropstateindexes; /*000359*/ u8 nextpropstateindex; /*00035a*/ u8 unk00035a; diff --git a/src/include/types.h b/src/include/types.h index b3d4cc5d6..e55dca35c 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -74,7 +74,7 @@ struct prop { /*0x3f*/ u8 unk3f_00 : 1; /*0x3f*/ u8 unk3f_01 : 1; /*0x3f*/ u8 unk3f_02 : 1; - /*0x3f*/ u8 unk3f_03 : 1; + /*0x3f*/ u8 inlist1 : 1; /*0x3f*/ u8 unk3f_04 : 1; /*0x3f*/ u8 unk3f_05 : 1; /*0x3f*/ u8 unk3f_06 : 1;