- lots of repeat literals in SW

This commit is contained in:
Christoph Oelckers 2022-10-07 19:49:22 +02:00
parent 8ede08ce69
commit 8cb40291f2
10 changed files with 33 additions and 62 deletions

View file

@ -728,8 +728,7 @@ int SetupGirlNinja(DSWActor* actor)
actor->user.StateEnd = s_GirlNinjaDie;
actor->user.Rot = sg_GirlNinjaRun;
actor->spr.xrepeat = 51;
actor->spr.yrepeat = 43;
actor->spr.SetScale(0.796875, 0.0671875);
actor->user.Attrib = &GirlNinjaAttrib;
actor->spr.pal = actor->user.spal = 26;

View file

@ -320,8 +320,7 @@ int SetupHornet(DSWActor* actor)
actor->user.pos.Z = actor->spr.pos.Z;
actor->spr.xrepeat = 37;
actor->spr.yrepeat = 32;
actor->spr.SetScale(0.578125, 0.5);
// Special looping buzz sound attached to each hornet spawned
PlaySound(DIGI_HORNETBUZZ, actor, v3df_follow|v3df_init);

View file

@ -664,12 +664,10 @@ void DoAutoSize(tspritetype* tspr)
case ICON_STAR: // 1793
break;
case ICON_UZI: // 1797
tspr->xrepeat = 43;
tspr->yrepeat = 40;
tspr->SetScale(0.671875, 0.625);
break;
case ICON_UZIFLOOR: // 1807
tspr->xrepeat = 43;
tspr->yrepeat = 40;
tspr->SetScale(0.671875, 0.625);
break;
case ICON_LG_UZI_AMMO: // 1799
break;
@ -684,8 +682,7 @@ void DoAutoSize(tspritetype* tspr)
case ICON_ROCKET: // 1843
break;
case ICON_SHOTGUN: // 1794
tspr->xrepeat = 57;
tspr->yrepeat = 58;
tspr->SetScale(0.890625, 0.90625);
break;
case ICON_LG_ROCKET: // 1796
break;
@ -696,16 +693,14 @@ void DoAutoSize(tspritetype* tspr)
case ICON_MICRO_BATTERY: // 1800
break;
case ICON_GRENADE_LAUNCHER: // 1817
tspr->xrepeat = 54;
tspr->yrepeat = 52;
tspr->SetScale(0.84375, 0.8125);
break;
case ICON_LG_GRENADE: // 1831
break;
case ICON_LG_MINE: // 1842
break;
case ICON_RAIL_GUN: // 1811
tspr->xrepeat = 50;
tspr->yrepeat = 54;
tspr->SetScale(0.78125, 0.84375);
break;
case ICON_RAIL_AMMO: // 1812
break;
@ -714,26 +709,21 @@ void DoAutoSize(tspritetype* tspr)
case ICON_MEDKIT: // 1803
break;
case ICON_CHEMBOMB:
tspr->xrepeat = 64;
tspr->yrepeat = 47;
tspr->SetScale(1, 0.734375);
break;
case ICON_FLASHBOMB:
tspr->xrepeat = 32;
tspr->yrepeat = 34;
tspr->SetScale(0.5, 0.53125);
break;
case ICON_NUKE:
break;
case ICON_CALTROPS:
tspr->xrepeat = 37;
tspr->yrepeat = 30;
tspr->SetScale(0.578125, 0.46875);
break;
case ICON_BOOSTER: // 1810
tspr->xrepeat = 30;
tspr->yrepeat = 38;
tspr->SetScale(0.46875, 0.59375);
break;
case ICON_HEAT_CARD: // 1819
tspr->xrepeat = 46;
tspr->yrepeat = 47;
tspr->SetScale(0.71875, 0.734375);
break;
case ICON_REPAIR_KIT: // 1813
break;
@ -746,8 +736,7 @@ void DoAutoSize(tspritetype* tspr)
case ICON_CLOAK: // 1826
break;
case ICON_NIGHT_VISION: // 3031
tspr->xrepeat = 59;
tspr->yrepeat = 71;
tspr->SetScale(0.921875, 1.109375);
break;
case ICON_NAPALM: // 3046
break;
@ -760,8 +749,7 @@ void DoAutoSize(tspritetype* tspr)
case ICON_GRENADE: // 3059
break;
case ICON_ARMOR: // 3030
tspr->xrepeat = 82;
tspr->yrepeat = 84;
tspr->SetScale(1.28125, 1.3125);
break;
case BLUE_KEY: // 1766
break;
@ -775,20 +763,17 @@ void DoAutoSize(tspritetype* tspr)
case RED_CARD:
case GREEN_CARD:
case YELLOW_CARD:
tspr->xrepeat = 36;
tspr->yrepeat = 33;
tspr->SetScale(0.5625, 0.5155625);
break;
case GOLD_SKELKEY:
case SILVER_SKELKEY:
case BRONZE_SKELKEY:
case RED_SKELKEY:
tspr->xrepeat = 39;
tspr->yrepeat = 45;
tspr->SetScale(0.609375, 0.703125);
break;
case SKEL_LOCKED:
case SKEL_UNLOCKED:
tspr->xrepeat = 47;
tspr->yrepeat = 40;
tspr->SetScale(0.734375, 0.625);
break;
case RAMCARD_LOCKED:
case RAMCARD_UNLOCKED:

