mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
When looking through a camera, don't do third person view.
Also, reorganize some G_DrawRooms() code a little without changing anything. git-svn-id: https://svn.eduke32.com/eduke32@3143 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
e7e777348b
commit
547b28b63e
1 changed files with 26 additions and 24 deletions
|
@ -3496,12 +3496,12 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio)
|
||||||
setaspect_new();
|
setaspect_new();
|
||||||
}
|
}
|
||||||
|
|
||||||
smoothratio = clamp((totalclock-ototalclock)*(65536/4), 0, 65536);
|
|
||||||
|
|
||||||
visibility = (int32_t)(p->visibility * (numplayers > 1 ? 1.f : r_ambientlightrecip));
|
|
||||||
|
|
||||||
if (ud.pause_on || g_player[snum].ps->on_crane > -1)
|
if (ud.pause_on || g_player[snum].ps->on_crane > -1)
|
||||||
smoothratio = 65536;
|
smoothratio = 65536;
|
||||||
|
else
|
||||||
|
smoothratio = clamp((totalclock-ototalclock)*(65536/4), 0, 65536);
|
||||||
|
|
||||||
|
visibility = (int32_t)(p->visibility * (numplayers > 1 ? 1.f : r_ambientlightrecip));
|
||||||
|
|
||||||
ud.camerasect = p->cursectnum;
|
ud.camerasect = p->cursectnum;
|
||||||
|
|
||||||
|
@ -3630,6 +3630,7 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio)
|
||||||
p->orotscrnang = p->rotscrnang; // JBF: save it for next time
|
p->orotscrnang = p->rotscrnang; // JBF: save it for next time
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p->newowner < 0)
|
||||||
{
|
{
|
||||||
vec3_t cam = { p->opos.x+mulscale16(p->pos.x-p->opos.x, smoothratio),
|
vec3_t cam = { p->opos.x+mulscale16(p->pos.x-p->opos.x, smoothratio),
|
||||||
p->opos.y+mulscale16(p->pos.y-p->opos.y, smoothratio),
|
p->opos.y+mulscale16(p->pos.y-p->opos.y, smoothratio),
|
||||||
|
@ -3638,31 +3639,34 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio)
|
||||||
|
|
||||||
Bmemcpy(&ud.camera, &cam, sizeof(vec3_t));
|
Bmemcpy(&ud.camera, &cam, sizeof(vec3_t));
|
||||||
ud.cameraang = p->oang + mulscale16(((p->ang+1024-p->oang)&2047)-1024, smoothratio);
|
ud.cameraang = p->oang + mulscale16(((p->ang+1024-p->oang)&2047)-1024, smoothratio);
|
||||||
|
ud.cameraang += p->look_ang;
|
||||||
ud.camerahoriz = p->ohoriz+p->ohorizoff
|
ud.camerahoriz = p->ohoriz+p->ohorizoff
|
||||||
+ mulscale16((p->horiz+p->horizoff-p->ohoriz-p->ohorizoff), smoothratio);
|
+ mulscale16((p->horiz+p->horizoff-p->ohoriz-p->ohorizoff), smoothratio);
|
||||||
}
|
|
||||||
ud.cameraang += p->look_ang;
|
|
||||||
|
|
||||||
if (p->newowner >= 0)
|
if (ud.viewbob)
|
||||||
|
{
|
||||||
|
int32_t addz = (p->opyoff + mulscale16(p->pyoff-p->opyoff, smoothratio));
|
||||||
|
if (p->over_shoulder_on)
|
||||||
|
addz >>= 3;
|
||||||
|
|
||||||
|
ud.camera.z += addz;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p->over_shoulder_on)
|
||||||
|
{
|
||||||
|
ud.camera.z -= 3072;
|
||||||
|
G_DoThirdPerson(p,&ud.camera,&ud.camerasect,ud.cameraang,ud.camerahoriz);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
|
// looking through viewscreen
|
||||||
|
Bmemcpy(&ud.camera, &p->pos, sizeof(vec3_t));
|
||||||
ud.cameraang = p->ang + p->look_ang;
|
ud.cameraang = p->ang + p->look_ang;
|
||||||
ud.camerahoriz = p->horiz + p->horizoff;
|
ud.camerahoriz = 100+sprite[p->newowner].shade;
|
||||||
Bmemcpy(&ud.camera, p, sizeof(vec3_t));
|
|
||||||
ud.camerasect = sprite[p->newowner].sectnum;
|
ud.camerasect = sprite[p->newowner].sectnum;
|
||||||
smoothratio = 65536;
|
smoothratio = 65536;
|
||||||
}
|
}
|
||||||
else if (ud.viewbob) // if (p->over_shoulder_on == 0)
|
|
||||||
{
|
|
||||||
if (p->over_shoulder_on)
|
|
||||||
ud.camera.z += (p->opyoff + mulscale16(p->pyoff-p->opyoff, smoothratio))>>3;
|
|
||||||
else ud.camera.z += p->opyoff + mulscale16(p->pyoff-p->opyoff, smoothratio);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p->over_shoulder_on)
|
|
||||||
{
|
|
||||||
ud.camera.z -= 3072;
|
|
||||||
G_DoThirdPerson(p,&ud.camera,&ud.camerasect,ud.cameraang,ud.camerahoriz);
|
|
||||||
}
|
|
||||||
|
|
||||||
cz = actor[p->i].ceilingz;
|
cz = actor[p->i].ceilingz;
|
||||||
fz = actor[p->i].floorz;
|
fz = actor[p->i].floorz;
|
||||||
|
@ -3676,9 +3680,7 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio)
|
||||||
if (sprite[p->i].pal == 1)
|
if (sprite[p->i].pal == 1)
|
||||||
ud.camera.z -= (18<<8);
|
ud.camera.z -= (18<<8);
|
||||||
|
|
||||||
if (p->newowner >= 0)
|
if (p->newowner < 0 && p->spritebridge == 0)
|
||||||
ud.camerahoriz = 100+sprite[p->newowner].shade;
|
|
||||||
else if (p->spritebridge == 0)
|
|
||||||
{
|
{
|
||||||
// NOTE: when shrunk, p->pos.z can be below the floor. This puts the
|
// NOTE: when shrunk, p->pos.z can be below the floor. This puts the
|
||||||
// camera into the sector again then.
|
// camera into the sector again then.
|
||||||
|
|
Loading…
Reference in a new issue