- use the same camera sprite selection logic as EDuke32 and RedNukem.

This is the only one that makes some sense.
This commit is contained in:
Christoph Oelckers 2020-12-13 14:11:38 +01:00
parent 0c71cc4b38
commit 3787e103d2
2 changed files with 6 additions and 11 deletions

View file

@ -1287,20 +1287,15 @@ static void movefireext(DDukeActor* actor)
static void moveviewscreen(DDukeActor* actor) static void moveviewscreen(DDukeActor* actor)
{ {
const int VIEWSCR_DIST = 8192; // was originally 2048, was increased to this by EDuke32 and RedNukem.
if (actor->s.xrepeat == 0) deletesprite(actor); if (actor->s.xrepeat == 0) deletesprite(actor);
else else
{ {
int x; int x;
findplayer(actor, &x); int p = findplayer(actor, &x);
if (x < 2048) x = dist(actor, ps[p].GetActor()); // the result from findplayer is not really useful.
{ if (x >= VIEWSCR_DIST && camsprite == actor)
#if 0
if (actor->s.yvel == 1)
camsprite = actor;
#endif
}
else if (camsprite != nullptr && actor->temp_data[0] == 1)
{ {
camsprite = nullptr; camsprite = nullptr;
actor->s.yvel = 0; actor->s.yvel = 0;

View file

@ -258,14 +258,14 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
continue; continue;
case VIEWSCREEN: case VIEWSCREEN:
case VIEWSCREEN2: case VIEWSCREEN2:
if (camsprite != nullptr && h->GetOwner()->temp_data[0] == 1) if (camsprite != nullptr && h->GetHitOwner()->temp_data[0] == 1)
{ {
t->picnum = STATIC; t->picnum = STATIC;
t->cstat |= (rand() & 12); t->cstat |= (rand() & 12);
t->xrepeat += 8; t->xrepeat += 8;
t->yrepeat += 8; t->yrepeat += 8;
} }
else if (camsprite != nullptr) else if (camsprite == h->GetHitOwner())
{ {
t->picnum = TILE_VIEWSCR; t->picnum = TILE_VIEWSCR;
} }