diff --git a/source/build/include/build.h b/source/build/include/build.h index 6720cf052..bd67e1482 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -805,7 +805,7 @@ EXTERN int16_t headspritesect[MAXSECTORS+1], headspritestat[MAXSTATUS+1]; EXTERN int16_t prevspritesect[MAXSPRITES], prevspritestat[MAXSPRITES]; EXTERN int16_t nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES]; -EXTERN vec2s_t tilesiz[MAXTILES]; +EXTERN vec2_16_t tilesiz[MAXTILES]; EXTERN char picsiz[MAXTILES]; EXTERN char walock[MAXTILES]; diff --git a/source/build/include/compat.h b/source/build/include/compat.h index c55f0dd8a..c0c4b1170 100644 --- a/source/build/include/compat.h +++ b/source/build/include/compat.h @@ -816,7 +816,7 @@ typedef struct MAY_ALIAS { int16_t x, y; } vec2_16_t; -using vec2s_t = vec2_16_t; +using vec2_16_t = vec2_16_t; typedef struct { uint32_t x, y; @@ -838,8 +838,6 @@ typedef struct MAY_ALIAS { int16_t x, y, z; } vec3_16_t; -using vec3s_t = vec3_16_t; - typedef struct { union { float x; float d; }; union { float y; float u; }; diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index 0ff8965ae..36e19a049 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -201,7 +201,7 @@ static int32_t check_tile(const char *defcmd, int32_t tile, const scriptfile *sc static void tile_from_truecolpic(int32_t tile, const palette_t *picptr, int32_t alphacut) { - vec2s_t const siz = tilesiz[tile]; + vec2_16_t const siz = tilesiz[tile]; int32_t i, j, tsiz = siz.x * siz.y; maybe_grow_buffer(&faketilebuffer, &faketilebuffersiz, tsiz); @@ -224,7 +224,7 @@ static void tile_from_truecolpic(int32_t tile, const palette_t *picptr, int32_t static int32_t Defs_LoadTileIntoBuffer(int32_t const tile) { - vec2s_t const siz = tilesiz[tile]; + vec2_16_t const siz = tilesiz[tile]; int32_t const tsiz = siz.x * siz.y; if (EDUKE32_PREDICT_FALSE(tilesiz[tile].x <= 0 || tilesiz[tile].y <= 0)) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 9e24d6eaa..db2d3736c 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -1842,7 +1842,7 @@ void printbunches(void) #define WSHELPER_DECL inline //ATTRIBUTE((always_inline)) -static WSHELPER_DECL void tweak_tsizes(vec2s_t *tsiz) +static WSHELPER_DECL void tweak_tsizes(vec2_16_t *tsiz) { if (pow2long[picsiz[globalpicnum]&15] == tsiz->x) tsiz->x--; @@ -1855,7 +1855,7 @@ static WSHELPER_DECL void tweak_tsizes(vec2s_t *tsiz) tsiz->y = -tsiz->y; } -static WSHELPER_DECL void calc_bufplc(intptr_t *bufplc, int32_t lw, vec2s_t tsiz) +static WSHELPER_DECL void calc_bufplc(intptr_t *bufplc, int32_t lw, vec2_16_t tsiz) { // CAUTION: lw can be negative! int32_t i = lw + globalxpanning; @@ -1928,7 +1928,7 @@ static void maskwallscan(int32_t x1, int32_t x2, int32_t saturatevplc) if ((uwall[x1] > ydimen) && (uwall[x2] > ydimen)) return; if ((dwall[x1] < 0) && (dwall[x2] < 0)) return; - vec2s_t tsiz = tilesiz[globalpicnum]; + vec2_16_t tsiz = tilesiz[globalpicnum]; if ((tsiz.x <= 0) || (tsiz.y <= 0)) return; setgotpic(globalpicnum); @@ -2929,7 +2929,7 @@ static void wallscan(int32_t x1, int32_t x2, int32_t x; intptr_t fpalookup; int32_t y1ve[4], y2ve[4]; - vec2s_t tsiz; + vec2_16_t tsiz; #ifdef MULTI_COLUMN_VLINE char bad; int32_t u4, d4, z; @@ -3080,7 +3080,7 @@ static void transmaskvline(int32_t x) intptr_t palookupoffs = FP_OFF(palookup[globalpal]) + getpalookupsh(mulscale16(swall[x],globvis)); - vec2s_t const ntsiz = { (int16_t)-tilesiz[globalpicnum].x, (int16_t)-tilesiz[globalpicnum].y }; + vec2_16_t const ntsiz = { (int16_t)-tilesiz[globalpicnum].x, (int16_t)-tilesiz[globalpicnum].y }; intptr_t bufplc; calc_bufplc(&bufplc, lwall[x], ntsiz); uint32_t vplc; @@ -3122,7 +3122,7 @@ static void transmaskvline2(int32_t x) setuptvlineasm2(globalshiftval,palookupoffse[0],palookupoffse[1]); - vec2s_t const ntsiz = { (int16_t)-tilesiz[globalpicnum].x, (int16_t)-tilesiz[globalpicnum].y }; + vec2_16_t const ntsiz = { (int16_t)-tilesiz[globalpicnum].x, (int16_t)-tilesiz[globalpicnum].y }; calc_bufplc(&bufplce[0], lwall[x], ntsiz); calc_bufplc(&bufplce[1], lwall[x2], ntsiz); @@ -4899,7 +4899,7 @@ draw_as_face_sprite: int const isiz = divscale19(xdimenscale,yp); int const xv = mulscale16(((int32_t)tspr->xrepeat)<<16,xyaspect); - vec2s_t const span = tilesiz[tilenum]; + vec2_16_t const span = tilesiz[tilenum]; vec2_t const siz = { mulscale30(isiz, xv * span.x), mulscale14(isiz, tspr->yrepeat * span.y) }; if (EDUKE32_PREDICT_FALSE((span.x>>11) >= siz.x || span.y >= (siz.y>>1))) diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index 22bc3cadd..4f31b4458 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -1571,7 +1571,7 @@ static void polymost_setuptexture(FHardwareTexture *tex, const int32_t dameth, i static void gloadtile_art_indexed(int32_t dapic, int32_t dameth, pthtyp *pth, int32_t doalloc) { - vec2s_t const & tsizart = tilesiz[dapic]; + vec2_16_t const & tsizart = tilesiz[dapic]; vec2_t siz = { tsizart.x, tsizart.y }; //POGOTODO: npoty char npoty = 0; @@ -1612,7 +1612,7 @@ void gloadtile_art(int32_t dapic, int32_t dapal, int32_t tintpalnum, int32_t das } static int32_t fullbrightloadingpass = 0; - vec2s_t const & tsizart = tilesiz[dapic]; + vec2_16_t const & tsizart = tilesiz[dapic]; vec2_t siz = { 0, 0 }, tsiz = { tsizart.x, tsizart.y }; int const picdim = tsiz.x*tsiz.y; char hasalpha = 0, hasfullbright = 0; @@ -2258,7 +2258,7 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32 //Load texture (globalpicnum) setgotpic(globalpicnum); - vec2s_t const & tsizart = tilesiz[globalpicnum]; + vec2_16_t const & tsizart = tilesiz[globalpicnum]; vec2_t tsiz = { tsizart.x, tsizart.y }; if (!waloff[globalpicnum]) @@ -6048,7 +6048,7 @@ void polymost_drawsprite(int32_t snum) pos.y -= (sintable[(tspr->ang) & 2047] >> 13); } - vec2s_t const oldsiz = tilesiz[globalpicnum]; + vec2_16_t const oldsiz = tilesiz[globalpicnum]; vec2_t tsiz = { oldsiz.x, oldsiz.y }; if (usehightile && h_xsize[globalpicnum]) @@ -6645,8 +6645,8 @@ void polymost_dorotatespritemodel(int32_t sx, int32_t sy, int32_t z, int16_t a, if (dastat & RS_TOPLEFT) { - vec2s_t siz = tilesiz[picnum]; - vec2s_t off = { (int16_t)((siz.x >> 1) + picanm[picnum].xofs), (int16_t)((siz.y >> 1) + picanm[picnum].yofs) }; + vec2_16_t siz = tilesiz[picnum]; + vec2_16_t off = { (int16_t)((siz.x >> 1) + picanm[picnum].xofs), (int16_t)((siz.y >> 1) + picanm[picnum].yofs) }; d = (float)z * (1.0f / (65536.f * 16384.f)); cosang2 = cosang = (float)sintable[(a + 512) & 2047] * d; @@ -6938,8 +6938,8 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16 drawpoly_alpha = daalpha * (1.0f / 255.0f); drawpoly_blend = dablend; - vec2s_t const siz = tilesiz[globalpicnum]; - vec2s_t ofs = { 0, 0 }; + vec2_16_t const siz = tilesiz[globalpicnum]; + vec2_16_t ofs = { 0, 0 }; if (!(dastat & RS_TOPLEFT)) { diff --git a/source/build/src/tiles.cpp b/source/build/src/tiles.cpp index f14c19617..1cc9642c2 100644 --- a/source/build/src/tiles.cpp +++ b/source/build/src/tiles.cpp @@ -30,7 +30,7 @@ static int32_t tilefileoffs[MAXTILES]; // necessary (have per-map ART files). static uint8_t *g_bakTileFileNum; static int32_t *g_bakTileFileOffs; -static vec2s_t *g_bakTileSiz; +static vec2_16_t *g_bakTileSiz; static picanm_t *g_bakPicAnm; static char * g_bakFakeTile; static char ** g_bakFakeTileData; @@ -563,7 +563,7 @@ int32_t artLoadFiles(const char *filename, int32_t askedsize) { Bstrncpyz(artfilenameformat, filename, sizeof(artfilenameformat)); - Bmemset(&tilesiz[0], 0, sizeof(vec2s_t) * MAXTILES); + Bmemset(&tilesiz[0], 0, sizeof(vec2_16_t) * MAXTILES); Bmemset(picanm, 0, sizeof(picanm)); for (auto &rot : rottile) diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index 3c9901593..359be0602 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -152,14 +152,14 @@ static void Menu_DrawCursorRight(int32_t x, int32_t y, int32_t z) if (IONMAIDEN) return; Menu_DrawCursorCommon(x, y, z, VM_OnEventWithReturn(EVENT_MENUCURSORRIGHT, -1, myconnectindex, SPINNINGNUKEICON+6-((6+(totalclock>>3))%7))); } -static void Menu_DrawCursorTextTile(int32_t x, int32_t y, int32_t h, int32_t picnum, vec2s_t const & siz, int32_t ydim_upper = 0, int32_t ydim_lower = ydim-1) +static void Menu_DrawCursorTextTile(int32_t x, int32_t y, int32_t h, int32_t picnum, vec2_16_t const & siz, int32_t ydim_upper = 0, int32_t ydim_lower = ydim-1) { vec2_t const adjsiz = { (siz.x>>1)<<16, siz.y<<16 }; Menu_DrawCursorCommon(x + scale(adjsiz.x, h, adjsiz.y), y, divscale16(h, adjsiz.y), picnum, ydim_upper, ydim_lower); } static void Menu_DrawCursorText(int32_t x, int32_t y, int32_t h, int32_t ydim_upper = 0, int32_t ydim_lower = ydim-1) { - vec2s_t const & siz = tilesiz[SPINNINGNUKEICON]; + vec2_16_t const & siz = tilesiz[SPINNINGNUKEICON]; if (IONMAIDEN || siz.x == 0) {