- SW: Rename all Tank-related function code to Vehicle.

This commit is contained in:
Mitchell Richters 2020-09-08 21:54:48 +10:00
parent 8625ac573d
commit 1e3199413c
6 changed files with 28 additions and 29 deletions

View file

@ -1058,9 +1058,8 @@ enum
PF2_INPUT_CAN_AIM = (BIT(1)), // Allow calling DoPlayerHorizon() from processMovement() PF2_INPUT_CAN_AIM = (BIT(1)), // Allow calling DoPlayerHorizon() from processMovement()
PF2_INPUT_CAN_TURN_GENERAL = (BIT(2)), // Allow calling DoPlayerTurn() from processMovement() PF2_INPUT_CAN_TURN_GENERAL = (BIT(2)), // Allow calling DoPlayerTurn() from processMovement()
PF2_INPUT_CAN_TURN_BOAT = (BIT(3)), // Allow calling DoPlayerTurnBoat() from processMovement() PF2_INPUT_CAN_TURN_BOAT = (BIT(3)), // Allow calling DoPlayerTurnBoat() from processMovement()
PF2_INPUT_CAN_TURN_TANK = (BIT(4)), // Allow calling DoPlayerTurnTank() from processMovement() PF2_INPUT_CAN_TURN_VEHICLE = (BIT(4)), // Allow calling DoPlayerTurnVehicle() from processMovement()
PF2_INPUT_CAN_TURN_TANKRECT = (BIT(5)), // Allow calling DoPlayerTurnTankRect() from processMovement() PF2_INPUT_CAN_MOVE_TURRET = (BIT(5)), // Allow calling DoPlayerMoveTurret() from processMovement()
PF2_INPUT_CAN_MOVE_TURRET = (BIT(6)), // Allow calling DoPlayerMoveTurret() from processMovement()
}; };
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -1831,7 +1830,7 @@ struct SECTOR_OBJECTstruct
#define SO_OPERATE_TRACK_START 90 #define SO_OPERATE_TRACK_START 90
#define SO_TURRET_MGUN 96 // machine gun #define SO_TURRET_MGUN 96 // machine gun
#define SO_TURRET 97 #define SO_TURRET 97
#define SO_TANK 98 #define SO_VEHICLE 98
// #define SO_SPEED_BOAT 99 // #define SO_SPEED_BOAT 99
#define SO_EMPTY(sop) ((sop)->xmid == INT32_MAX) #define SO_EMPTY(sop) ((sop)->xmid == INT32_MAX)

View file

@ -37,7 +37,7 @@ BEGIN_SW_NS
void DoPlayerHorizon(PLAYERp pp, fixed_t const q16horz, double const scaleAdjust); void DoPlayerHorizon(PLAYERp pp, fixed_t const q16horz, double const scaleAdjust);
void DoPlayerTurn(PLAYERp pp, fixed_t const q16avel, double const scaleAdjust); void DoPlayerTurn(PLAYERp pp, fixed_t const q16avel, double const scaleAdjust);
// void DoPlayerTurnBoat(PLAYERp pp, fixed_t q16avel); // void DoPlayerTurnBoat(PLAYERp pp, fixed_t q16avel);
void DoPlayerTurnTank(PLAYERp pp, fixed_t q16avel, int z, int floor_dist); void DoPlayerTurnVehicle(PLAYERp pp, fixed_t q16avel, int z, int floor_dist);
void DoPlayerMoveTurret(PLAYERp pp, fixed_t q16avel, fixed_t q16horz, double const scaleAdjust); void DoPlayerMoveTurret(PLAYERp pp, fixed_t q16avel, fixed_t q16horz, double const scaleAdjust);
static InputPacket loc; static InputPacket loc;
@ -294,8 +294,8 @@ static void processMovement(PLAYERp const pp, ControlInfo* const hidInput, bool
DoPlayerTurnBoat(pp, q16avel); DoPlayerTurnBoat(pp, q16avel);
#endif #endif
if (TEST(pp->Flags2, PF2_INPUT_CAN_TURN_TANK)) if (TEST(pp->Flags2, PF2_INPUT_CAN_TURN_VEHICLE))
DoPlayerTurnTank(pp, q16avel, pp->posz + Z(10), labs(pp->posz + Z(10) - pp->sop->floor_loz)); DoPlayerTurnVehicle(pp, q16avel, pp->posz + Z(10), labs(pp->posz + Z(10) - pp->sop->floor_loz));
if (TEST(pp->Flags2, PF2_INPUT_CAN_MOVE_TURRET)) if (TEST(pp->Flags2, PF2_INPUT_CAN_MOVE_TURRET))
DoPlayerMoveTurret(pp, q16avel, q16horz, scaleAdjust); DoPlayerMoveTurret(pp, q16avel, q16horz, scaleAdjust);

View file

@ -457,7 +457,7 @@ int WeaponOperate(PLAYERp pp)
{ {
switch (pp->sop->track) switch (pp->sop->track)
{ {
case SO_TANK: case SO_VEHICLE:
case SO_TURRET: case SO_TURRET:
case SO_TURRET_MGUN: case SO_TURRET_MGUN:
// case SO_SPEED_BOAT: // case SO_SPEED_BOAT:

View file

@ -164,10 +164,10 @@ void DoPlayerClimb(PLAYERp pp);
void DoPlayerBeginDie(PLAYERp pp); void DoPlayerBeginDie(PLAYERp pp);
void DoPlayerDie(PLAYERp pp); void DoPlayerDie(PLAYERp pp);
// void DoPlayerBeginOperateBoat(PLAYERp pp); // void DoPlayerBeginOperateBoat(PLAYERp pp);
void DoPlayerBeginOperateTank(PLAYERp pp); void DoPlayerBeginOperateVehicle(PLAYERp pp);
void DoPlayerBeginOperate(PLAYERp pp); void DoPlayerBeginOperate(PLAYERp pp);
// void DoPlayerOperateBoat(PLAYERp pp); // void DoPlayerOperateBoat(PLAYERp pp);
void DoPlayerOperateTank(PLAYERp pp); void DoPlayerOperateVehicle(PLAYERp pp);
void DoPlayerOperateTurret(PLAYERp pp); void DoPlayerOperateTurret(PLAYERp pp);
void DoPlayerBeginDive(PLAYERp pp); void DoPlayerBeginDive(PLAYERp pp);
void DoPlayerDive(PLAYERp pp); void DoPlayerDive(PLAYERp pp);
@ -1646,7 +1646,7 @@ DoPlayerTurnBoat(PLAYERp pp, fixed_t q16avel)
#endif #endif
void void
DoPlayerTurnTank(PLAYERp pp, fixed_t q16avel, int z, int floor_dist) DoPlayerTurnVehicle(PLAYERp pp, fixed_t q16avel, int z, int floor_dist)
{ {
SECTOR_OBJECTp sop = pp->sop; SECTOR_OBJECTp sop = pp->sop;
@ -1673,7 +1673,7 @@ DoPlayerTurnTank(PLAYERp pp, fixed_t q16avel, int z, int floor_dist)
} }
void void
DoPlayerTurnTankRect(PLAYERp pp, int *x, int *y, int *ox, int *oy) DoPlayerTurnVehicleRect(PLAYERp pp, int *x, int *y, int *ox, int *oy)
{ {
fixed_t q16avel; fixed_t q16avel;
SECTOR_OBJECTp sop = pp->sop; SECTOR_OBJECTp sop = pp->sop;
@ -2949,7 +2949,7 @@ DriveCrush(PLAYERp pp, int *x, int *y)
} }
void void
DoPlayerMoveTank(PLAYERp pp) DoPlayerMoveVehicle(PLAYERp pp)
{ {
int z; int z;
int floor_dist; int floor_dist;
@ -3057,7 +3057,7 @@ DoPlayerMoveTank(PLAYERp pp)
save_cstat = pp->SpriteP->cstat; save_cstat = pp->SpriteP->cstat;
RESET(pp->SpriteP->cstat, CSTAT_SPRITE_BLOCK); RESET(pp->SpriteP->cstat, CSTAT_SPRITE_BLOCK);
DoPlayerTurnTankRect(pp, x, y, ox, oy); DoPlayerTurnVehicleRect(pp, x, y, ox, oy);
ret = RectClipMove(pp, x, y); ret = RectClipMove(pp, x, y);
DriveCrush(pp, x, y); DriveCrush(pp, x, y);
@ -3107,11 +3107,11 @@ DoPlayerMoveTank(PLAYERp pp)
{ {
if (!cl_syncinput) if (!cl_syncinput)
{ {
SET(pp->Flags2, PF2_INPUT_CAN_TURN_TANK); SET(pp->Flags2, PF2_INPUT_CAN_TURN_VEHICLE);
} }
else else
{ {
DoPlayerTurnTank(pp, pp->input.q16avel, z, floor_dist); DoPlayerTurnVehicle(pp, pp->input.q16avel, z, floor_dist);
} }
save_cstat = pp->SpriteP->cstat; save_cstat = pp->SpriteP->cstat;
@ -5361,13 +5361,13 @@ DoPlayerBeginOperateBoat(PLAYERp pp)
#endif #endif
void void
DoPlayerBeginOperateTank(PLAYERp pp) DoPlayerBeginOperateVehicle(PLAYERp pp)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
pp->floor_dist = PLAYER_RUN_FLOOR_DIST; pp->floor_dist = PLAYER_RUN_FLOOR_DIST;
pp->ceiling_dist = PLAYER_RUN_CEILING_DIST; pp->ceiling_dist = PLAYER_RUN_CEILING_DIST;
pp->DoPlayerAction = DoPlayerOperateTank; pp->DoPlayerAction = DoPlayerOperateVehicle;
// temporary set to get weapons down // temporary set to get weapons down
if (TEST(pp->sop->flags, SOBJ_HAS_WEAPON)) if (TEST(pp->sop->flags, SOBJ_HAS_WEAPON))
@ -5523,13 +5523,13 @@ DoPlayerBeginOperate(PLAYERp pp)
switch (sop->track) switch (sop->track)
{ {
case SO_TANK: case SO_VEHICLE:
if (pp->input.fvel|pp->input.svel) if (pp->input.fvel|pp->input.svel)
PlaySOsound(pp->sop->mid_sector, SO_DRIVE_SOUND); PlaySOsound(pp->sop->mid_sector, SO_DRIVE_SOUND);
else else
PlaySOsound(pp->sop->mid_sector, SO_IDLE_SOUND); PlaySOsound(pp->sop->mid_sector, SO_IDLE_SOUND);
pp->posz = fz - PLAYER_HEIGHT; pp->posz = fz - PLAYER_HEIGHT;
DoPlayerBeginOperateTank(pp); DoPlayerBeginOperateVehicle(pp);
break; break;
case SO_TURRET_MGUN: case SO_TURRET_MGUN:
case SO_TURRET: case SO_TURRET:
@ -5613,13 +5613,13 @@ DoPlayerBeginRemoteOperate(PLAYERp pp, SECTOR_OBJECTp sop)
switch (sop->track) switch (sop->track)
{ {
case SO_TANK: case SO_VEHICLE:
if (pp->input.fvel|pp->input.svel) if (pp->input.fvel|pp->input.svel)
PlaySOsound(pp->sop->mid_sector, SO_DRIVE_SOUND); PlaySOsound(pp->sop->mid_sector, SO_DRIVE_SOUND);
else else
PlaySOsound(pp->sop->mid_sector, SO_IDLE_SOUND); PlaySOsound(pp->sop->mid_sector, SO_IDLE_SOUND);
pp->posz = fz - PLAYER_HEIGHT; pp->posz = fz - PLAYER_HEIGHT;
DoPlayerBeginOperateTank(pp); DoPlayerBeginOperateVehicle(pp);
break; break;
case SO_TURRET_MGUN: case SO_TURRET_MGUN:
case SO_TURRET: case SO_TURRET:
@ -5829,7 +5829,7 @@ DoPlayerOperateBoat(PLAYERp pp)
#endif #endif
void void
DoPlayerOperateTank(PLAYERp pp) DoPlayerOperateVehicle(PLAYERp pp)
{ {
short save_sectnum; short save_sectnum;
@ -5858,7 +5858,7 @@ DoPlayerOperateTank(PLAYERp pp)
if (pp->sop_remote) if (pp->sop_remote)
RemoteToPlayer(pp); RemoteToPlayer(pp);
DoPlayerMoveTank(pp); DoPlayerMoveVehicle(pp);
if (pp->sop_remote) if (pp->sop_remote)
{ {
@ -7439,7 +7439,7 @@ domovethings(void)
ChopsCheck(pp); ChopsCheck(pp);
// Reset flags used while tying input to framerate // Reset flags used while tying input to framerate
RESET(pp->Flags2, PF2_INPUT_CAN_AIM|PF2_INPUT_CAN_TURN_GENERAL|PF2_INPUT_CAN_TURN_BOAT|PF2_INPUT_CAN_TURN_TANK|PF2_INPUT_CAN_TURN_TANKRECT|PF2_INPUT_CAN_MOVE_TURRET); RESET(pp->Flags2, PF2_INPUT_CAN_AIM|PF2_INPUT_CAN_TURN_GENERAL|PF2_INPUT_CAN_TURN_BOAT|PF2_INPUT_CAN_TURN_VEHICLE|PF2_INPUT_CAN_MOVE_TURRET);
resetinputhelpers(pp); resetinputhelpers(pp);
if (pp->DoPlayerAction) pp->DoPlayerAction(pp); if (pp->DoPlayerAction) pp->DoPlayerAction(pp);
@ -7866,10 +7866,10 @@ static saveable_code saveable_player_code[] =
SAVE_CODE(DoPlayerBeginDie), SAVE_CODE(DoPlayerBeginDie),
//SAVE_CODE(DoPlayerDie), //SAVE_CODE(DoPlayerDie),
//SAVE_CODE(DoPlayerBeginOperateBoat), //SAVE_CODE(DoPlayerBeginOperateBoat),
SAVE_CODE(DoPlayerBeginOperateTank), SAVE_CODE(DoPlayerBeginOperateVehicle),
SAVE_CODE(DoPlayerBeginOperate), SAVE_CODE(DoPlayerBeginOperate),
//SAVE_CODE(DoPlayerOperateBoat), //SAVE_CODE(DoPlayerOperateBoat),
SAVE_CODE(DoPlayerOperateTank), SAVE_CODE(DoPlayerOperateVehicle),
SAVE_CODE(DoPlayerOperateTurret), SAVE_CODE(DoPlayerOperateTurret),
SAVE_CODE(DoPlayerBeginDive), SAVE_CODE(DoPlayerBeginDive),
SAVE_CODE(DoPlayerDive), SAVE_CODE(DoPlayerDive),

View file

@ -1390,7 +1390,7 @@ SetupSectorObject(short sectnum, short tag)
{ {
case SO_TURRET_MGUN: case SO_TURRET_MGUN:
case SO_TURRET: case SO_TURRET:
case SO_TANK: case SO_VEHICLE:
sop->vel = 0; sop->vel = 0;
SET(sop->flags, SOBJ_OPERATIONAL); SET(sop->flags, SOBJ_OPERATIONAL);
break; break;

View file

@ -5948,7 +5948,7 @@ DoDamage(short SpriteNum, short Weapon)
{ {
switch (wu->PlayerP->sop->track) switch (wu->PlayerP->sop->track)
{ {
case SO_TANK: case SO_VEHICLE:
damage = -200; damage = -200;
if (u->sop_parent) if (u->sop_parent)