From 735d1ed77e0993629b4b48d86d544259ee554ab3 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Mon, 1 Oct 2012 17:52:18 +0000 Subject: [PATCH] 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 --- polymer/eduke32/build/include/build.h | 8 +------- polymer/eduke32/build/src/build.c | 2 +- polymer/eduke32/build/src/engine.c | 21 ++++++++------------- polymer/eduke32/source/player.c | 4 ++-- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 8b6dc4fa7..5dc64137e 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -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); int16_t yax_vnextsec(int16_t line, int16_t cf); 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) { @@ -687,12 +687,6 @@ int32_t krand(void); int32_t ksqrt(uint32_t num); 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) { return (uint32_t)dx*dx + (uint32_t)dy*dy; diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 4dc4f3624..0104ba348 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -4228,7 +4228,7 @@ rotate_hlsect_out: } // 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) { message("Punch loop INTERNAL ERROR: dstsect < 0. Map corrupt?"); diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index f9762d059..7bdc23aa4 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -160,7 +160,7 @@ static char *artptrs[MAXTILEFILES]; #endif 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]; const char pow2char[8] = {1,2,4,8,16,32,64,128}; const int32_t pow2long[32] = @@ -570,7 +570,7 @@ void yax_update(int32_t resetstat) 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); 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)) if (inside(x, y, i)==1) - { - if (ret_bunchnum) - *ret_bunchnum = bunchnum; return i; - } return -1; } @@ -799,7 +795,7 @@ static void yax_copytsprites() if (yax_getbunch(sectnum, cf) != yax_globalbunch) continue; - sectnum = yax_getneighborsect(spr->x, spr->y, sectnum, cf, NULL); + sectnum = yax_getneighborsect(spr->x, spr->y, sectnum, cf); if (sectnum < 0) continue; } @@ -11246,7 +11242,7 @@ restart_grand: x = x1 + mulscale24(x21,frac); y = y1 + mulscale24(y21,frac); - ns = yax_getneighborsect(x, y, dasectnum, cf, NULL); + ns = yax_getneighborsect(x, y, dasectnum, cf); if (ns < 0) continue; @@ -11301,7 +11297,7 @@ restart_grand: x = x1 + mulscale24(x21,t); y = y1 + mulscale24(y21,t); - nexts = yax_getneighborsect(x, y, dasectnum, cf, NULL); + nexts = yax_getneighborsect(x, y, dasectnum, cf); if (nexts >= 0) goto add_nextsector; } @@ -11772,8 +11768,7 @@ restart_grand: if (SECTORFLD(hit->sect,stat, hitscan_hitsectcf)&yax_waltosecmask(dawalclipmask)) return 0; - i = yax_getneighborsect(hit->pos.x, hit->pos.y, hit->sect, - hitscan_hitsectcf, NULL); + i = yax_getneighborsect(hit->pos.x, hit->pos.y, hit->sect, hitscan_hitsectcf); if (i >= 0) { 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 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)) SET_AND_RETURN(*sectnum, i); } 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)) SET_AND_RETURN(*sectnum, i); } diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 8d8821eb0..128b074d4 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -4324,7 +4324,7 @@ static void getzsofslope_player(int16_t sectnum, int32_t dax, int32_t day, int32 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) { *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) { - i = yax_getneighborsect(dax, day, sectnum, YAX_FLOOR, NULL); + i = yax_getneighborsect(dax, day, sectnum, YAX_FLOOR); if (i >= 0) { *florz = getflorzofslope(i, dax,day);