MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xEntMotionDebugDraw

Function xEntMotionDebugDraw

src/SB/Core/x/xEntMotion.cpp:1244–1304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1242}
1243
1244static void xEntMotionDebugDraw(const xEntMotion* xem)
1245{
1246 if (xem->owner && xem->target)
1247 {
1248 xDrawSetColor(g_NEON_GREEN);
1249 xDrawLine(xEntGetPos(xem->owner), xEntGetPos(xem->target));
1250 }
1251
1252 switch (xem->type)
1253 {
1254 case k_XENTMOTIONTYPE_ER:
1255 xDrawSetColor(g_NEON_RED);
1256 xDrawLine(&xem->er.a, &xem->er.b);
1257 break;
1258 case k_XENTMOTIONTYPE_ORBIT:
1259 if (xem->owner)
1260 {
1261 xDrawSetColor(g_NEON_RED);
1262 xDrawLine(&xem->orb.c, xEntGetPos(xem->owner));
1263 }
1264 break;
1265 case k_XENTMOTIONTYPE_MP:
1266 {
1267 xDrawSetColor(g_PIMP_GOLD);
1268 xMovePoint* xmp = xem->mp.dest;
1269 if (xmp)
1270 {
1271 for (U16 idx = 0; idx < xMovePointGetNumPoints(xmp); idx++)
1272 {
1273 xMovePoint* omp = xMovePointGetPoint(xmp, idx);
1274 if (omp != xem->mp.src)
1275 {
1276 xDrawLine(xMovePointGetPos(xmp), xMovePointGetPos(omp));
1277 }
1278 for (U16 jdx = 0; jdx < xMovePointGetNumPoints(omp); jdx++)
1279 {
1280 xMovePoint* pmp = xMovePointGetPoint(omp, jdx);
1281 xDrawLine(xMovePointGetPos(omp), xMovePointGetPos(pmp));
1282 }
1283 }
1284 }
1285 if (xem->mp.src && xem->mp.dest)
1286 {
1287 xDrawSetColor(g_NEON_RED);
1288 xDrawLine(xMovePointGetPos(xem->mp.src), xMovePointGetPos(xem->mp.dest));
1289 }
1290 break;
1291 }
1292 case k_XENTMOTIONTYPE_MECH:
1293 xDrawSetColor(g_NEON_RED);
1294 xDrawLine(&xem->mech.apos, &xem->mech.bpos);
1295 break;
1296 case k_XENTMOTIONTYPE_PEND:
1297 if (xem->owner)
1298 {
1299 xDrawSetColor(g_NEON_RED);
1300 xDrawLine(&xem->pen.top, xEntGetPos(xem->owner));
1301 }

Callers 1

xEntMotionDebugCBFunction · 0.70

Calls 6

xDrawSetColorFunction · 0.85
xDrawLineFunction · 0.85
xEntGetPosFunction · 0.85
xMovePointGetNumPointsFunction · 0.85
xMovePointGetPointFunction · 0.85
xMovePointGetPosFunction · 0.85

Tested by

no test coverage detected