SW: Minor tweaks.

This commit is contained in:
Mitchell Richters 2020-04-05 20:05:52 +10:00 committed by Christoph Oelckers
parent a178961a3e
commit 377ba68344
3 changed files with 5 additions and 14 deletions

View file

@ -885,7 +885,7 @@ analyzesprites(int viewx, int viewy, int viewz, SWBOOL mirror)
} }
tsp->z = tsp->z + pp->siz; tsp->z = tsp->z + pp->siz;
tsp->ang = fix16_to_int(pp->siang); tsp->ang = fix16_to_int(pp->q16ang);
//continue; //continue;
} }
else else
@ -2056,7 +2056,6 @@ drawscreen(PLAYERp pp)
pp->six = tx; pp->six = tx;
pp->siy = ty; pp->siy = ty;
pp->siz = tz - pp->posz; pp->siz = tz - pp->posz;
pp->siang = tq16ang;
QuakeViewChange(camerapp, &quake_z, &quake_x, &quake_y, &quake_ang); QuakeViewChange(camerapp, &quake_z, &quake_x, &quake_y, &quake_ang);
VisViewChange(camerapp, &g_visibility); VisViewChange(camerapp, &g_visibility);

View file

@ -1055,7 +1055,6 @@ struct PLAYERstruct
int camera_dist; // view mode dist int camera_dist; // view mode dist
int circle_camera_dist; int circle_camera_dist;
int six,siy,siz; // save player interp position for PlayerSprite int six,siy,siz; // save player interp position for PlayerSprite
fix16_t siang;
int xvect, yvect; int xvect, yvect;
int oxvect, oyvect; int oxvect, oyvect;

View file

@ -97,7 +97,7 @@ SWBOOL NightVision = FALSE;
extern SWBOOL FinishedLevel; extern SWBOOL FinishedLevel;
//#define PLAYER_TURN_SCALE (8) //#define PLAYER_TURN_SCALE (8)
#define PLAYER_TURN_SCALE 2.4f #define PLAYER_TURN_SCALE (12)
// the smaller the number the slower the going // the smaller the number the slower the going
#define PLAYER_RUN_FRICTION (50000L) #define PLAYER_RUN_FRICTION (50000L)
@ -1332,7 +1332,7 @@ DoPlayerTeleportPause(PLAYERp pp)
void void
DoPlayerTeleportToSprite(PLAYERp pp, SPRITEp sp) DoPlayerTeleportToSprite(PLAYERp pp, SPRITEp sp)
{ {
pp->q16ang = pp->q16ang = fix16_from_int(sp->ang); pp->q16ang = fix16_from_int(sp->ang);
pp->posx = pp->oposx = pp->oldposx = sp->x; pp->posx = pp->oposx = pp->oldposx = sp->x;
pp->posy = pp->oposy = pp->oldposy = sp->y; pp->posy = pp->oposy = pp->oldposy = sp->y;
@ -1538,8 +1538,6 @@ DoPlayerCrawlHeight(PLAYERp pp)
void void
DoPlayerTurn(PLAYERp pp) DoPlayerTurn(PLAYERp pp)
{ {
fix16_t angvel;
#define TURN_SHIFT 2 #define TURN_SHIFT 2
if (!TEST(pp->Flags, PF_TURN_180)) if (!TEST(pp->Flags, PF_TURN_180))
@ -1594,14 +1592,9 @@ DoPlayerTurn(PLAYERp pp)
return; return;
} }
angvel = fix16_smul(pp->input.q16avel, fix16_from_float(PLAYER_TURN_SCALE)); if (pp->input.q16avel != 0)
if (angvel != 0)
{ {
// running is not handled here now pp->q16ang = fix16_sadd(pp->q16ang, fix16_sdiv(fix16_smul(pp->input.q16avel, fix16_from_int(synctics)), fix16_from_int(32))) & 0x7FFFFFF;
angvel = fix16_sdiv(angvel, fix16_from_int(4));
pp->q16ang = fix16_sadd(pp->q16ang, fix16_sdiv(fix16_smul(angvel, fix16_from_int(synctics)), fix16_from_int(32))) & 0x7FFFFFF;
// update players sprite angle // update players sprite angle
// NOTE: It's also updated in UpdatePlayerSprite, but needs to be // NOTE: It's also updated in UpdatePlayerSprite, but needs to be