mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +00:00
Merge branch 'waypoint-radius-debug' into 'master'
Draw radius for waypoint debug on "best" waypoint. See merge request KartKrew/Kart!275
This commit is contained in:
commit
a6fef70f75
4 changed files with 58 additions and 2 deletions
|
|
@ -7100,6 +7100,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
"S_BATTLECAPSULE_SUPPORT",
|
"S_BATTLECAPSULE_SUPPORT",
|
||||||
"S_BATTLECAPSULE_SUPPORTFLY",
|
"S_BATTLECAPSULE_SUPPORTFLY",
|
||||||
|
|
||||||
|
"S_EGOORB",
|
||||||
|
|
||||||
#ifdef SEENAMES
|
#ifdef SEENAMES
|
||||||
"S_NAMECHECK",
|
"S_NAMECHECK",
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,8 @@ char sprnames[NUMSPRITES + 1][5] =
|
||||||
"ICEB","CNDL","DOCH","DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS",
|
"ICEB","CNDL","DOCH","DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS",
|
||||||
"ZTCH","MKMA","MKMP","RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH",
|
"ZTCH","MKMA","MKMP","RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH",
|
||||||
"BFRT","OFRT","RFRT","PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN",
|
"BFRT","OFRT","RFRT","PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN",
|
||||||
"FWRK","MXCL","RGSP","DRAF","GRES","OTFG","DBOS","XMS4","XMS5","VIEW"
|
"FWRK","MXCL","RGSP","DRAF","GRES","OTFG","DBOS","EGOO","XMS4","XMS5",
|
||||||
|
"VIEW"
|
||||||
};
|
};
|
||||||
|
|
||||||
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
|
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
|
||||||
|
|
@ -3497,6 +3498,8 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_CAPS, 4, -1, {NULL}, 0, 0, S_NULL}, // S_BATTLECAPSULE_SUPPORT
|
{SPR_CAPS, 4, -1, {NULL}, 0, 0, S_NULL}, // S_BATTLECAPSULE_SUPPORT
|
||||||
{SPR_CAPS, FF_ANIMATE|5, -1, {NULL}, 3, 1, S_NULL}, // S_BATTLECAPSULE_SUPPORTFLY
|
{SPR_CAPS, FF_ANIMATE|5, -1, {NULL}, 3, 1, S_NULL}, // S_BATTLECAPSULE_SUPPORTFLY
|
||||||
|
|
||||||
|
{SPR_EGOO, 0, 1, {NULL}, 0, 0, S_NULL}, // S_EGOORB
|
||||||
|
|
||||||
#ifdef SEENAMES
|
#ifdef SEENAMES
|
||||||
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK
|
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -796,6 +796,8 @@ typedef enum sprite
|
||||||
|
|
||||||
SPR_DBOS, // Drift boost flame
|
SPR_DBOS, // Drift boost flame
|
||||||
|
|
||||||
|
SPR_EGOO,
|
||||||
|
|
||||||
// Xmas-specific sprites that don't fit aboxe
|
// Xmas-specific sprites that don't fit aboxe
|
||||||
SPR_XMS4,
|
SPR_XMS4,
|
||||||
SPR_XMS5,
|
SPR_XMS5,
|
||||||
|
|
@ -4184,6 +4186,8 @@ typedef enum state
|
||||||
S_BATTLECAPSULE_SUPPORT,
|
S_BATTLECAPSULE_SUPPORT,
|
||||||
S_BATTLECAPSULE_SUPPORTFLY,
|
S_BATTLECAPSULE_SUPPORTFLY,
|
||||||
|
|
||||||
|
S_EGOORB,
|
||||||
|
|
||||||
#ifdef SEENAMES
|
#ifdef SEENAMES
|
||||||
S_NAMECHECK,
|
S_NAMECHECK,
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -474,7 +474,7 @@ static void K_DebugWaypointsSpawnLine(waypoint_t *const waypoint1, waypoint_t *c
|
||||||
spawnedmobj->state->tics = 1;
|
spawnedmobj->state->tics = 1;
|
||||||
spawnedmobj->frame = spawnedmobj->frame & ~FF_TRANSMASK;
|
spawnedmobj->frame = spawnedmobj->frame & ~FF_TRANSMASK;
|
||||||
spawnedmobj->color = linkcolours[linkcolour];
|
spawnedmobj->color = linkcolours[linkcolour];
|
||||||
spawnedmobj->scale = FixedMul(FRACUNIT/4, FixedDiv((15 - ((leveltime + n) % 16))*FRACUNIT, 15*FRACUNIT));
|
spawnedmobj->scale = FixedMul(spawnedmobj->scale, FixedMul(FRACUNIT/4, FixedDiv((15 - ((leveltime + n) % 16))*FRACUNIT, 15*FRACUNIT)));
|
||||||
}
|
}
|
||||||
|
|
||||||
x += stepx;
|
x += stepx;
|
||||||
|
|
@ -483,6 +483,48 @@ static void K_DebugWaypointsSpawnLine(waypoint_t *const waypoint1, waypoint_t *c
|
||||||
} while (n--);
|
} while (n--);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
void K_DebugWaypointDrawRadius(waypoint_t *const waypoint)
|
||||||
|
|
||||||
|
Draw a debugging circle to represent a waypoint's radius
|
||||||
|
|
||||||
|
Input Arguments:-
|
||||||
|
waypoint - A waypoint to draw the radius of
|
||||||
|
--------------------------------------------------*/
|
||||||
|
static void K_DebugWaypointDrawRadius(waypoint_t *const waypoint)
|
||||||
|
{
|
||||||
|
mobj_t *radiusOrb;
|
||||||
|
mobj_t *waypointmobj;
|
||||||
|
const INT32 numRadiusMobjs = 64;
|
||||||
|
INT32 i = 0;
|
||||||
|
angle_t spawnAngle = 0U;
|
||||||
|
fixed_t spawnX= 0;
|
||||||
|
fixed_t spawnY= 0;
|
||||||
|
fixed_t spawnZ= 0;
|
||||||
|
|
||||||
|
I_Assert(waypoint != NULL);
|
||||||
|
I_Assert(waypoint->mobj != NULL);
|
||||||
|
|
||||||
|
waypointmobj = waypoint->mobj;
|
||||||
|
|
||||||
|
for (i = 0; i < numRadiusMobjs; i++)
|
||||||
|
{
|
||||||
|
spawnAngle = (ANGLE_MAX / numRadiusMobjs) * i;
|
||||||
|
|
||||||
|
spawnZ = waypointmobj->z;
|
||||||
|
spawnX = waypointmobj->x + P_ReturnThrustX(waypointmobj, spawnAngle, waypointmobj->radius);
|
||||||
|
spawnY = waypointmobj->y + P_ReturnThrustY(waypointmobj, spawnAngle, waypointmobj->radius);
|
||||||
|
|
||||||
|
radiusOrb = P_SpawnMobj(spawnX, spawnY, spawnZ, MT_SPARK);
|
||||||
|
P_SetMobjState(radiusOrb, S_THOK);
|
||||||
|
radiusOrb->state->nextstate = S_NULL;
|
||||||
|
radiusOrb->state->tics = 1;
|
||||||
|
radiusOrb->frame = radiusOrb->frame & ~FF_TRANSMASK;
|
||||||
|
radiusOrb->color = SKINCOLOR_PURPLE;
|
||||||
|
radiusOrb->scale = radiusOrb->scale / 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
void K_DebugWaypointsVisualise(void)
|
void K_DebugWaypointsVisualise(void)
|
||||||
|
|
||||||
|
|
@ -523,15 +565,20 @@ void K_DebugWaypointsVisualise(void)
|
||||||
{
|
{
|
||||||
if (waypoint->numnextwaypoints == 0 && waypoint->numprevwaypoints == 0)
|
if (waypoint->numnextwaypoints == 0 && waypoint->numprevwaypoints == 0)
|
||||||
{
|
{
|
||||||
|
P_SetMobjState(debugmobj, S_EGOORB);
|
||||||
debugmobj->color = SKINCOLOR_RED;
|
debugmobj->color = SKINCOLOR_RED;
|
||||||
|
debugmobj->colorized = true;
|
||||||
}
|
}
|
||||||
else if (waypoint->numnextwaypoints == 0 || waypoint->numprevwaypoints == 0)
|
else if (waypoint->numnextwaypoints == 0 || waypoint->numprevwaypoints == 0)
|
||||||
{
|
{
|
||||||
|
P_SetMobjState(debugmobj, S_EGOORB);
|
||||||
debugmobj->color = SKINCOLOR_YELLOW;
|
debugmobj->color = SKINCOLOR_YELLOW;
|
||||||
|
debugmobj->colorized = true;
|
||||||
}
|
}
|
||||||
else if (waypoint == players[displayplayers[0]].nextwaypoint)
|
else if (waypoint == players[displayplayers[0]].nextwaypoint)
|
||||||
{
|
{
|
||||||
debugmobj->color = SKINCOLOR_GREEN;
|
debugmobj->color = SKINCOLOR_GREEN;
|
||||||
|
K_DebugWaypointDrawRadius(waypoint);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue