Remove last argument from yax_getneighborsect(), make radarang[] engine.c-local.

git-svn-id: https://svn.eduke32.com/eduke32@3039 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-10-01 17:52:18 +00:00
parent 2ab247b68a
commit 735d1ed77e
4 changed files with 12 additions and 23 deletions

View file

@ -127,7 +127,7 @@ int16_t yax_getnextwall(int16_t wal, int16_t cf);
void yax_setnextwall(int16_t wal, int16_t cf, int16_t thenextwall); void yax_setnextwall(int16_t wal, int16_t cf, int16_t thenextwall);
int16_t yax_vnextsec(int16_t line, int16_t cf); int16_t yax_vnextsec(int16_t line, int16_t cf);
void yax_update(int32_t resetstat); void yax_update(int32_t resetstat);
int32_t yax_getneighborsect(int32_t x, int32_t y, int32_t sectnum, int32_t cf, int16_t *ret_bunchnum); int32_t yax_getneighborsect(int32_t x, int32_t y, int32_t sectnum, int32_t cf);
static inline int32_t yax_waltosecmask(int32_t walclipmask) static inline int32_t yax_waltosecmask(int32_t walclipmask)
{ {
@ -687,12 +687,6 @@ int32_t krand(void);
int32_t ksqrt(uint32_t num); int32_t ksqrt(uint32_t num);
int32_t __fastcall getangle(int32_t xvect, int32_t yvect); int32_t __fastcall getangle(int32_t xvect, int32_t yvect);
//
// getangle
//
EXTERN int16_t radarang[1280];
static inline uint32_t uhypsq(int32_t dx, int32_t dy) static inline uint32_t uhypsq(int32_t dx, int32_t dy)
{ {
return (uint32_t)dx*dx + (uint32_t)dy*dy; return (uint32_t)dx*dx + (uint32_t)dy*dy;

View file

@ -4228,7 +4228,7 @@ rotate_hlsect_out:
} }
// get other-side sector, j==loopstartwall // get other-side sector, j==loopstartwall
dstsect = yax_getneighborsect(wall[j].x, wall[j].y, srcsect, cf, NULL); dstsect = yax_getneighborsect(wall[j].x, wall[j].y, srcsect, cf);
if (dstsect < 0) if (dstsect < 0)
{ {
message("Punch loop INTERNAL ERROR: dstsect < 0. Map corrupt?"); message("Punch loop INTERNAL ERROR: dstsect < 0. Map corrupt?");

View file

@ -160,7 +160,7 @@ static char *artptrs[MAXTILEFILES];
#endif #endif
static int32_t no_radarang2 = 0; static int32_t no_radarang2 = 0;
static int16_t radarang2[MAXXDIM]; static int16_t radarang[1280], radarang2[MAXXDIM];
B_ENGINE_STATIC uint16_t ATTRIBUTE((used)) sqrtable[4096], ATTRIBUTE((used)) shlookup[4096+256]; B_ENGINE_STATIC uint16_t ATTRIBUTE((used)) sqrtable[4096], ATTRIBUTE((used)) shlookup[4096+256];
const char pow2char[8] = {1,2,4,8,16,32,64,128}; const char pow2char[8] = {1,2,4,8,16,32,64,128};
const int32_t pow2long[32] = const int32_t pow2long[32] =
@ -570,7 +570,7 @@ void yax_update(int32_t resetstat)
editstatus = oeditstatus; editstatus = oeditstatus;
} }
int32_t yax_getneighborsect(int32_t x, int32_t y, int32_t sectnum, int32_t cf, int16_t *ret_bunchnum) int32_t yax_getneighborsect(int32_t x, int32_t y, int32_t sectnum, int32_t cf)
{ {
int16_t bunchnum = yax_getbunch(sectnum, cf); int16_t bunchnum = yax_getbunch(sectnum, cf);
int32_t i; int32_t i;
@ -580,11 +580,7 @@ int32_t yax_getneighborsect(int32_t x, int32_t y, int32_t sectnum, int32_t cf, i
for (SECTORS_OF_BUNCH(bunchnum, !cf, i)) for (SECTORS_OF_BUNCH(bunchnum, !cf, i))
if (inside(x, y, i)==1) if (inside(x, y, i)==1)
{
if (ret_bunchnum)
*ret_bunchnum = bunchnum;
return i; return i;
}
return -1; return -1;
} }
@ -799,7 +795,7 @@ static void yax_copytsprites()
if (yax_getbunch(sectnum, cf) != yax_globalbunch) if (yax_getbunch(sectnum, cf) != yax_globalbunch)
continue; continue;
sectnum = yax_getneighborsect(spr->x, spr->y, sectnum, cf, NULL); sectnum = yax_getneighborsect(spr->x, spr->y, sectnum, cf);
if (sectnum < 0) if (sectnum < 0)
continue; continue;
} }
@ -11246,7 +11242,7 @@ restart_grand:
x = x1 + mulscale24(x21,frac); x = x1 + mulscale24(x21,frac);
y = y1 + mulscale24(y21,frac); y = y1 + mulscale24(y21,frac);
ns = yax_getneighborsect(x, y, dasectnum, cf, NULL); ns = yax_getneighborsect(x, y, dasectnum, cf);
if (ns < 0) if (ns < 0)
continue; continue;
@ -11301,7 +11297,7 @@ restart_grand:
x = x1 + mulscale24(x21,t); x = x1 + mulscale24(x21,t);
y = y1 + mulscale24(y21,t); y = y1 + mulscale24(y21,t);
nexts = yax_getneighborsect(x, y, dasectnum, cf, NULL); nexts = yax_getneighborsect(x, y, dasectnum, cf);
if (nexts >= 0) if (nexts >= 0)
goto add_nextsector; goto add_nextsector;
} }
@ -11772,8 +11768,7 @@ restart_grand:
if (SECTORFLD(hit->sect,stat, hitscan_hitsectcf)&yax_waltosecmask(dawalclipmask)) if (SECTORFLD(hit->sect,stat, hitscan_hitsectcf)&yax_waltosecmask(dawalclipmask))
return 0; return 0;
i = yax_getneighborsect(hit->pos.x, hit->pos.y, hit->sect, i = yax_getneighborsect(hit->pos.x, hit->pos.y, hit->sect, hitscan_hitsectcf);
hitscan_hitsectcf, NULL);
if (i >= 0) if (i >= 0)
{ {
Bmemcpy(&newsv, &hit->pos, sizeof(vec3_t)); Bmemcpy(&newsv, &hit->pos, sizeof(vec3_t));
@ -12992,14 +12987,14 @@ void updatesectorz(int32_t x, int32_t y, int32_t z, int16_t *sectnum)
#ifdef YAX_ENABLE #ifdef YAX_ENABLE
if (z < cz) if (z < cz)
{ {
i = yax_getneighborsect(x, y, *sectnum, YAX_CEILING, NULL); i = yax_getneighborsect(x, y, *sectnum, YAX_CEILING);
if (i >= 0 && z >= getceilzofslope(i, x, y)) if (i >= 0 && z >= getceilzofslope(i, x, y))
SET_AND_RETURN(*sectnum, i); SET_AND_RETURN(*sectnum, i);
} }
if (z > fz) if (z > fz)
{ {
i = yax_getneighborsect(x, y, *sectnum, YAX_FLOOR, NULL); i = yax_getneighborsect(x, y, *sectnum, YAX_FLOOR);
if (i >= 0 && z <= getflorzofslope(i, x, y)) if (i >= 0 && z <= getflorzofslope(i, x, y))
SET_AND_RETURN(*sectnum, i); SET_AND_RETURN(*sectnum, i);
} }

View file

@ -4324,7 +4324,7 @@ static void getzsofslope_player(int16_t sectnum, int32_t dax, int32_t day, int32
if ((sector[sectnum].ceilingstat&512)==0) if ((sector[sectnum].ceilingstat&512)==0)
{ {
i = yax_getneighborsect(dax, day, sectnum, YAX_CEILING, NULL); i = yax_getneighborsect(dax, day, sectnum, YAX_CEILING);
if (i >= 0) if (i >= 0)
{ {
*ceilz = getceilzofslope(i, dax,day); *ceilz = getceilzofslope(i, dax,day);
@ -4334,7 +4334,7 @@ static void getzsofslope_player(int16_t sectnum, int32_t dax, int32_t day, int32
if ((sector[sectnum].floorstat&512)==0) if ((sector[sectnum].floorstat&512)==0)
{ {
i = yax_getneighborsect(dax, day, sectnum, YAX_FLOOR, NULL); i = yax_getneighborsect(dax, day, sectnum, YAX_FLOOR);
if (i >= 0) if (i >= 0)
{ {
*florz = getflorzofslope(i, dax,day); *florz = getflorzofslope(i, dax,day);