- some SW cleanup

This commit is contained in:
Christoph Oelckers 2021-09-20 08:44:48 +02:00
parent bbe49eee7c
commit 3220a6d786
3 changed files with 32 additions and 49 deletions

View file

@ -45,7 +45,6 @@ ANIMATOR InitActorRunToward;
bool FAF_Sector(short); bool FAF_Sector(short);
bool DropAhead(short SpriteNum, short min_height); bool DropAhead(short SpriteNum, short min_height);
short FindTrackToPlayer(USERp u);
ANIMATORp ChooseAction(DECISION decision[]); ANIMATORp ChooseAction(DECISION decision[]);

View file

@ -353,111 +353,113 @@ PreCacheActor(void)
for (i=0; i < MAXSPRITES; i++) for (i=0; i < MAXSPRITES; i++)
{ {
if (sprite[i].statnum >= MAXSTATUS) auto pUsr = User[i].Data();
auto pSpr = &sprite[i];
if (pSpr->statnum >= MAXSTATUS)
continue; continue;
if (User[i].Data()) if (pUsr)
pic = User[i]->ID; pic = pUsr->ID;
else else
pic = sprite[i].picnum; pic = pSpr->picnum;
switch (pic) switch (pic)
{ {
case COOLIE_RUN_R0: case COOLIE_RUN_R0:
PreCacheCoolie(sprite[i].pal); PreCacheCoolie(pSpr->pal);
break; break;
case NINJA_RUN_R0: case NINJA_RUN_R0:
case NINJA_CRAWL_R0: case NINJA_CRAWL_R0:
PreCacheNinja(sprite[i].pal); PreCacheNinja(pSpr->pal);
break; break;
case GORO_RUN_R0: case GORO_RUN_R0:
PreCacheGuardian(sprite[i].pal); PreCacheGuardian(pSpr->pal);
break; break;
case 1441: case 1441:
case COOLG_RUN_R0: case COOLG_RUN_R0:
PreCacheGhost(sprite[i].pal); PreCacheGhost(pSpr->pal);
break; break;
case EEL_RUN_R0: case EEL_RUN_R0:
PreCacheEel(sprite[i].pal); PreCacheEel(pSpr->pal);
break; break;
case SUMO_RUN_R0: case SUMO_RUN_R0:
PreCacheZilla(sprite[i].pal); PreCacheZilla(pSpr->pal);
break; break;
case ZILLA_RUN_R0: case ZILLA_RUN_R0:
PreCacheSumo(sprite[i].pal); PreCacheSumo(pSpr->pal);
break; break;
case TOILETGIRL_R0: case TOILETGIRL_R0:
PreCacheToiletGirl(sprite[i].pal); PreCacheToiletGirl(pSpr->pal);
break; break;
case WASHGIRL_R0: case WASHGIRL_R0:
PreCacheWashGirl(sprite[i].pal); PreCacheWashGirl(pSpr->pal);
break; break;
case CARGIRL_R0: case CARGIRL_R0:
PreCacheCarGirl(sprite[i].pal); PreCacheCarGirl(pSpr->pal);
break; break;
case MECHANICGIRL_R0: case MECHANICGIRL_R0:
PreCacheMechanicGirl(sprite[i].pal); PreCacheMechanicGirl(pSpr->pal);
break; break;
case SAILORGIRL_R0: case SAILORGIRL_R0:
PreCacheSailorGirl(sprite[i].pal); PreCacheSailorGirl(pSpr->pal);
break; break;
case PRUNEGIRL_R0: case PRUNEGIRL_R0:
PreCachePruneGirl(sprite[i].pal); PreCachePruneGirl(pSpr->pal);
break; break;
case TRASHCAN: case TRASHCAN:
PreCacheTrash(sprite[i].pal); PreCacheTrash(pSpr->pal);
break; break;
case BUNNY_RUN_R0: case BUNNY_RUN_R0:
PreCacheBunny(sprite[i].pal); PreCacheBunny(pSpr->pal);
break; break;
case RIPPER_RUN_R0: case RIPPER_RUN_R0:
PreCacheRipper(sprite[i].pal); PreCacheRipper(pSpr->pal);
break; break;
case RIPPER2_RUN_R0: case RIPPER2_RUN_R0:
PreCacheRipper2(sprite[i].pal); PreCacheRipper2(pSpr->pal);
break; break;
case SERP_RUN_R0: case SERP_RUN_R0:
PreCacheSerpent(sprite[i].pal); PreCacheSerpent(pSpr->pal);
break; break;
case LAVA_RUN_R0: case LAVA_RUN_R0:
break; break;
case SKEL_RUN_R0: case SKEL_RUN_R0:
PreCacheSkel(sprite[i].pal); PreCacheSkel(pSpr->pal);
break; break;
case HORNET_RUN_R0: case HORNET_RUN_R0:
PreCacheHornet(sprite[i].pal); PreCacheHornet(pSpr->pal);
break; break;
case SKULL_R0: case SKULL_R0:
PreCacheSkull(sprite[i].pal); PreCacheSkull(pSpr->pal);
break; break;
case BETTY_R0: case BETTY_R0:
PreCacheBetty(sprite[i].pal); PreCacheBetty(pSpr->pal);
break; break;
case GIRLNINJA_RUN_R0: case GIRLNINJA_RUN_R0:
PreCacheNinjaGirl(sprite[i].pal); PreCacheNinjaGirl(pSpr->pal);
break; break;
case 623: // Pachinko win light case 623: // Pachinko win light
@ -465,11 +467,11 @@ PreCacheActor(void)
case PACHINKO2: case PACHINKO2:
case PACHINKO3: case PACHINKO3:
case PACHINKO4: case PACHINKO4:
PreCachePachinko(sprite[i].pal); PreCachePachinko(pSpr->pal);
break; break;
default: default:
markTileForPrecache(pic, sprite[i].pal); markTileForPrecache(pic, pSpr->pal);
} }
} }
} }

