From cdf095f88149f440935e892ce3691f377f4014e1 Mon Sep 17 00:00:00 2001 From: Niko Date: Fri, 24 Mar 2023 15:13:34 -0400 Subject: [PATCH] Faradise UI_Map_DrawDrivers --- .../decompile/General/UI/UI_Map_DrawDrivers.c | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 psx-modding-toolchain/games/CrashTeamRacing/decompile/General/UI/UI_Map_DrawDrivers.c diff --git a/psx-modding-toolchain/games/CrashTeamRacing/decompile/General/UI/UI_Map_DrawDrivers.c b/psx-modding-toolchain/games/CrashTeamRacing/decompile/General/UI/UI_Map_DrawDrivers.c new file mode 100644 index 00000000..88051385 --- /dev/null +++ b/psx-modding-toolchain/games/CrashTeamRacing/decompile/General/UI/UI_Map_DrawDrivers.c @@ -0,0 +1,59 @@ +#include + +void UI_Map_DrawDrivers(int ptrMap,struct Thread* bucket,short *param_3) + +{ + int kartColor; + int uVar2; + struct Driver* d; + struct GameTracker* gGT = sdata->gGT; + + // if 2P or 4P + if((gGT->numPlyrCurrGame & 1) == 0) + { + // quit, no map drawn + return; + } + + for( /* bucket */ ; + bucket != 0; + bucket = bucket->siblingThread, + *param_3 = *param_3 + 1 + ) + { + // Player structure + d = bucket->object; + + // characterID + 5 + kartColor = data.characterIDs[d->driverID] + 5; + + // default (AI) + uVar2 = 0x31; + + // if this is human and not AI + if ((d->actionsFlagSet & 0x100000) == 0) + { + // If this is an even numbered frame + if ((gGT->timer & 2) == 0) { + kartColor = 4; + } + + // If you're in Adventure Arena + if ((gGT->gameMode1 & 0x100000) != 0) + { + // Draw dot for Player on 2D Adv Map + UI_Map_DrawAdvPlayer(ptrMap,bucket->inst->matrix.m[0][2],0x32,kartColor, + (d->rotCurr.y + 0x800U) | 0x1000,0x800); + + continue; + } + + // Player + uVar2 = 0x32; + } + + // Draw icon on map + UI_Map_DrawRawIcon(ptrMap,&bucket->inst->matrix.t[0],uVar2,(short)kartColor,0,0x1000); + } + return; +} \ No newline at end of file