mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
SW: Rename q16avel -> q16angvel and q16horz -> q16aimvel.
While it is understandable that avel and horz came from Duke3D, having both q16horiz and q16horz in the updated SW_PACKET struct can be confusing, and the alternative notation is more consistent with the original struct field names of angvel and aimvel, as well as the differing uses of the name angvel still present in player.cpp.
This commit is contained in:
parent
952c578957
commit
eaefc2576c
6 changed files with 81 additions and 81 deletions
|
@ -271,8 +271,8 @@ DemoWritePackets(const SW_PACKET *buffer, int32_t count, FILE *f)
|
||||||
{
|
{
|
||||||
packet.vel = B_LITTLE16(buffer->vel);
|
packet.vel = B_LITTLE16(buffer->vel);
|
||||||
packet.svel = B_LITTLE16(buffer->svel);
|
packet.svel = B_LITTLE16(buffer->svel);
|
||||||
packet.angvel = fix16_to_int(buffer->q16avel);
|
packet.angvel = fix16_to_int(buffer->q16angvel);
|
||||||
packet.aimvel = fix16_to_int(buffer->q16horz);
|
packet.aimvel = fix16_to_int(buffer->q16aimvel);
|
||||||
packet.bits = B_LITTLE32(buffer->bits);
|
packet.bits = B_LITTLE32(buffer->bits);
|
||||||
fwrite(&packet, sizeof(packet), 1, f);
|
fwrite(&packet, sizeof(packet), 1, f);
|
||||||
}
|
}
|
||||||
|
@ -288,8 +288,8 @@ DemoReadPackets(SW_PACKET *buffer, int32_t count, DFILE f)
|
||||||
DREAD(&packet, sizeof(packet), 1, f);
|
DREAD(&packet, sizeof(packet), 1, f);
|
||||||
buffer->vel = B_LITTLE16(packet.vel);
|
buffer->vel = B_LITTLE16(packet.vel);
|
||||||
buffer->svel = B_LITTLE16(packet.svel);
|
buffer->svel = B_LITTLE16(packet.svel);
|
||||||
buffer->q16avel = fix16_from_int(packet.angvel);
|
buffer->q16angvel = fix16_from_int(packet.angvel);
|
||||||
buffer->q16horz = fix16_from_int(packet.aimvel);
|
buffer->q16aimvel = fix16_from_int(packet.aimvel);
|
||||||
buffer->bits = B_LITTLE32(packet.bits);
|
buffer->bits = B_LITTLE32(packet.bits);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3185,7 +3185,7 @@ getinput(SW_PACKET *loc, SWBOOL tied)
|
||||||
info.dyaw = (info.dyaw * turn_scale)>>8;
|
info.dyaw = (info.dyaw * turn_scale)>>8;
|
||||||
|
|
||||||
int32_t svel = 0, vel = 0;
|
int32_t svel = 0, vel = 0;
|
||||||
fix16_t q16horz = 0, q16avel = 0;
|
fix16_t q16aimvel = 0, q16angvel = 0;
|
||||||
|
|
||||||
if (buttonMap.ButtonDown(gamefunc_Strafe) && !pp->sop)
|
if (buttonMap.ButtonDown(gamefunc_Strafe) && !pp->sop)
|
||||||
{
|
{
|
||||||
|
@ -3194,19 +3194,19 @@ getinput(SW_PACKET *loc, SWBOOL tied)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
q16avel = fix16_div(fix16_from_int(info.mousex), fix16_from_int(32));
|
q16angvel = fix16_div(fix16_from_int(info.mousex), fix16_from_int(32));
|
||||||
q16avel += fix16_from_int(info.dyaw) / analogExtent * (turnamount << 1);
|
q16angvel += fix16_from_int(info.dyaw) / analogExtent * (turnamount << 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mouseaim)
|
if (mouseaim)
|
||||||
q16horz = -fix16_div(fix16_from_int(info.mousey), fix16_from_int(64));
|
q16aimvel = -fix16_div(fix16_from_int(info.mousey), fix16_from_int(64));
|
||||||
else
|
else
|
||||||
vel = -(info.mousey >> 6);
|
vel = -(info.mousey >> 6);
|
||||||
|
|
||||||
if (in_mouseflip)
|
if (in_mouseflip)
|
||||||
q16horz = -q16horz;
|
q16aimvel = -q16aimvel;
|
||||||
|
|
||||||
q16horz -= fix16_from_int(info.dpitch) * turnamount / analogExtent;
|
q16aimvel -= fix16_from_int(info.dpitch) * turnamount / analogExtent;
|
||||||
svel -= info.dx * keymove / analogExtent;
|
svel -= info.dx * keymove / analogExtent;
|
||||||
vel -= info.dz * keymove / analogExtent;
|
vel -= info.dz * keymove / analogExtent;
|
||||||
|
|
||||||
|
@ -3225,12 +3225,12 @@ getinput(SW_PACKET *loc, SWBOOL tied)
|
||||||
if (PEDANTIC_MODE)
|
if (PEDANTIC_MODE)
|
||||||
{
|
{
|
||||||
if (turnheldtime >= TURBOTURNTIME)
|
if (turnheldtime >= TURBOTURNTIME)
|
||||||
q16avel -= fix16_from_int(turnamount);
|
q16angvel -= fix16_from_int(turnamount);
|
||||||
else
|
else
|
||||||
q16avel -= fix16_from_int(PREAMBLETURN);
|
q16angvel -= fix16_from_int(PREAMBLETURN);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
q16avel = fix16_ssub(q16avel, fix16_from_float(scaleAdjustmentToInterval((turnheldtime >= TURBOTURNTIME) ? turnamount : PREAMBLETURN)));
|
q16angvel = fix16_ssub(q16angvel, fix16_from_float(scaleAdjustmentToInterval((turnheldtime >= TURBOTURNTIME) ? turnamount : PREAMBLETURN)));
|
||||||
}
|
}
|
||||||
else if (buttonMap.ButtonDown(gamefunc_Turn_Right))
|
else if (buttonMap.ButtonDown(gamefunc_Turn_Right))
|
||||||
{
|
{
|
||||||
|
@ -3238,12 +3238,12 @@ getinput(SW_PACKET *loc, SWBOOL tied)
|
||||||
if (PEDANTIC_MODE)
|
if (PEDANTIC_MODE)
|
||||||
{
|
{
|
||||||
if (turnheldtime >= TURBOTURNTIME)
|
if (turnheldtime >= TURBOTURNTIME)
|
||||||
q16avel += fix16_from_int(turnamount);
|
q16angvel += fix16_from_int(turnamount);
|
||||||
else
|
else
|
||||||
q16avel += fix16_from_int(PREAMBLETURN);
|
q16angvel += fix16_from_int(PREAMBLETURN);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
q16avel = fix16_sadd(q16avel, fix16_from_float(scaleAdjustmentToInterval((turnheldtime >= TURBOTURNTIME) ? turnamount : PREAMBLETURN)));
|
q16angvel = fix16_sadd(q16angvel, fix16_from_float(scaleAdjustmentToInterval((turnheldtime >= TURBOTURNTIME) ? turnamount : PREAMBLETURN)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3272,21 +3272,21 @@ getinput(SW_PACKET *loc, SWBOOL tied)
|
||||||
if (buttonMap.ButtonDown(gamefunc_Move_Backward))
|
if (buttonMap.ButtonDown(gamefunc_Move_Backward))
|
||||||
vel += -keymove;
|
vel += -keymove;
|
||||||
|
|
||||||
q16avel = fix16_clamp(q16avel, -fix16_from_int(MAXANGVEL), fix16_from_int(MAXANGVEL));
|
q16angvel = fix16_clamp(q16angvel, -fix16_from_int(MAXANGVEL), fix16_from_int(MAXANGVEL));
|
||||||
q16horz = fix16_clamp(q16horz, -fix16_from_int(MAXHORIZVEL), fix16_from_int(MAXHORIZVEL));
|
q16aimvel = fix16_clamp(q16aimvel, -fix16_from_int(MAXHORIZVEL), fix16_from_int(MAXHORIZVEL));
|
||||||
|
|
||||||
if (PEDANTIC_MODE)
|
if (PEDANTIC_MODE)
|
||||||
{
|
{
|
||||||
q16avel = fix16_floor(q16avel);
|
q16angvel = fix16_floor(q16angvel);
|
||||||
q16horz = fix16_floor(q16horz);
|
q16aimvel = fix16_floor(q16aimvel);
|
||||||
}
|
}
|
||||||
else if (!TEST(pp->Flags, PF_DEAD))
|
else if (!TEST(pp->Flags, PF_DEAD))
|
||||||
{
|
{
|
||||||
void DoPlayerTurn(PLAYERp pp, fix16_t *pq16ang, fix16_t q16avel);
|
void DoPlayerTurn(PLAYERp pp, fix16_t *pq16ang, fix16_t q16angvel);
|
||||||
void DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16horz);
|
void DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16aimvel);
|
||||||
if (!TEST(pp->Flags, PF_CLIMBING))
|
if (!TEST(pp->Flags, PF_CLIMBING))
|
||||||
DoPlayerTurn(pp, &pp->camq16ang, q16avel);
|
DoPlayerTurn(pp, &pp->camq16ang, q16angvel);
|
||||||
DoPlayerHorizon(pp, &pp->camq16horiz, q16horz);
|
DoPlayerHorizon(pp, &pp->camq16horiz, q16aimvel);
|
||||||
}
|
}
|
||||||
|
|
||||||
loc->vel += vel;
|
loc->vel += vel;
|
||||||
|
@ -3307,8 +3307,8 @@ getinput(SW_PACKET *loc, SWBOOL tied)
|
||||||
loc->svel = momy;
|
loc->svel = momy;
|
||||||
}
|
}
|
||||||
|
|
||||||
loc->q16avel += q16avel;
|
loc->q16angvel += q16angvel;
|
||||||
loc->q16horz += q16horz;
|
loc->q16aimvel += q16aimvel;
|
||||||
|
|
||||||
if (!CommEnabled)
|
if (!CommEnabled)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1084,8 +1084,8 @@ typedef struct
|
||||||
{
|
{
|
||||||
int16_t vel;
|
int16_t vel;
|
||||||
int16_t svel;
|
int16_t svel;
|
||||||
fix16_t q16avel;
|
fix16_t q16angvel;
|
||||||
fix16_t q16horz;
|
fix16_t q16aimvel;
|
||||||
fix16_t q16ang;
|
fix16_t q16ang;
|
||||||
fix16_t q16horiz;
|
fix16_t q16horiz;
|
||||||
int32_t bits;
|
int32_t bits;
|
||||||
|
|
|
@ -443,8 +443,8 @@ void computergetinput(int snum, SW_PACKET *syn)
|
||||||
// Reset input bits
|
// Reset input bits
|
||||||
syn->vel = 0;
|
syn->vel = 0;
|
||||||
syn->svel = 0;
|
syn->svel = 0;
|
||||||
syn->q16avel = 0;
|
syn->q16angvel = 0;
|
||||||
syn->q16horz = 0;
|
syn->q16aimvel = 0;
|
||||||
syn->bits = 0;
|
syn->bits = 0;
|
||||||
|
|
||||||
x1 = p->posx;
|
x1 = p->posx;
|
||||||
|
@ -648,9 +648,9 @@ void computergetinput(int snum, SW_PACKET *syn)
|
||||||
daang = NORM_ANGLE((daang-64) + STD_RANDOM_RANGE(128));
|
daang = NORM_ANGLE((daang-64) + STD_RANDOM_RANGE(128));
|
||||||
|
|
||||||
// Below formula fails in certain cases
|
// Below formula fails in certain cases
|
||||||
//syn->q16avel = fix16_from_int(min(max((((daang+1024-damyang)&2047)-1024)>>1,-MAXANGVEL),MAXANGVEL)); //was 127
|
//syn->q16angvel = fix16_from_int(min(max((((daang+1024-damyang)&2047)-1024)>>1,-MAXANGVEL),MAXANGVEL)); //was 127
|
||||||
p->q16ang = fix16_from_int(daang);
|
p->q16ang = fix16_from_int(daang);
|
||||||
syn->q16horz = fix16_from_int(min(max((zang-fix16_to_int(p->q16horiz))>>1,-PLAYER_HORIZ_MAX),PLAYER_HORIZ_MAX));
|
syn->q16aimvel = fix16_from_int(min(max((zang-fix16_to_int(p->q16horiz))>>1,-PLAYER_HORIZ_MAX),PLAYER_HORIZ_MAX));
|
||||||
// Sets type of aiming, auto aim for bots
|
// Sets type of aiming, auto aim for bots
|
||||||
syn->bits |= (1<<SK_AUTO_AIM);
|
syn->bits |= (1<<SK_AUTO_AIM);
|
||||||
return;
|
return;
|
||||||
|
@ -806,7 +806,7 @@ void computergetinput(int snum, SW_PACKET *syn)
|
||||||
daang = getangle(x2-x1,y2-y1);
|
daang = getangle(x2-x1,y2-y1);
|
||||||
syn->vel += (x2-x1)*2047/dist;
|
syn->vel += (x2-x1)*2047/dist;
|
||||||
syn->svel += (y2-y1)*2047/dist;
|
syn->svel += (y2-y1)*2047/dist;
|
||||||
syn->q16avel = fix16_from_int(min(max((((daang+1024-damyang)&2047)-1024)>>3,-MAXANGVEL),MAXANGVEL));
|
syn->q16angvel = fix16_from_int(min(max((((daang+1024-damyang)&2047)-1024)>>3,-MAXANGVEL),MAXANGVEL));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
goalsprite[snum] = -1;
|
goalsprite[snum] = -1;
|
||||||
|
@ -869,7 +869,7 @@ void computergetinput(int snum, SW_PACKET *syn)
|
||||||
daang = ((getangle(wall[wall[goalwall[snum]].point2].x-wall[goalwall[snum]].x,wall[wall[goalwall[snum]].point2].y-wall[goalwall[snum]].y)+1536)&2047);
|
daang = ((getangle(wall[wall[goalwall[snum]].point2].x-wall[goalwall[snum]].x,wall[wall[goalwall[snum]].point2].y-wall[goalwall[snum]].y)+1536)&2047);
|
||||||
syn->vel += (x2-x1)*2047/dist;
|
syn->vel += (x2-x1)*2047/dist;
|
||||||
syn->svel += (y2-y1)*2047/dist;
|
syn->svel += (y2-y1)*2047/dist;
|
||||||
syn->q16avel = fix16_from_int(min(max((((daang+1024-damyang)&2047)-1024)>>3,-MAXANGVEL),MAXANGVEL));
|
syn->q16angvel = fix16_from_int(min(max((((daang+1024-damyang)&2047)-1024)>>3,-MAXANGVEL),MAXANGVEL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -890,7 +890,7 @@ void computergetinput(int snum, SW_PACKET *syn)
|
||||||
daang = ((getangle(wall[wall[goalwall[snum]].point2].x-wall[goalwall[snum]].x,wall[wall[goalwall[snum]].point2].y-wall[goalwall[snum]].y)+1536)&2047);
|
daang = ((getangle(wall[wall[goalwall[snum]].point2].x-wall[goalwall[snum]].x,wall[wall[goalwall[snum]].point2].y-wall[goalwall[snum]].y)+1536)&2047);
|
||||||
syn->vel += (x2-x1)*2047/dist;
|
syn->vel += (x2-x1)*2047/dist;
|
||||||
syn->svel += (y2-y1)*2047/dist;
|
syn->svel += (y2-y1)*2047/dist;
|
||||||
syn->q16avel = fix16_from_int(min(max((((daang+1024-damyang)&2047)-1024)>>3,-MAXANGVEL),MAXANGVEL));
|
syn->q16angvel = fix16_from_int(min(max((((daang+1024-damyang)&2047)-1024)>>3,-MAXANGVEL),MAXANGVEL));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,8 +105,8 @@ typedef struct
|
||||||
{
|
{
|
||||||
int32_t vel;
|
int32_t vel;
|
||||||
int32_t svel;
|
int32_t svel;
|
||||||
fix16_t q16avel;
|
fix16_t q16angvel;
|
||||||
fix16_t q16horz;
|
fix16_t q16aimvel;
|
||||||
fix16_t q16ang;
|
fix16_t q16ang;
|
||||||
fix16_t q16horiz;
|
fix16_t q16horiz;
|
||||||
int32_t bits;
|
int32_t bits;
|
||||||
|
@ -300,19 +300,19 @@ int EncodeBits(SW_PACKET *pak, SW_PACKET *old_pak, uint8_t* buf)
|
||||||
SET(*base_ptr, BIT(1));
|
SET(*base_ptr, BIT(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pak->q16avel != old_pak->q16avel) || (pak->q16ang != old_pak->q16ang))
|
if ((pak->q16angvel != old_pak->q16angvel) || (pak->q16ang != old_pak->q16ang))
|
||||||
{
|
{
|
||||||
*((fix16_t *)buf) = pak->q16avel;
|
*((fix16_t *)buf) = pak->q16angvel;
|
||||||
buf += sizeof(pak->q16avel);
|
buf += sizeof(pak->q16angvel);
|
||||||
*((fix16_t *)buf) = pak->q16ang;
|
*((fix16_t *)buf) = pak->q16ang;
|
||||||
buf += sizeof(pak->q16ang);
|
buf += sizeof(pak->q16ang);
|
||||||
SET(*base_ptr, BIT(2));
|
SET(*base_ptr, BIT(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pak->q16horz != old_pak->q16horz) || (pak->q16horiz != old_pak->q16horiz))
|
if ((pak->q16aimvel != old_pak->q16aimvel) || (pak->q16horiz != old_pak->q16horiz))
|
||||||
{
|
{
|
||||||
*((fix16_t *)buf) = pak->q16horz;
|
*((fix16_t *)buf) = pak->q16aimvel;
|
||||||
buf += sizeof(pak->q16horz);
|
buf += sizeof(pak->q16aimvel);
|
||||||
*((fix16_t *)buf) = pak->q16horiz;
|
*((fix16_t *)buf) = pak->q16horiz;
|
||||||
buf += sizeof(pak->q16horiz);
|
buf += sizeof(pak->q16horiz);
|
||||||
SET(*base_ptr, BIT(3));
|
SET(*base_ptr, BIT(3));
|
||||||
|
@ -357,16 +357,16 @@ int DecodeBits(SW_PACKET *pak, SW_PACKET *old_pak, uint8_t* buf)
|
||||||
|
|
||||||
if (TEST(*base_ptr, BIT(2)))
|
if (TEST(*base_ptr, BIT(2)))
|
||||||
{
|
{
|
||||||
pak->q16avel = *(fix16_t *)buf;
|
pak->q16angvel = *(fix16_t *)buf;
|
||||||
buf += sizeof(pak->q16avel);
|
buf += sizeof(pak->q16angvel);
|
||||||
pak->q16ang = *(fix16_t *)buf;
|
pak->q16ang = *(fix16_t *)buf;
|
||||||
buf += sizeof(pak->q16ang);
|
buf += sizeof(pak->q16ang);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TEST(*base_ptr, BIT(3)))
|
if (TEST(*base_ptr, BIT(3)))
|
||||||
{
|
{
|
||||||
pak->q16horz = *(fix16_t *)buf;
|
pak->q16aimvel = *(fix16_t *)buf;
|
||||||
buf += sizeof(pak->q16horz);
|
buf += sizeof(pak->q16aimvel);
|
||||||
pak->q16horiz = *(fix16_t *)buf;
|
pak->q16horiz = *(fix16_t *)buf;
|
||||||
buf += sizeof(pak->q16horiz);
|
buf += sizeof(pak->q16horiz);
|
||||||
}
|
}
|
||||||
|
@ -950,8 +950,8 @@ faketimerhandler(void)
|
||||||
|
|
||||||
AveragePacket.vel += loc.vel;
|
AveragePacket.vel += loc.vel;
|
||||||
AveragePacket.svel += loc.svel;
|
AveragePacket.svel += loc.svel;
|
||||||
AveragePacket.q16avel += loc.q16avel;
|
AveragePacket.q16angvel += loc.q16angvel;
|
||||||
AveragePacket.q16horz += loc.q16horz;
|
AveragePacket.q16aimvel += loc.q16aimvel;
|
||||||
AveragePacket.q16ang = Player[myconnectindex].camq16ang;
|
AveragePacket.q16ang = Player[myconnectindex].camq16ang;
|
||||||
AveragePacket.q16horiz = Player[myconnectindex].camq16horiz;
|
AveragePacket.q16horiz = Player[myconnectindex].camq16horiz;
|
||||||
SET(AveragePacket.bits, loc.bits);
|
SET(AveragePacket.bits, loc.bits);
|
||||||
|
@ -972,8 +972,8 @@ faketimerhandler(void)
|
||||||
|
|
||||||
loc.vel = AveragePacket.vel / MovesPerPacket;
|
loc.vel = AveragePacket.vel / MovesPerPacket;
|
||||||
loc.svel = AveragePacket.svel / MovesPerPacket;
|
loc.svel = AveragePacket.svel / MovesPerPacket;
|
||||||
loc.q16avel = fix16_div(AveragePacket.q16avel, fix16_from_int(MovesPerPacket));
|
loc.q16angvel = fix16_div(AveragePacket.q16angvel, fix16_from_int(MovesPerPacket));
|
||||||
loc.q16horz = fix16_div(AveragePacket.q16horz, fix16_from_int(MovesPerPacket));
|
loc.q16aimvel = fix16_div(AveragePacket.q16aimvel, fix16_from_int(MovesPerPacket));
|
||||||
loc.q16ang = AveragePacket.q16ang;
|
loc.q16ang = AveragePacket.q16ang;
|
||||||
loc.q16horiz = AveragePacket.q16horiz;
|
loc.q16horiz = AveragePacket.q16horiz;
|
||||||
loc.bits = AveragePacket.bits;
|
loc.bits = AveragePacket.bits;
|
||||||
|
|
|
@ -1538,7 +1538,7 @@ DoPlayerCrawlHeight(PLAYERp pp)
|
||||||
double scaleAdjustmentToInterval(double x);
|
double scaleAdjustmentToInterval(double x);
|
||||||
|
|
||||||
void
|
void
|
||||||
DoPlayerTurn(PLAYERp pp, fix16_t *pq16ang, fix16_t q16avel)
|
DoPlayerTurn(PLAYERp pp, fix16_t *pq16ang, fix16_t q16angvel)
|
||||||
{
|
{
|
||||||
#define TURN_SHIFT 2
|
#define TURN_SHIFT 2
|
||||||
|
|
||||||
|
@ -1617,14 +1617,14 @@ DoPlayerTurn(PLAYERp pp, fix16_t *pq16ang, fix16_t q16avel)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
q16avel = fix16_smul(q16avel, fix16_from_int(PLAYER_TURN_SCALE));
|
q16angvel = fix16_smul(q16angvel, fix16_from_int(PLAYER_TURN_SCALE));
|
||||||
|
|
||||||
if (q16avel != 0)
|
if (q16angvel != 0)
|
||||||
{
|
{
|
||||||
// running is not handled here now
|
// running is not handled here now
|
||||||
q16avel += fix16_sdiv(q16avel, fix16_from_int(4));
|
q16angvel += fix16_sdiv(q16angvel, fix16_from_int(4));
|
||||||
|
|
||||||
*pq16ang += fix16_sdiv(fix16_mul(q16avel, fix16_from_int(synctics)), fix16_from_int(32));
|
*pq16ang += fix16_sdiv(fix16_mul(q16angvel, fix16_from_int(synctics)), fix16_from_int(32));
|
||||||
*pq16ang = NORM_Q16ANGLE(*pq16ang);
|
*pq16ang = NORM_Q16ANGLE(*pq16ang);
|
||||||
if (PEDANTIC_MODE)
|
if (PEDANTIC_MODE)
|
||||||
*pq16ang = fix16_floor(*pq16ang);
|
*pq16ang = fix16_floor(*pq16ang);
|
||||||
|
@ -1656,7 +1656,7 @@ DoPlayerTurnBoat(PLAYERp pp)
|
||||||
if (sop->drive_angspeed)
|
if (sop->drive_angspeed)
|
||||||
{
|
{
|
||||||
pp->drive_oangvel = pp->drive_angvel;
|
pp->drive_oangvel = pp->drive_angvel;
|
||||||
pp->drive_angvel = mulscale16(fix16_to_int(pp->input.q16avel), sop->drive_angspeed);
|
pp->drive_angvel = mulscale16(fix16_to_int(pp->input.q16angvel), sop->drive_angspeed);
|
||||||
|
|
||||||
angslide = sop->drive_angslide;
|
angslide = sop->drive_angslide;
|
||||||
pp->drive_angvel = (pp->drive_angvel + (pp->drive_oangvel*(angslide-1)))/angslide;
|
pp->drive_angvel = (pp->drive_angvel + (pp->drive_oangvel*(angslide-1)))/angslide;
|
||||||
|
@ -1665,7 +1665,7 @@ DoPlayerTurnBoat(PLAYERp pp)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
angvel = fix16_to_int(pp->input.q16avel) * PLAYER_TURN_SCALE;
|
angvel = fix16_to_int(pp->input.q16angvel) * PLAYER_TURN_SCALE;
|
||||||
angvel += angvel - DIV4(angvel);
|
angvel += angvel - DIV4(angvel);
|
||||||
angvel = DIV32(angvel * synctics);
|
angvel = DIV32(angvel * synctics);
|
||||||
}
|
}
|
||||||
|
@ -1688,7 +1688,7 @@ DoPlayerTurnTank(PLAYERp pp, int z, int floor_dist)
|
||||||
int angslide;
|
int angslide;
|
||||||
|
|
||||||
pp->drive_oangvel = pp->drive_angvel;
|
pp->drive_oangvel = pp->drive_angvel;
|
||||||
pp->drive_angvel = mulscale16(fix16_to_int(pp->input.q16avel), sop->drive_angspeed);
|
pp->drive_angvel = mulscale16(fix16_to_int(pp->input.q16angvel), sop->drive_angspeed);
|
||||||
|
|
||||||
angslide = sop->drive_angslide;
|
angslide = sop->drive_angslide;
|
||||||
pp->drive_angvel = (pp->drive_angvel + (pp->drive_oangvel*(angslide-1)))/angslide;
|
pp->drive_angvel = (pp->drive_angvel + (pp->drive_oangvel*(angslide-1)))/angslide;
|
||||||
|
@ -1697,7 +1697,7 @@ DoPlayerTurnTank(PLAYERp pp, int z, int floor_dist)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
angvel = DIV8(fix16_to_int(pp->input.q16avel) * synctics);
|
angvel = DIV8(fix16_to_int(pp->input.q16angvel) * synctics);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (angvel != 0)
|
if (angvel != 0)
|
||||||
|
@ -1721,7 +1721,7 @@ DoPlayerTurnTankRect(PLAYERp pp, int *x, int *y, int *ox, int *oy)
|
||||||
int angslide;
|
int angslide;
|
||||||
|
|
||||||
pp->drive_oangvel = pp->drive_angvel;
|
pp->drive_oangvel = pp->drive_angvel;
|
||||||
pp->drive_angvel = mulscale16(fix16_to_int(pp->input.q16avel), sop->drive_angspeed);
|
pp->drive_angvel = mulscale16(fix16_to_int(pp->input.q16angvel), sop->drive_angspeed);
|
||||||
|
|
||||||
angslide = sop->drive_angslide;
|
angslide = sop->drive_angslide;
|
||||||
pp->drive_angvel = (pp->drive_angvel + (pp->drive_oangvel*(angslide-1)))/angslide;
|
pp->drive_angvel = (pp->drive_angvel + (pp->drive_oangvel*(angslide-1)))/angslide;
|
||||||
|
@ -1730,7 +1730,7 @@ DoPlayerTurnTankRect(PLAYERp pp, int *x, int *y, int *ox, int *oy)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
angvel = DIV8(fix16_to_int(pp->input.q16avel) * synctics);
|
angvel = DIV8(fix16_to_int(pp->input.q16angvel) * synctics);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (angvel != 0)
|
if (angvel != 0)
|
||||||
|
@ -1759,9 +1759,9 @@ DoPlayerTurnTurret(PLAYERp pp)
|
||||||
fifo_ndx = (movefifoplc-2) & (MOVEFIFOSIZ - 1);
|
fifo_ndx = (movefifoplc-2) & (MOVEFIFOSIZ - 1);
|
||||||
last_input = pp->inputfifo[fifo_ndx];
|
last_input = pp->inputfifo[fifo_ndx];
|
||||||
|
|
||||||
if (pp->input.q16avel && !last_input.q16avel)
|
if (pp->input.q16angvel && !last_input.q16angvel)
|
||||||
PlaySOsound(pp->sop->mid_sector, SO_DRIVE_SOUND);
|
PlaySOsound(pp->sop->mid_sector, SO_DRIVE_SOUND);
|
||||||
else if (!pp->input.q16avel && last_input.q16avel)
|
else if (!pp->input.q16angvel && last_input.q16angvel)
|
||||||
PlaySOsound(pp->sop->mid_sector, SO_IDLE_SOUND);
|
PlaySOsound(pp->sop->mid_sector, SO_IDLE_SOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1770,7 +1770,7 @@ DoPlayerTurnTurret(PLAYERp pp)
|
||||||
int angslide;
|
int angslide;
|
||||||
|
|
||||||
pp->drive_oangvel = pp->drive_angvel;
|
pp->drive_oangvel = pp->drive_angvel;
|
||||||
pp->drive_angvel = mulscale16(fix16_to_int(pp->input.q16avel), sop->drive_angspeed);
|
pp->drive_angvel = mulscale16(fix16_to_int(pp->input.q16angvel), sop->drive_angspeed);
|
||||||
|
|
||||||
angslide = sop->drive_angslide;
|
angslide = sop->drive_angslide;
|
||||||
pp->drive_angvel = (pp->drive_angvel + (pp->drive_oangvel*(angslide-1)))/angslide;
|
pp->drive_angvel = (pp->drive_angvel + (pp->drive_oangvel*(angslide-1)))/angslide;
|
||||||
|
@ -1779,7 +1779,7 @@ DoPlayerTurnTurret(PLAYERp pp)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
angvel = DIV4(fix16_to_int(pp->input.q16avel) * synctics);
|
angvel = DIV4(fix16_to_int(pp->input.q16angvel) * synctics);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (angvel != 0)
|
if (angvel != 0)
|
||||||
|
@ -1906,7 +1906,7 @@ PlayerAutoLook(PLAYERp pp)
|
||||||
|
|
||||||
extern int PlaxCeilGlobZadjust, PlaxFloorGlobZadjust;
|
extern int PlaxCeilGlobZadjust, PlaxFloorGlobZadjust;
|
||||||
void
|
void
|
||||||
DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16horz)
|
DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16aimvel)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
#define HORIZ_SPEED (16)
|
#define HORIZ_SPEED (16)
|
||||||
|
@ -1924,9 +1924,9 @@ DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16horz)
|
||||||
if (cl_slopetilting)
|
if (cl_slopetilting)
|
||||||
PlayerAutoLook(pp);
|
PlayerAutoLook(pp);
|
||||||
|
|
||||||
if (q16horz)
|
if (q16aimvel)
|
||||||
{
|
{
|
||||||
pp->q16horizbase += q16horz;
|
pp->q16horizbase += q16aimvel;
|
||||||
SET(pp->Flags, PF_LOCK_HORIZ | PF_LOOKING);
|
SET(pp->Flags, PF_LOCK_HORIZ | PF_LOOKING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2635,7 +2635,7 @@ DoPlayerMove(PLAYERp pp)
|
||||||
|
|
||||||
SlipSlope(pp);
|
SlipSlope(pp);
|
||||||
|
|
||||||
DoPlayerTurn(pp, &pp->q16ang, pp->input.q16avel);
|
DoPlayerTurn(pp, &pp->q16ang, pp->input.q16angvel);
|
||||||
|
|
||||||
pp->oldposx = pp->posx;
|
pp->oldposx = pp->posx;
|
||||||
pp->oldposy = pp->posy;
|
pp->oldposy = pp->posy;
|
||||||
|
@ -2739,7 +2739,7 @@ DoPlayerMove(PLAYERp pp)
|
||||||
|
|
||||||
DoPlayerSetWadeDepth(pp);
|
DoPlayerSetWadeDepth(pp);
|
||||||
|
|
||||||
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
|
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel);
|
||||||
|
|
||||||
if (pp->cursectnum >= 0 && TEST(sector[pp->cursectnum].extra, SECTFX_DYNAMIC_AREA))
|
if (pp->cursectnum >= 0 && TEST(sector[pp->cursectnum].extra, SECTFX_DYNAMIC_AREA))
|
||||||
{
|
{
|
||||||
|
@ -2947,7 +2947,7 @@ DoPlayerMoveBoat(PLAYERp pp)
|
||||||
OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->posx, pp->posy);
|
OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->posx, pp->posy);
|
||||||
pp->cursectnum = save_sectnum; // for speed
|
pp->cursectnum = save_sectnum; // for speed
|
||||||
|
|
||||||
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
|
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -3117,7 +3117,7 @@ DriveCrush(PLAYERp pp, int *x, int *y)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// not moving - don't crush
|
// not moving - don't crush
|
||||||
if ((pp->xvect|pp->yvect) == 0 && pp->input.q16avel == 0)
|
if ((pp->xvect|pp->yvect) == 0 && pp->input.q16angvel == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// main sector
|
// main sector
|
||||||
|
@ -3458,7 +3458,7 @@ DoPlayerMoveTank(PLAYERp pp)
|
||||||
OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->posx, pp->posy);
|
OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->posx, pp->posy);
|
||||||
pp->cursectnum = save_sectnum; // for speed
|
pp->cursectnum = save_sectnum; // for speed
|
||||||
|
|
||||||
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
|
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel);
|
||||||
|
|
||||||
DoTankTreads(pp);
|
DoTankTreads(pp);
|
||||||
}
|
}
|
||||||
|
@ -3475,7 +3475,7 @@ DoPlayerMoveTurret(PLAYERp pp)
|
||||||
|
|
||||||
OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->sop->xmid, pp->sop->ymid);
|
OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->sop->xmid, pp->sop->ymid);
|
||||||
|
|
||||||
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
|
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -4051,7 +4051,7 @@ DoPlayerClimb(PLAYERp pp)
|
||||||
sp->z = pp->posz + PLAYER_HEIGHT;
|
sp->z = pp->posz + PLAYER_HEIGHT;
|
||||||
changespritesect(pp->PlayerSprite, pp->cursectnum);
|
changespritesect(pp->PlayerSprite, pp->cursectnum);
|
||||||
|
|
||||||
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
|
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel);
|
||||||
|
|
||||||
if (FAF_ConnectArea(pp->cursectnum))
|
if (FAF_ConnectArea(pp->cursectnum))
|
||||||
{
|
{
|
||||||
|
@ -5922,7 +5922,7 @@ DoPlayerBeginOperate(PLAYERp pp)
|
||||||
break;
|
break;
|
||||||
case SO_TURRET_MGUN:
|
case SO_TURRET_MGUN:
|
||||||
case SO_TURRET:
|
case SO_TURRET:
|
||||||
if (pp->input.q16avel)
|
if (pp->input.q16angvel)
|
||||||
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);
|
||||||
|
@ -6010,7 +6010,7 @@ DoPlayerBeginRemoteOperate(PLAYERp pp, SECTOR_OBJECTp sop)
|
||||||
break;
|
break;
|
||||||
case SO_TURRET_MGUN:
|
case SO_TURRET_MGUN:
|
||||||
case SO_TURRET:
|
case SO_TURRET:
|
||||||
if (pp->input.q16avel)
|
if (pp->input.q16angvel)
|
||||||
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);
|
||||||
|
@ -6779,9 +6779,9 @@ void DoPlayerDeathFollowKiller(PLAYERp pp)
|
||||||
//DoPlayerDeathTilt(pp, pp->tilt_dest, 4 * synctics);
|
//DoPlayerDeathTilt(pp, pp->tilt_dest, 4 * synctics);
|
||||||
|
|
||||||
// allow turning
|
// allow turning
|
||||||
if ((TEST(pp->Flags, PF_DEAD_HEAD) && pp->input.q16avel != 0) || TEST(pp->Flags, PF_HEAD_CONTROL))
|
if ((TEST(pp->Flags, PF_DEAD_HEAD) && pp->input.q16angvel != 0) || TEST(pp->Flags, PF_HEAD_CONTROL))
|
||||||
{
|
{
|
||||||
DoPlayerTurn(pp, &pp->q16ang, pp->input.q16avel);
|
DoPlayerTurn(pp, &pp->q16ang, pp->input.q16angvel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7603,7 +7603,7 @@ void ChopsCheck(PLAYERp pp)
|
||||||
|
|
||||||
if (!M_Active() && !HelpInputMode && !TEST(pp->Flags, PF_DEAD) && !pp->sop_riding && numplayers <= 1)
|
if (!M_Active() && !HelpInputMode && !TEST(pp->Flags, PF_DEAD) && !pp->sop_riding && numplayers <= 1)
|
||||||
{
|
{
|
||||||
if ((pp->input.bits|pp->input.vel|pp->input.svel|pp->input.q16avel|pp->input.q16horz) ||
|
if ((pp->input.bits|pp->input.vel|pp->input.svel|pp->input.q16angvel|pp->input.q16aimvel) ||
|
||||||
TEST(pp->Flags, PF_CLIMBING|PF_FALLING|PF_DIVING))
|
TEST(pp->Flags, PF_CLIMBING|PF_FALLING|PF_DIVING))
|
||||||
{
|
{
|
||||||
// Hit a input key or other reason to stop chops
|
// Hit a input key or other reason to stop chops
|
||||||
|
|
Loading…
Reference in a new issue