-fixed: The HUD model info was taken from the wrong player

It used the current console player's camera, not the actual camera being used for rendering. Although this is the same most of the time, let's better do it right.

This also removes a few leftover references to the player array elsewhwere in the hardware renderer
This commit is contained in:
Christoph Oelckers 2019-01-30 01:04:30 +01:00
parent b12de04258
commit c15212ca82
4 changed files with 2 additions and 9 deletions

View File

@ -615,8 +615,6 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector, int which)
stack = false;
if ((which & SSRF_RENDER3DPLANES) && x.ffloors.Size())
{
player_t * player = players[consoleplayer].camera->player;
renderflags = SSRF_RENDER3DPLANES;
srf |= SSRF_RENDER3DPLANES;
// 3d-floors must not overlap!

View File

@ -948,7 +948,6 @@ void HWHorizonPortal::DrawContents(HWDrawInfo *di, FRenderState &state)
Clocker c(PortalAll);
FMaterial * gltexture;
player_t * player = &players[consoleplayer];
GLSectorPlane * sp = &origin->plane;
auto &vp = di->Viewpoint;

View File

@ -753,7 +753,6 @@ void GLSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
else
Angles = thing->Angles;
player_t *player = &players[consoleplayer];
FloatRect r;
if (sector->sectornum != thing->Sector->sectornum && !thruportal)
@ -1069,7 +1068,6 @@ void GLSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
const bool drawWithXYBillboard = (!(actor->renderflags & RF_FORCEYBILLBOARD)
&& (actor->renderflags & RF_SPRITETYPEMASK) == RF_FACESPRITE
&& players[consoleplayer].camera
&& (gl_billboard_mode == 1 || actor->renderflags & RF_FORCEXYBILLBOARD));
@ -1113,8 +1111,6 @@ void GLSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
void GLSprite::ProcessParticle (HWDrawInfo *di, particle_t *particle, sector_t *sector)//, int shade, int fakeside)
{
player_t *player=&players[consoleplayer];
if (particle->alpha==0) return;
lightlevel = hw_ClampLight(sector->GetTexture(sector_t::ceiling) == skyflatnum ?

View File

@ -488,7 +488,6 @@ void HWDrawInfo::PreparePlayerSprites(sector_t * viewsector, area_t in_area)
bool brightflash = false;
AActor * playermo = players[consoleplayer].camera;
player_t * player = playermo->player;
const bool hudModelStep = IsHUDModelForPlayerAvailable(player);
const auto &vp = Viewpoint;
@ -502,6 +501,7 @@ void HWDrawInfo::PreparePlayerSprites(sector_t * viewsector, area_t in_area)
(r_deathcamera && camera->health <= 0))
return;
const bool hudModelStep = IsHUDModelForPlayerAvailable(camera->player);
WeaponPosition weap = GetWeaponPosition(camera->player, vp.TicFrac);
WeaponLighting light = GetWeaponLighting(viewsector, vp.Pos, isFullbrightScene(), in_area, camera->Pos());