View file

@ -3027,19 +3027,12 @@ DoActorHitTrackEndPoint(USERp u)
// jump the current track & determine if you should go to another // jump the current track & determine if you should go to another
if (TEST(u->Flags, SPR_RUN_AWAY)) if (TEST(u->Flags, SPR_RUN_AWAY))
{ {
short FindTrackAwayFromPlayer(USERp);
//DSPRINTF(ds, "End Of Track - Looking for another!\n");
MONO_PRINT(ds);
// look for another track leading away from the player // look for another track leading away from the player
u->track = FindTrackAwayFromPlayer(u); u->track = FindTrackAwayFromPlayer(u);
if (u->track >= 0) if (u->track >= 0)
{ {
sp->ang = NORM_ANGLE(getangle((Track[u->track].TrackPoint + u->point)->x - sp->x, (Track[u->track].TrackPoint + u->point)->y - sp->y)); sp->ang = NORM_ANGLE(getangle((Track[u->track].TrackPoint + u->point)->x - sp->x, (Track[u->track].TrackPoint + u->point)->y - sp->y));
//DSPRINTF(ds, "Track Away From Player!\n");
MONO_PRINT(ds);
} }
else else
{ {
@ -3050,11 +3043,6 @@ DoActorHitTrackEndPoint(USERp u)
} }
else if (TEST(u->Flags, SPR_FIND_PLAYER)) else if (TEST(u->Flags, SPR_FIND_PLAYER))
{ {
short FindTrackToPlayer(USERp);
//DSPRINTF(ds, "End Of Track - Looking for another!\n");
MONO_PRINT(ds);
// look for another track leading away from the player // look for another track leading away from the player
u->track = FindTrackToPlayer(u); u->track = FindTrackToPlayer(u);
@ -3071,9 +3059,6 @@ DoActorHitTrackEndPoint(USERp u)
} }
else else
{ {
//DSPRINTF(ds, "End Of Track - DONT Look for another!\n");
MONO_PRINT(ds);
u->track = -1; u->track = -1;
} }
} }
@ -3110,9 +3095,6 @@ ActorTrackDecide(TRACK_POINTp tpoint, short SpriteNum)
sp = u->SpriteP; sp = u->SpriteP;
//DSPRINTF(ds,"tpoint->tag_low = %d, u->ID = %d\n",tpoint->tag_low,u->ID);
MONO_PRINT(ds);
switch (tpoint->tag_low) switch (tpoint->tag_low)
{ {
case TRACK_START: case TRACK_START: