mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- Blood/Duke/RR/SW: Improvements to 3rd person viewing by modifying the rendered player's posz so the camera is looking further above the camera sprite as EDuke32 does. Blood just enables the crosshair when using 3rd person view.
This commit is contained in:
parent
e7de0da36c
commit
4ff3810711
4 changed files with 34 additions and 11 deletions
|
@ -98,13 +98,14 @@ static void viewBurnTime(int gScale)
|
|||
|
||||
void hudDraw(PLAYER *gView, VIEW *pView, int nSectnum, double bobx, double boby, double zDelta, int basepal, double smoothratio)
|
||||
{
|
||||
double look_anghalf = getHalfLookAng(pView->q16look_ang, gView->q16look_ang, cl_syncinput, smoothratio);
|
||||
|
||||
DrawCrosshair(kCrosshairTile, gView->pXSprite->health >> 4, -look_anghalf, 0, 2);
|
||||
|
||||
if (gViewPos == 0)
|
||||
{
|
||||
double look_anghalf = getHalfLookAng(pView->q16look_ang, gView->q16look_ang, cl_syncinput, smoothratio);
|
||||
double looking_arc = fabs(look_anghalf) / 4.5;
|
||||
|
||||
DrawCrosshair(kCrosshairTile, gView->pXSprite->health >> 4, -look_anghalf, 0, 2);
|
||||
|
||||
double cX = 160 - look_anghalf;
|
||||
double cY = 220 + looking_arc;
|
||||
if (cl_weaponsway)
|
||||
|
|
|
@ -300,7 +300,7 @@ void drawoverlays(double smoothratio)
|
|||
|
||||
if (ps[myconnectindex].newowner == -1 && ud.camerasprite == -1)
|
||||
{
|
||||
DrawCrosshair(TILE_CROSSHAIR, ps[screenpeek].last_extra, -getHalfLookAng(pp->oq16look_ang, pp->q16look_ang, cl_syncinput, smoothratio), 0, isRR() ? 0.5 : 1);
|
||||
DrawCrosshair(TILE_CROSSHAIR, ps[screenpeek].last_extra, -getHalfLookAng(pp->oq16look_ang, pp->q16look_ang, cl_syncinput, smoothratio), pp->over_shoulder_on ? 2.5 : 0, isRR() ? 0.5 : 1);
|
||||
}
|
||||
|
||||
if (paused == 2)
|
||||
|
|
|
@ -604,7 +604,16 @@ void displayrooms(int snum, double smoothratio)
|
|||
{
|
||||
if (cl_viewbob) cposz += p->opyoff + xs_CRoundToInt(fmulscale16(p->pyoff - p->opyoff, smoothratio));
|
||||
}
|
||||
else view(p, &cposx, &cposy, &cposz, §, cang.asbuild(), choriz.asq16(), smoothratio);
|
||||
else
|
||||
{
|
||||
cposz -= isRR() ? 3840 : 3072;
|
||||
|
||||
if (!view(p, &cposx, &cposy, &cposz, §, cang.asbuild(), choriz.asq16(), smoothratio))
|
||||
{
|
||||
cposz += isRR() ? 3840 : 3072;
|
||||
view(p, &cposx, &cposy, &cposz, §, cang.asbuild(), choriz.asq16(), smoothratio);
|
||||
}
|
||||
}
|
||||
|
||||
// do screen rotation.
|
||||
renderSetRollAngle(FixedToInt(q16rotscrnang));
|
||||
|
|
|
@ -941,7 +941,7 @@ post_analyzesprites(void)
|
|||
#endif
|
||||
|
||||
|
||||
void
|
||||
bool
|
||||
BackView(int *nx, int *ny, int *nz, short *vsect, fixed_t *nq16ang, fixed_t q16horiz)
|
||||
{
|
||||
vec3_t n = { *nx, *ny, *nz };
|
||||
|
@ -973,6 +973,12 @@ BackView(int *nx, int *ny, int *nz, short *vsect, fixed_t *nq16ang, fixed_t q16h
|
|||
hitscan(&n, *vsect, vx, vy, vz,
|
||||
&hitinfo, CLIPMASK_PLAYER);
|
||||
|
||||
if (*vsect < 0)
|
||||
{
|
||||
sp->cstat = bakcstat;
|
||||
return false;
|
||||
}
|
||||
|
||||
ASSERT(*vsect >= 0 && *vsect < MAXSECTORS);
|
||||
|
||||
sp->cstat = bakcstat; // Restore cstat
|
||||
|
@ -1018,7 +1024,7 @@ BackView(int *nx, int *ny, int *nz, short *vsect, fixed_t *nq16ang, fixed_t q16h
|
|||
ASSERT(*vsect >= 0 && *vsect < MAXSECTORS);
|
||||
BackView(nx, ny, nz, vsect, nq16ang, q16horiz);
|
||||
hsp->cstat = flag_backup;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1057,7 +1063,8 @@ BackView(int *nx, int *ny, int *nz, short *vsect, fixed_t *nq16ang, fixed_t q16h
|
|||
// Make sure vsect is correct
|
||||
updatesectorz(*nx, *ny, *nz, vsect);
|
||||
|
||||
*nq16ang = IntToFixed(ang);
|
||||
*nq16ang += IntToFixed(pp->view_outside_dang);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1259,10 +1266,10 @@ void DrawCrosshair(PLAYERp pp)
|
|||
{
|
||||
extern bool CameraTestMode;
|
||||
|
||||
if (!(CameraTestMode) && !TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE))
|
||||
if (!(CameraTestMode))
|
||||
{
|
||||
USERp u = User[pp->PlayerSprite];
|
||||
::DrawCrosshair(2326, u->Health, -getHalfLookAng(pp->oq16look_ang, pp->q16look_ang, cl_syncinput, smoothratio), 0, 2, shadeToLight(10));
|
||||
::DrawCrosshair(2326, u->Health, -getHalfLookAng(pp->oq16look_ang, pp->q16look_ang, cl_syncinput, smoothratio), TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE) ? 5 : 0, 2, shadeToLight(10));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1719,7 +1726,13 @@ drawscreen(PLAYERp pp, double smoothratio)
|
|||
|
||||
if (TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE))
|
||||
{
|
||||
BackView(&tx, &ty, &tz, &tsectnum, &tq16ang, tq16horiz);
|
||||
tz -= 8448;
|
||||
|
||||
if (!BackView(&tx, &ty, &tz, &tsectnum, &tq16ang, tq16horiz))
|
||||
{
|
||||
tz += 8448;
|
||||
BackView(&tx, &ty, &tz, &tsectnum, &tq16ang, tq16horiz);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue