From 5800cd588c44b2544faccaa71f8d8112fbaec552 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 21 Jun 2016 00:33:58 +0000 Subject: [PATCH] tsectortype -> usectortype twalltype -> uwalltype tspritetype -> uspritetype No other changes. git-svn-id: https://svn.eduke32.com/eduke32@5796 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/build.h | 16 +- polymer/eduke32/build/include/buildtypes.h | 6 +- polymer/eduke32/build/include/clip.h | 4 +- polymer/eduke32/build/include/mdsprite.h | 8 +- polymer/eduke32/build/include/polymer.h | 4 +- polymer/eduke32/build/include/polymost.h | 6 +- polymer/eduke32/build/src/build.c | 50 +++--- polymer/eduke32/build/src/clip.c | 60 +++---- polymer/eduke32/build/src/common.c | 8 +- polymer/eduke32/build/src/engine.c | 154 +++++++++--------- polymer/eduke32/build/src/engine_priv.h | 6 +- polymer/eduke32/build/src/mdsprite.c | 8 +- polymer/eduke32/build/src/polymer.c | 44 ++--- polymer/eduke32/build/src/polymost.c | 40 ++--- polymer/eduke32/build/src/voxmodel.c | 2 +- polymer/eduke32/source/actors.c | 44 ++--- polymer/eduke32/source/actors.h | 4 +- polymer/eduke32/source/astub.c | 4 +- polymer/eduke32/source/game.c | 30 ++-- polymer/eduke32/source/game.h | 2 +- polymer/eduke32/source/gameexec.c | 48 +++--- polymer/eduke32/source/gameexec.h | 2 +- polymer/eduke32/source/gamestructures.c | 4 +- .../eduke32/source/lunatic/defs_common.lua | 14 +- polymer/eduke32/source/m32def.h | 2 +- polymer/eduke32/source/m32exec.c | 32 ++-- polymer/eduke32/source/m32structures.c | 2 +- polymer/eduke32/source/player.c | 24 +-- polymer/eduke32/source/premap.c | 2 +- polymer/eduke32/source/screens.c | 10 +- polymer/eduke32/source/sector.c | 8 +- polymer/eduke32/source/sector.h | 6 +- 32 files changed, 327 insertions(+), 327 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 0f805955c..fbdc504c2 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -503,9 +503,9 @@ static inline void inplace_vx_tweak_wall(walltypevx *vxwal, int32_t yaxp) typedef sectortypevx sectortype; typedef walltypevx walltype; -typedef sectortype tsectortype; -typedef walltype twalltype; -typedef spritetype tspritetype; +typedef sectortype usectortype; +typedef walltype uwalltype; +typedef spritetype uspritetype; //////////////////// END Lunatic new-generation map format //////////////// #else typedef sectortypev7 sectortype; @@ -522,7 +522,7 @@ typedef struct { uint8_t filler; float alpha; // NOTE: keep 'tspr' on an 8-byte boundary: - tspritetype *tspr; + uspritetype *tspr; #if !defined UINTPTR_MAX # error Need UINTPTR_MAX define to select between 32- and 64-bit structs #endif @@ -570,7 +570,7 @@ EXTERN spritesmooth_t *spritesmooth; EXTERN sectortype *sector; EXTERN walltype *wall; EXTERN spritetype *sprite; -EXTERN tspritetype *tsprite; +EXTERN uspritetype *tsprite; #else EXTERN spriteext_t spriteext[MAXSPRITES+MAXUNIQHUDID]; EXTERN spritesmooth_t spritesmooth[MAXSPRITES+MAXUNIQHUDID]; @@ -578,7 +578,7 @@ EXTERN spritesmooth_t spritesmooth[MAXSPRITES+MAXUNIQHUDID]; EXTERN sectortype sector[MAXSECTORS + M32_FIXME_SECTORS]; EXTERN walltype wall[MAXWALLS + M32_FIXME_WALLS]; EXTERN spritetype sprite[MAXSPRITES]; -EXTERN tspritetype tsprite[MAXSPRITESONSCREEN]; +EXTERN uspritetype tsprite[MAXSPRITESONSCREEN]; #endif EXTERN uint32_t sectorchanged[MAXSECTORS + M32_FIXME_SECTORS]; @@ -644,7 +644,7 @@ FORCE_INLINE void sprite_tracker_hook(uintptr_t address) EXTERN int16_t maskwall[MAXWALLSB], maskwallcnt; EXTERN int16_t thewall[MAXWALLSB]; -EXTERN tspritetype *tspriteptr[MAXSPRITESONSCREEN + 1]; +EXTERN uspritetype *tspriteptr[MAXSPRITESONSCREEN + 1]; EXTERN int32_t wx1, wy1, wx2, wy2; EXTERN int32_t xdim, ydim, numpages; @@ -1178,7 +1178,7 @@ FORCE_INLINE void getzsofslope(int16_t sectnum, int32_t dax, int32_t day, int32_ // Is a red wall in a safe fashion, i.e. only if consistency invariant // ".nextsector >= 0 iff .nextwall >= 0" holds. -FORCE_INLINE int32_t redwallp(const twalltype *wal) +FORCE_INLINE int32_t redwallp(const uwalltype *wal) { return (wal->nextwall >= 0 && wal->nextsector >= 0); } diff --git a/polymer/eduke32/build/include/buildtypes.h b/polymer/eduke32/build/include/buildtypes.h index 42b4049a3..a8d626227 100644 --- a/polymer/eduke32/build/include/buildtypes.h +++ b/polymer/eduke32/build/include/buildtypes.h @@ -9,9 +9,9 @@ #define StructTracker(tracker, type) type -#define WALLTYPE twalltype -#define SECTORTYPE tsectortype -#define SPRITETYPE tspritetype +#define WALLTYPE uwalltype +#define SECTORTYPE usectortype +#define SPRITETYPE uspritetype #else diff --git a/polymer/eduke32/build/include/clip.h b/polymer/eduke32/build/include/clip.h index ed1e34c74..35d70eb38 100644 --- a/polymer/eduke32/build/include/clip.h +++ b/polymer/eduke32/build/include/clip.h @@ -45,8 +45,8 @@ extern clipinfo_t clipinfo[CM_MAX]; typedef struct { int16_t numsectors, numwalls; - tsectortype *sector; - twalltype *wall; + usectortype *sector; + uwalltype *wall; } mapinfo_t; extern mapinfo_t origmapinfo, clipmapinfo; diff --git a/polymer/eduke32/build/include/mdsprite.h b/polymer/eduke32/build/include/mdsprite.h index 18991f9cc..05fc64fff 100644 --- a/polymer/eduke32/build/include/mdsprite.h +++ b/polymer/eduke32/build/include/mdsprite.h @@ -204,13 +204,13 @@ typedef struct EXTERN mdmodel_t **models; -void updateanimation(md2model_t *m, const tspritetype *tspr, uint8_t lpal); +void updateanimation(md2model_t *m, const uspritetype *tspr, uint8_t lpal); int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf); void mdinit(void); void freeallmodels(void); void clearskins(int32_t type); -int32_t polymost_mddraw(const tspritetype *tspr); -EXTERN void md3_vox_calcmat_common(const tspritetype *tspr, const vec3f_t *a0, float f, float mat[16]); +int32_t polymost_mddraw(const uspritetype *tspr); +EXTERN void md3_vox_calcmat_common(const uspritetype *tspr, const vec3f_t *a0, float f, float mat[16]); EXTERN int32_t mdpause; EXTERN int32_t nextmodelid; @@ -218,7 +218,7 @@ EXTERN voxmodel_t *voxmodels[MAXVOXELS]; void voxfree(voxmodel_t *m); voxmodel_t *voxload(const char *filnam); -int32_t polymost_voxdraw(voxmodel_t *m, const tspritetype *tspr); +int32_t polymost_voxdraw(voxmodel_t *m, const uspritetype *tspr); int md3postload_polymer(md3model_t* m); //int32_t md_thinoutmodel(int32_t modelid, uint8_t *usedframebitmap); diff --git a/polymer/eduke32/build/include/polymer.h b/polymer/eduke32/build/include/polymer.h index 91161d276..1ec53fc37 100644 --- a/polymer/eduke32/build/include/polymer.h +++ b/polymer/eduke32/build/include/polymer.h @@ -421,7 +421,7 @@ static inline void polymer_normalize(float* vec); static inline void polymer_pokesector(int16_t sectnum); static void polymer_extractfrustum(GLfloat* modelview, GLfloat* projection, float* frustum); static inline int32_t polymer_planeinfrustum(_prplane *plane, float* frustum); -static inline void polymer_scansprites(int16_t sectnum, tspritetype* tsprite, int32_t* spritesortcnt); +static inline void polymer_scansprites(int16_t sectnum, uspritetype* tsprite, int32_t* spritesortcnt); static void polymer_updatesprite(int32_t snum); // SKIES static void polymer_getsky(void); @@ -431,7 +431,7 @@ static void polymer_drawartsky(int16_t tilenum, char palnum, int8_t shad static void polymer_drawartskyquad(int32_t p1, int32_t p2, GLfloat height); static void polymer_drawskybox(int16_t tilenum, char palnum, int8_t shade); // MDSPRITES -static void polymer_drawmdsprite(tspritetype *tspr); +static void polymer_drawmdsprite(uspritetype *tspr); static void polymer_loadmodelvbos(md3model_t* m); // MATERIALS static void polymer_getscratchmaterial(_prmaterial* material); diff --git a/polymer/eduke32/build/include/polymost.h b/polymer/eduke32/build/include/polymost.h index 4bfb8ca38..9922f4bae 100644 --- a/polymer/eduke32/build/include/polymost.h +++ b/polymer/eduke32/build/include/polymost.h @@ -87,15 +87,15 @@ static inline float getshadefactor(int32_t const shade) #define POLYMOST_CHOOSE_FOG_PAL(fogpal, pal) \ ((fogpal) ? (fogpal) : (pal)) -static inline int32_t get_floor_fogpal(tsectortype const * const sec) +static inline int32_t get_floor_fogpal(usectortype const * const sec) { return POLYMOST_CHOOSE_FOG_PAL(sec->fogpal, sec->floorpal); } -static inline int32_t get_ceiling_fogpal(tsectortype const * const sec) +static inline int32_t get_ceiling_fogpal(usectortype const * const sec) { return POLYMOST_CHOOSE_FOG_PAL(sec->fogpal, sec->ceilingpal); } -static inline int32_t fogpal_shade(tsectortype const * const sec, int32_t const shade) +static inline int32_t fogpal_shade(usectortype const * const sec, int32_t const shade) { // When fogging is due to sector[].fogpal, don't make the fog parameters // depend on the shade of the object. diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 863f563b9..456be429a 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -199,9 +199,9 @@ typedef struct int16_t *bunchnum; // [numsectors][2] int16_t *ynextwall; // [numwalls][2] #endif - tsectortype *sector; - twalltype *wall; - tspritetype *sprite; + usectortype *sector; + uwalltype *wall; + uspritetype *sprite; } mapinfofull_t; int32_t g_doScreenShot; @@ -1720,8 +1720,8 @@ static int32_t backup_highlighted_map(mapinfofull_t *mapinfo) } // allocate temp storage - mapinfo->sector = (tsectortype *)Xmalloc(highlightsectorcnt * sizeof(sectortype)); - mapinfo->wall = (twalltype *)Xmalloc(tmpnumwalls * sizeof(walltype)); + mapinfo->sector = (usectortype *)Xmalloc(highlightsectorcnt * sizeof(sectortype)); + mapinfo->wall = (uwalltype *)Xmalloc(tmpnumwalls * sizeof(walltype)); #ifdef YAX_ENABLE if (mapinfo->numyaxbunches > 0) @@ -1737,7 +1737,7 @@ static int32_t backup_highlighted_map(mapinfofull_t *mapinfo) if (tmpnumsprites>0) { - mapinfo->sprite = (tspritetype *)Xmalloc(tmpnumsprites * sizeof(spritetype)); + mapinfo->sprite = (uspritetype *)Xmalloc(tmpnumsprites * sizeof(spritetype)); } else { @@ -1772,7 +1772,7 @@ static int32_t backup_highlighted_map(mapinfofull_t *mapinfo) if (obn >= 0 && nbn < 0) { // A bunch was discarded. - tsectortype *const sec = &mapinfo->sector[i]; + usectortype *const sec = &mapinfo->sector[i]; # if !defined NEW_MAP_FORMAT uint16_t *const cs = j==YAX_CEILING ? &sec->ceilingstat : &sec->floorstat; uint8_t *const xp = j==YAX_CEILING ? &sec->ceilingxpanning : &sec->floorxpanning; @@ -1954,7 +1954,7 @@ static int32_t restore_highlighted_map(mapinfofull_t *mapinfo, int32_t forreal) // insert sprites for (i=0; inumsprites; i++) { - const tspritetype *srcspr = &mapinfo->sprite[i]; + const uspritetype *srcspr = &mapinfo->sprite[i]; int32_t sect = onumsectors + srcspr->sectnum; j = insertsprite(sect, srcspr->statnum); @@ -2361,9 +2361,9 @@ void fade_editor_screen(int32_t keepcol) static void copy_some_wall_members(int16_t dst, int16_t src, int32_t reset_some) { - static twalltype nullwall; + static uwalltype nullwall; walltype * const dstwal = &wall[dst]; - const twalltype *srcwal = src >= 0 ? (twalltype *)&wall[src] : &nullwall; + const uwalltype *srcwal = src >= 0 ? (uwalltype *)&wall[src] : &nullwall; memset(&nullwall, 0, sizeof(nullwall)); nullwall.yrepeat = 8; @@ -2588,7 +2588,7 @@ static int32_t trace_loop(int32_t j, uint8_t *visitedwall, int16_t *ignore_ret, // Context that needs special treatment: suckwall, splitsect, splitstartwall static int32_t backup_drawn_walls(int32_t restore) { - static twalltype *tmpwall; + static uwalltype *tmpwall; // back up if (restore==0) @@ -2601,7 +2601,7 @@ static int32_t backup_drawn_walls(int32_t restore) return 2; Bfree(tmpwall); - tmpwall = (twalltype *)Xmalloc((newnumwalls-numwalls) * sizeof(walltype)); + tmpwall = (uwalltype *)Xmalloc((newnumwalls-numwalls) * sizeof(walltype)); ovh.bak_wallsdrawn = newnumwalls-numwalls; @@ -2751,8 +2751,8 @@ static int32_t sectors_components(int16_t hlsectcnt, const int16_t *hlsector, in static int cmpgeomwal1(const void *w1, const void *w2) { - twalltype const * const wal1 = (twalltype *)&wall[B_UNBUF16(w1)]; - twalltype const * const wal2 = (twalltype *)&wall[B_UNBUF16(w2)]; + uwalltype const * const wal1 = (uwalltype *)&wall[B_UNBUF16(w1)]; + uwalltype const * const wal2 = (uwalltype *)&wall[B_UNBUF16(w2)]; if (wal1->x == wal2->x) return wal1->y - wal2->y; @@ -3294,7 +3294,7 @@ static void drawspritelabel(int i) return; // KEEPINSYNC drawscreen_drawsprite() - tspritetype const * s = (tspritetype *)&sprite[i]; + uspritetype const * s = (uspritetype *)&sprite[i]; uint8_t const spritecol = spritecol2d[s->picnum][(s->cstat&1)]; int col = spritecol ? editorcolors[spritecol] : getspritecol(i); int const blocking = s->cstat & 1; @@ -4034,7 +4034,7 @@ void overheadeditor(void) int32_t startofloop, endofloop; int32_t numtoswap = -1; int32_t w=0; - twalltype tempwall; + uwalltype tempwall; startofloop = startwall = sector[highlightsector[i]].wallptr; endofloop = endwall = startwall+sector[highlightsector[i]].wallnum-1; @@ -5303,7 +5303,7 @@ end_yax: ; sector[refsect].wallnum += n; if (refsect != numsectors-1) { - twalltype *tmpwall = (twalltype *)Xmalloc(n * sizeof(walltype)); + uwalltype *tmpwall = (uwalltype *)Xmalloc(n * sizeof(walltype)); int16_t *tmponw = (int16_t *)Xmalloc(n * sizeof(int16_t)); for (m=0; mpoint2]; - wal1p2 = (twalltype *)&wall[wal1->point2]; + wal0p2 = (uwalltype *)&wall[wal0->point2]; + wal1p2 = (uwalltype *)&wall[wal1->point2]; if (k==0) { @@ -6193,13 +6193,13 @@ end_point_dragging: { pos.x = wal0->x + (wal0p2->x - wal0->x)/4; pos.y = wal0->y + (wal0p2->y - wal0->y)/4; - pos.z = getflorzofslope(sectorofwall(wal0-(twalltype *)wall), pos.x, pos.y); + pos.z = getflorzofslope(sectorofwall(wal0-(uwalltype *)wall), pos.x, pos.y); if (!delayerr) message("Outer wall coordinates must coincide for both components"); - OSD_Printf("wal0:%d (%d,%d)--(%d,%d)\n",(int)(wal0-(twalltype *)wall), + OSD_Printf("wal0:%d (%d,%d)--(%d,%d)\n",(int)(wal0-(uwalltype *)wall), wal0->x,wal0->y, wal0p2->x,wal0p2->y); - OSD_Printf("wal1:%d (%d,%d)--(%d,%d)\n",(int)(wal1-(twalltype *)wall), + OSD_Printf("wal1:%d (%d,%d)--(%d,%d)\n",(int)(wal1-(uwalltype *)wall), wal1->x,wal1->y, wal1p2->x,wal1p2->y); goto end_join_sectors; diff --git a/polymer/eduke32/build/src/clip.c b/polymer/eduke32/build/src/clip.c index 775a699e9..4750b2432 100644 --- a/polymer/eduke32/build/src/clip.c +++ b/polymer/eduke32/build/src/clip.c @@ -18,8 +18,8 @@ void mapinfo_set(mapinfo_t *bak, mapinfo_t *newmap) { bak->numsectors = numsectors; bak->numwalls = numwalls; - bak->sector = (tsectortype *) sector; - bak->wall = (twalltype *) wall; + bak->sector = (usectortype *) sector; + bak->wall = (uwalltype *) wall; } if (newmap) @@ -43,9 +43,9 @@ int16_t *sectq; // [numsectors] int16_t pictoidx[MAXTILES]; // maps tile num to clipinfo[] index static int16_t *tempictoidx; -static tsectortype *loadsector; -static twalltype *loadwall, *loadwallinv; -static tspritetype *loadsprite; +static usectortype *loadsector; +static uwalltype *loadwall, *loadwallinv; +static uspritetype *loadsprite; void clipmapinfo_init() @@ -85,9 +85,9 @@ int32_t clipmapinfo_load(void) clipmapinfo_init(); - loadsector = (tsectortype *) Xmalloc(MAXSECTORS * sizeof(sectortype)); - loadwall = (twalltype *) Xmalloc(MAXWALLS * sizeof(walltype)); - loadsprite = (tspritetype *) Xmalloc(MAXSPRITES * sizeof(spritetype)); + loadsector = (usectortype *) Xmalloc(MAXSECTORS * sizeof(sectortype)); + loadwall = (uwalltype *) Xmalloc(MAXWALLS * sizeof(walltype)); + loadsprite = (uspritetype *) Xmalloc(MAXSPRITES * sizeof(spritetype)); if (g_clipMapFilesNum) fisec = (int32_t *) Xcalloc(g_clipMapFilesNum, sizeof(int32_t)); @@ -155,8 +155,8 @@ int32_t clipmapinfo_load(void) } // shrink - loadsector = (tsectortype *) Xrealloc(loadsector, ournumsectors*sizeof(sectortype)); - loadwall = (twalltype *) Xrealloc(loadwall, ournumwalls*sizeof(walltype)); + loadsector = (usectortype *) Xrealloc(loadsector, ournumsectors*sizeof(sectortype)); + loadwall = (uwalltype *) Xrealloc(loadwall, ournumwalls*sizeof(walltype)); Bmemcpy(sector, loadsector, ournumsectors*sizeof(sectortype)); Bmemcpy(wall, loadwall, ournumwalls*sizeof(walltype)); @@ -431,7 +431,7 @@ int32_t clipmapinfo_load(void) Bmemcpy(loadwall, wall, ournumwalls*sizeof(walltype)); // loadwallinv will contain all walls with inverted orientation for x/y-flip handling - loadwallinv = (twalltype *) Xmalloc(ournumwalls*sizeof(walltype)); + loadwallinv = (uwalltype *) Xmalloc(ournumwalls*sizeof(walltype)); { int32_t j, loopstart, loopend, numloopwalls; @@ -536,9 +536,9 @@ int32_t clipmoveboxtracenum = 3; int32_t clipinsidebox(vec2_t *vect, int16_t wallnum, int32_t walldist) { int32_t const r = walldist<<1; - twalltype const *wal = (twalltype *) &wall[wallnum]; + uwalltype const *wal = (uwalltype *) &wall[wallnum]; vec2_t const v1 ={ wal->x + walldist - vect->x, wal->y + walldist - vect->y }; - wal = (twalltype *) &wall[wal->point2]; + wal = (uwalltype *) &wall[wal->point2]; vec2_t v2 ={ wal->x + walldist - vect->x, wal->y + walldist - vect->y }; if (((v1.x < 0) && (v2.x < 0)) || ((v1.y < 0) && (v2.y < 0)) || @@ -681,17 +681,17 @@ int32_t clipsprite_initindex(int32_t curidx, spritetype *curspr, int32_t *clipse for (k=clipinfo[curidx].qbeg; k<=clipinfo[curidx].qend; k++) { const int32_t j = sectq[k]; - tsectortype *const sec = (tsectortype *)§or[j]; + usectortype *const sec = (usectortype *)§or[j]; const int32_t startwall = sec->wallptr, endwall = startwall+sec->wallnum; int32_t w; - twalltype *wal; + uwalltype *wal; sec->floorz = daz + mulscale22(scalez, CM_FLOORZ(j)); sec->ceilingz = daz + mulscale22(scalez, CM_CEILINGZ(j)); //initprintf("sec %d: f=%d, c=%d\n", j, sec->floorz, sec->ceilingz); - for (w=startwall, wal=(twalltype *)&wall[startwall]; wx = mulscale22(scalex, CM_WALL_X(w)); wal->y = mulscale22(scaley, CM_WALL_Y(w)); @@ -754,7 +754,7 @@ FORCE_INLINE void clipmove_tweak_pos(const vec3_t *pos, int32_t gx, int32_t gy, static int32_t check_floor_curb(int32_t dasect, int32_t nextsect, int32_t flordist, int32_t posz, int32_t dax, int32_t day) { - tsectortype const * const sec2 = (tsectortype *)§or[nextsect]; + usectortype const * const sec2 = (usectortype *)§or[nextsect]; int32_t const daz2 = getflorzofslope(nextsect, dax, day); return ((sec2->floorstat&1) == 0 && // parallaxed floor curbs don't clip @@ -896,8 +896,8 @@ int32_t clipmove(vec3_t *pos, int16_t *sectnum, clipspritecnt = 0; clipspritenum = 0; do { - const twalltype *wal; - const tsectortype *sec; + const uwalltype *wal; + const usectortype *sec; int32_t dasect, startwall, endwall; #ifdef HAVE_CLIPSHAPE_FEATURE @@ -936,12 +936,12 @@ int32_t clipmove(vec3_t *pos, int16_t *sectnum, ////////// Walls ////////// - sec = (tsectortype *)§or[dasect]; + sec = (usectortype *)§or[dasect]; startwall = sec->wallptr; endwall = startwall + sec->wallnum; - for (j=startwall, wal=(twalltype *)&wall[startwall]; jpoint2]; + const uwalltype *const wal2 = (uwalltype *)&wall[wal->point2]; if ((wal->x < xmin && wal2->x < xmin) || (wal->x > xmax && wal2->x > xmax) || (wal->y < ymin && wal2->y < ymin) || (wal->y > ymax && wal2->y > ymax)) @@ -961,7 +961,7 @@ int32_t clipmove(vec3_t *pos, int16_t *sectnum, { if (wal->nextsector>=0) { - const tsectortype *sec2 = (tsectortype *)§or[wal->nextsector]; + const usectortype *sec2 = (usectortype *)§or[wal->nextsector]; clipmove_tweak_pos(pos, gx, gy, x1, y1, x2, y2, &dax, &day); @@ -1012,7 +1012,7 @@ int32_t clipmove(vec3_t *pos, int16_t *sectnum, if (clipyou == 0) { - const tsectortype *sec2 = (tsectortype *)§or[wal->nextsector]; + const usectortype *sec2 = (usectortype *)§or[wal->nextsector]; int32_t daz2 = getceilzofslope(wal->nextsector, dax, day); clipyou = ((sec2->ceilingstat&1) == 0 && @@ -1135,7 +1135,7 @@ int32_t clipmove(vec3_t *pos, int16_t *sectnum, rxi[0] = x1; ryi[0] = y1; - get_floorspr_points((tspritetype const *) spr, 0, 0, &rxi[0], &rxi[1], &rxi[2], &rxi[3], + get_floorspr_points((uspritetype const *) spr, 0, 0, &rxi[0], &rxi[1], &rxi[2], &rxi[3], &ryi[0], &ryi[1], &ryi[2], &ryi[3]); dax = mulscale14(sintable[(spr->ang-256+512)&2047], walldist); @@ -1308,8 +1308,8 @@ int32_t pushmove(vec3_t *vect, int16_t *sectnum, clipsectcnt = 0; clipsectnum = 1; do { - const twalltype *wal; - const tsectortype *sec; + const uwalltype *wal; + const usectortype *sec; int32_t startwall, endwall; #if 0 // Push FACE sprites @@ -1344,13 +1344,13 @@ int32_t pushmove(vec3_t *vect, int16_t *sectnum, } } #endif - sec = (tsectortype *)§or[clipsectorlist[clipsectcnt]]; + sec = (usectortype *)§or[clipsectorlist[clipsectcnt]]; if (dir > 0) startwall = sec->wallptr, endwall = startwall + sec->wallnum; else endwall = sec->wallptr, startwall = endwall + sec->wallnum; - for (i=startwall, wal=(twalltype *)&wall[startwall]; i!=endwall; i+=dir, wal+=dir) + for (i=startwall, wal=(uwalltype *)&wall[startwall]; i!=endwall; i+=dir, wal+=dir) if (clipinsidebox((vec2_t *)vect, i, walldist-4) == 1) { j = 0; @@ -1358,7 +1358,7 @@ int32_t pushmove(vec3_t *vect, int16_t *sectnum, if (wal->cstat&dawalclipmask) j = 1; if (j == 0) { - const tsectortype *const sec2 = (tsectortype *)§or[wal->nextsector]; + const usectortype *const sec2 = (usectortype *)§or[wal->nextsector]; int32_t daz2; //Find closest point on wall (dax, day) to (vect->x, vect->y) diff --git a/polymer/eduke32/build/src/common.c b/polymer/eduke32/build/src/common.c index ab4a6c60b..bc5794e12 100644 --- a/polymer/eduke32/build/src/common.c +++ b/polymer/eduke32/build/src/common.c @@ -189,15 +189,15 @@ int32_t maybe_append_ext(char *wbuf, int32_t wbufsiz, const char *fn, const char int32_t ldist(const void *s1, const void *s2) { - tspritetype const *const sp1 = (tspritetype const *)s1; - tspritetype const *const sp2 = (tspritetype const *)s2; + uspritetype const *const sp1 = (uspritetype const *)s1; + uspritetype const *const sp2 = (uspritetype const *)s2; return sepldist(sp1->x - sp2->x, sp1->y - sp2->y); } int32_t dist(const void *s1, const void *s2) { - tspritetype const *const sp1 = (tspritetype const *)s1; - tspritetype const *const sp2 = (tspritetype const *)s2; + uspritetype const *const sp1 = (uspritetype const *)s1; + uspritetype const *const sp2 = (uspritetype const *)s2; return sepdist(sp1->x - sp2->x, sp1->y - sp2->y, sp1->z - sp2->z); } diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 05cc04552..98f65c247 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -845,7 +845,7 @@ static void yax_copytsprites() { int32_t i, spritenum, gotthrough, sectnum; int32_t sortcnt = yax_spritesortcnt[yax_globallev]; - const tspritetype *spr; + const uspritetype *spr; for (i=0; isectnum; if (gotthrough == (MAXSPRITES|(MAXSPRITES<<1))) @@ -1535,7 +1535,7 @@ char apptitle[256] = "Build Engine"; // 1=break out of sprite collecting; int32_t engine_addtsprite(int16_t z, int16_t sectnum) { - tspritetype *spr = (tspritetype *)&sprite[z]; + uspritetype *spr = (uspritetype *)&sprite[z]; #ifdef YAX_ENABLE if (g_nodraw==0) { @@ -1711,7 +1711,7 @@ static void scansector(int16_t startsectnum) #endif for (int32_t i=headspritesect[sectnum]; i>=0; i=nextspritesect[i]) { - const tspritetype *const spr = (tspritetype *)&sprite[i]; + const uspritetype *const spr = (uspritetype *)&sprite[i]; if (((spr->cstat&0x8000) == 0 || showinvisibility) && spr->xrepeat > 0 && spr->yrepeat > 0) @@ -1738,9 +1738,9 @@ static void scansector(int16_t startsectnum) for (int32_t w=startwall; wnextsector; - const twalltype *const wal2 = (twalltype *)&wall[wal->point2]; + const uwalltype *const wal2 = (uwalltype *)&wall[wal->point2]; const int32_t x1 = wal->x-globalposx, y1 = wal->y-globalposy; const int32_t x2 = wal2->x-globalposx, y2 = wal2->y-globalposy; @@ -2120,10 +2120,10 @@ int32_t wallfront(int32_t l1, int32_t l2) // // spritewallfront (internal) // -static inline int32_t spritewallfront(const tspritetype *s, int32_t w) +static inline int32_t spritewallfront(const uspritetype *s, int32_t w) { - const twalltype *const wal = (twalltype *)&wall[w]; - const twalltype *wal2 = (twalltype *)&wall[wal->point2]; + const uwalltype *const wal = (uwalltype *)&wall[w]; + const uwalltype *wal2 = (uwalltype *)&wall[wal->point2]; const vec2_t v = { wal->x, wal->y }; return dmulscale32(wal2->x - v.x, s->y - v.y, -(s->x - v.x), wal2->y - v.y) >= 0; @@ -2253,7 +2253,7 @@ static inline void slowhline(int32_t xr, int32_t yp) // // prepwall (internal) // -static void prepwall(int32_t z, const twalltype *wal) +static void prepwall(int32_t z, const uwalltype *wal) { int32_t l=0, ol=0, x; @@ -2538,7 +2538,7 @@ static int32_t wallmost(int16_t *mostbuf, int32_t w, int32_t sectnum, char dasta if (wi == sector[sectnum].wallptr) return owallmost(mostbuf,w,z); - const twalltype *const wal = (twalltype *)&wall[wi]; + const uwalltype *const wal = (uwalltype *)&wall[wi]; const int32_t x1 = wal->x, x2 = wall[wal->point2].x-x1; const int32_t y1 = wal->y, y2 = wall[wal->point2].y-y1; @@ -2665,7 +2665,7 @@ static void calc_globalshifts(void) if (globalyshift > 31) globalyshift=0; } -static int32_t setup_globals_cf1(const tsectortype *sec, int32_t pal, int32_t zd, +static int32_t setup_globals_cf1(const usectortype *sec, int32_t pal, int32_t zd, int32_t picnum, int32_t shade, int32_t stat, int32_t xpanning, int32_t ypanning, int32_t x1) { @@ -2760,7 +2760,7 @@ static int32_t setup_globals_cf1(const tsectortype *sec, int32_t pal, int32_t zd static void ceilscan(int32_t x1, int32_t x2, int32_t sectnum) { int32_t x, y1, y2; - const tsectortype *const sec = (tsectortype *)§or[sectnum]; + const usectortype *const sec = (usectortype *)§or[sectnum]; if (setup_globals_cf1(sec, sec->ceilingpal, sec->ceilingz-globalposz, sec->ceilingpicnum, sec->ceilingshade, sec->ceilingstat, @@ -2858,7 +2858,7 @@ static void ceilscan(int32_t x1, int32_t x2, int32_t sectnum) static void florscan(int32_t x1, int32_t x2, int32_t sectnum) { int32_t x, y1, y2; - const tsectortype *const sec = (tsectortype *)§or[sectnum]; + const usectortype *const sec = (usectortype *)§or[sectnum]; if (setup_globals_cf1(sec, sec->floorpal, globalposz-sec->floorz, sec->floorpicnum, sec->floorshade, sec->floorstat, @@ -3451,8 +3451,8 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat) // Er, yes, they're not global anymore: int32_t globalx, globaly, globalz, globalzx; - const tsectortype *const sec = (tsectortype *)§or[sectnum]; - const twalltype *wal; + const usectortype *const sec = (usectortype *)§or[sectnum]; + const uwalltype *wal; if (dastat == 0) { @@ -3482,7 +3482,7 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat) if ((tilesiz[globalpicnum].x <= 0) || (tilesiz[globalpicnum].y <= 0)) return; if (waloff[globalpicnum] == 0) loadtile(globalpicnum); - wal = (twalltype *)&wall[sec->wallptr]; + wal = (uwalltype *)&wall[sec->wallptr]; wx = wall[wal->point2].x - wal->x; wy = wall[wal->point2].y - wal->y; dasqr = krecipasm(nsqrtasm(uhypsq(wx,wy))); @@ -3619,7 +3619,7 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat) // static void parascan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat, int32_t bunch) { - tsectortype *sec; + usectortype *sec; int32_t j, k, l, m, n, x, z, wallnum, nextsectnum, globalhorizbak; int16_t *topptr, *botptr; @@ -3631,7 +3631,7 @@ static void parascan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat, i UNREFERENCED_PARAMETER(dax1); UNREFERENCED_PARAMETER(dax2); - sectnum = thesector[bunchfirst[bunch]]; sec = (tsectortype *)§or[sectnum]; + sectnum = thesector[bunchfirst[bunch]]; sec = (usectortype *)§or[sectnum]; globalhorizbak = globalhoriz; globvis = globalpisibility; @@ -3806,7 +3806,7 @@ static void parascan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat, i // set orientation, panning, shade, pal; picnum -static void setup_globals_wall1(const twalltype *wal, int32_t dapicnum) +static void setup_globals_wall1(const uwalltype *wal, int32_t dapicnum) { globalorientation = wal->cstat; @@ -3822,7 +3822,7 @@ static void setup_globals_wall1(const twalltype *wal, int32_t dapicnum) if (palookup[globalpal] == NULL) globalpal = 0; // JBF: fixes crash } -static void setup_globals_wall2(const twalltype *wal, uint8_t secvisibility, int32_t topzref, int32_t botzref) +static void setup_globals_wall2(const uwalltype *wal, uint8_t secvisibility, int32_t topzref, int32_t botzref) { const int32_t logtilesizy = (picsiz[globalpicnum]>>4); const int32_t tsizy = tilesiz[globalpicnum].y; @@ -3925,7 +3925,7 @@ static void drawalls(int32_t bunch) int32_t z = bunchfirst[bunch]; const int32_t sectnum = thesector[z]; - const tsectortype *const sec = (tsectortype *)§or[sectnum]; + const usectortype *const sec = (usectortype *)§or[sectnum]; uint8_t andwstat1 = 0xff, andwstat2 = 0xff; @@ -4052,10 +4052,10 @@ static void drawalls(int32_t bunch) } const int32_t wallnum = thewall[z]; - const twalltype *const wal = (twalltype *)&wall[wallnum]; + const uwalltype *const wal = (uwalltype *)&wall[wallnum]; const int32_t nextsectnum = wal->nextsector; - const tsectortype *const nextsec = nextsectnum>=0 ? (tsectortype *)§or[nextsectnum] : NULL; + const usectortype *const nextsec = nextsectnum>=0 ? (usectortype *)§or[nextsectnum] : NULL; int32_t gotswall = 0; @@ -4225,7 +4225,7 @@ static void drawalls(int32_t bunch) searchstat = 0; searchit = 1; } - const twalltype *twal = (wal->cstat&2) ? (twalltype *)&wall[wal->nextwall] : wal; + const uwalltype *twal = (wal->cstat&2) ? (uwalltype *)&wall[wal->nextwall] : wal; setup_globals_wall1(twal, twal->picnum); setup_globals_wall2(wal, sec->visibility, nextsec->floorz, sec->ceilingz); @@ -4705,7 +4705,7 @@ static void drawvox(int32_t dasprx, int32_t daspry, int32_t dasprz, int32_t dasp } -static void setup_globals_sprite1(const tspritetype *tspr, const tsectortype *sec, +static void setup_globals_sprite1(const uspritetype *tspr, const usectortype *sec, int32_t yspan, int32_t yoff, int32_t tilenum, int32_t cstat, int32_t *z1ptr, int32_t *z2ptr) { @@ -4797,7 +4797,7 @@ FORCE_INLINE int32_t mulscale_triple30(int32_t a, int32_t b, int32_t c) static void drawsprite_classic(int32_t snum) { - tspritetype *const tspr = tspriteptr[snum]; + uspritetype *const tspr = tspriteptr[snum]; const int32_t sectnum = tspr->sectnum; if (sectnum < 0 || bad_tspr(tspr)) @@ -4816,7 +4816,7 @@ static void drawsprite_classic(int32_t snum) const int32_t spritenum = tspr->owner; const float alpha = spriteext[spritenum].alpha; - const tsectortype *const sec = (tsectortype *)§or[sectnum]; + const usectortype *const sec = (usectortype *)§or[sectnum]; int32_t cstat=tspr->cstat, tilenum; @@ -5900,10 +5900,10 @@ static void drawmaskwall(int16_t damaskwallcnt) //============================================================================= //POLYMOST ENDS int32_t z = maskwall[damaskwallcnt]; - twalltype *wal = (twalltype *)&wall[thewall[z]]; + uwalltype *wal = (uwalltype *)&wall[thewall[z]]; int32_t sectnum = thesector[z]; - tsectortype *sec = (tsectortype *)§or[sectnum]; - tsectortype *nsec = (tsectortype *)§or[wal->nextsector]; + usectortype *sec = (usectortype *)§or[sectnum]; + usectortype *nsec = (usectortype *)§or[wal->nextsector]; int32_t z1 = max(nsec->ceilingz,sec->ceilingz); int32_t z2 = min(nsec->floorz,sec->floorz); @@ -7627,7 +7627,7 @@ static spritesmooth_t spritesmooth_s[MAXSPRITES+MAXUNIQHUDID]; static sectortype sector_s[MAXSECTORS + M32_FIXME_SECTORS]; static walltype wall_s[MAXWALLS + M32_FIXME_WALLS]; static spritetype sprite_s[MAXSPRITES]; -static tspritetype tsprite_s[MAXSPRITESONSCREEN]; +static uspritetype tsprite_s[MAXSPRITESONSCREEN]; #endif int32_t preinitengine(void) @@ -8189,8 +8189,8 @@ static inline _equation equation(float x1, float y1, float x2, float y2) int32_t wallvisible(int32_t x, int32_t y, int16_t wallnum) { // 1 if wall is in front of player 0 otherwise - twalltype *w1 = (twalltype *)&wall[wallnum]; - twalltype *w2 = (twalltype *)&wall[w1->point2]; + uwalltype *w1 = (uwalltype *)&wall[wallnum]; + uwalltype *w2 = (uwalltype *)&wall[w1->point2]; int32_t a1 = getangle(w1->x - x, w1->y - y); int32_t a2 = getangle(w2->x - x, w2->y - y); @@ -8280,7 +8280,7 @@ static inline int32_t sameside(const _equation *eq, const vec2f_t *p1, c // rest x/y: out void get_wallspr_points(const spritetype *spr, int32_t *x1, int32_t *x2, int32_t *y1, int32_t *y2); -void get_floorspr_points(const tspritetype *spr, int32_t px, int32_t py, +void get_floorspr_points(const uspritetype *spr, int32_t px, int32_t py, int32_t *x1, int32_t *x2, int32_t *x3, int32_t *x4, int32_t *y1, int32_t *y2, int32_t *y3, int32_t *y4); @@ -8380,7 +8380,7 @@ killsprite: { for (int32_t k=i; kz; if ((s->cstat&48) != 32) @@ -8488,7 +8488,7 @@ killsprite: )) { vec2f_t spr; - const tspritetype *tspr = tspriteptr[i]; + const uspritetype *tspr = tspriteptr[i]; spr.x = (float)tspr->x; spr.y = (float)tspr->y; @@ -8677,9 +8677,9 @@ void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang) begindrawing(); //{{{ - tsectortype *sec; + usectortype *sec; - for (s=0,sec=(tsectortype *)§or[s]; s>3]&pow2char[s&7]) { #ifdef YAX_ENABLE @@ -8702,9 +8702,9 @@ void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang) } #else j = startwall; l = 0; - twalltype *wal; + uwalltype *wal; int32_t w; - for (w=sec->wallnum,wal=(twalltype *)&wall[startwall]; w>0; w--,wal++,j++) + for (w=sec->wallnum,wal=(uwalltype *)&wall[startwall]; w>0; w--,wal++,j++) { k = lastwall(j); if ((k > j) && (npoints > 0)) { xb1[npoints-1] = l; l = npoints; } //overwrite point2 @@ -8828,7 +8828,7 @@ void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang) for (s=sortnum-1; s>=0; s--) { - tspritetype * const spr = (tspritetype * )&sprite[tsprite[s].owner]; + uspritetype * const spr = (uspritetype * )&sprite[tsprite[s].owner]; if ((spr->cstat&48) == 32) { const int32_t xspan = tilesiz[spr->picnum].x; @@ -10726,7 +10726,7 @@ int32_t inside(int32_t x, int32_t y, int16_t sectnum) if (sectnum >= 0 && sectnum < numsectors) { uint32_t cnt1 = 0, cnt2 = 0; - twalltype const * wal = (twalltype *) &wall[sector[sectnum].wallptr]; + uwalltype const * wal = (uwalltype *) &wall[sector[sectnum].wallptr]; int32_t i = sector[sectnum].wallnum; do @@ -10881,7 +10881,7 @@ int32_t nextsectorneighborz(int16_t sectnum, int32_t refz, int16_t topbottom, in int32_t nextz = (direction==1) ? INT32_MAX : INT32_MIN; int32_t sectortouse = -1; - const twalltype *wal = (twalltype *)&wall[sector[sectnum].wallptr]; + const uwalltype *wal = (uwalltype *)&wall[sector[sectnum].wallptr]; int32_t i = sector[sectnum].wallnum; do @@ -10950,8 +10950,8 @@ restart_grand: for (dacnt=0; dacntwallnum,wal=(twalltype *)&wall[sec->wallptr]; cnt>0; cnt--,wal++) + for (cnt=sec->wallnum,wal=(uwalltype *)&wall[sec->wallptr]; cnt>0; cnt--,wal++) { - const twalltype *const wal2 = (twalltype *)&wall[wal->point2]; + const uwalltype *const wal2 = (uwalltype *)&wall[wal->point2]; const int32_t x31 = wal->x-x1, x34 = wal->x-wal2->x; const int32_t y31 = wal->y-y1, y34 = wal->y-wal2->y; @@ -11109,7 +11109,7 @@ static int32_t hitscan_hitsectcf=-1; // stat, heinum, z: either ceiling- or floor- // how: -1: behave like ceiling, 1: behave like floor -static int32_t hitscan_trysector(const vec3_t *sv, const tsectortype *sec, hitdata_t *hit, +static int32_t hitscan_trysector(const vec3_t *sv, const usectortype *sec, hitdata_t *hit, int32_t vx, int32_t vy, int32_t vz, uint16_t stat, int16_t heinum, int32_t z, int32_t how, const intptr_t *tmp) { @@ -11118,8 +11118,8 @@ static int32_t hitscan_trysector(const vec3_t *sv, const tsectortype *sec, hitda if (stat&2) { - const twalltype *const wal = (twalltype *)&wall[sec->wallptr]; - const twalltype *const wal2 = (twalltype *)&wall[wal->point2]; + const uwalltype *const wal = (uwalltype *)&wall[sec->wallptr]; + const uwalltype *const wal2 = (uwalltype *)&wall[wal->point2]; int32_t j, dax=wal2->x-wal->x, day=wal2->y-wal->y; i = nsqrtasm(uhypsq(dax,day)); if (i == 0) return 1; //continue; @@ -11154,9 +11154,9 @@ static int32_t hitscan_trysector(const vec3_t *sv, const tsectortype *sec, hitda { if (tmp==NULL) { - if (inside(x1,y1,sec-(tsectortype *)sector) == 1) + if (inside(x1,y1,sec-(usectortype *)sector) == 1) { - hit_set(hit, sec-(tsectortype *)sector, -1, -1, x1, y1, z1); + hit_set(hit, sec-(usectortype *)sector, -1, -1, x1, y1, z1); hitscan_hitsectcf = (how+1)>>1; } } @@ -11168,7 +11168,7 @@ static int32_t hitscan_trysector(const vec3_t *sv, const tsectortype *sec, hitda if (!thislastsec) { - if (inside(x1,y1,sec-(tsectortype *)sector) == 1) + if (inside(x1,y1,sec-(usectortype *)sector) == 1) hit_set(hit, curspr->sectnum, -1, curspr-sprite, x1, y1, z1); } #ifdef HAVE_CLIPSHAPE_FEATURE @@ -11221,7 +11221,7 @@ void get_wallspr_points(const spritetype *spr, int32_t *x1, int32_t *x2, // x1, y1: in/out // rest x/y: out -void get_floorspr_points(const tspritetype *spr, int32_t px, int32_t py, +void get_floorspr_points(const uspritetype *spr, int32_t px, int32_t py, int32_t *x1, int32_t *x2, int32_t *x3, int32_t *x4, int32_t *y1, int32_t *y2, int32_t *y3, int32_t *y4) { @@ -11371,8 +11371,8 @@ restart_grand: clipspritecnt = clipspritenum = 0; do { - const tsectortype *sec; - const twalltype *wal; + const usectortype *sec; + const uwalltype *wal; int32_t dasector, z, startwall, endwall; #ifdef HAVE_CLIPSHAPE_FEATURE @@ -11400,7 +11400,7 @@ restart_grand: tempshortcnt = 0; } #endif - dasector = clipsectorlist[tempshortcnt]; sec = (tsectortype *)§or[dasector]; + dasector = clipsectorlist[tempshortcnt]; sec = (usectortype *)§or[dasector]; i = 1; #ifdef HAVE_CLIPSHAPE_FEATURE @@ -11422,10 +11422,10 @@ restart_grand: ////////// Walls ////////// startwall = sec->wallptr; endwall = startwall + sec->wallnum; - for (z=startwall,wal=(twalltype *)&wall[startwall]; znextsector; - const twalltype *const wal2 = (twalltype *)&wall[wal->point2]; + const uwalltype *const wal2 = (uwalltype *)&wall[wal->point2]; int32_t daz2, zz; if (curspr && nextsector<0) continue; @@ -11594,7 +11594,7 @@ restart_grand: if (klabs(intx-sv->x)+klabs(inty-sv->y) > klabs((hit->pos.x)-sv->x)+klabs((hit->pos.y)-sv->y)) continue; - get_floorspr_points((tspritetype const *)spr, intx, inty, &x1, &x2, &x3, &x4, + get_floorspr_points((uspritetype const *)spr, intx, inty, &x1, &x2, &x3, &x4, &y1, &y2, &y3, &y4); if (get_floorspr_clipyou(x1, x2, x3, x4, y1, y2, y3, y4)) @@ -11690,12 +11690,12 @@ void neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16_t ange, const int32_t startwall = sector[dasector].wallptr; const int32_t endwall = startwall + sector[dasector].wallnum - 1; - const twalltype *wal; + const uwalltype *wal; int32_t z; - for (z=startwall,wal=(twalltype *)&wall[startwall]; z<=endwall; z++,wal++) + for (z=startwall,wal=(uwalltype *)&wall[startwall]; z<=endwall; z++,wal++) { - const twalltype *const wal2 = (twalltype *)&wall[wal->point2]; + const uwalltype *const wal2 = (uwalltype *)&wall[wal->point2]; const int32_t nextsector = wal->nextsector; const int32_t x1=wal->x, y1=wal->y, x2=wal2->x, y2=wal2->y; @@ -12006,7 +12006,7 @@ void updatesector(int32_t x, int32_t y, int16_t *sectnum) if ((unsigned)*sectnum < (unsigned)numsectors) { - const twalltype *wal = (twalltype *)&wall[sector[*sectnum].wallptr]; + const uwalltype *wal = (uwalltype *)&wall[sector[*sectnum].wallptr]; int32_t j = sector[*sectnum].wallnum; do @@ -12066,7 +12066,7 @@ void updatesectorexclude(int32_t x, int32_t y, int16_t *sectnum, const uint8_t * if (*sectnum >= 0 && *sectnum < numsectors) { - const twalltype *wal = (twalltype *)&wall[sector[*sectnum].wallptr]; + const uwalltype *wal = (uwalltype *)&wall[sector[*sectnum].wallptr]; int32_t j = sector[*sectnum].wallnum; do @@ -12096,7 +12096,7 @@ void updatesectorz(int32_t x, int32_t y, int32_t z, int16_t *sectnum) if ((uint32_t)(*sectnum) < 2*MAXSECTORS) { - const twalltype *wal; + const uwalltype *wal; int32_t j, cz, fz; int32_t nofirstzcheck = 0; @@ -12129,7 +12129,7 @@ void updatesectorz(int32_t x, int32_t y, int32_t z, int16_t *sectnum) if (inside_p(x, y, *sectnum)) return; - wal = (twalltype *)&wall[sector[*sectnum].wallptr]; + wal = (uwalltype *)&wall[sector[*sectnum].wallptr]; j = sector[*sectnum].wallnum; do { @@ -12519,7 +12519,7 @@ restart_grand: if ((pos->z > daz) == ((cstat&8)==0)) continue; - get_floorspr_points((tspritetype const *) &sprite[j], pos->x, pos->y, &x1, &x2, &x3, &x4, + get_floorspr_points((uspritetype const *) &sprite[j], pos->x, pos->y, &x1, &x2, &x3, &x4, &y1, &y2, &y3, &y4); vec2_t const da = { mulscale14(sintable[(sprite[j].ang - 256 + 512) & 2047], walldist + 4), @@ -13155,7 +13155,7 @@ int32_t getceilzofslopeptr(const sectortype *sec, int32_t dax, int32_t day) if (!(sec->ceilingstat&2)) return sec->ceilingz; - twalltype const *wal = (twalltype *)&wall[sec->wallptr]; + uwalltype const *wal = (uwalltype *)&wall[sec->wallptr]; // floor(sqrt(2**31-1)) == 46340 vec2_t const w = *(vec2_t *) wal; @@ -13173,7 +13173,7 @@ int32_t getflorzofslopeptr(const sectortype *sec, int32_t dax, int32_t day) if (!(sec->floorstat&2)) return sec->floorz; - twalltype const *wal = (twalltype *) &wall[sec->wallptr]; + uwalltype const *wal = (uwalltype *) &wall[sec->wallptr]; vec2_t const w = *(vec2_t *) wal; vec2_t const d ={ wall[wal->point2].x-w.x , wall[wal->point2].y-w.y }; @@ -13192,8 +13192,8 @@ void getzsofslopeptr(const sectortype *sec, int32_t dax, int32_t day, int32_t *c if (((sec->ceilingstat|sec->floorstat)&2) != 2) return; - twalltype const *wal = (twalltype *) &wall[sec->wallptr]; - twalltype const *wal2 = (twalltype *) &wall[wal->point2]; + uwalltype const *wal = (uwalltype *) &wall[sec->wallptr]; + uwalltype const *wal2 = (uwalltype *) &wall[wal->point2]; const vec2_t d ={ wal2->x-wal->x, wal2->y-wal->y }; int32_t const i = nsqrtasm(uhypsq(d.x,d.y))<<5; @@ -13212,7 +13212,7 @@ void getzsofslopeptr(const sectortype *sec, int32_t dax, int32_t day, int32_t *c // void alignceilslope(int16_t dasect, int32_t x, int32_t y, int32_t z) { - const twalltype *const wal = (twalltype *)&wall[sector[dasect].wallptr]; + const uwalltype *const wal = (uwalltype *)&wall[sector[dasect].wallptr]; const int32_t dax = wall[wal->point2].x-wal->x; const int32_t day = wall[wal->point2].y-wal->y; @@ -13233,7 +13233,7 @@ void alignceilslope(int16_t dasect, int32_t x, int32_t y, int32_t z) // void alignflorslope(int16_t dasect, int32_t x, int32_t y, int32_t z) { - const twalltype *const wal = (twalltype *)&wall[sector[dasect].wallptr]; + const uwalltype *const wal = (uwalltype *)&wall[sector[dasect].wallptr]; const int32_t dax = wall[wal->point2].x-wal->x; const int32_t day = wall[wal->point2].y-wal->y; @@ -13278,7 +13278,7 @@ void setfirstwall(int16_t sectnum, int16_t newfirstwall) { int32_t i, j, numwallsofloop; int32_t dagoalloop; - twalltype *tmpwall; + uwalltype *tmpwall; const int32_t startwall = sector[sectnum].wallptr; const int32_t danumwalls = sector[sectnum].wallnum; @@ -13287,7 +13287,7 @@ void setfirstwall(int16_t sectnum, int16_t newfirstwall) if (newfirstwall < startwall || newfirstwall >= startwall+danumwalls) return; - tmpwall = (twalltype *)Xmalloc(danumwalls * sizeof(walltype)); + tmpwall = (uwalltype *)Xmalloc(danumwalls * sizeof(walltype)); Bmemcpy(tmpwall, &wall[startwall], danumwalls*sizeof(walltype)); diff --git a/polymer/eduke32/build/src/engine_priv.h b/polymer/eduke32/build/src/engine_priv.h index d9ce65706..3df010755 100644 --- a/polymer/eduke32/build/src/engine_priv.h +++ b/polymer/eduke32/build/src/engine_priv.h @@ -270,7 +270,7 @@ extern uint16_t ATTRIBUTE((used)) sqrtable[4096], ATTRIBUTE((used)) shlookup[409 extern int16_t thesector[MAXWALLSB], thewall[MAXWALLSB]; extern int16_t bunchfirst[MAXWALLSB], bunchlast[MAXWALLSB]; extern int16_t maskwall[MAXWALLSB], maskwallcnt; -extern tspritetype *tspriteptr[MAXSPRITESONSCREEN + 1]; +extern uspritetype *tspriteptr[MAXSPRITESONSCREEN + 1]; extern int32_t xdimen, xdimenrecip, halfxdimen, xdimenscale, xdimscale, ydimen; extern float fxdimen; extern intptr_t frameoffset; @@ -318,7 +318,7 @@ void calc_and_apply_fog_factor(int32_t tile, int32_t shade, int32_t vis, int32_t extern void get_wallspr_points(const spritetype *spr, int32_t *x1, int32_t *x2, int32_t *y1, int32_t *y2); -extern void get_floorspr_points(const tspritetype *spr, int32_t px, int32_t py, +extern void get_floorspr_points(const uspritetype *spr, int32_t px, int32_t py, int32_t *x1, int32_t *x2, int32_t *x3, int32_t *x4, int32_t *y1, int32_t *y2, int32_t *y3, int32_t *y4); @@ -340,7 +340,7 @@ int32_t animateoffs(int const tilenum); } while (0) #endif -FORCE_INLINE int32_t bad_tspr(const tspritetype *tspr) +FORCE_INLINE int32_t bad_tspr(const uspritetype *tspr) { // NOTE: tspr->owner >= MAXSPRITES (could be model) has to be handled by // caller. diff --git a/polymer/eduke32/build/src/mdsprite.c b/polymer/eduke32/build/src/mdsprite.c index f23a9e5fe..e3b2d4a7f 100644 --- a/polymer/eduke32/build/src/mdsprite.c +++ b/polymer/eduke32/build/src/mdsprite.c @@ -1004,7 +1004,7 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf) } //Note: even though it says md2model, it works for both md2model&md3model -void updateanimation(md2model_t *m, const tspritetype *tspr, uint8_t lpal) +void updateanimation(md2model_t *m, const uspritetype *tspr, uint8_t lpal) { const mdanim_t *anim; int32_t i, j, k; @@ -1972,7 +1972,7 @@ int md3postload_polymer(md3model_t *m) } -void md3_vox_calcmat_common(const tspritetype *tspr, const vec3f_t *a0, float f, float mat[16]) +void md3_vox_calcmat_common(const uspritetype *tspr, const vec3f_t *a0, float f, float mat[16]) { float g; float k0, k1, k2, k3, k4, k5, k6, k7; @@ -2060,7 +2060,7 @@ static void md3draw_handle_triangles(const md3surf_t *s, uint16_t *indexhandle, #endif } -static int32_t polymost_md3draw(md3model_t *m, const tspritetype *tspr) +static int32_t polymost_md3draw(md3model_t *m, const uspritetype *tspr) { vec3f_t m0, m1, a0; md3xyzn_t *v0, *v1; @@ -2690,7 +2690,7 @@ void md_allocvbos(void) } #endif -int32_t polymost_mddraw(const tspritetype *tspr) +int32_t polymost_mddraw(const uspritetype *tspr) { #ifdef USE_GLEXT if (r_vbos && (r_vbocount > allocvbos)) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 01b42b58d..bfbcd290b 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -1460,14 +1460,14 @@ static void polymer_drawsearchplane(_prplane *plane, GLubyte *oldcolor, void polymer_drawmaskwall(int32_t damaskwallcnt) { - tsectortype *sec; + usectortype *sec; walltype *wal; _prwall *w; GLubyte oldcolor[4]; if (pr_verbosity >= 3) OSD_Printf("PR : Masked wall %i...\n", damaskwallcnt); - sec = (tsectortype *)§or[sectorofwall(maskwall[damaskwallcnt])]; + sec = (usectortype *)§or[sectorofwall(maskwall[damaskwallcnt])]; wal = &wall[maskwall[damaskwallcnt]]; w = prwalls[maskwall[damaskwallcnt]]; @@ -1488,8 +1488,8 @@ void polymer_drawsprite(int32_t snum) int32_t i, j, cs; _prsprite *s; - tspritetype *const tspr = tspriteptr[snum]; - const tsectortype *sec; + uspritetype *const tspr = tspriteptr[snum]; + const usectortype *sec; if (pr_verbosity >= 3) OSD_Printf("PR : Sprite %i...\n", snum); @@ -1504,9 +1504,9 @@ void polymer_drawsprite(int32_t snum) DO_TILE_ANIM(tspr->picnum, tspr->owner+32768); - sec = (tsectortype *)§or[tspr->sectnum]; + sec = (usectortype *)§or[tspr->sectnum]; calc_and_apply_fog(tspr->picnum, fogpal_shade(sec, tspr->shade), sec->visibility, - get_floor_fogpal((tsectortype *)§or[tspr->sectnum])); + get_floor_fogpal((usectortype *)§or[tspr->sectnum])); if (usemodels && tile2model[Ptile2tile(tspr->picnum,tspr->pal)].modelid >= 0 && tile2model[Ptile2tile(tspr->picnum,tspr->pal)].framenum >= 0 && @@ -1757,7 +1757,7 @@ int32_t polymer_havehighpalookup(int32_t basepalnum, int32_t palnum) // CORE static void polymer_displayrooms(const int16_t dacursectnum) { - tsectortype *sec; + usectortype *sec; int32_t i; int16_t bunchnum; int16_t ns; @@ -1770,7 +1770,7 @@ static void polymer_displayrooms(const int16_t dacursectnum) GLfloat localprojectionmatrix[16]; float frustum[5 * 4]; int32_t localspritesortcnt; - tspritetype localtsprite[MAXSPRITESONSCREEN]; + uspritetype localtsprite[MAXSPRITESONSCREEN]; int16_t localmaskwall[MAXWALLSB]; int16_t localmaskwallcnt; _prmirror mirrorlist[10]; @@ -1817,7 +1817,7 @@ static void polymer_displayrooms(const int16_t dacursectnum) while (front != back) { - sec = (tsectortype *)§or[sectorqueue[front]]; + sec = (usectortype *)§or[sectorqueue[front]]; polymer_pokesector(sectorqueue[front]); polymer_drawsector(sectorqueue[front], FALSE); @@ -2542,12 +2542,12 @@ static void polymer_freeboard(void) // SECTORS static int32_t polymer_initsector(int16_t sectnum) { - tsectortype *sec; + usectortype *sec; _prsector* s; if (pr_verbosity >= 2) OSD_Printf("PR : Initializing sector %i...\n", sectnum); - sec = (tsectortype *)§or[sectnum]; + sec = (usectortype *)§or[sectnum]; s = (_prsector *)Xcalloc(1, sizeof(_prsector)); s->verts = (GLdouble *)Xcalloc(sec->wallnum, sizeof(GLdouble) * 3); @@ -2581,7 +2581,7 @@ static int32_t polymer_initsector(int16_t sectnum) static int32_t polymer_updatesector(int16_t sectnum) { _prsector* s; - tsectortype *sec; + usectortype *sec; walltype *wal; int32_t i, j; int32_t ceilz, florz; @@ -2595,7 +2595,7 @@ static int32_t polymer_updatesector(int16_t sectnum) if (pr_nullrender >= 3) return 0; s = prsectors[sectnum]; - sec = (tsectortype *)§or[sectnum]; + sec = (usectortype *)§or[sectnum]; secangcos = secangsin = 2; @@ -2914,13 +2914,13 @@ static int32_t polymer_buildfloor(int16_t sectnum) { // This function tesselates the floor/ceiling of a sector and stores the triangles in a display list. _prsector* s; - tsectortype *sec; + usectortype *sec; intptr_t i; if (pr_verbosity >= 2) OSD_Printf("PR : Tesselating floor of sector %i...\n", sectnum); s = prsectors[sectnum]; - sec = (tsectortype *)§or[sectnum]; + sec = (usectortype *)§or[sectnum]; if (s == NULL) return (-1); @@ -2973,7 +2973,7 @@ static int32_t polymer_buildfloor(int16_t sectnum) static void polymer_drawsector(int16_t sectnum, int32_t domasks) { - tsectortype *sec; + usectortype *sec; _prsector* s; GLubyte oldcolor[4]; int32_t draw; @@ -2981,7 +2981,7 @@ static void polymer_drawsector(int16_t sectnum, int32_t domasks) if (pr_verbosity >= 3) OSD_Printf("PR : Drawing sector %i...\n", sectnum); - sec = (tsectortype *)§or[sectnum]; + sec = (usectortype *)§or[sectnum]; s = prsectors[sectnum]; queuedmask = FALSE; @@ -3549,7 +3549,7 @@ static void polymer_updatewall(int16_t wallnum) static void polymer_drawwall(int16_t sectnum, int16_t wallnum) { - tsectortype *sec; + usectortype *sec; walltype *wal; _prwall *w; GLubyte oldcolor[4]; @@ -3557,7 +3557,7 @@ static void polymer_drawwall(int16_t sectnum, int16_t wallnum) if (pr_verbosity >= 3) OSD_Printf("PR : Drawing wall %i...\n", wallnum); - sec = (tsectortype *)§or[sectnum]; + sec = (usectortype *)§or[sectnum]; wal = &wall[wallnum]; w = prwalls[wallnum]; @@ -3817,7 +3817,7 @@ static inline int32_t polymer_planeinfrustum(_prplane *plane, float* frustum) return 1; } -static inline void polymer_scansprites(int16_t sectnum, tspritetype* localtsprite, int32_t* localspritesortcnt) +static inline void polymer_scansprites(int16_t sectnum, uspritetype* localtsprite, int32_t* localspritesortcnt) { int32_t i; spritetype *spr; @@ -3842,7 +3842,7 @@ void polymer_updatesprite(int32_t snum) { int32_t xsize, ysize, i, j; int32_t tilexoff, tileyoff, xoff, yoff, centeryoff=0; - tspritetype *tspr = tspriteptr[snum]; + uspritetype *tspr = tspriteptr[snum]; float xratio, yratio, ang; float spos[3]; const _prvert *inbuffer; @@ -4328,7 +4328,7 @@ static void polymer_drawskybox(int16_t tilenum, char palnum, int8_t shad } // MDSPRITES -static void polymer_drawmdsprite(tspritetype *tspr) +static void polymer_drawmdsprite(uspritetype *tspr) { md3model_t* m; mdskinmap_t* sk; diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index f8dbdd4a6..ba9c36e1c 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -2464,7 +2464,7 @@ void polymost_editorfunc(void) if (spritesortcnt == MAXSPRITESONSCREEN) spritesortcnt--; - tspritetype *tsp = &tsprite[spritesortcnt]; + uspritetype *tsp = &tsprite[spritesortcnt]; double dadist, x, y, z; Bmemcpy(tsp, &hit->pos, sizeof(vec3_t)); x = tsp->x-globalposx; y=tsp->y-globalposy; z=(tsp->z-globalposz)/16.0; @@ -2592,7 +2592,7 @@ static void polymost_internal_nonparallaxed(vec2f_t n0, vec2f_t n1, float ryp0, { int const have_floor = sectnum & MAXSECTORS; sectnum &= ~MAXSECTORS; - tsectortype const * const sec = (tsectortype *)§or[sectnum]; + usectortype const * const sec = (usectortype *)§or[sectnum]; // comments from floor code: //(singlobalang/-16384*(sx-ghalfx) + 0*(sy-ghoriz) + (cosviewingrangeglobalang/16384)*ghalfx)*d + globalposx = u*16 @@ -2839,7 +2839,7 @@ static void polymost_drawalls(int32_t const bunch) drawpoly_alpha = 0.f; int32_t const sectnum = thesector[bunchfirst[bunch]]; - tsectortype const * const sec = (tsectortype *)§or[sectnum]; + usectortype const * const sec = (usectortype *)§or[sectnum]; //DRAW WALLS SECTION! for (int z=bunchfirst[bunch]; z>=0; z=bunchp2[z]) @@ -2851,9 +2851,9 @@ static void polymost_drawalls(int32_t const bunch) continue; #endif - twalltype * const wal = (twalltype *)&wall[wallnum], *wal2 = (twalltype *)&wall[wal->point2]; + uwalltype * const wal = (uwalltype *)&wall[wallnum], *wal2 = (uwalltype *)&wall[wal->point2]; int32_t const nextsectnum = wal->nextsector; - tsectortype * const nextsec = nextsectnum>=0 ? (tsectortype *)§or[nextsectnum] : NULL; + usectortype * const nextsec = nextsectnum>=0 ? (usectortype *)§or[nextsectnum] : NULL; //Offset&Rotate 3D coordinates to screen 3D space vec2f_t walpos = { (float)(wal->x-globalposx), (float)(wal->y-globalposy) }; @@ -3544,12 +3544,12 @@ static void polymost_drawalls(int32_t const bunch) } if (((ofy0 < fy0) || (ofy1 < fy1)) && (!((sec->floorstat§or[nextsectnum].floorstat)&1))) { - twalltype *nwal; + uwalltype *nwal; if (!(wal->cstat&2)) nwal = wal; else { - nwal = (twalltype *)&wall[wal->nextwall]; + nwal = (uwalltype *)&wall[wal->nextwall]; otex.u += (float)(nwal->xpanning - wal->xpanning) * otex.d; xtex.u += (float)(nwal->xpanning - wal->xpanning) * xtex.d; ytex.u += (float)(nwal->xpanning - wal->xpanning) * ytex.d; @@ -3672,7 +3672,7 @@ void polymost_scansector(int32_t sectnum) for (int z=headspritesect[sectnum]; z>=0; z=nextspritesect[z]) { - tspritetype const * const spr = (tspritetype *)&sprite[z]; + uspritetype const * const spr = (uspritetype *)&sprite[z]; if ((((spr->cstat&0x8000) == 0) || (showinvisibility)) && (spr->xrepeat > 0) && (spr->yrepeat > 0)) { @@ -3697,12 +3697,12 @@ void polymost_scansector(int32_t sectnum) int scanfirst = numscans; vec2f_t p2 = { 0, 0 }; - twalltype *wal; + uwalltype *wal; int z; - for (z=startwall,wal=(twalltype *)&wall[z]; zpoint2]; + uwalltype const * const wal2 = (uwalltype *)&wall[wal->point2]; vec2f_t const fp1 = { (float)(wal->x-globalposx), (float)(wal->y-globalposy) }; vec2f_t const fp2 = { (float)(wal2->x-globalposx), (float)(wal2->y-globalposy) }; @@ -4059,15 +4059,15 @@ void polymost_drawrooms() void polymost_drawmaskwall(int32_t damaskwallcnt) { int const z = maskwall[damaskwallcnt]; - twalltype const * const wal = (twalltype *)&wall[thewall[z]], *wal2 = (twalltype *)&wall[wal->point2]; + uwalltype const * const wal = (uwalltype *)&wall[thewall[z]], *wal2 = (uwalltype *)&wall[wal->point2]; int32_t const sectnum = thesector[z]; - tsectortype const * const sec = (tsectortype *)§or[sectnum]; + usectortype const * const sec = (usectortype *)§or[sectnum]; // if (wal->nextsector < 0) return; // Without MASKWALL_BAD_ACCESS fix: // wal->nextsector is -1, WGR2 SVN Lochwood Hollow (Til' Death L1) (or trueror1.map) - tsectortype const * const nsec = (tsectortype *)§or[wal->nextsector]; + usectortype const * const nsec = (usectortype *)§or[wal->nextsector]; globalpicnum = wal->overpicnum; if ((uint32_t)globalpicnum >= MAXTILES) @@ -4264,10 +4264,10 @@ typedef struct wallspriteinfo_t wsprinfo[MAXSPRITES]; -static inline int32_t polymost_findwall(tspritetype const * const tspr, vec2_t const * const tsiz, int32_t * rd) +static inline int32_t polymost_findwall(uspritetype const * const tspr, vec2_t const * const tsiz, int32_t * rd) { int32_t dist = 4, closest = -1; - tsectortype const * const sect = (tsectortype * )§or[tspr->sectnum]; + usectortype const * const sect = (usectortype * )§or[tspr->sectnum]; vec2_t n; for (int i=sect->wallptr; iwallptr + sect->wallnum; i++) @@ -4336,12 +4336,12 @@ int32_t polymost_lintersect(int32_t x1, int32_t y1, int32_t x2, int32_t y2, void polymost_drawsprite(int32_t snum) { - tspritetype *const tspr = tspriteptr[snum]; + uspritetype *const tspr = tspriteptr[snum]; if (EDUKE32_PREDICT_FALSE(bad_tspr(tspr))) return; - const tsectortype *sec; + const usectortype *sec; int32_t spritenum = tspr->owner; @@ -4372,7 +4372,7 @@ void polymost_drawsprite(int32_t snum) drawpoly_alpha = spriteext[spritenum].alpha; - sec = (tsectortype *)§or[tspr->sectnum]; + sec = (usectortype *)§or[tspr->sectnum]; calc_and_apply_fog(tspr->picnum, fogpal_shade(sec, globalshade), sec->visibility, get_floor_fogpal(sec)); @@ -4969,7 +4969,7 @@ void polymost_dorotatespritemodel(int32_t sx, int32_t sy, int32_t z, int16_t a, vec3f_t vec1; - tspritetype tspr; + uspritetype tspr; Bmemset(&tspr, 0, sizeof(spritetype)); hudtyp const * const hud = tile2model[tilenum].hudmem[(dastat&4)>>2]; diff --git a/polymer/eduke32/build/src/voxmodel.c b/polymer/eduke32/build/src/voxmodel.c index 9e96b5a55..958cb5dce 100644 --- a/polymer/eduke32/build/src/voxmodel.c +++ b/polymer/eduke32/build/src/voxmodel.c @@ -896,7 +896,7 @@ voxmodel_t *voxload(const char *filnam) } //Draw voxel model as perfect cubes -int32_t polymost_voxdraw(voxmodel_t *m, const tspritetype *tspr) +int32_t polymost_voxdraw(voxmodel_t *m, const uspritetype *tspr) { // float clut[6] = {1.02,1.02,0.94,1.06,0.98,0.98}; float f, g, k0; diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 2a73b5e8b..b366253a2 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -99,7 +99,7 @@ void G_ClearCameraView(DukePlayer_t *ps) } // Manhattan distance between wall-point and sprite. -static inline int32_t G_WallSpriteDist(const twalltype * const wal, const tspritetype * const spr) +static inline int32_t G_WallSpriteDist(const uwalltype * const wal, const uspritetype * const spr) { return klabs(wal->x - spr->x) + klabs(wal->y - spr->y); } @@ -107,7 +107,7 @@ static inline int32_t G_WallSpriteDist(const twalltype * const wal, const tsprit void A_RadiusDamage(int32_t i, int32_t r, int32_t hp1, int32_t hp2, int32_t hp3, int32_t hp4) { int32_t d, q, stati; - tspritetype const *const s = (tspritetype *)&sprite[i]; + uspritetype const *const s = (uspritetype *)&sprite[i]; static const int32_t statlist[] = { STAT_DEFAULT, STAT_ACTOR, STAT_STANDABLE, @@ -130,7 +130,7 @@ void A_RadiusDamage(int32_t i, int32_t r, int32_t hp1, int32_t hp2, int32_t hp3, do { - const twalltype *wal; + const uwalltype *wal; const int32_t dasect = sectorlist[sectcnt++]; const int32_t startwall = sector[dasect].wallptr; const int32_t endwall = startwall+sector[dasect].wallnum; @@ -140,8 +140,8 @@ void A_RadiusDamage(int32_t i, int32_t r, int32_t hp1, int32_t hp2, int32_t hp3, // Check if "hit" 1st or 3rd wall-point. This mainly makes sense // for rectangular "ceiling light"-style sectors. - if (G_WallSpriteDist((twalltype *)&wall[startwall], s) < r || - G_WallSpriteDist((twalltype *)&wall[wall[w2].point2], s) < r) + if (G_WallSpriteDist((uwalltype *)&wall[startwall], s) < r || + G_WallSpriteDist((uwalltype *)&wall[wall[w2].point2], s) < r) { if (((sector[dasect].ceilingz-s->z)>>8) < r) Sect_DamageCeilingOrFloor(0, dasect); @@ -149,7 +149,7 @@ void A_RadiusDamage(int32_t i, int32_t r, int32_t hp1, int32_t hp2, int32_t hp3, Sect_DamageCeilingOrFloor(1, dasect); } - for (w=startwall,wal=(twalltype *)&wall[startwall]; wpicnum != SHRINKSPARK || (sj->cstat&257)) if (dist(s, sj) < r) { - if (A_CheckEnemySprite((tspritetype *)sj) && !cansee(sj->x, sj->y,sj->z+q, sj->sectnum, s->x, s->y, s->z+q, s->sectnum)) + if (A_CheckEnemySprite((uspritetype *)sj) && !cansee(sj->x, sj->y,sj->z+q, sj->sectnum, s->x, s->y, s->z+q, s->sectnum)) goto BOLT; A_DamageObject(j, i); } } - else if (sj->extra >= 0 && (tspritetype *)sj != s && (sj->picnum == TRIPBOMB || A_CheckEnemySprite((tspritetype *)sj) || sj->picnum == QUEBALL || sj->picnum == STRIPEBALL || (sj->cstat&257) || sj->picnum == DUKELYINGDEAD)) + else if (sj->extra >= 0 && (uspritetype *)sj != s && (sj->picnum == TRIPBOMB || A_CheckEnemySprite((uspritetype *)sj) || sj->picnum == QUEBALL || sj->picnum == STRIPEBALL || (sj->cstat&257) || sj->picnum == DUKELYINGDEAD)) { if (s->picnum == SHRINKSPARK && sj->picnum != SHARK && (j == s->owner || sj->xrepeat < 24)) { @@ -304,13 +304,13 @@ BOLT: // : the projectile // : the SE7 // : below->above change? -static int32_t Proj_MaybeDoTransport(int32_t spritenum, const tspritetype * const effector, int32_t fromunderp, int32_t daz) +static int32_t Proj_MaybeDoTransport(int32_t spritenum, const uspritetype * const effector, int32_t fromunderp, int32_t daz) { if (totalclock <= actor[spritenum].lasttransport) return 0; spritetype *const spr = &sprite[spritenum]; - const tspritetype *const otherse = (tspritetype *)&sprite[effector->owner]; + const uspritetype *const otherse = (uspritetype *)&sprite[effector->owner]; actor[spritenum].lasttransport = totalclock + (TICSPERFRAME<<2); @@ -401,7 +401,7 @@ static int32_t A_CheckNeedZUpdate(int32_t spritenum, int32_t changez, int32_t *d int32_t A_MoveSpriteClipdist(int32_t spritenum, const vec3_t *change, uint32_t cliptype, int32_t clipdist) { spritetype *const spr = &sprite[spritenum]; - const int32_t badguy = A_CheckEnemySprite((tspritetype *)spr); + const int32_t badguy = A_CheckEnemySprite((uspritetype *)spr); const int32_t oldx = spr->x, oldy = spr->y; if (spr->statnum == STAT_MISC || (badguy && spr->xrepeat < 4)) @@ -540,12 +540,12 @@ int32_t A_MoveSpriteClipdist(int32_t spritenum, const vec3_t *change, uint32_t c if (lotag == ST_1_ABOVE_WATER) if (daz >= actor[spritenum].floorz) - if (Proj_MaybeDoTransport(spritenum, (tspritetype *)&sprite[i], 0, daz)) + if (Proj_MaybeDoTransport(spritenum, (uspritetype *)&sprite[i], 0, daz)) return 0; if (lotag == ST_2_UNDERWATER) if (daz <= actor[spritenum].ceilingz) - if (Proj_MaybeDoTransport(spritenum, (tspritetype *)&sprite[i], 1, daz)) + if (Proj_MaybeDoTransport(spritenum, (uspritetype *)&sprite[i], 1, daz)) return 0; } } @@ -641,7 +641,7 @@ void A_DoGuts(int32_t sp, int32_t gtype, int32_t n) int32_t gutz,floorz; int32_t i,a,j,sx = 32,sy = 32; - tspritetype const * const s = (tspritetype *)&sprite[sp]; + uspritetype const * const s = (uspritetype *)&sprite[sp]; if (A_CheckEnemySprite(s) && s->xrepeat < 16) sx = sy = 8; @@ -673,7 +673,7 @@ void A_DoGutsDir(int32_t sp, int32_t gtype, int32_t n) { int32_t gutz,floorz; int32_t i,a,j,sx = 32,sy = 32; - tspritetype const * const s = (tspritetype *)&sprite[sp]; + uspritetype const * const s = (uspritetype *)&sprite[sp]; if (A_CheckEnemySprite(s) && s->xrepeat < 16) sx = sy = 8; @@ -876,7 +876,7 @@ ACTOR_STATIC void G_MoveZombieActors(void) actor[i].timetosleep++; if (actor[i].timetosleep >= (x>>8)) { - if (A_CheckEnemySprite((tspritetype *)s)) + if (A_CheckEnemySprite((uspritetype *)s)) { const int32_t px = g_player[p].ps->opos.x+64-(krand()&127); const int32_t py = g_player[p].ps->opos.y+64-(krand()&127); @@ -947,7 +947,7 @@ ACTOR_STATIC void G_MoveZombieActors(void) } } - if (A_CheckEnemySprite((tspritetype *)s) && A_CheckSpriteFlags(i,SFLAG_NOSHADE) == 0) + if (A_CheckEnemySprite((uspritetype *)s) && A_CheckSpriteFlags(i,SFLAG_NOSHADE) == 0) { if (sector[s->sectnum].ceilingstat&1) s->shade = sector[s->sectnum].ceilingshade; @@ -3064,7 +3064,7 @@ ACTOR_STATIC void G_MoveWeapons(void) j &= (MAXSPRITES-1); if (s->picnum == FREEZEBLAST && sprite[j].pal == 1) - if (A_CheckEnemySprite((tspritetype *)&sprite[j]) || sprite[j].picnum == APLAYER) + if (A_CheckEnemySprite((uspritetype *)&sprite[j]) || sprite[j].picnum == APLAYER) { j = A_Spawn(i, TRANSPORTERSTAR); sprite[j].pal = 1; @@ -4913,7 +4913,7 @@ DETONATEB: goto BOLT; } - if (!g_netServer && ud.multimode < 2 && A_CheckEnemySprite((tspritetype *)s)) + if (!g_netServer && ud.multimode < 2 && A_CheckEnemySprite((uspritetype *)s)) { if (g_noEnemies == 1) { @@ -5598,7 +5598,7 @@ static void MaybeTrainKillEnemies(int32_t i, int32_t numguts) { const int32_t nextj = nextspritesect[j]; - if (sprite[j].extra >= 0 && sprite[j].statnum == STAT_ACTOR && A_CheckEnemySprite((tspritetype *)&sprite[j])) + if (sprite[j].extra >= 0 && sprite[j].statnum == STAT_ACTOR && A_CheckEnemySprite((uspritetype *)&sprite[j])) { int16_t k = sprite[j].sectnum; @@ -6564,7 +6564,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3 { for (SPRITES_OF(STAT_ACTOR, k)) { - if (sprite[k].extra > 0 && A_CheckEnemySprite((tspritetype *)&sprite[k]) + if (sprite[k].extra > 0 && A_CheckEnemySprite((uspritetype *)&sprite[k]) && clipinsidebox((vec2_t *)&sprite[k], j, 256) == 1) goto BOLT; } @@ -7756,7 +7756,7 @@ BOLT: if (s->lotag == SE_29_WAVES) { - tsectortype const *const sc = (tsectortype *)§or[s->sectnum]; + usectortype const *const sc = (usectortype *)§or[s->sectnum]; if (sc->wallnum == 4) { diff --git a/polymer/eduke32/source/actors.h b/polymer/eduke32/source/actors.h index 71b9fa324..aee1e6c3f 100644 --- a/polymer/eduke32/source/actors.h +++ b/polymer/eduke32/source/actors.h @@ -347,7 +347,7 @@ ACTOR_INLINE_HEADER int32_t A_MoveSprite(int32_t spritenum, const vec3_t *change EXTERN_INLINE_HEADER int32_t G_CheckForSpaceCeiling(int32_t sectnum); EXTERN_INLINE_HEADER int32_t G_CheckForSpaceFloor(int32_t sectnum); -EXTERN_INLINE_HEADER int32_t A_CheckEnemySprite(tspritetype const * const s); +EXTERN_INLINE_HEADER int32_t A_CheckEnemySprite(uspritetype const * const s); #ifdef __cplusplus } @@ -392,7 +392,7 @@ EXTERN_INLINE int32_t G_CheckForSpaceFloor(int32_t sectnum) (sector[sectnum].floorpicnum==MOONSKY1 || sector[sectnum].floorpicnum==BIGORBIT1)); } -EXTERN_INLINE int32_t A_CheckEnemySprite(tspritetype const * const s) +EXTERN_INLINE int32_t A_CheckEnemySprite(uspritetype const * const s) { return A_CheckEnemyTile(s->picnum); } diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index aba29d74b..3b9f7dba6 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -9022,7 +9022,7 @@ static int32_t osdcmd_do(const osdfuncparm_t *parm) if (in3dmode() && AIMING_AT_SPRITE) { vm.g_i = searchwall; - vm.g_sp = (tspritetype *)&sprite[vm.g_i]; + vm.g_sp = (uspritetype *)&sprite[vm.g_i]; } // If OSD is down, that would interfere with user input, so don't consider @@ -10402,7 +10402,7 @@ void ExtPreCheckKeys(void) // just before drawrooms void ExtAnalyzeSprites(int32_t ourx, int32_t oury, int32_t oura, int32_t smoothr) { int32_t i, k; - tspritetype *tspr; + uspritetype *tspr; int32_t frames=0, sh; UNREFERENCED_PARAMETER(ourx); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 3721ec726..0197b246f 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -1302,7 +1302,7 @@ int32_t A_InsertSprite(int16_t whatsect,int32_t s_x,int32_t s_y,int32_t s_z,int1 G_GameExit("Too many sprites spawned."); } - tspritetype spr_temp = { s_x, s_y, s_z, 0, s_pn, s_s, 0, 0, 0, s_xr, s_yr, 0, + uspritetype spr_temp = { s_x, s_y, s_z, 0, s_pn, s_s, 0, 0, 0, s_xr, s_yr, 0, 0, whatsect, s_ss, s_a, s_ow, s_ve, 0, s_zv, 0, 0, 0 }; #ifdef DEBUGGINGAIDS @@ -1633,7 +1633,7 @@ int32_t A_Spawn(int32_t j, int32_t pn) { sp->xrepeat = 48; sp->yrepeat = 64; - if (sprite[j].statnum == STAT_PLAYER || A_CheckEnemySprite((tspritetype *)&sprite[j])) + if (sprite[j].statnum == STAT_PLAYER || A_CheckEnemySprite((uspritetype *)&sprite[j])) sp->z -= (32<<8); } } @@ -3345,7 +3345,7 @@ SPAWN_END: return i; } -static int32_t G_MaybeTakeOnFloorPal(tspritetype *datspr, int32_t sect) +static int32_t G_MaybeTakeOnFloorPal(uspritetype *datspr, int32_t sect) { int32_t dapal = sector[sect].floorpal; @@ -3359,7 +3359,7 @@ static int32_t G_MaybeTakeOnFloorPal(tspritetype *datspr, int32_t sect) return 0; } -static int32_t getofs_viewtype5(const tspritetype *s, tspritetype *t, int32_t a, uint8_t invertp) +static int32_t getofs_viewtype5(const uspritetype *s, uspritetype *t, int32_t a, uint8_t invertp) { int32_t angdif = invertp ? a-s->ang : s->ang-a; int32_t k = (((angdif+3072+128)&2047)>>8)&7; @@ -3374,7 +3374,7 @@ static int32_t getofs_viewtype5(const tspritetype *s, tspritetype *t, int32_t a, return k; } -static int32_t getofs_viewtype7(const tspritetype *s, tspritetype *t, int32_t a, uint8_t invertp) +static int32_t getofs_viewtype7(const uspritetype *s, uspritetype *t, int32_t a, uint8_t invertp) { int32_t angdif = invertp ? a-s->ang : s->ang-a; int32_t k = ((angdif+3072+128)&2047)/170; @@ -3489,7 +3489,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoo #endif for (j=spritesortcnt-1; j>=0; j--) { - tspritetype *const t = &tsprite[j]; + uspritetype *const t = &tsprite[j]; const int32_t i = t->owner; const spritetype *const s = &sprite[i]; @@ -3518,7 +3518,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoo for (j=spritesortcnt-1; j>=0; j--) { - tspritetype *const t = &tsprite[j]; + uspritetype *const t = &tsprite[j]; const int32_t i = t->owner; const spritetype *const s = &sprite[i]; @@ -3576,7 +3576,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoo continue; default: // NOTE: wall-aligned sprites will never take on ceiling/floor shade... - if ((t->cstat&16) || (A_CheckEnemySprite((tspritetype *)t) && + if ((t->cstat&16) || (A_CheckEnemySprite((uspritetype *)t) && (unsigned)t->owner < MAXSPRITES && sprite[t->owner].extra > 0) || t->statnum == STAT_PLAYER) continue; } @@ -3608,11 +3608,11 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoo int32_t startframe, viewtype; #endif //is the perfect time to animate sprites - tspritetype *const t = &tsprite[j]; + uspritetype *const t = &tsprite[j]; const int32_t i = t->owner; // XXX: what's up with the (i < 0) check? // NOTE: not const spritetype because set at SET_SPRITE_NOT_TSPRITE (see below). - tspritetype *const s = (i < 0) ? &tsprite[j] : (tspritetype *)&sprite[i]; + uspritetype *const s = (i < 0) ? &tsprite[j] : (uspritetype *)&sprite[i]; if (ud.lockout && G_CheckAdultTile(DYNAMICTILEMAP(s->picnum))) { @@ -3857,7 +3857,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoo if (ud.showweapons && sprite[g_player[p].ps->i].extra > 0 && g_player[p].ps->curr_weapon > 0 && spritesortcnt < MAXSPRITESONSCREEN) { - tspritetype *const newt = &tsprite[spritesortcnt]; + uspritetype *const newt = &tsprite[spritesortcnt]; int32_t curweap = g_player[p].ps->curr_weapon; Bmemcpy(newt, t, sizeof(spritetype)); @@ -3887,7 +3887,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoo if (g_player[p].sync->extbits & (1<<7) && !ud.pause_on && spritesortcntinv_amount[GET_HEATS] > 0 && g_player[screenpeek].ps->heat_on && - (A_CheckEnemySprite((tspritetype *)s) || A_CheckSpriteFlags(t->owner,SFLAG_NVG) || s->picnum == APLAYER || s->statnum == STAT_DUMMYPLAYER)) + (A_CheckEnemySprite((uspritetype *)s) || A_CheckSpriteFlags(t->owner,SFLAG_NVG) || s->picnum == APLAYER || s->statnum == STAT_DUMMYPLAYER)) { t->pal = 6; t->shade = 0; } // Fake floor shadow, implemented by inserting a new tsprite. - if (s->statnum == STAT_DUMMYPLAYER || A_CheckEnemySprite((tspritetype *)s) || A_CheckSpriteFlags(t->owner,SFLAG_SHADOW) || (s->picnum == APLAYER && s->owner >= 0)) + if (s->statnum == STAT_DUMMYPLAYER || A_CheckEnemySprite((uspritetype *)s) || A_CheckSpriteFlags(t->owner,SFLAG_SHADOW) || (s->picnum == APLAYER && s->owner >= 0)) if (t->statnum != TSPR_TEMP && s->picnum != EXPLOSION2 && s->picnum != HANGLIGHT && s->picnum != DOMELITE && s->picnum != HOTMEAT) { if (actor[i].dispicnum < 0) @@ -4162,7 +4162,7 @@ skip: if ((s->z-daz) < (8<<8) && g_player[screenpeek].ps->pos.z < daz) { - tspritetype *const newt = &tsprite[spritesortcnt]; + uspritetype *const newt = &tsprite[spritesortcnt]; Bmemcpy(newt, t, sizeof(spritetype)); diff --git a/polymer/eduke32/source/game.h b/polymer/eduke32/source/game.h index 2ccbc14ca..d01bba390 100644 --- a/polymer/eduke32/source/game.h +++ b/polymer/eduke32/source/game.h @@ -493,7 +493,7 @@ static inline int32_t G_GetMusicIdx(const char *str) return (ep * MAXLEVELS) + lev; } -static inline int G_GetViewscreenSizeShift(const tspritetype *tspr) +static inline int G_GetViewscreenSizeShift(const uspritetype *tspr) { #if VIEWSCREENFACTOR == 0 UNREFERENCED_PARAMETER(tspr); diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 79943229a..da1352b1f 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -260,7 +260,7 @@ static int32_t VM_CheckSquished(void) P_DoQuote(QUOTE_SQUISHED, vm.g_pp); - if (A_CheckEnemySprite((tspritetype *)vm.g_sp)) + if (A_CheckEnemySprite((uspritetype *)vm.g_sp)) vm.g_sp->xvel = 0; if (EDUKE32_PREDICT_FALSE(vm.g_sp->pal == 1)) // frozen @@ -290,7 +290,7 @@ int32_t A_Dodge(spritetype *s) const int32_t mxvect = sintable[(s->ang+512)&2047]; const int32_t myvect = sintable[s->ang&2047]; - if (A_CheckEnemySprite((tspritetype *)s) && s->extra <= 0) // hack + if (A_CheckEnemySprite((uspritetype *)s) && s->extra <= 0) // hack return 0; for (int32_t i=headspritestat[STAT_PROJECTILE]; i>=0; i=nextspritestat[i]) //weapons list @@ -348,7 +348,7 @@ int32_t A_GetFurthestAngle(int32_t iActor, int32_t angs) return furthest_angle&2047; } -int32_t A_FurthestVisiblePoint(int32_t iActor, tspritetype * const ts, int32_t *dax, int32_t *day) +int32_t A_FurthestVisiblePoint(int32_t iActor, uspritetype * const ts, int32_t *dax, int32_t *day) { if (AC_COUNT(actor[iActor].t_data)&63) return -1; @@ -417,13 +417,13 @@ void A_GetZLimits(int32_t iActor) if ((florhit&49152) == 49152 && (sprite[florhit&(MAXSPRITES-1)].cstat&48) == 0) { - tspritetype const * const hitspr = (tspritetype *)&sprite[florhit&(MAXSPRITES-1)]; + uspritetype const * const hitspr = (uspritetype *)&sprite[florhit&(MAXSPRITES-1)]; florhit &= (MAXSPRITES-1); // If a non-projectile would fall onto non-frozen enemy OR an enemy onto a player... if ((A_CheckEnemySprite(hitspr) && hitspr->pal != 1 && s->statnum != STAT_PROJECTILE) - || (hitspr->picnum == APLAYER && A_CheckEnemySprite((tspritetype *)s))) + || (hitspr->picnum == APLAYER && A_CheckEnemySprite((uspritetype *)s))) { actor[iActor].flags |= SFLAG_NOFLOORSHADOW; // No shadows on actors s->xvel = -256; // SLIDE_ABOVE_ENEMY @@ -528,7 +528,7 @@ GAMEEXEC_STATIC void VM_AlterAng(int32_t movflags) vm.g_sp->zvel += ((actor[vm.g_i].mv.vvel<<4) - vm.g_sp->zvel)/5; #endif - if (A_CheckEnemySprite((tspritetype *)vm.g_sp) && vm.g_sp->extra <= 0) // hack + if (A_CheckEnemySprite((uspritetype *)vm.g_sp) && vm.g_sp->extra <= 0) // hack return; if (movflags&seekplayer) @@ -653,7 +653,7 @@ GAMEEXEC_STATIC void VM_Move(void) // XXX: Does it break anything? Where are movflags with all bits set created? const uint16_t *movflagsptr = &AC_MOVFLAGS(vm.g_sp, &actor[vm.g_i]); const int32_t movflags = /*(*movflagsptr==-1) ? 0 :*/ *movflagsptr; - const int32_t deadflag = (A_CheckEnemySprite((tspritetype *)vm.g_sp) && vm.g_sp->extra <= 0); + const int32_t deadflag = (A_CheckEnemySprite((uspritetype *)vm.g_sp) && vm.g_sp->extra <= 0); AC_COUNT(vm.g_t)++; @@ -721,7 +721,7 @@ dead: if (vm.g_sp->xvel > -6 && vm.g_sp->xvel < 6) vm.g_sp->xvel = 0; - int badguyp = A_CheckEnemySprite((tspritetype *)vm.g_sp); + int badguyp = A_CheckEnemySprite((uspritetype *)vm.g_sp); if (vm.g_sp->xvel || vm.g_sp->zvel) { @@ -983,7 +983,7 @@ static void VM_Fall(int32_t g_i, spritetype *g_sp) // Preliminary new z position of the actor. int32_t z = actor[g_i].floorz - ZOFFSET; - if (A_CheckEnemySprite((tspritetype *)g_sp) || (g_sp->picnum == APLAYER && g_sp->owner >= 0)) + if (A_CheckEnemySprite((uspritetype *)g_sp) || (g_sp->picnum == APLAYER && g_sp->owner >= 0)) { if (g_sp->zvel > 3084 && g_sp->extra <= 1) { @@ -1292,7 +1292,7 @@ skip_check: int32_t sclip = 768, angdif = 16; - if (A_CheckEnemySprite((tspritetype *)vm.g_sp) && vm.g_sp->xrepeat > 56) + if (A_CheckEnemySprite((uspritetype *)vm.g_sp) && vm.g_sp->xrepeat > 56) { sclip = 3084; angdif = 48; @@ -1338,14 +1338,14 @@ skip_check: case CON_IFCANSEE: { - tspritetype * s = (tspritetype *)&sprite[ps->i]; + uspritetype * s = (uspritetype *)&sprite[ps->i]; // select sprite for monster to target // if holoduke is on, let them target holoduke first. // if (ps->holoduke_on >= 0) { - s = (tspritetype *)&sprite[ps->holoduke_on]; + s = (uspritetype *)&sprite[ps->holoduke_on]; tw = cansee(vm.g_sp->x,vm.g_sp->y,vm.g_sp->z-(krand()&((32<<8)-1)),vm.g_sp->sectnum, s->x,s->y,s->z,s->sectnum); @@ -1353,7 +1353,7 @@ skip_check: { // they can't see player's holoduke // check for player... - s = (tspritetype *)&sprite[ps->i]; + s = (uspritetype *)&sprite[ps->i]; } } @@ -1413,7 +1413,7 @@ skip_check: AC_COUNT(vm.g_t) = AC_ACTION_COUNT(vm.g_t) = AC_CURFRAME(vm.g_t) = 0; - if (!A_CheckEnemySprite((tspritetype *)vm.g_sp) || vm.g_sp->extra > 0) // hack + if (!A_CheckEnemySprite((uspritetype *)vm.g_sp) || vm.g_sp->extra > 0) // hack if (vm.g_sp->hitag&random_angle) vm.g_sp->ang = krand()&2047; continue; @@ -1813,7 +1813,7 @@ skip_check: AC_COUNT(vm.g_t) = 0; AC_MOVE_ID(vm.g_t) = *insptr++; vm.g_sp->hitag = *insptr++; - if (A_CheckEnemySprite((tspritetype *)vm.g_sp) && vm.g_sp->extra <= 0) // hack + if (A_CheckEnemySprite((uspritetype *)vm.g_sp) && vm.g_sp->extra <= 0) // hack continue; if (vm.g_sp->hitag&random_angle) vm.g_sp->ang = krand()&2047; @@ -3725,7 +3725,7 @@ nullquote: continue; case CON_IFRESPAWN: - if (A_CheckEnemySprite((tspritetype *)vm.g_sp)) VM_CONDITIONAL(ud.respawn_monsters) + if (A_CheckEnemySprite((uspritetype *)vm.g_sp)) VM_CONDITIONAL(ud.respawn_monsters) else if (A_CheckInventorySprite(vm.g_sp)) VM_CONDITIONAL(ud.respawn_inventory) else VM_CONDITIONAL(ud.respawn_items) continue; @@ -5280,19 +5280,19 @@ finish_qsprintf: case ITER_DRAWNSPRITES: { /* - tspritetype lastSpriteBackup; - tspritetype *const lastSpritePtr = (tspritetype *) &sprite[MAXSPRITES-1]; + uspritetype lastSpriteBackup; + uspritetype *const lastSpritePtr = (uspritetype *) &sprite[MAXSPRITES-1]; */ // Back up sprite MAXSPRITES-1. /* - Bmemcpy(&lastSpriteBackup, lastSpritePtr, sizeof(tspritetype)); + Bmemcpy(&lastSpriteBackup, lastSpritePtr, sizeof(uspritetype)); */ for (int ii=0; iisectnum >= MAXSECTORS)) { - if (A_CheckEnemySprite((tspritetype *)vm.g_sp)) + if (A_CheckEnemySprite((uspritetype *)vm.g_sp)) vm.g_pp->actors_killed++; A_DeleteSprite(vm.g_i); @@ -5798,7 +5798,7 @@ void A_Execute(int32_t iActor, int32_t iPlayer, int32_t lDist) return; } - if (A_CheckEnemySprite((tspritetype *)vm.g_sp)) + if (A_CheckEnemySprite((uspritetype *)vm.g_sp)) { if (vm.g_sp->xrepeat > 60 || (ud.respawn_monsters == 1 && vm.g_sp->extra <= 0)) return; diff --git a/polymer/eduke32/source/gameexec.h b/polymer/eduke32/source/gameexec.h index 8ee1dff49..c21f8731a 100644 --- a/polymer/eduke32/source/gameexec.h +++ b/polymer/eduke32/source/gameexec.h @@ -49,7 +49,7 @@ void A_LoadActor(int32_t iActor); void A_Execute(int32_t iActor, int32_t iPlayer, int32_t lDist); void A_Fall(int32_t iActor); -int32_t A_FurthestVisiblePoint(int32_t iActor,tspritetype * const ts,int32_t *dax,int32_t *day); +int32_t A_FurthestVisiblePoint(int32_t iActor,uspritetype * const ts,int32_t *dax,int32_t *day); int32_t A_GetFurthestAngle(int32_t iActor,int32_t angs); void A_GetZLimits(int32_t iActor); int32_t G_GetAngleDelta(int32_t a,int32_t na); diff --git a/polymer/eduke32/source/gamestructures.c b/polymer/eduke32/source/gamestructures.c index 35e22ed40..1fd8e8c5a 100644 --- a/polymer/eduke32/source/gamestructures.c +++ b/polymer/eduke32/source/gamestructures.c @@ -1167,7 +1167,7 @@ int32_t __fastcall VM_GetTsprite(register int32_t const iActor, register int32_t return -1; } - tspritetype * const tspr = spriteext[iActor].tspr; + uspritetype * const tspr = spriteext[iActor].tspr; if (EDUKE32_PREDICT_FALSE(!tspr)) { @@ -1216,7 +1216,7 @@ void __fastcall VM_SetTsprite(register int32_t const iActor, register int32_t co return; } - tspritetype * const tspr = spriteext[iActor].tspr; + uspritetype * const tspr = spriteext[iActor].tspr; if (EDUKE32_PREDICT_FALSE(!tspr)) { diff --git a/polymer/eduke32/source/lunatic/defs_common.lua b/polymer/eduke32/source/lunatic/defs_common.lua index 04291cbd3..6f608af2d 100644 --- a/polymer/eduke32/source/lunatic/defs_common.lua +++ b/polymer/eduke32/source/lunatic/defs_common.lua @@ -254,9 +254,9 @@ struct { ffi.cdef([[ typedef $ sectortype; typedef $ walltype; -// NOTE: spritetype and tspritetype are different types with the same data members. +// NOTE: spritetype and uspritetype are different types with the same data members. typedef $ spritetype; -typedef struct { spritetype; } tspritetype; +typedef struct { spritetype; } uspritetype; typedef struct { int32_t x, y; @@ -326,7 +326,7 @@ if (ffiC.engine_main_arrays_are_static ~= 0) then sectortype sector[]; walltype wall[]; spritetype sprite[]; - tspritetype tsprite[]; + uspritetype tsprite[]; spriteext_t spriteext[]; ]] else @@ -334,7 +334,7 @@ else sectortype *sector; walltype *wall; spritetype *sprite; - tspritetype *tsprite; + uspritetype *tsprite; spriteext_t *spriteext; ]] end @@ -673,8 +673,8 @@ local spriteext_mt = { ffi.metatype("spriteext_t", spriteext_mt) local spritetype_ptr_ct = ffi.typeof("$ *", ffi.typeof(strip_const(SPRITE_STRUCT))) --- NOTE: this is the *protected* tspritetype pointer. -local tspritetype_ptr_ct = ffi.typeof("$ *", ffi.typeof("tspritetype")) +-- NOTE: this is the *protected* uspritetype pointer. +local tspritetype_ptr_ct = ffi.typeof("$ *", ffi.typeof("uspritetype")) local intarg = ffi.new("int32_t[1]") @@ -841,7 +841,7 @@ function finish_spritetype(mt_index) tspritetype_mt.__index[name] = func end ffi.metatype("spritetype", spritetype_mt) - ffi.metatype("tspritetype", tspritetype_mt) + ffi.metatype("uspritetype", tspritetype_mt) end diff --git a/polymer/eduke32/source/m32def.h b/polymer/eduke32/source/m32def.h index cd622f482..77eea5db1 100644 --- a/polymer/eduke32/source/m32def.h +++ b/polymer/eduke32/source/m32def.h @@ -111,7 +111,7 @@ typedef struct { // VM state: either ==0 (top-level), >=1 and < MAXEVENTS+1 (event), // or >= MAXEVENTS+1 and < MAXEVENTS+1+g_stateCount (state) int32_t g_st; - tspritetype *g_sp; + uspritetype *g_sp; uint32_t flags; //g_errorFlag, g_returnFlag; // 1:updatehighlight, 2:updatehighlightsector, 4:interactive (from menu)? diff --git a/polymer/eduke32/source/m32exec.c b/polymer/eduke32/source/m32exec.c index c1065d0aa..c22187542 100644 --- a/polymer/eduke32/source/m32exec.c +++ b/polymer/eduke32/source/m32exec.c @@ -157,7 +157,7 @@ void VM_OnEvent(register int32_t iEventID, register int32_t iActor) vm.g_i = iActor; // current sprite ID if (vm.g_i >= 0) - vm.g_sp = (tspritetype *)&sprite[vm.g_i]; + vm.g_sp = (uspritetype *)&sprite[vm.g_i]; vm.g_st = 1+iEventID; @@ -241,7 +241,7 @@ static int X_DoSort(const void *lv, const void *rv) // in interactive execution, allow the current sprite index to be the aimed-at sprite (in 3d mode) #define X_ERROR_INVALIDCI() \ if ((vm.g_i < 0 || vm.g_i >= MAXSPRITES) && \ - (vm.g_st != 0 || searchstat != 3 || (vm.g_i = searchwall, vm.g_sp = (tspritetype *)&sprite[vm.g_i], 0))) \ + (vm.g_st != 0 || searchstat != 3 || (vm.g_i = searchwall, vm.g_sp = (uspritetype *)&sprite[vm.g_i], 0))) \ { \ M32_ERROR("Current sprite index invalid!"); \ continue; \ @@ -262,7 +262,7 @@ static int X_DoSort(const void *lv, const void *rv) } #define X_ERROR_INVALIDSP() \ - if (!vm.g_sp && (vm.g_st != 0 || searchstat != 3 || (vm.g_sp = (tspritetype *)&sprite[searchwall], 0))) \ + if (!vm.g_sp && (vm.g_st != 0 || searchstat != 3 || (vm.g_sp = (uspritetype *)&sprite[searchwall], 0))) \ { \ M32_ERROR("Current sprite invalid!"); \ continue; \ @@ -1271,7 +1271,7 @@ skip_check: const int32_t parm2 = how<=ITER_DRAWNSPRITES ? 0 : Gv_GetVarX(*insptr++); instype *const end = insptr + *insptr, *const beg = ++insptr; const int32_t vm_i_bak = vm.g_i; - tspritetype *const vm_sp_bak = vm.g_sp; + uspritetype *const vm_sp_bak = vm.g_sp; if (vm.flags&VMFLAG_ERROR) continue; @@ -1285,7 +1285,7 @@ skip_check: continue; Gv_SetVarX(var, jj); vm.g_i = jj; - vm.g_sp = (tspritetype *)&sprite[jj]; + vm.g_sp = (uspritetype *)&sprite[jj]; insptr = beg; VM_Execute(1); } @@ -1331,7 +1331,7 @@ skip_check: jj &= (MAXSPRITES-1); Gv_SetVarX(var, jj); vm.g_i = jj; - vm.g_sp = (tspritetype *)&sprite[jj]; + vm.g_sp = (uspritetype *)&sprite[jj]; insptr = beg; VM_Execute(1); } @@ -1359,27 +1359,27 @@ skip_check: break; case ITER_DRAWNSPRITES: { - tspritetype lastSpriteBackup; - tspritetype *const lastSpritePtr = (tspritetype *)&sprite[MAXSPRITES-1]; + uspritetype lastSpriteBackup; + uspritetype *const lastSpritePtr = (uspritetype *)&sprite[MAXSPRITES-1]; // Back up sprite MAXSPRITES-1. - Bmemcpy(&lastSpriteBackup, lastSpritePtr, sizeof(tspritetype)); + Bmemcpy(&lastSpriteBackup, lastSpritePtr, sizeof(uspritetype)); for (int ii=0; ii= LIGHT_X); int32_t i = (how&ACCESS_USEVARS) ? vm.g_i : lVar1; - tspritetype *datspr = NULL; + uspritetype *datspr = NULL; const memberlabel_t *dalabel = lightp ? &LightLabels[lLabelID-LIGHT_X] : &SpriteLabels[lLabelID]; if ((how&ACCESS_USEVARS) && lVar1 != M32_THISACTOR_VAR_ID) diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 830025459..708acc978 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -258,9 +258,9 @@ static int32_t A_FindTargetSprite(const spritetype *s, int32_t aang, int32_t atw break; for (i=headspritestat[aimstats[k]]; i >= 0; i=nextspritestat[i]) if (sprite[i].xrepeat > 0 && sprite[i].extra >= 0 && (sprite[i].cstat&(257+32768)) == 257) - if (A_CheckEnemySprite((tspritetype *)&sprite[i]) || k < 2) + if (A_CheckEnemySprite((uspritetype *)&sprite[i]) || k < 2) { - if (A_CheckEnemySprite((tspritetype *)&sprite[i]) || PN == APLAYER || PN == SHARK) + if (A_CheckEnemySprite((uspritetype *)&sprite[i]) || PN == APLAYER || PN == SHARK) { if (PN == APLAYER && s->picnum == APLAYER && s != &sprite[i] && // ud.ffire == 0 && @@ -602,7 +602,7 @@ static int32_t SectorContainsSE13(int32_t sectnum) // (in that case walltype *hitwal may be stale) static inline void HandleHitWall(hitdata_t *hit) { - twalltype const * const hitwal = (twalltype *)&wall[hit->wall]; + uwalltype const * const hitwal = (uwalltype *)&wall[hit->wall]; if ((hitwal->cstat&2) && redwallp(hitwal)) if (hit->pos.z >= sector[hitwal->nextsector].floorz) @@ -692,7 +692,7 @@ static int32_t P_PostFireHitscan(int32_t p, int32_t k, hitdata_t *hit, int32_t i } else if (hit->wall >= 0) { - twalltype const * const hitwal = (twalltype *)&wall[hit->wall]; + uwalltype const * const hitwal = (uwalltype *)&wall[hit->wall]; Proj_MaybeSpawn(k, spawnatimpacttile, hit); @@ -800,7 +800,7 @@ static int32_t Proj_CheckBlood(const vec3_t *srcvect, const hitdata_t *hit, if (hit->wall < 0 || hit->sect < 0) return 0; - twalltype const * const hitwal = (twalltype *)&wall[hit->wall]; + uwalltype const * const hitwal = (uwalltype *)&wall[hit->wall]; if (FindDistance2D(srcvect->x-hit->pos.x, srcvect->y-hit->pos.y) < projrange) if (hitwal->overpicnum != BIGFORCE && (hitwal->cstat&16) == 0) @@ -978,7 +978,7 @@ static int32_t A_ShootCustom(const int32_t i, const int32_t atwith, int16_t sa, l = safeldist(g_player[j].ps->i, s); zvel = tabledivide32_noinline((g_player[j].ps->opos.z - srcvect->z)*vel, l); - if (A_CheckEnemySprite((tspritetype *)s) && (AC_MOVFLAGS(s, &actor[i]) & face_player_smart)) + if (A_CheckEnemySprite((uspritetype *)s) && (AC_MOVFLAGS(s, &actor[i]) & face_player_smart)) sa = s->ang + (krand() & 31) - 16; } } @@ -1067,7 +1067,7 @@ static int32_t A_ShootCustom(const int32_t i, const int32_t atwith, int16_t sa, if (Proj_CheckBlood(srcvect, &hit, proj->range, mulscale3(proj->yrepeat, tilesiz[proj->decal].y) << 8)) { - const twalltype *const hitwal = (twalltype *)&wall[hit.wall]; + const uwalltype *const hitwal = (uwalltype *)&wall[hit.wall]; if (FindDistance2D(hitwal->x - wall[hitwal->point2].x, hitwal->y - wall[hitwal->point2].y) > (mulscale3(proj->xrepeat + 8, tilesiz[proj->decal].x))) @@ -1162,7 +1162,7 @@ static int32_t A_ShootHardcoded(int32_t i, int32_t atwith, int16_t sa, vec3_t sr { if (Proj_CheckBlood(&srcvect, &hit, 1024, 16<<8)) { - const twalltype *const hitwal = (twalltype *)&wall[hit.wall]; + const uwalltype *const hitwal = (uwalltype *)&wall[hit.wall]; if (SectorContainsSE13(hitwal->nextsector)) return -1; @@ -1386,7 +1386,7 @@ static int32_t A_ShootHardcoded(int32_t i, int32_t atwith, int16_t sa, vec3_t sr l = safeldist(g_player[j].ps->i, s); zvel = tabledivide32_noinline((g_player[j].ps->opos.z - srcvect.z)*vel, l); - if (A_CheckEnemySprite((tspritetype *)s) && (AC_MOVFLAGS(s, &actor[i]) & face_player_smart)) + if (A_CheckEnemySprite((uspritetype *)s) && (AC_MOVFLAGS(s, &actor[i]) & face_player_smart)) sa = s->ang+(krand()&31)-16; } @@ -1636,7 +1636,7 @@ int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel) { srcvect.z -= (7<<8); - if (A_CheckEnemySprite((tspritetype *)s) && PN != COMMANDER) + if (A_CheckEnemySprite((uspritetype *)s) && PN != COMMANDER) { srcvect.x += (sintable[(sa+1024+96)&2047]>>7); srcvect.y += (sintable[(sa+512+96)&2047]>>7); @@ -4587,7 +4587,7 @@ void P_ProcessInput(int32_t snum) p->sbs = j; } } - else if (A_CheckEnemySprite((tspritetype *)&sprite[j]) && sprite[j].xrepeat > 24 && klabs(s->z-sprite[j].z) < (84<<8)) + else if (A_CheckEnemySprite((uspritetype *)&sprite[j]) && sprite[j].xrepeat > 24 && klabs(s->z-sprite[j].z) < (84<<8)) { // TX: I think this is what makes the player slide off enemies... might // be a good sprite flag to add later. @@ -5567,7 +5567,7 @@ HORIZONLY: break; } default: - if (A_CheckEnemySprite((tspritetype *)&sprite[p->actorsqu])) + if (A_CheckEnemySprite((uspritetype *)&sprite[p->actorsqu])) p->actors_killed++; A_DeleteSprite(p->actorsqu); break; diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index d961bfee9..42c8a2f3f 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -71,7 +71,7 @@ static void G_CacheSpriteNum(int32_t i) char maxc; int32_t j; - if (ud.monsters_off && A_CheckEnemySprite((tspritetype *)&sprite[i])) return; + if (ud.monsters_off && A_CheckEnemySprite((uspritetype *)&sprite[i])) return; maxc = 1; diff --git a/polymer/eduke32/source/screens.c b/polymer/eduke32/source/screens.c index 04f542446..2dc955785 100644 --- a/polymer/eduke32/source/screens.c +++ b/polymer/eduke32/source/screens.c @@ -315,7 +315,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 int32_t xvect, yvect, xvect2, yvect2; int16_t p; char col; - twalltype *wal, *wal2; + uwalltype *wal, *wal2; spritetype *spr; int32_t tmpydim = (xdim*5)/8; @@ -340,7 +340,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 z1 = sector[i].ceilingz; z2 = sector[i].floorz; - for (j=startwall, wal=(twalltype *)&wall[startwall]; jnextwall; if (k < 0) continue; @@ -361,7 +361,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 x1 = dmulscale16(ox, xvect, -oy, yvect)+(xdim<<11); y1 = dmulscale16(oy, xvect2, ox, yvect2)+(ydim<<11); - wal2 = (twalltype *)&wall[wal->point2]; + wal2 = (uwalltype *)&wall[wal->point2]; ox = wal2->x-cposx; oy = wal2->y-cposy; x2 = dmulscale16(ox, xvect, -oy, yvect)+(xdim<<11); @@ -529,7 +529,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 endwall = sector[i].wallptr + sector[i].wallnum; k = -1; - for (j=startwall, wal=(twalltype *)&wall[startwall]; jnextwall >= 0) continue; @@ -550,7 +550,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 } k = wal->point2; - wal2 = (twalltype *)&wall[k]; + wal2 = (uwalltype *)&wall[k]; ox = wal2->x-cposx; oy = wal2->y-cposy; x2 = dmulscale16(ox, xvect, -oy, yvect)+(xdim<<11); diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index c0e77b7cb..c621a850b 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -400,7 +400,7 @@ void G_AnimateCamSprite(int32_t smoothratio) if (OW >= 0 && dist(&sprite[ps->i], &sprite[i]) < VIEWSCREEN_ACTIVE_DISTANCE) { - const int viewscrShift = G_GetViewscreenSizeShift((const tspritetype *)&sprite[i]); + const int viewscrShift = G_GetViewscreenSizeShift((const uspritetype *)&sprite[i]); const int viewscrTile = TILE_VIEWSCR-viewscrShift; if (waloff[viewscrTile] == 0) @@ -2260,7 +2260,7 @@ void A_DamageObject(int32_t i,int32_t sn) if ((sprite[sn].picnum == FREEZEBLAST || sprite[sn].owner != i) && sprite[i].statnum != STAT_PROJECTILE) { - if (A_CheckEnemySprite((tspritetype *)&sprite[i]) == 1) + if (A_CheckEnemySprite((uspritetype *)&sprite[i]) == 1) { if (sprite[sn].picnum == RPG) sprite[sn].extra <<= 1; @@ -2877,7 +2877,7 @@ int32_t A_CheckHitSprite(int32_t i, int16_t *hitsp) hitdata_t hit; int32_t zoff = 0; - if (A_CheckEnemySprite((tspritetype *) &sprite[i])) + if (A_CheckEnemySprite((uspritetype *) &sprite[i])) zoff = (42<<8); else if (PN == APLAYER) zoff = (39<<8); @@ -2892,7 +2892,7 @@ int32_t A_CheckHitSprite(int32_t i, int16_t *hitsp) if (hitsp) *hitsp = hit.sprite; - if (hit.wall >= 0 && (wall[hit.wall].cstat&16) && A_CheckEnemySprite((tspritetype *) &sprite[i])) + if (hit.wall >= 0 && (wall[hit.wall].cstat&16) && A_CheckEnemySprite((uspritetype *) &sprite[i])) return 1<<30; return FindDistance2D(hit.pos.x-SX,hit.pos.y-SY); diff --git a/polymer/eduke32/source/sector.h b/polymer/eduke32/source/sector.h index afcbe6c15..c243e19d8 100644 --- a/polymer/eduke32/source/sector.h +++ b/polymer/eduke32/source/sector.h @@ -80,10 +80,10 @@ typedef struct { actor_t actor[MAXSPRITES]; playerspawn_t g_playerSpawnPoints[MAXPLAYERS]; animwalltype animwall[MAXANIMWALLS]; - tsectortype sector[MAXSECTORS]; + usectortype sector[MAXSECTORS]; spriteext_t spriteext[MAXSPRITES]; - tspritetype sprite[MAXSPRITES]; - twalltype wall[MAXWALLS]; + uspritetype sprite[MAXSPRITES]; + uwalltype wall[MAXWALLS]; #if !defined LUNATIC intptr_t *vars[MAXGAMEVARS]; intptr_t *arrays[MAXGAMEARRAYS];