diff --git a/source/blood/src/hudsprites.cpp b/source/blood/src/hudsprites.cpp index 8010583a3..ca14fae03 100644 --- a/source/blood/src/hudsprites.cpp +++ b/source/blood/src/hudsprites.cpp @@ -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) diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index 696b5d5bd..11b2cb761 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -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) diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index 6a62407bf..67ba2d368 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -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)); diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index 3bd500985..5b5e3d4d3 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -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 {