View file

@ -2227,7 +2227,7 @@ int SpawnShell(DSWActor* actor, int ShellNum)
// Set the shell number
actorNew->user.ShellNum = ShellCount;
actorNew->spr.yrepeat = actorNew->spr.xrepeat = 13;
actorNew->spr.SetScale(0.203125, 0.203125);
break;
case SHOT_SHELL:
actorNew->spr.pos.Z -= 13;
@ -2241,7 +2241,7 @@ int SpawnShell(DSWActor* actor, int ShellNum)
// Set the shell number
actorNew->user.ShellNum = ShellCount;
actorNew->spr.yrepeat = actorNew->spr.xrepeat = 18;
actorNew->spr.SetScale(0.28125, 0.28125);
break;
}

View file

@ -474,7 +474,7 @@ int SetupLava(DSWActor* actor)
actor->user.Rot = sg_LavaRun;
EnemyDefaults(actor, &LavaActionSet, &LavaPersonality);
actor->spr.xrepeat = actor->spr.yrepeat = 110;
actor->spr.SetScale(1.71875, 1.71875);
actor->clipdist = 32;
actor->user.Flags |= (SPR_XFLIP_TOGGLE|SPR_ELECTRO_TOLERANT);

View file

@ -390,8 +390,7 @@ int SetupWashGirl(DSWActor* actor)
actor->user.Rot = 0;
actor->user.RotNum = 0;
actor->spr.xrepeat = 28;
actor->spr.yrepeat = 24;
actor->spr.SetScale(0.4374, 0.375);
actor->vel.X = 0;
actor->vel.Z = 0;
actor->spr.lotag = WASHGIRL_R0;
@ -621,8 +620,7 @@ int SetupTrashCan(DSWActor* actor)
actor->user.RotNum = 0;
actor->spr.xrepeat = 46;
actor->spr.yrepeat = 42;
actor->spr.SetScale(0.71875, 0.65625);
actor->vel.X = 0;
actor->vel.Z = 0;
actor->user.ID = TRASHCAN;
@ -1297,8 +1295,7 @@ int SetupCarGirl(DSWActor* actor)
actor->user.Rot = 0;
actor->user.RotNum = 0;
actor->spr.xrepeat = 29;
actor->spr.yrepeat = 25;
actor->spr.SetScale(0.453125, 0.390625);
actor->vel.X = 0;
actor->vel.Z = 0;
actor->spr.lotag = CARGIRL_R0;
@ -1533,8 +1530,7 @@ int SetupMechanicGirl(DSWActor* actor)
actor->user.Rot = 0;
actor->user.RotNum = 0;
actor->spr.xrepeat = 27;
actor->spr.yrepeat = 26;
actor->spr.SetScale(0.421875, 0.40625);
actor->vel.X = 0;
actor->vel.Z = 0;
actor->spr.lotag = MECHANICGIRL_R0;
@ -1768,8 +1764,7 @@ int SetupSailorGirl(DSWActor* actor)
actor->user.Rot = 0;
actor->user.RotNum = 0;
actor->spr.xrepeat = 28;
actor->spr.yrepeat = 26;
actor->spr.SetScale(0.4375, 0.40625);
actor->vel.X = 0;
actor->vel.Z = 0;
actor->spr.lotag = SAILORGIRL_R0;
@ -1998,8 +1993,7 @@ int SetupPruneGirl(DSWActor* actor)
actor->user.Rot = 0;
actor->user.RotNum = 0;
actor->spr.xrepeat = 33;
actor->spr.yrepeat = 28;
actor->spr.SetScale(0.515625, 0.4375);
actor->vel.X = 0;
actor->vel.Z = 0;
actor->spr.lotag = PRUNEGIRL_R0;

View file

@ -1838,8 +1838,7 @@ int SetupNinja(DSWActor* actor)
actor->user.StateEnd = s_NinjaDie;
actor->user.Rot = sg_NinjaRun;
actor->spr.xrepeat = 46;
actor->spr.yrepeat = 46;
actor->spr.SetScale(0.71875, 0.71875);
if (actor->spr.pal == PALETTE_PLAYER5)
{
@ -2419,8 +2418,7 @@ void InitPlayerSprite(PLAYER* pp)
actor->spr.shade = -60; // was 15
actor->clipdist = 16;
actor->spr.xrepeat = PLAYER_NINJA_XREPEAT;
actor->spr.yrepeat = PLAYER_NINJA_YREPEAT;
actor->spr.SetScale(PLAYER_NINJA_XREPEAT, PLAYER_NINJA_YREPEAT);
actor->spr.pal = PALETTE_PLAYER0 + pp->pnum;
actor->user.spal = actor->spr.pal;

View file

@ -6130,7 +6130,7 @@ void DoPlayerDeathCheckKeys(PLAYER* pp)
NewStateGroup(plActor, plActor->user.ActorActionSet->Stand);
plActor->spr.picnum = plActor->user.State->Pic;
plActor->spr.picnum = plActor->user.State->Pic;
plActor->spr.xrepeat = plActor->spr.yrepeat = PLAYER_NINJA_XREPEAT;
plActor->spr.SetScale(PLAYER_NINJA_XREPEAT, PLAYER_NINJA_XREPEAT);
plActor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
plActor->spr.pos = pp->pos.plusZ(PLAYER_HEIGHTF);
plActor->spr.angle = pp->angle.ang;
@ -6150,8 +6150,7 @@ void DoPlayerDeathCheckKeys(PLAYER* pp)
plActor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
plActor->spr.cstat |= (CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
pp->input.actions |= SB_CENTERVIEW;
plActor->spr.xrepeat = PLAYER_NINJA_XREPEAT;
plActor->spr.yrepeat = PLAYER_NINJA_YREPEAT;
plActor->spr.SetScale(PLAYER_NINJA_XREPEAT, PLAYER_NINJA_YREPEAT);
pp->horizon.horiz = nullAngle;
DoPlayerResetMovement(pp);

View file

@ -114,10 +114,8 @@ constexpr double PLAYER_FALL_HEIGHTF = 28;
constexpr double PLAYER_DEATH_HEIGHTF = 16;
constexpr double PLAYER_DEAD_HEAD_FLOORZ_OFFSET = 7;
//#define PLAYER_NINJA_XREPEAT (56)
//#define PLAYER_NINJA_YREPEAT (56)
#define PLAYER_NINJA_XREPEAT (47)
#define PLAYER_NINJA_YREPEAT (33)
constexpr double PLAYER_NINJA_XREPEAT = 0.734375;
constexpr double PLAYER_NINJA_YREPEAT = 0.515625;
BEGIN_SW_NS

View file

@ -760,8 +760,7 @@ int SetupZombie(DSWActor* actor)
actor->user.Health = 100;
actor->user.StateEnd = &s_ZombiePain[0][0];
actor->user.Rot = sg_ZombieRun;
actor->spr.xrepeat = PLAYER_NINJA_XREPEAT;
actor->spr.yrepeat = PLAYER_NINJA_YREPEAT;
actor->spr.SetScale(PLAYER_NINJA_XREPEAT, PLAYER_NINJA_YREPEAT);
actor->user.Attrib = &ZombieAttrib;
EnemyDefaults(actor, &ZombieActionSet, &ZombiePersonality);