diff --git a/src/game/game_179060.c b/src/game/game_179060.c index 39ecc5dce..ec0e54c4d 100644 --- a/src/game/game_179060.c +++ b/src/game/game_179060.c @@ -7217,7 +7217,7 @@ void scenarioHtbKill(struct mpchr *mpchr, s32 arg1, s32 *score, s32 *arg3) *arg3 = mpchr->unk3c; } -s32 scenarioHtbRadar(s32 value) +Gfx *scenarioHtbRadar(Gfx *gdl) { if ((g_MpSetup.options & MPOPTION_SHOWONRADAR1) && g_ScenarioData.htb.token != NULL && @@ -7227,13 +7227,13 @@ s32 scenarioHtbRadar(s32 value) dist.x = g_ScenarioData.htb.pos.x - g_Vars.currentplayer->prop->pos.x; dist.y = g_ScenarioData.htb.pos.y - g_Vars.currentplayer->prop->pos.y; dist.z = g_ScenarioData.htb.pos.z - g_Vars.currentplayer->prop->pos.z; - value = func0f18e9ec(value, g_ScenarioData.htb.token, &dist, 0xff0000, 0, 1); + gdl = radarDrawDot(gdl, g_ScenarioData.htb.token, &dist, 0xff0000, 0, 1); } - return value; + return gdl; } -bool scenarioHtbRadar2(s32 *displaylist, struct prop *prop) +bool scenarioHtbRadar2(Gfx **gdl, struct prop *prop) { if ((g_MpSetup.options & MPOPTION_SHOWONRADAR1) && g_ScenarioData.htb.token && @@ -7246,9 +7246,9 @@ bool scenarioHtbRadar2(s32 *displaylist, struct prop *prop) if (g_MpSetup.options & MPOPTION_TEAMSENABLED) { u32 colour = g_TeamColours[teamGetIndex(prop->chr->team)]; - *displaylist = func0f18e9ec(*displaylist, g_ScenarioData.htb.token, &dist, colour, 0, 1); + *gdl = radarDrawDot(*gdl, g_ScenarioData.htb.token, &dist, colour, 0, 1); } else { - *displaylist = func0f18e9ec(*displaylist, g_ScenarioData.htb.token, &dist, 0xff0000, 0, 1); + *gdl = radarDrawDot(*gdl, g_ScenarioData.htb.token, &dist, 0xff0000, 0, 1); } return true; @@ -7749,7 +7749,7 @@ void scenarioCtcKill(struct mpchr *mpchr, s32 arg1, s32 *score, s32 *arg3) *arg3 = mpchr->unk3c; } -s32 scenarioCtcRadar(s32 value) +Gfx *scenarioCtcRadar(Gfx *gdl) { if (g_MpSetup.options & MPOPTION_SHOWONRADAR2) { s32 i; @@ -7762,15 +7762,15 @@ s32 scenarioCtcRadar(s32 value) dist.x = g_ScenarioData.ctc.tokens[i]->pos.x - g_Vars.currentplayer->prop->pos.x; dist.y = g_ScenarioData.ctc.tokens[i]->pos.y - g_Vars.currentplayer->prop->pos.y; dist.z = g_ScenarioData.ctc.tokens[i]->pos.z - g_Vars.currentplayer->prop->pos.z; - value = func0f18e9ec(value, g_ScenarioData.ctc.tokens[i], &dist, g_TeamColours[i], 0, 1); + gdl = radarDrawDot(gdl, g_ScenarioData.ctc.tokens[i], &dist, g_TeamColours[i], 0, 1); } } } - return value; + return gdl; } -bool scenarioCtcRadar2(s32 *displaylist, struct prop *prop) +bool scenarioCtcRadar2(Gfx **gdl, struct prop *prop) { s32 i; @@ -7783,7 +7783,7 @@ bool scenarioCtcRadar2(s32 *displaylist, struct prop *prop) dist.x = g_ScenarioData.ctc.tokens[i]->pos.x - g_Vars.currentplayer->prop->pos.x; dist.y = g_ScenarioData.ctc.tokens[i]->pos.y - g_Vars.currentplayer->prop->pos.y; dist.z = g_ScenarioData.ctc.tokens[i]->pos.z - g_Vars.currentplayer->prop->pos.z; - *displaylist = func0f18e9ec(*displaylist, g_ScenarioData.ctc.tokens[i], &dist, + *gdl = radarDrawDot(*gdl, g_ScenarioData.ctc.tokens[i], &dist, g_TeamColours[i], colour, 1); return true; } @@ -8967,7 +8967,7 @@ void scenarioKohKill(struct mpchr *mpchr, s32 arg1, s32 *score, s32 *arg3) *arg3 = mpchr->unk3c; } -s32 scenarioKohRadar(s32 value) +Gfx *scenarioKohRadar(Gfx *gdl) { if (g_MpSetup.options & MPOPTION_HILLONRADAR && g_ScenarioData.koh.unk08 == 0) { struct coord dist; @@ -8982,10 +8982,10 @@ s32 scenarioKohRadar(s32 value) colour = g_TeamColours[g_ScenarioData.koh.occupiedteam]; } - value = func0f18e9ec(value, NULL, &dist, colour, 0, 1); + gdl = radarDrawDot(gdl, NULL, &dist, colour, 0, 1); } - return value; + return gdl; } GLOBAL_ASM( @@ -10137,7 +10137,7 @@ glabel scenarioHtmRadar /* f183dcc: afae0014 */ sw $t6,0x14($sp) /* f183dd0: afa00010 */ sw $zero,0x10($sp) /* f183dd4: 46062201 */ sub.s $f8,$f4,$f6 -/* f183dd8: 0fc63a7b */ jal func0f18e9ec +/* f183dd8: 0fc63a7b */ jal radarDrawDot /* f183ddc: e7a800a0 */ swc1 $f8,0xa0($sp) /* f183de0: 00408825 */ or $s1,$v0,$zero .L0f183de4: @@ -10415,7 +10415,7 @@ glabel scenarioHtmRadar /* f1841bc: afb90014 */ sw $t9,0x14($sp) /* f1841c0: 01eb3825 */ or $a3,$t7,$t3 /* f1841c4: 8e050080 */ lw $a1,0x80($s0) -/* f1841c8: 0fc63a7b */ jal func0f18e9ec +/* f1841c8: 0fc63a7b */ jal radarDrawDot /* f1841cc: afa00010 */ sw $zero,0x10($sp) /* f1841d0: 00408825 */ or $s1,$v0,$zero /* f1841d4: 2610000c */ addiu $s0,$s0,0xc @@ -10439,7 +10439,7 @@ glabel scenarioHtmRadar /* f184214: 27bd00a8 */ addiu $sp,$sp,0xa8 ); -bool scenarioHtmRadar2(s32 *displaylist, struct prop *prop) +bool scenarioHtmRadar2(Gfx **gdl, struct prop *prop) { if ((g_MpSetup.options & MPOPTION_SHOWONRADAR3) && g_ScenarioData.htm.uplink) { if (prop == g_ScenarioData.htm.uplink && @@ -10451,9 +10451,9 @@ bool scenarioHtmRadar2(s32 *displaylist, struct prop *prop) if (g_MpSetup.options & MPOPTION_TEAMSENABLED) { u32 colour = g_TeamColours[teamGetIndex(prop->chr->team)]; - *displaylist = func0f18e9ec(*displaylist, g_ScenarioData.htm.uplink, &dist, colour, 0, 1); + *gdl = radarDrawDot(*gdl, g_ScenarioData.htm.uplink, &dist, colour, 0, 1); } else { - *displaylist = func0f18e9ec(*displaylist, g_ScenarioData.htm.uplink, &dist, 0xff0000, 0, 1); + *gdl = radarDrawDot(*gdl, g_ScenarioData.htm.uplink, &dist, 0xff0000, 0, 1); } return true; @@ -11202,9 +11202,9 @@ void scenarioPacKill(struct mpchr *mpchr, s32 arg1, s32 *score, s32 *arg3) *arg3 = mpchr->unk3c; } -s32 scenarioPacRadar(s32 value) +Gfx *scenarioPacRadar(Gfx *gdl) { - return value; + return gdl; } GLOBAL_ASM( @@ -11266,7 +11266,7 @@ glabel scenarioPacRadar2 /* f184e64: afa80014 */ sw $t0,0x14($sp) /* f184e68: afa00010 */ sw $zero,0x10($sp) /* f184e6c: 8fa50034 */ lw $a1,0x34($sp) -/* f184e70: 0fc63a7b */ jal func0f18e9ec +/* f184e70: 0fc63a7b */ jal radarDrawDot /* f184e74: 27a60038 */ addiu $a2,$sp,0x38 /* f184e78: 8fa90048 */ lw $t1,0x48($sp) /* f184e7c: ad220000 */ sw $v0,0x0($t1) @@ -11276,7 +11276,7 @@ glabel scenarioPacRadar2 /* f184e88: 8d440000 */ lw $a0,0x0($t2) /* f184e8c: afab0014 */ sw $t3,0x14($sp) /* f184e90: afa00010 */ sw $zero,0x10($sp) -/* f184e94: 0fc63a7b */ jal func0f18e9ec +/* f184e94: 0fc63a7b */ jal radarDrawDot /* f184e98: 8fa50034 */ lw $a1,0x34($sp) /* f184e9c: 8fac0048 */ lw $t4,0x48($sp) /* f184ea0: ad820000 */ sw $v0,0x0($t4) @@ -11293,7 +11293,7 @@ glabel scenarioPacRadar2 // Mismatch because the game jumps to pac properties directly // while decomp loads the base pac address then uses offsets. -//bool scenarioPacRadar2(s32 *displaylist, struct prop *prop) +//bool scenarioPacRadar2(Gfx **gdl, struct prop *prop) //{ // if ((g_MpSetup.options & MPOPTION_SHOWONRADAR4) && g_ScenarioData.pac.victimindex >= 0) { // s32 index = g_ScenarioData.pac.victimindex; @@ -11307,9 +11307,9 @@ glabel scenarioPacRadar2 // // if (g_MpSetup.options & MPOPTION_TEAMSENABLED) { // u32 colour = g_TeamColours[teamGetIndex(prop->chr->team)]; -// *displaylist = func0f18e9ec(*displaylist, thing, &dist, colour, 0, 1); +// *gdl = radarDrawDot(*gdl, thing, &dist, colour, 0, 1); // } else { -// *displaylist = func0f18e9ec(*displaylist, thing, &dist, 0xff0000, 0, 1); +// *gdl = radarDrawDot(*gdl, thing, &dist, 0xff0000, 0, 1); // } // // return true; @@ -12237,19 +12237,19 @@ glabel func0f185c14 /* f185d5c: 27bd0020 */ addiu $sp,$sp,0x20 ); -s32 scenarioRadar(s32 value) +Gfx *scenarioRadar(Gfx *gdl) { if (g_Vars.normmplayerisrunning && g_MpScenarios[g_MpSetup.scenario].radarfunc) { - return g_MpScenarios[g_MpSetup.scenario].radarfunc(value); + return g_MpScenarios[g_MpSetup.scenario].radarfunc(gdl); } - return value; + return gdl; } -bool scenarioRadar2(s32 *displaylist, struct prop *prop) +bool scenarioRadar2(Gfx **gdl, struct prop *prop) { if (g_Vars.normmplayerisrunning && g_MpScenarios[g_MpSetup.scenario].radar2func) { - return g_MpScenarios[g_MpSetup.scenario].radar2func(displaylist, prop); + return g_MpScenarios[g_MpSetup.scenario].radar2func(gdl, prop); } return false; diff --git a/src/game/game_187770.c b/src/game/game_187770.c index 9cb5ffdf6..e37a80d72 100644 --- a/src/game/game_187770.c +++ b/src/game/game_187770.c @@ -8418,7 +8418,7 @@ glabel teamGetIndex ); GLOBAL_ASM( -glabel func0f18e9ec +glabel radarDrawDot /* f18e9ec: 27bdff20 */ addiu $sp,$sp,-224 /* f18e9f0: afbf0034 */ sw $ra,0x34($sp) /* f18e9f4: afb60030 */ sw $s6,0x30($sp) @@ -9695,7 +9695,7 @@ glabel func0f18f874 .L0f18fd24: /* f18fd24: 8c4500bc */ lw $a1,0xbc($v0) /* f18fd28: afa00014 */ sw $zero,0x14($sp) -/* f18fd2c: 0fc63a7b */ jal func0f18e9ec +/* f18fd2c: 0fc63a7b */ jal radarDrawDot /* f18fd30: afa00010 */ sw $zero,0x10($sp) /* f18fd34: afa20088 */ sw $v0,0x88($sp) .L0f18fd38: @@ -9756,7 +9756,7 @@ glabel func0f18f874 /* f18fe04: afa00014 */ sw $zero,0x14($sp) /* f18fe08: 46105481 */ sub.s $f18,$f10,$f16 /* f18fe0c: afa00010 */ sw $zero,0x10($sp) -/* f18fe10: 0fc63a7b */ jal func0f18e9ec +/* f18fe10: 0fc63a7b */ jal radarDrawDot /* f18fe14: e7b20070 */ swc1 $f18,0x70($sp) /* f18fe18: 8fa9003c */ lw $t1,0x3c($sp) /* f18fe1c: afa20088 */ sw $v0,0x88($sp) @@ -9835,7 +9835,7 @@ glabel func0f18f874 /* f18ff2c: afa00014 */ sw $zero,0x14($sp) /* f18ff30: afa00010 */ sw $zero,0x10($sp) /* f18ff34: 8fa40088 */ lw $a0,0x88($sp) -/* f18ff38: 0fc63a7b */ jal func0f18e9ec +/* f18ff38: 0fc63a7b */ jal radarDrawDot /* f18ff3c: 27a60068 */ addiu $a2,$sp,0x68 /* f18ff40: afa20088 */ sw $v0,0x88($sp) .L0f18ff44: @@ -9858,7 +9858,7 @@ glabel func0f18f874 /* f18ff80: 31f90010 */ andi $t9,$t7,0x10 /* f18ff84: 53200006 */ beqzl $t9,.L0f18ffa0 /* f18ff88: 27a40088 */ addiu $a0,$sp,0x88 -/* f18ff8c: 0fc64018 */ jal func0f190060 +/* f18ff8c: 0fc64018 */ jal radarDrawProps /* f18ff90: 00402025 */ or $a0,$v0,$zero /* f18ff94: afa20088 */ sw $v0,0x88($sp) /* f18ff98: 8e480284 */ lw $t0,0x284($s2) @@ -9901,7 +9901,7 @@ glabel func0f18f874 /* f190020: 27a60068 */ addiu $a2,$sp,0x68 /* f190024: 8d6500bc */ lw $a1,0xbc($t3) /* f190028: afa00014 */ sw $zero,0x14($sp) -/* f19002c: 0fc63a7b */ jal func0f18e9ec +/* f19002c: 0fc63a7b */ jal radarDrawDot /* f190030: afa00010 */ sw $zero,0x10($sp) /* f190034: afa20088 */ sw $v0,0x88($sp) /* f190038: 240c0001 */ addiu $t4,$zero,0x1 @@ -9918,142 +9918,52 @@ glabel func0f18f874 /* f19005c: 27bd0088 */ addiu $sp,$sp,0x88 ); -GLOBAL_ASM( -glabel func0f190060 -/* f190060: 27bdff80 */ addiu $sp,$sp,-128 -/* f190064: 3c02800a */ lui $v0,%hi(g_Vars) -/* f190068: 24429fc0 */ addiu $v0,$v0,%lo(g_Vars) -/* f19006c: 8c4e0284 */ lw $t6,0x284($v0) -/* f190070: afb00020 */ sw $s0,0x20($sp) -/* f190074: 8c50033c */ lw $s0,0x33c($v0) -/* f190078: afbf0044 */ sw $ra,0x44($sp) -/* f19007c: afbe0040 */ sw $s8,0x40($sp) -/* f190080: afb7003c */ sw $s7,0x3c($sp) -/* f190084: afb60038 */ sw $s6,0x38($sp) -/* f190088: afb50034 */ sw $s5,0x34($sp) -/* f19008c: afb40030 */ sw $s4,0x30($sp) -/* f190090: afb3002c */ sw $s3,0x2c($sp) -/* f190094: afb20028 */ sw $s2,0x28($sp) -/* f190098: afb10024 */ sw $s1,0x24($sp) -/* f19009c: 8dd200bc */ lw $s2,0xbc($t6) -/* f1900a0: 00809825 */ or $s3,$a0,$zero -/* f1900a4: 1200005f */ beqz $s0,.L0f190224 -/* f1900a8: 26520008 */ addiu $s2,$s2,0x8 -/* f1900ac: 3c1effff */ lui $s8,0xffff -/* f1900b0: 24170003 */ addiu $s7,$zero,0x3 -/* f1900b4: 24160002 */ addiu $s6,$zero,0x2 -/* f1900b8: 24150001 */ addiu $s5,$zero,0x1 -/* f1900bc: 24140004 */ addiu $s4,$zero,0x4 -/* f1900c0: 92070000 */ lbu $a3,0x0($s0) -.L0f1900c4: -/* f1900c4: 50f50008 */ beql $a3,$s5,.L0f1900e8 -/* f1900c8: 8e110004 */ lw $s1,0x4($s0) -/* f1900cc: 50f60006 */ beql $a3,$s6,.L0f1900e8 -/* f1900d0: 8e110004 */ lw $s1,0x4($s0) -/* f1900d4: 50f7002c */ beql $a3,$s7,.L0f190188 -/* f1900d8: 8e020004 */ lw $v0,0x4($s0) -/* f1900dc: 54f4004f */ bnel $a3,$s4,.L0f19021c -/* f1900e0: 8e100020 */ lw $s0,0x20($s0) -/* f1900e4: 8e110004 */ lw $s1,0x4($s0) -.L0f1900e8: -/* f1900e8: 8e2f0010 */ lw $t7,0x10($s1) -/* f1900ec: 31f80040 */ andi $t8,$t7,0x40 -/* f1900f0: 5700000a */ bnezl $t8,.L0f19011c -/* f1900f4: c6040008 */ lwc1 $f4,0x8($s0) -/* f1900f8: 0fc41b99 */ jal cheatIsActive -/* f1900fc: 2404001a */ addiu $a0,$zero,0x1a -/* f190100: 50400046 */ beqzl $v0,.L0f19021c -/* f190104: 8e100020 */ lw $s0,0x20($s0) -/* f190108: 8e390010 */ lw $t9,0x10($s1) -/* f19010c: 33280800 */ andi $t0,$t9,0x800 -/* f190110: 51000042 */ beqzl $t0,.L0f19021c -/* f190114: 8e100020 */ lw $s0,0x20($s0) -/* f190118: c6040008 */ lwc1 $f4,0x8($s0) -.L0f19011c: -/* f19011c: c6460000 */ lwc1 $f6,0x0($s2) -/* f190120: 02602025 */ or $a0,$s3,$zero -/* f190124: 02002825 */ or $a1,$s0,$zero -/* f190128: 46062201 */ sub.s $f8,$f4,$f6 -/* f19012c: 27a60060 */ addiu $a2,$sp,0x60 -/* f190130: 3407ff00 */ dli $a3,0xff00 -/* f190134: e7a80060 */ swc1 $f8,0x60($sp) -/* f190138: c6500004 */ lwc1 $f16,0x4($s2) -/* f19013c: c60a000c */ lwc1 $f10,0xc($s0) -/* f190140: 46105481 */ sub.s $f18,$f10,$f16 -/* f190144: e7b20064 */ swc1 $f18,0x64($sp) -/* f190148: c6460008 */ lwc1 $f6,0x8($s2) -/* f19014c: c6040010 */ lwc1 $f4,0x10($s0) -/* f190150: 46062201 */ sub.s $f8,$f4,$f6 -/* f190154: e7a80068 */ swc1 $f8,0x68($sp) -/* f190158: 8e290010 */ lw $t1,0x10($s1) -/* f19015c: 312a0040 */ andi $t2,$t1,0x40 -/* f190160: 11400003 */ beqz $t2,.L0f190170 -/* f190164: 00000000 */ sll $zero,$zero,0x0 -/* f190168: 10000001 */ beqz $zero,.L0f190170 -/* f19016c: 03c03825 */ or $a3,$s8,$zero -.L0f190170: -/* f190170: afa00010 */ sw $zero,0x10($sp) -/* f190174: 0fc63a7b */ jal func0f18e9ec -/* f190178: afa00014 */ sw $zero,0x14($sp) -/* f19017c: 10000026 */ beqz $zero,.L0f190218 -/* f190180: 00409825 */ or $s3,$v0,$zero -/* f190184: 8e020004 */ lw $v0,0x4($s0) -.L0f190188: -/* f190188: 50400024 */ beqzl $v0,.L0f19021c -/* f19018c: 8e100020 */ lw $s0,0x20($s0) -/* f190190: 8c4b032c */ lw $t3,0x32c($v0) -/* f190194: 000b6d00 */ sll $t5,$t3,0x14 -/* f190198: 05a30020 */ bgezl $t5,.L0f19021c -/* f19019c: 8e100020 */ lw $s0,0x20($s0) -/* f1901a0: 80430007 */ lb $v1,0x7($v0) -/* f1901a4: 24010005 */ addiu $at,$zero,0x5 -/* f1901a8: 5283001c */ beql $s4,$v1,.L0f19021c -/* f1901ac: 8e100020 */ lw $s0,0x20($s0) -/* f1901b0: 5061001a */ beql $v1,$at,.L0f19021c -/* f1901b4: 8e100020 */ lw $s0,0x20($s0) -/* f1901b8: 8c4e0014 */ lw $t6,0x14($v0) -/* f1901bc: 000e7880 */ sll $t7,$t6,0x2 -/* f1901c0: 05e20016 */ bltzl $t7,.L0f19021c -/* f1901c4: 8e100020 */ lw $s0,0x20($s0) -/* f1901c8: c60a0008 */ lwc1 $f10,0x8($s0) -/* f1901cc: c6500000 */ lwc1 $f16,0x0($s2) -/* f1901d0: 02602025 */ or $a0,$s3,$zero -/* f1901d4: 02002825 */ or $a1,$s0,$zero -/* f1901d8: 46105481 */ sub.s $f18,$f10,$f16 -/* f1901dc: 27a60050 */ addiu $a2,$sp,0x50 -/* f1901e0: 3c07ff00 */ lui $a3,0xff00 -/* f1901e4: e7b20050 */ swc1 $f18,0x50($sp) -/* f1901e8: c6460004 */ lwc1 $f6,0x4($s2) -/* f1901ec: c604000c */ lwc1 $f4,0xc($s0) -/* f1901f0: 46062201 */ sub.s $f8,$f4,$f6 -/* f1901f4: e7a80054 */ swc1 $f8,0x54($sp) -/* f1901f8: c6500008 */ lwc1 $f16,0x8($s2) -/* f1901fc: c60a0010 */ lwc1 $f10,0x10($s0) -/* f190200: afa00014 */ sw $zero,0x14($sp) -/* f190204: afa00010 */ sw $zero,0x10($sp) -/* f190208: 46105481 */ sub.s $f18,$f10,$f16 -/* f19020c: 0fc63a7b */ jal func0f18e9ec -/* f190210: e7b20058 */ swc1 $f18,0x58($sp) -/* f190214: 00409825 */ or $s3,$v0,$zero -.L0f190218: -/* f190218: 8e100020 */ lw $s0,0x20($s0) -.L0f19021c: -/* f19021c: 5600ffa9 */ bnezl $s0,.L0f1900c4 -/* f190220: 92070000 */ lbu $a3,0x0($s0) -.L0f190224: -/* f190224: 8fbf0044 */ lw $ra,0x44($sp) -/* f190228: 02601025 */ or $v0,$s3,$zero -/* f19022c: 8fb3002c */ lw $s3,0x2c($sp) -/* f190230: 8fb00020 */ lw $s0,0x20($sp) -/* f190234: 8fb10024 */ lw $s1,0x24($sp) -/* f190238: 8fb20028 */ lw $s2,0x28($sp) -/* f19023c: 8fb40030 */ lw $s4,0x30($sp) -/* f190240: 8fb50034 */ lw $s5,0x34($sp) -/* f190244: 8fb60038 */ lw $s6,0x38($sp) -/* f190248: 8fb7003c */ lw $s7,0x3c($sp) -/* f19024c: 8fbe0040 */ lw $s8,0x40($sp) -/* f190250: 03e00008 */ jr $ra -/* f190254: 27bd0080 */ addiu $sp,$sp,0x80 -/* f190258: 00000000 */ sll $zero,$zero,0x0 -/* f19025c: 00000000 */ sll $zero,$zero,0x0 -); +Gfx *radarDrawProps(Gfx *gdl) +{ + struct prop *prop = g_Vars.unk00033c; + struct coord *playerpos = &g_Vars.currentplayer->prop->pos; + struct defaultobj *obj; + struct chrdata *chr; + u32 stack1; + struct coord dist1; + u32 stack2; + struct coord dist2; + + while (prop) { + switch (prop->type) { + case PROPTYPE_OBJ: + case PROPTYPE_DOOR: + case PROPTYPE_WEAPON: + obj = prop->obj; + + if ((obj->flags3 & OBJFLAG3_RTRACKED_YELLOW) || + (cheatIsActive(CHEAT_RTRACKER) && (obj->flags3 & OBJFLAG3_RTRACKED_BLUE))) { + dist1.x = prop->pos.x - playerpos->x; + dist1.y = prop->pos.y - playerpos->y; + dist1.z = prop->pos.z - playerpos->z; + + gdl = radarDrawDot(gdl, prop, &dist1, + (obj->flags3 & OBJFLAG3_RTRACKED_YELLOW) ? 0xffff0000 : 0x0000ff00, + 0, 0); + } + break; + case PROPTYPE_CHR: + chr = prop->chr; + + if (chr && chr->unk32c_20 + && chr->actiontype != ACT_DIE + && chr->actiontype != ACT_DEAD + && (chr->hidden & CHRHFLAG_CLOAKED) == 0) { + dist2.x = prop->pos.x - playerpos->x; + dist2.y = prop->pos.y - playerpos->y; + dist2.z = prop->pos.z - playerpos->z; + gdl = radarDrawDot(gdl, prop, &dist2, 0xff000000, 0, 0); + } + break; + } + + prop = prop->next; + } + + return gdl; +} diff --git a/src/include/game/game_179060.h b/src/include/game/game_179060.h index 184ffa0ec..ea8a82125 100644 --- a/src/include/game/game_179060.h +++ b/src/include/game/game_179060.h @@ -91,14 +91,14 @@ void func0f182c98(void); void scenarioHtmReset(void); void scenarioHtmCallback14(struct chrdata *chr); u32 scenarioHtmCallback18(void); -s32 scenarioHtmRadar(s32 value); +Gfx *scenarioHtmRadar(Gfx *gdl); void scenarioPacChooseVictims(void); bool scenarioPacHighlight(struct prop *prop, u32 *colour); void func0f1845bc(void); u32 func0f1847b8(void); void scenarioPacCallback10(void); u32 scenarioPacCallback18(void); -bool scenarioPacRadar2(s32 *displaylist, struct prop *prop); +bool scenarioPacRadar2(Gfx **gdl, struct prop *prop); s32 menudialog00184ec0(u32, u32, u32 *); u32 func0f184fb0(void); u32 func0f18500c(void); @@ -182,16 +182,16 @@ void scenarioHtbReset(void); void scenarioHtbCallback10(void); void scenarioHtbCallback14(struct chrdata *chr); void scenarioHtbKill(struct mpchr *mpchr, s32 arg1, s32 *score, s32 *arg3); -s32 scenarioHtbRadar(s32 value); -bool scenarioHtbRadar2(s32 *displaylist, struct prop *prop); +Gfx *scenarioHtbRadar(Gfx *gdl); +bool scenarioHtbRadar2(Gfx **gdl, struct prop *prop); bool scenarioHtbHighlight(struct prop *prop, u32 *colour); void scenarioCtcInit(void); s32 scenarioCtcCallback08(void); void scenarioCtcCallback10(void); void scenarioCtcCallback14(); void scenarioCtcKill(struct mpchr *mpchr, s32 arg1, s32 *score, s32 *arg3); -s32 scenarioCtcRadar(s32 value); -bool scenarioCtcRadar2(s32 *displaylist, struct prop *prop); +Gfx *scenarioCtcRadar(Gfx *gdl); +bool scenarioCtcRadar2(Gfx **gdl, struct prop *prop); bool scenarioCtcCallback2c(f32 arg0, struct coord *pos, s16 *arg2, struct prop *prop, f32 *arg4); s32 scenarioCtcGetMaxTeams(void); bool scenarioCtcIsRoomHighlighted(s16 room); @@ -201,18 +201,18 @@ void scenarioKohCallback44(s32 *arg0); void scenarioKohInit(void); void scenarioKohReset(void); void scenarioKohKill(struct mpchr *mpchr, s32 arg1, s32 *score, s32 *arg3); -s32 scenarioKohRadar(s32 value); +Gfx *scenarioKohRadar(Gfx *gdl); bool scenarioKohIsRoomHighlighted(s16 arg0); void scenarioHtmInit(void); s32 scenarioHtmCallback08(void); void scenarioHtmCallback10(void); void scenarioHtmKill(struct mpchr *mpchr, s32 arg1, s32 *score, s32 *arg3); -bool scenarioHtmRadar2(s32 *displaylist, struct prop *prop); +bool scenarioHtmRadar2(Gfx **gdl, struct prop *prop); bool scenarioHtmHighlight(struct prop *prop, u32 *colour); void scenarioPacInit(void); void scenarioPacReset(void); void scenarioPacKill(struct mpchr *mpchr, s32 arg1, s32 *score, s32 *arg3); -s32 scenarioPacRadar(s32 value); +Gfx *scenarioPacRadar(Gfx *gdl); s32 menuhandlerMpOpenOptions(u32 operation, struct menu_item *item, s32 *value); void scenarioCallback40(s32 *arg0); void scenarioCallback44(s32 *arg0); @@ -221,8 +221,8 @@ s32 scenarioCallback08(void); void scenarioReset(void); void scenarioCallback10(void); void scenarioCallback14(struct chrdata *chr); -s32 scenarioRadar(s32 value); -bool scenarioRadar2(s32 *displaylist, struct prop *prop); +Gfx *scenarioRadar(Gfx *gdl); +bool scenarioRadar2(Gfx **gdl, struct prop *prop); f32 scenarioCallback2c(f32 arg0, struct coord *pos, s16 *arg2, struct prop *prop); s32 scenarioGetMaxTeams(void); void scenarioCallback38(s16 arg0, s32 *arg1, s32 *arg2, s32 *arg3); diff --git a/src/include/game/game_187770.h b/src/include/game/game_187770.h index 4f0d8d286..8d9152f2c 100644 --- a/src/include/game/game_187770.h +++ b/src/include/game/game_187770.h @@ -118,8 +118,8 @@ void func0f18e558(void); u32 func0f18e57c(void); u32 func0f18e5ac(void); s32 teamGetIndex(s32 team); -s32 func0f18e9ec(s32 arg0, struct prop *token, struct coord *dist, s32 colour, s32 arg4, s32 arg5); +Gfx *radarDrawDot(Gfx *gdl, struct prop *prop, struct coord *dist, u32 colour, s32 arg4, s32 arg5); u32 func0f18f874(void); -u32 func0f190060(void); +Gfx *radarDrawProps(Gfx *gdl); #endif diff --git a/src/include/types.h b/src/include/types.h index fd8d0463a..ac130c7c2 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -4418,8 +4418,8 @@ struct mpscenario { void (*unk14)(struct chrdata *chr); void *unk18; void (*killfunc)(struct mpchr *mpchr, s32 arg1, s32 *score, s32 *arg3); - s32 (*radarfunc)(s32 value); - bool (*radar2func)(s32 *displaylist, struct prop *prop); + Gfx *(*radarfunc)(Gfx *gdl); + bool (*radar2func)(Gfx **gdl, struct prop *prop); bool (*highlightfunc)(struct prop *prop, u32 *colour); bool (*unk2c)(f32 arg0, struct coord *pos, s16 *arg2, struct prop *prop, f32 *arg4); s32 (*maxteamsfunc)(void);