mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- changed setsectinterpolate to receive a sector number, not a sprite number.
This commit is contained in:
parent
32fc9329de
commit
2b0f56a94c
6 changed files with 21 additions and 22 deletions
|
@ -161,7 +161,7 @@ int hitawall(struct player_struct* pl, int* hitWall);
|
||||||
int hits(DDukeActor* snum);
|
int hits(DDukeActor* snum);
|
||||||
|
|
||||||
void clearsectinterpolate(int sprnum);
|
void clearsectinterpolate(int sprnum);
|
||||||
void setsectinterpolate(int sprnum);
|
void setsectinterpolate(int sectnum);
|
||||||
DDukeActor* LocateTheLocator(int n, int sectnum);
|
DDukeActor* LocateTheLocator(int n, int sectnum);
|
||||||
void clearcamera(player_struct* ps);
|
void clearcamera(player_struct* ps);
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ inline int checkcursectnums(int se)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for(i=connecthead;i>=0;i=connectpoint2[i])
|
for(i=connecthead;i>=0;i=connectpoint2[i])
|
||||||
if((unsigned)ps[i].i < MAXSPRITES && sprite[ps[i].i].sectnum == se ) return i;
|
if((unsigned)ps[i].i < MAXSPRITES && ps[i].GetActor()->s.sectnum == se ) return i;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,10 +100,10 @@ void restoreinterpolations() //Stick at end of drawscreen
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void setsectinterpolate(int i)
|
void setsectinterpolate(int sectnum)
|
||||||
{
|
{
|
||||||
int j, k, startwall,endwall;
|
int j, k, startwall,endwall;
|
||||||
auto sect = §or[sprite[i].sectnum];
|
auto sect = §or[sectnum];
|
||||||
|
|
||||||
startwall = sect->wallptr;
|
startwall = sect->wallptr;
|
||||||
endwall = startwall+sect->wallnum;
|
endwall = startwall+sect->wallnum;
|
||||||
|
@ -124,10 +124,10 @@ void setsectinterpolate(int i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearsectinterpolate(short i)
|
void clearsectinterpolate(int sectnum)
|
||||||
{
|
{
|
||||||
short j,startwall,endwall;
|
short j,startwall,endwall;
|
||||||
auto sect = §or[sprite[i].sectnum];
|
auto sect = §or[sectnum];
|
||||||
|
|
||||||
startwall = sect->wallptr;
|
startwall = sect->wallptr;
|
||||||
endwall = startwall + sect->wallnum;
|
endwall = startwall + sect->wallnum;
|
||||||
|
|
|
@ -102,7 +102,8 @@ void fakedomovethings(void)
|
||||||
{
|
{
|
||||||
input *syn;
|
input *syn;
|
||||||
struct player_struct *p;
|
struct player_struct *p;
|
||||||
int i, j, k, doubvel, fz, cz, hz, lz, x, y;
|
int i, j, k, doubvel, fz, cz, x, y;
|
||||||
|
Collision clz, chz;
|
||||||
short psect, psectlotag, tempsect, backcstat;
|
short psect, psectlotag, tempsect, backcstat;
|
||||||
uint8_t shrunk, spritebridge;
|
uint8_t shrunk, spritebridge;
|
||||||
ESyncBits actions;
|
ESyncBits actions;
|
||||||
|
@ -138,11 +139,11 @@ void fakedomovethings(void)
|
||||||
omyz = myz;
|
omyz = myz;
|
||||||
omyang = myang;
|
omyang = myang;
|
||||||
|
|
||||||
getzrange(myx,myy,myz,psect,&cz,&hz,&fz,&lz,163L,CLIPMASK0);
|
getzrange(myx,myy,myz,psect,&cz,chz,&fz,clz,163L,CLIPMASK0);
|
||||||
|
|
||||||
j = getflorzofslope(psect,myx,myy);
|
j = getflorzofslope(psect,myx,myy);
|
||||||
|
|
||||||
if( (lz&49152) == 16384 && psectlotag == 1 && klabs(myz-j) > PHEIGHT+(16<<8) )
|
if(clz.type == kHitSector && psectlotag == 1 && klabs(myz-j) > PHEIGHT+(16<<8) )
|
||||||
psectlotag = 0;
|
psectlotag = 0;
|
||||||
|
|
||||||
if( p->aim_mode == 0 && myonground && psectlotag != 2 && (sector[psect].floorstat&2) )
|
if( p->aim_mode == 0 && myonground && psectlotag != 2 && (sector[psect].floorstat&2) )
|
||||||
|
@ -163,27 +164,25 @@ void fakedomovethings(void)
|
||||||
if (myhorizoff > 0) myhorizoff -= ((myhorizoff>>3)+1);
|
if (myhorizoff > 0) myhorizoff -= ((myhorizoff>>3)+1);
|
||||||
else if (myhorizoff < 0) myhorizoff += (((-myhorizoff)>>3)+1);
|
else if (myhorizoff < 0) myhorizoff += (((-myhorizoff)>>3)+1);
|
||||||
|
|
||||||
if(hz >= 0 && (hz&49152) == 49152)
|
if(chz.type == kHitSprite)
|
||||||
{
|
{
|
||||||
hz &= (MAXSPRITES-1);
|
if (chz.actor->s.statnum == 1 && chz.actor->s.extra >= 0)
|
||||||
if (sprite[hz].statnum == 1 && sprite[hz].extra >= 0)
|
|
||||||
{
|
{
|
||||||
hz = 0;
|
chz.type = kHitNone;
|
||||||
cz = getceilzofslope(psect,myx,myy);
|
cz = getceilzofslope(psect,myx,myy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lz >= 0 && (lz&49152) == 49152)
|
if (clz.type == kHitSprite)
|
||||||
{
|
{
|
||||||
j = lz&(MAXSPRITES-1);
|
if ((clz.actor->s.cstat&33) == 33)
|
||||||
if ((sprite[j].cstat&33) == 33)
|
|
||||||
{
|
{
|
||||||
psectlotag = 0;
|
psectlotag = 0;
|
||||||
spritebridge = 1;
|
spritebridge = 1;
|
||||||
}
|
}
|
||||||
if(badguy(&sprite[j]) && sprite[j].xrepeat > 24 && klabs(p->GetActor()->s.z-sprite[j].z) < (84<<8) )
|
if(badguy(chz.actor) && sprite[j].xrepeat > 24 && klabs(p->GetActor()->s.z- chz.actor->s.z) < (84<<8) )
|
||||||
{
|
{
|
||||||
j = getangle( sprite[j].x-myx,sprite[j].y-myy);
|
j = getangle(chz.actor->s.x-myx, chz.actor->s.y-myy);
|
||||||
myxvel -= sintable[(j+512)&2047]<<4;
|
myxvel -= sintable[(j+512)&2047]<<4;
|
||||||
myyvel -= sintable[j&2047]<<4;
|
myyvel -= sintable[j&2047]<<4;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ static void recreateinterpolations()
|
||||||
case SE_16_REACTOR:
|
case SE_16_REACTOR:
|
||||||
case SE_26:
|
case SE_26:
|
||||||
case SE_30_TWO_WAY_TRAIN:
|
case SE_30_TWO_WAY_TRAIN:
|
||||||
setsectinterpolate(k);
|
setsectinterpolate(sprite[k].sectnum);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -956,7 +956,7 @@ void spawneffector(int i)
|
||||||
if (sp->pal) sprite[i].clipdist = 1;
|
if (sp->pal) sprite[i].clipdist = 1;
|
||||||
else sprite[i].clipdist = 0;
|
else sprite[i].clipdist = 0;
|
||||||
t[3] = sector[sect].floorz;
|
t[3] = sector[sect].floorz;
|
||||||
sector[sect].hitag = i;
|
sector[sect].hitag = i; // hijack
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j = 0; j < MAXSPRITES; j++)
|
for (j = 0; j < MAXSPRITES; j++)
|
||||||
|
@ -1005,7 +1005,7 @@ void spawneffector(int i)
|
||||||
sp->extra = 0;
|
sp->extra = 0;
|
||||||
else sp->extra = 1;
|
else sp->extra = 1;
|
||||||
|
|
||||||
sector[sect].hitag = i;
|
sector[sect].hitag = i; // hijack
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
|
|
||||||
|
@ -1075,7 +1075,7 @@ void spawneffector(int i)
|
||||||
case SE_15_SLIDING_DOOR:
|
case SE_15_SLIDING_DOOR:
|
||||||
case SE_16_REACTOR:
|
case SE_16_REACTOR:
|
||||||
case SE_26:
|
case SE_26:
|
||||||
setsectinterpolate(i);
|
setsectinterpolate(sprite[i].sectnum);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue