Commit a3dbdea4 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

Duke3d: revise a359877b

parent 83278aec
......@@ -965,19 +965,23 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
if (pPlayer->newowner < 0)
{
vec3_t camVect = { pPlayer->opos.x + mulscale16(pPlayer->pos.x - pPlayer->opos.x, smoothRatio),
pPlayer->opos.y + mulscale16(pPlayer->pos.y - pPlayer->opos.y, smoothRatio),
pPlayer->opos.z + mulscale16(pPlayer->pos.z - pPlayer->opos.z, smoothRatio) };
vec3_t const goal = { pPlayer->opos.x + mulscale16(pPlayer->pos.x - pPlayer->opos.x, smoothRatio),
pPlayer->opos.y + mulscale16(pPlayer->pos.y - pPlayer->opos.y, smoothRatio),
pPlayer->opos.z + mulscale16(pPlayer->pos.z - pPlayer->opos.z, smoothRatio) };
static vec3_t v3;
CAMERA(pos) = goal;
#if 1
// I'm not particularly happy with this
static vec3_t lastcam;
static int16_t lastcamsect;
if (Bmemcmp(&pPlayer->pos, &pPlayer->opos, sizeof(vec3_t)))
camVect = { v3.x + ((camVect.x - v3.x) >> 1), v3.y + ((camVect.y - v3.y) >> 1), v3.z + ((camVect.z - v3.z) >> 1) };
if (cansee(lastcam.x, lastcam.y, lastcam.z, lastcamsect, goal.x, goal.y, goal.z, CAMERA(sect)))
CAMERA(pos) = { logapproach(lastcam.x, goal.x), logapproach(lastcam.y, goal.y), logapproach(lastcam.z, goal.z) };
v3 = camVect;
lastcam = CAMERA(pos);
lastcamsect = CAMERA(sect);
#endif
CAMERA(pos) = camVect;
if (thisPlayer.smoothcamera)
{
CAMERA(q16ang) = pPlayer->oq16ang
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment