From 5256146f89ed6bebdbd084faa0a75eb3df6bafdc Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Tue, 19 May 2015 22:02:25 +0000 Subject: [PATCH] SW, KenBuild: tilesiz git-svn-id: https://svn.eduke32.com/eduke32@5204 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/sw/src/anim.c | 4 +- polymer/eduke32/source/sw/src/border.c | 30 ++--- polymer/eduke32/source/sw/src/console.c | 74 +++++------ polymer/eduke32/source/sw/src/draw.c | 6 +- polymer/eduke32/source/sw/src/game.c | 10 +- polymer/eduke32/source/sw/src/game.h | 34 ++--- polymer/eduke32/source/sw/src/jplayer.c | 12 +- polymer/eduke32/source/sw/src/jsector.c | 24 ++-- polymer/eduke32/source/sw/src/menus.c | 56 ++++---- polymer/eduke32/source/sw/src/panel.c | 134 ++++++++++---------- polymer/eduke32/source/sw/src/sprite.c | 4 +- polymer/eduke32/source/sw/src/text.c | 12 +- polymer/eduke32/source/sw/src/weapon.c | 2 +- polymer/eduke32/source/testgame/src/bstub.c | 6 +- polymer/eduke32/source/testgame/src/game.c | 74 +++++------ 15 files changed, 241 insertions(+), 241 deletions(-) diff --git a/polymer/eduke32/source/sw/src/anim.c b/polymer/eduke32/source/sw/src/anim.c index edb30b881..b54ef5672 100644 --- a/polymer/eduke32/source/sw/src/anim.c +++ b/polymer/eduke32/source/sw/src/anim.c @@ -299,8 +299,8 @@ playanm(short anim_num) for (i = 0; i < 768; i++) ANIMvesapal[i] = palptr[i]>>2; - tilesizx[ANIM_TILE(ANIMnum)] = 200; - tilesizy[ANIM_TILE(ANIMnum)] = 320; + tilesiz[ANIM_TILE(ANIMnum)].x = 200; + tilesiz[ANIM_TILE(ANIMnum)].y = 320; clearview(0); diff --git a/polymer/eduke32/source/sw/src/border.c b/polymer/eduke32/source/sw/src/border.c index 664cac8fe..960b1f439 100644 --- a/polymer/eduke32/source/sw/src/border.c +++ b/polymer/eduke32/source/sw/src/border.c @@ -199,7 +199,7 @@ SetFragBar(PLAYERp pp) for (i = windowx1; i <= windowx2; i++) { - y = (tilesizy[FRAG_BAR] * num_frag_bars) - (2 * (num_frag_bars-1)); + y = (tilesiz[FRAG_BAR].y * num_frag_bars) - (2 * (num_frag_bars-1)); y = y * (ydim/200.0); if (windowy1 < y) @@ -209,7 +209,7 @@ SetFragBar(PLAYERp pp) for (i = 0, y = 0; i < num_frag_bars; i++) { pSpawnFullScreenSprite(pp, FRAG_BAR, PRI_MID, 0, y); - y += tilesizy[FRAG_BAR] - 2; + y += tilesiz[FRAG_BAR].y - 2; } // write each persons kill info to everybody @@ -239,12 +239,12 @@ void DrawBorderShade(PLAYERp pp, short shade_num, short wx1, short wy1, short wx int dark_shade = 27 - (shade_num * 6); int light_shade = 20 - (shade_num * 6); - for (i = 0; i < xdim; i += tilesizx[BORDER_TILE]) + for (i = 0; i < xdim; i += tilesiz[BORDER_TILE].x) { - for (j = 0; j < ydim; j += tilesizy[BORDER_TILE]) + for (j = 0; j < ydim; j += tilesiz[BORDER_TILE].y) { - k = i + tilesizx[BORDER_TILE]; - l = j + tilesizy[BORDER_TILE]; + k = i + tilesiz[BORDER_TILE].x; + l = j + tilesiz[BORDER_TILE].y; if (RectOverlap(i, j, k, l, wx1 - 1, wy1 - 1, wx2 + 1, wy1)) { @@ -349,12 +349,12 @@ void DrawBorder(PLAYERp pp, short x, short y, short x2, short y2) short i,j,k,l; short count = 0; - for (i = 0; i < xdim; i += tilesizx[BORDER_TILE]) + for (i = 0; i < xdim; i += tilesiz[BORDER_TILE].x) { - for (j = 0; j < ydim; j += tilesizy[BORDER_TILE]) + for (j = 0; j < ydim; j += tilesiz[BORDER_TILE].y) { - k = i + tilesizx[BORDER_TILE]; - l = j + tilesizy[BORDER_TILE]; + k = i + tilesiz[BORDER_TILE].x; + l = j + tilesiz[BORDER_TILE].y; if (RectOverlap(i, j, k, l, x, y, windowx1-1, y2)) { @@ -392,12 +392,12 @@ void DrawPanelBorderSides(PLAYERp pp, short x, short y, short x2, short y2, shor short i,j,k,l; short count = 0; - for (i = 0; i < xdim; i += tilesizx[BORDER_TILE]) + for (i = 0; i < xdim; i += tilesiz[BORDER_TILE].x) { - for (j = 0; j < ydim; j += tilesizy[BORDER_TILE]) + for (j = 0; j < ydim; j += tilesiz[BORDER_TILE].y) { - k = i + tilesizx[BORDER_TILE]; - l = j + tilesizy[BORDER_TILE]; + k = i + tilesiz[BORDER_TILE].x; + l = j + tilesiz[BORDER_TILE].y; if (RectOverlap(i, j, k, l, x, y, panl, y2)) { @@ -551,7 +551,7 @@ void SetBorder(PLAYERp pp, int value) if (gs.BorderNum == BORDER_BAR) SetConsoleDmost(); - pSpawnFullScreenSprite(pp, STATUS_BAR, PRI_FRONT, 0, 200 - tilesizy[STATUS_BAR]); + pSpawnFullScreenSprite(pp, STATUS_BAR, PRI_FRONT, 0, 200 - tilesiz[STATUS_BAR].y); PlayerUpdatePanelInfo(Player + screenpeek); } diff --git a/polymer/eduke32/source/sw/src/console.c b/polymer/eduke32/source/sw/src/console.c index 3d50d3bd1..d45b74cde 100644 --- a/polymer/eduke32/source/sw/src/console.c +++ b/polymer/eduke32/source/sw/src/console.c @@ -683,131 +683,131 @@ int TileRangeMem(int start) { case 4096: // Evil Ninja for (i=4096; i<=4239; i++) - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 800: // Hornet for (i=800; i<=811; i++) - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 817: for (i=817; i<=819; i++) // Bouncing Betty - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 820: // Skull for (i=820; i<=854; i++) - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 960: for (i=960; i<=1016; i++) // Serpent God - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; for (i=1300; i<=1314; i++) - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 1024: for (i=1024; i<=1175; i++) // LoWang - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 1320: for (i=1320; i<=1396; i++) // Skeletor Priest - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 1400: for (i=1400; i<=1440; i++) // Coolie - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; for (i=4260; i<=4266; i++) - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 1441: for (i=1441; i<=1450; i++) // Coolie Ghost - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; for (i=4267; i<=4312; i++) - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 1469: for (i=1469; i<=1497; i++) // Guardian - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; for (i=1504; i<=1518; i++) - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 1580: for (i=1580; i<=1644; i++) // Little Ripper - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 4320: for (i=4320; i<=4427; i++) // Big Ripper - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 2540: for (i=2540; i<=2546; i++) // Trashcan - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 4430: for (i=4430; i<=4479; i++) // Fish - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 4490: for (i=4490; i<=4544; i++) // Sumo - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 5023: for (i=5023; i<=5026; i++) // Toilet Girl - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 5032: for (i=5032; i<=5035; i++) // Wash Girl - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 2000: for (i=2000; i<=2002; i++) // Chop Stick Panel - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 2004: for (i=2004; i<=2009; i++) // Uzi Panel - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; for (i=2040; i<=2043; i++) // Uzi Overlays - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 2010: for (i=2010; i<=2019; i++) // Rail Panel - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 2130: for (i=2130; i<=2137; i++) // Shuriken Panel - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 2050: for (i=2050; i<=2053; i++) // Heart Panel - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 2054: for (i=2054; i<=2057; i++) // HotHead Panel - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 2070: for (i=2070; i<=2077; i++) // Rocket Launcher Panel - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 2080: for (i=2080; i<=2083; i++) // Sword Panel - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 4090: for (i=4090; i<=4093; i++) // Bloody Sword Panel - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 2121: for (i=2121; i<=2126; i++) // 40MM Panel - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 2211: for (i=2211; i<=2216; i++) // Shotgun Panel - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; for (i=2225; i<=2227; i++) // Shotgun Quad-Mode Panel - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; case 2220: for (i=2220; i<=2224; i++) // Sticky Bomb Panel - total += tilesizx[i]*tilesizy[i]; + total += tilesiz[i].x*tilesiz[i].y; break; } @@ -839,7 +839,7 @@ void CON_Cache(void) tottiles = 0; for (i=0; i<8192; i++) if (incache[i] > 0) - tottiles += tilesizx[i]*tilesizy[i]; + tottiles += tilesiz[i].x*tilesiz[i].y; ////////////////////////////////////////////// @@ -976,7 +976,7 @@ void CON_Cache(void) incache[2220]=0; break; - default: totsprites += tilesizx[i]*tilesizy[i]; + default: totsprites += tilesiz[i].x*tilesiz[i].y; } } } diff --git a/polymer/eduke32/source/sw/src/draw.c b/polymer/eduke32/source/sw/src/draw.c index b31eb5e5e..9939a174d 100644 --- a/polymer/eduke32/source/sw/src/draw.c +++ b/polymer/eduke32/source/sw/src/draw.c @@ -2605,7 +2605,7 @@ DrawCompass(PLAYERp pp) #define NORM_CANG(ang) (((ang) + 32) & 31) short start_ang,ang; - short x_size = tilesizx[COMPASS_NORTH]; + short x_size = tilesiz[COMPASS_NORTH].x; short x; short i; int flags; @@ -2698,8 +2698,8 @@ ScreenLoadSaveSetup(PLAYERp pp) if (!waloff[SAVE_SCREEN_TILE]) allocache((void **)&waloff[SAVE_SCREEN_TILE], SAVE_SCREEN_XSIZE * SAVE_SCREEN_YSIZE, &walock[SAVE_SCREEN_TILE]); - tilesizx[SAVE_SCREEN_TILE] = SAVE_SCREEN_XSIZE; - tilesizx[SAVE_SCREEN_TILE] = SAVE_SCREEN_YSIZE; + tilesiz[SAVE_SCREEN_TILE].x = SAVE_SCREEN_XSIZE; + tilesiz[SAVE_SCREEN_TILE].x = SAVE_SCREEN_YSIZE; return SAVE_SCREEN_TILE; } diff --git a/polymer/eduke32/source/sw/src/game.c b/polymer/eduke32/source/sw/src/game.c index 68d0dbc9c..6a4b9350c 100644 --- a/polymer/eduke32/source/sw/src/game.c +++ b/polymer/eduke32/source/sw/src/game.c @@ -5726,7 +5726,7 @@ SHOWSPRITE: l = spr->xrepeat; dax = sintable[k & 2047] * l; day = sintable[(k + 1536) & 2047] * l; - l = tilesizx[tilenum]; + l = tilesiz[tilenum].x; k = (l >> 1) + xoff; x1 -= mulscale(dax, k, 16); x2 = x1 + mulscale(dax, l, 16); @@ -5761,9 +5761,9 @@ SHOWSPRITE: k = spr->ang; cosang = sintable[(k + 512) & 2047]; sinang = sintable[k]; - xspan = tilesizx[tilenum]; + xspan = tilesiz[tilenum].x; xrepeat = spr->xrepeat; - yspan = tilesizy[tilenum]; + yspan = tilesiz[tilenum].y; yrepeat = spr->yrepeat; dax = ((xspan >> 1) + xoff) * xrepeat; @@ -5832,9 +5832,9 @@ SHOWSPRITE: if ((show2dwall[j >> 3] & (1 << (j & 7))) == 0) continue; - if (tilesizx[wal->picnum] == 0) + if (tilesiz[wal->picnum].x == 0) continue; - if (tilesizy[wal->picnum] == 0) + if (tilesiz[wal->picnum].y == 0) continue; ox = wal->x - cposx; diff --git a/polymer/eduke32/source/sw/src/game.h b/polymer/eduke32/source/sw/src/game.h index 5e9a478af..8569c2aae 100644 --- a/polymer/eduke32/source/sw/src/game.h +++ b/polymer/eduke32/source/sw/src/game.h @@ -402,8 +402,8 @@ int StdRandomRange(int range); #define DIST(x1, y1, x2, y2) ksqrt( SQ((x1) - (x2)) + SQ((y1) - (y2)) ) -#define PIC_SIZX(sn) (tilesizx[sprite[sn].picnum]) -#define PIC_SIZY(sn) (tilesizy[sprite[sn].picnum]) +#define PIC_SIZX(sn) (tilesiz[sprite[sn].picnum].x) +#define PIC_SIZY(sn) (tilesiz[sprite[sn].picnum].y) // Distance macro - tx, ty, tmin are holding vars that must be declared in the routine // that uses this macro @@ -416,40 +416,40 @@ int StdRandomRange(int range); } #define SPRITE_SIZE_X(sp_num) ((sprite[sp_num].xrepeat == 64) ? \ - tilesizx[sprite[sp_num].picnum] : \ - ((sprite[sp_num].xrepeat * tilesizx[sprite[sp_num].picnum]) >> 6) \ + tilesiz[sprite[sp_num].picnum].x : \ + ((sprite[sp_num].xrepeat * tilesiz[sprite[sp_num].picnum].x) >> 6) \ ) #define SPRITE_SIZE_Y(sp_num) ((sprite[sp_num].yrepeat == 64) ? \ - tilesizy[sprite[sp_num].picnum] : \ - ((sprite[sp_num].yrepeat * tilesizy[sprite[sp_num].picnum]) >> 6) \ + tilesiz[sprite[sp_num].picnum].y : \ + ((sprite[sp_num].yrepeat * tilesiz[sprite[sp_num].picnum].y) >> 6) \ ) #define SPRITE_SIZE_Z(sp_num) ((sprite[sp_num].yrepeat == 64) ? \ - Z(tilesizy[sprite[sp_num].picnum]) : \ - ((sprite[sp_num].yrepeat * tilesizy[sprite[sp_num].picnum]) << 2) \ + Z(tilesiz[sprite[sp_num].picnum].y) : \ + ((sprite[sp_num].yrepeat * tilesiz[sprite[sp_num].picnum].y) << 2) \ ) #define SPRITEp_SIZE_X(sp) (((sp)->xrepeat == 64) ? \ - tilesizx[(sp)->picnum] : \ - (((sp)->xrepeat * tilesizx[(sp)->picnum]) >> 6) \ + tilesiz[(sp)->picnum].x : \ + (((sp)->xrepeat * tilesiz[(sp)->picnum].x) >> 6) \ ) #define SPRITEp_SIZE_Y(sp) (((sp)->yrepeat == 64) ? \ - tilesizy[(sp)->picnum] : \ - (((sp)->yrepeat * tilesizy[(sp)->picnum]) >> 6) \ + tilesiz[(sp)->picnum].y : \ + (((sp)->yrepeat * tilesiz[(sp)->picnum].y) >> 6) \ ) #define SPRITEp_SIZE_Z(sp) (((sp)->yrepeat == 64) ? \ - Z(tilesizy[(sp)->picnum]) : \ - (((sp)->yrepeat * tilesizy[(sp)->picnum]) << 2) \ + Z(tilesiz[(sp)->picnum].y) : \ + (((sp)->yrepeat * tilesiz[(sp)->picnum].y) << 2) \ ) // Given a z height and sprite return the correct x repeat value -#define SPRITEp_SIZE_X_2_XREPEAT(sp, x) (((x)*64)/tilesizx[(sp)->picnum]) +#define SPRITEp_SIZE_X_2_XREPEAT(sp, x) (((x)*64)/tilesiz[(sp)->picnum].x) // Given a z height and sprite return the correct y repeat value -#define SPRITEp_SIZE_Z_2_YREPEAT(sp, zh) ((zh)/(4*tilesizy[(sp)->picnum])) -#define SPRITEp_SIZE_Y_2_YREPEAT(sp, y) (((y)*64)/tilesizy[(sp)->picnum]) +#define SPRITEp_SIZE_Z_2_YREPEAT(sp, zh) ((zh)/(4*tilesiz[(sp)->picnum].y)) +#define SPRITEp_SIZE_Y_2_YREPEAT(sp, y) (((y)*64)/tilesiz[(sp)->picnum].y) // x & y offset of tile diff --git a/polymer/eduke32/source/sw/src/jplayer.c b/polymer/eduke32/source/sw/src/jplayer.c index 019fbff51..09bea73fd 100644 --- a/polymer/eduke32/source/sw/src/jplayer.c +++ b/polymer/eduke32/source/sw/src/jplayer.c @@ -94,7 +94,7 @@ int gametext(int x,int y,char *t,char s,short dabits) if (*t >= '0' && *t <= '9') newx += 8; - else newx += tilesizx[ac]; + else newx += tilesiz[ac].x; t++; } @@ -114,7 +114,7 @@ int gametext(int x,int y,char *t,char s,short dabits) if (*t >= '0' && *t <= '9') x += 8; - else x += tilesizx[ac]; + else x += tilesiz[ac].x; t++; } @@ -142,7 +142,7 @@ int minigametext(int x,int y,char *t,char s,short dabits) if (*t > asc_Space && *t < 127) { - newx += tilesizx[ac]; + newx += tilesiz[ac].x; } else x += 4; @@ -164,7 +164,7 @@ int minigametext(int x,int y,char *t,char s,short dabits) if (*t > asc_Space && *t < 127) { rotatesprite(x<<16,y<<16,65536L,0,ac,-128,17,dabits,0,0,xdim-1,ydim-1); - x += tilesizx[ac]; + x += tilesiz[ac].x; } else x += 4; @@ -186,7 +186,7 @@ int minitext(int x,int y,char *t,char p,char sb) else ac = *t - '!' + MINIFONT; rotatesprite(x<<16,y<<16,65536L,0,ac,0,p,sb,0,0,xdim-1,ydim-1); - x += 4; // tilesizx[ac]+1; + x += 4; // tilesiz[ac].x+1; t++; } @@ -204,7 +204,7 @@ int minitextshade(int x,int y,char *t,char s,char p,char sb) else ac = *t - '!' + MINIFONT; rotatesprite(x<<16,y<<16,65536L,0,ac,s,p,sb,0,0,xdim-1,ydim-1); - x += 4; // tilesizx[ac]+1; + x += 4; // tilesiz[ac].x+1; t++; } diff --git a/polymer/eduke32/source/sw/src/jsector.c b/polymer/eduke32/source/sw/src/jsector.c index e4a3af4b3..0a9b153b8 100644 --- a/polymer/eduke32/source/sw/src/jsector.c +++ b/polymer/eduke32/source/sw/src/jsector.c @@ -332,13 +332,13 @@ JS_InitMirrors(void) // Scan wall tags for mirrors mirrorcnt = 0; - tilesizx[MIRROR] = 0; - tilesizy[MIRROR] = 0; + tilesiz[MIRROR].x = 0; + tilesiz[MIRROR].y = 0; for (i = 0; i < MAXMIRRORS; i++) { - tilesizx[i + MIRRORLABEL] = 0; - tilesizy[i + MIRRORLABEL] = 0; + tilesiz[i + MIRRORLABEL].x = 0; + tilesiz[i + MIRRORLABEL].y = 0; mirror[i].campic = -1; mirror[i].camsprite = -1; mirror[i].camera = -1; @@ -420,7 +420,7 @@ JS_InitMirrors(void) mirror[mirrorcnt].camsprite = SpriteNum; // JBF: commenting out this line results in the screen in $BULLET being visible - tilesizx[mirror[mirrorcnt].campic] = tilesizy[mirror[mirrorcnt].campic] = 0; + tilesiz[mirror[mirrorcnt].campic].x = tilesiz[mirror[mirrorcnt].campic].y = 0; Found_Cam = TRUE; } @@ -492,7 +492,7 @@ void drawroomstotile(int daposx, int daposy, int daposz, PRODUCTION_ASSERT(waloff[tilenume]); - setviewtotile(tilenume, tilesizx[tilenume], tilesizy[tilenume]); + setviewtotile(tilenume, tilesiz[tilenume].x, tilesiz[tilenume].y); drawrooms(daposx, daposy, daposz, daang, dahoriz, dacursectnum); analyzesprites(daposx, daposy, daposz, FALSE); @@ -516,8 +516,8 @@ drawroomstotile(int daposx, int daposy, int daposz, char *ptr1, *ptr2; // DRAWROOMS TO TILE BACKUP&SET CODE - xsiz = tilesizx[tilenume]; - ysiz = tilesizy[tilenume]; + xsiz = tilesiz[tilenume].x; + ysiz = tilesiz[tilenume].y; // bakchainnumpages = chainnumpages; bakchainnumpages = numpages; // chainnumpages = 0; @@ -784,12 +784,12 @@ JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, short tpang, int tphoriz) // you are outside of it! if (!mirror[cnt].mstate == m_viewon) { - tilesizx[MIRROR] = tilesizy[MIRROR] = 0; + tilesiz[MIRROR].x = tilesiz[MIRROR].y = 0; // Set TV camera sprite size to 0 to show mirror // behind in this case! if (mirror[cnt].campic != -1) - tilesizx[mirror[cnt].campic] = tilesizy[mirror[cnt].campic] = 0; + tilesiz[mirror[cnt].campic].x = tilesiz[mirror[cnt].campic].y = 0; drawrooms(dx, dy, dz, tpang, tphoriz, sp->sectnum + MAXSECTORS); analyzesprites(dx, dy, dz, FALSE); drawmasks(); @@ -861,7 +861,7 @@ JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, short tpang, int tphoriz) // Set up the tile for drawing - tilesizx[mirror[cnt].campic] = tilesizy[mirror[cnt].campic] = 128; + tilesiz[mirror[cnt].campic].x = tilesiz[mirror[cnt].campic].y = 128; if (MirrorMoveSkip16 == 0 || (DoCam && (MoveSkip4 == 0))) { @@ -909,7 +909,7 @@ JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, short tpang, int tphoriz) // drawrooms(tx, ty, tz, tpang, tphoriz, pp->cursectnum); // Clean up anything that the camera view might have done SetFragBar(pp); - tilesizx[MIRROR] = tilesizy[MIRROR] = 0; + tilesiz[MIRROR].x = tilesiz[MIRROR].y = 0; wall[mirror[cnt].mirrorwall].overpicnum = MIRRORLABEL + cnt; } else diff --git a/polymer/eduke32/source/sw/src/menus.c b/polymer/eduke32/source/sw/src/menus.c index e315df054..56ff07cf1 100644 --- a/polymer/eduke32/source/sw/src/menus.c +++ b/polymer/eduke32/source/sw/src/menus.c @@ -2300,9 +2300,9 @@ MNU_MeasureStringLarge(const char *string, short *w, short *h) continue; } - width += tilesizx[pic]+1; - if (height < tilesizy[pic]) - height = tilesizy[pic]; + width += tilesiz[pic].x+1; + if (height < tilesiz[pic].y) + height = tilesiz[pic].y; } *w = width; @@ -2343,7 +2343,7 @@ MNU_DrawStringLarge(short x, short y, const char *string) } rotatesprite(offset << 16, y << 16, MZ, 0, pic, MenuTextShade, 0, MenuDrawFlags|ROTATE_SPRITE_CORNER, 0, 0, xdim - 1, ydim - 1); - offset += tilesizx[pic] + 1; + offset += tilesiz[pic].x + 1; } } @@ -2376,9 +2376,9 @@ MNU_MeasureString(const char *string, short *w, short *h) if (c > asc_Space && c < 127) { - width += tilesizx[ac]; - if (height < tilesizy[ac]) - height = tilesizy[ac]; + width += tilesiz[ac].x; + if (height < tilesiz[ac].y) + height = tilesiz[ac].y; } else if (c == asc_Space) width += 4; // Special case for space char @@ -2417,7 +2417,7 @@ MNU_DrawString(short x, short y, const char *string, short shade, short pal) if (c > asc_Space && c < 127) { rotatesprite(offset<<16,y<<16,MZ,0,ac, shade, pal, MenuDrawFlags, 0, 0, xdim - 1, ydim - 1); - offset += tilesizx[ac]; + offset += tilesiz[ac].x; } else if (c == asc_Space) offset += 4; // Special case for space char @@ -2444,7 +2444,7 @@ MNU_DrawString(short x, short y, char *string) if (c > asc_Space && c < 127) { rotatesprite(offset << 16, y << 16, MZ, 0, xlatfont[c], MenuTextShade, 0, MenuDrawFlags, 0, 0, xdim - 1, ydim - 1); - offset += tilesizx[xlatfont[c]]; + offset += tilesiz[xlatfont[c]].x; } else if (c == asc_Space) offset += 4; // Special case for space char @@ -2474,9 +2474,9 @@ MNU_MeasureSmallString(const char *string, short *w, short *h) if (c > asc_Space && c < 127) { - width += tilesizx[ac]; - if (height < tilesizy[ac]) - height = tilesizy[ac]; + width += tilesiz[ac].x; + if (height < tilesiz[ac].y) + height = tilesiz[ac].y; } else if (c == asc_Space) width += 4; // Special case for space char @@ -2509,7 +2509,7 @@ MNU_DrawSmallString(short x, short y, const char *string, short shade, short pal { rotatesprite(offset<<16,y<<16,MZ,0,ac, shade, pal, MenuDrawFlags, 0, 0, xdim - 1, ydim - 1); - offset += tilesizx[ac]; + offset += tilesiz[ac].x; } else if (c == asc_Space) @@ -3587,7 +3587,7 @@ MNU_DoButton(MenuItem_p item, SWBOOL draw) MNU_DrawString(x, y, item->text, MenuTextShade, 16); if (extra_text) - MNU_DrawString(OPT_XSIDE + tilesizx[pic_radiobuttn1] + 6, y, extra_text, MenuTextShade, 16); + MNU_DrawString(OPT_XSIDE + tilesiz[pic_radiobuttn1].x + 6, y, extra_text, MenuTextShade, 16); MenuTextShade = MENU_SHADE_DEFAULT; } else @@ -3597,7 +3597,7 @@ MNU_DoButton(MenuItem_p item, SWBOOL draw) else rotatesprite(x << 16, y << 16, MZ, 0, pic_radiobuttn1, 2, 0, MenuDrawFlags, 0, 0, xdim - 1, ydim - 1); - x += tilesizx[pic_radiobuttn1] + 4; + x += tilesiz[pic_radiobuttn1].x + 4; // Draw the menu item text rotatesprite(x << 16, y << 16, MZ, 0, item->pic, 2, 0, MenuDrawFlags, 0, 0, xdim - 1, ydim - 1); @@ -3902,7 +3902,7 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) } sprintf(tmp_text, "%d bpp", validbpps[offset]); - MNU_DrawString(OPT_XSIDE+tilesizx[pic_slidelend]+tilesizx[pic_sliderend]+(barwidth+1)*tilesizx[pic_slidebar], item->y, tmp_text, 1, 16); + MNU_DrawString(OPT_XSIDE+tilesiz[pic_slidelend].x+tilesiz[pic_sliderend].x+(barwidth+1)*tilesiz[pic_slidebar].x, item->y, tmp_text, 1, 16); } break; case sldr_mousescalex: @@ -3924,7 +3924,7 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) } sprintf(tmp_text, "%.2f", (float)(slidersettings[item->slider]<<13) / 65535.f); - MNU_DrawSmallString(OPT_XSIDE+tilesizx[pic_slidelend]+tilesizx[pic_sliderend]+(MAX_SLDR_WIDTH+1)*tilesizx[pic_slidebar], item->y+4, tmp_text, 1, 16); + MNU_DrawSmallString(OPT_XSIDE+tilesiz[pic_slidelend].x+tilesiz[pic_sliderend].x+(MAX_SLDR_WIDTH+1)*tilesiz[pic_slidebar].x, item->y+4, tmp_text, 1, 16); break; case sldr_joyaxisscale: @@ -3945,7 +3945,7 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) } sprintf(tmp_text, "%.2f", (float)(slidersettings[item->slider]<<13) / 65535.f); - MNU_DrawSmallString(OPT_XSIDE+tilesizx[pic_slidelend]+tilesizx[pic_sliderend]+(MAX_SLDR_WIDTH+1)*tilesizx[pic_slidebar], item->y+4, tmp_text, 1, 16); + MNU_DrawSmallString(OPT_XSIDE+tilesiz[pic_slidelend].x+tilesiz[pic_sliderend].x+(MAX_SLDR_WIDTH+1)*tilesiz[pic_slidebar].x, item->y+4, tmp_text, 1, 16); break; case sldr_joyaxisanalog: @@ -3971,7 +3971,7 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) p = CONFIG_AnalogNumToName(MNU_ControlAxisNum(offset)); while (*p != 0 && *p != '_') p++; if (*p == '_') p++; - MNU_DrawSmallString(OPT_XSIDE+tilesizx[pic_slidelend]+tilesizx[pic_sliderend]+(barwidth+1)*tilesizx[pic_slidebar], item->y+4, p, 1, 16); + MNU_DrawSmallString(OPT_XSIDE+tilesiz[pic_slidelend].x+tilesiz[pic_sliderend].x+(barwidth+1)*tilesiz[pic_slidebar].x, item->y+4, p, 1, 16); } break; @@ -4002,7 +4002,7 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) } sprintf(tmp_text, "%.2f%%", (float)(slidersettings[item->slider]<<10) / 32767.f); - MNU_DrawSmallString(OPT_XSIDE+tilesizx[pic_slidelend]+tilesizx[pic_sliderend]+(MAX_SLDR_WIDTH+1)*tilesizx[pic_slidebar], item->y+4, tmp_text, 1, 16); + MNU_DrawSmallString(OPT_XSIDE+tilesiz[pic_slidelend].x+tilesiz[pic_sliderend].x+(MAX_SLDR_WIDTH+1)*tilesiz[pic_slidebar].x, item->y+4, tmp_text, 1, 16); break; default: @@ -4020,14 +4020,14 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) // Draw the left end cap of the bar rotatesprite(x << 16, y << 16, MZ, 0, pic_slidelend, shade, 0, MenuDrawFlags, 0, 0, xdim - 1, ydim - 1); - x += tilesizx[pic_slidelend]; + x += tilesiz[pic_slidelend].x; knobx = x; // Draw the in between sections for (i = 0; i < min(barwidth,MAX_SLDR_WIDTH); i++) { rotatesprite(x << 16, y << 16, MZ, 0, pic_slidebar, shade, 0, MenuDrawFlags, 0, 0, xdim - 1, ydim - 1); - x += tilesizx[pic_slidebar]; + x += tilesiz[pic_slidebar].x; } // Draw the right end cap @@ -4036,11 +4036,11 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) // Draw the knob, compressing the X coordinate if the bar is too wide if (barwidth > MAX_SLDR_WIDTH) { - knobx += offset * (MAX_SLDR_WIDTH*tilesizx[pic_slidebar]-tilesizx[pic_sliderknob]) / (barwidth-1); + knobx += offset * (MAX_SLDR_WIDTH*tilesiz[pic_slidebar].x-tilesiz[pic_sliderknob].x) / (barwidth-1); } else { - knobx += tilesizx[pic_slidebar] * offset; + knobx += tilesiz[pic_slidebar].x * offset; } rotatesprite(knobx << 16, (y + 2) << 16, MZ, 0, pic_sliderknob, shade, 0, MenuDrawFlags, 0, 0, xdim - 1, ydim - 1); } @@ -4298,13 +4298,13 @@ MNU_DrawItemIcon(MenuItem *item) if (item->text) { scale /= 2; - x -= mulscale17(tilesizx[pic_yinyang],scale) + 2; + x -= mulscale17(tilesiz[pic_yinyang].x,scale) + 2; y += 4; } else { scale -= (1<<13); - x -= ((tilesizx[pic_yinyang]) / 2) - 3; + x -= ((tilesiz[pic_yinyang].x) / 2) - 3; y += 8; } @@ -4343,7 +4343,7 @@ MNU_DrawItem(MenuItem *item) -30 + STD_RANDOM_RANGE(50), PALETTE_MENU_HIGHLIGHT, MenuDrawFlags, 0, 0, xdim - 1, ydim - 1); else - rotatesprite((item->x + tilesizx[pic_radiobuttn1] + 4) << 16, item->y << 16, + rotatesprite((item->x + tilesiz[pic_radiobuttn1].x + 4) << 16, item->y << 16, MZ, 0, item->pic, item->shade, PALETTE_MENU_HIGHLIGHT, MenuDrawFlags, 0, 0, xdim - 1, ydim - 1); } else @@ -4353,7 +4353,7 @@ MNU_DrawItem(MenuItem *item) rotatesprite(item->x << 16, item->y << 16, MZ, 0, item->pic, item->shade, 0, MenuDrawFlags, 0, 319, 199, 0); else - rotatesprite((item->x + tilesizx[pic_radiobuttn1] + 4) << 16, item->y << 16, + rotatesprite((item->x + tilesiz[pic_radiobuttn1].x + 4) << 16, item->y << 16, MZ, 0, item->pic, item->shade, 0, MenuDrawFlags, 0, 0, xdim - 1, ydim - 1); } } diff --git a/polymer/eduke32/source/sw/src/panel.c b/polymer/eduke32/source/sw/src/panel.c index e0212fa61..655175df4 100644 --- a/polymer/eduke32/source/sw/src/panel.c +++ b/polymer/eduke32/source/sw/src/panel.c @@ -696,8 +696,8 @@ PlayerUpdateKeys(PLAYERp pp) if (gs.BorderNum < BORDER_BAR || pp - Player != screenpeek) return; - xsize = tilesizx[PANEL_KEY_RED]+1; - ysize = tilesizy[PANEL_KEY_RED]+2; + xsize = tilesiz[PANEL_KEY_RED].x+1; + ysize = tilesiz[PANEL_KEY_RED].y+2; // erase old info pSpawnFullScreenSprite(pp, KEYS_ERASE, PRI_MID, PANEL_KEYS_BOX_X, PANEL_BOX_Y); @@ -1238,7 +1238,7 @@ void SpecialUziRetractFunc(PANEL_SPRITEp psp) { psp->y += 4 * synctics; - if (psp->y >= 200 + tilesizy[psp->picnum]) + if (psp->y >= 200 + tilesiz[psp->picnum].y) { pKillSprite(psp); } @@ -1308,7 +1308,7 @@ InitWeaponSword(PLAYERp pp) if (!pp->Wpn[WPN_SWORD]) { psp = pp->Wpn[WPN_SWORD] = pSpawnSprite(pp, ps_PresentSword, PRI_MID, SWORD_XOFF, SWORD_YOFF); - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; } if (pp->CurWpn == pp->Wpn[WPN_SWORD]) @@ -1441,7 +1441,7 @@ pSwordSlideDown(PANEL_SPRITEp psp) pSetState(psp, psp->PresentState); psp->x = SWORD_XOFF; psp->y = SWORD_YOFF; - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; psp->yorig = psp->y; } } @@ -1521,7 +1521,7 @@ pSwordSlideDownR(PANEL_SPRITEp psp) pSetState(psp, psp->PresentState); psp->x = SWORD_XOFF; psp->y = SWORD_YOFF; - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; psp->yorig = psp->y; } } @@ -1547,9 +1547,9 @@ pSwordHide(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= SWORD_YOFF + tilesizy[picnum]) + if (psp->y >= SWORD_YOFF + tilesiz[picnum].y) { - psp->y = SWORD_YOFF + tilesizy[picnum]; + psp->y = SWORD_YOFF + tilesiz[picnum].y; psp->x = SWORD_XOFF; pWeaponUnHideKeys(psp, psp->PresentState); @@ -1636,7 +1636,7 @@ pSwordRetract(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= SWORD_YOFF + tilesizy[picnum]) + if (psp->y >= SWORD_YOFF + tilesiz[picnum].y) { RESET(psp->PlayerP->Flags, PF_WEAPON_RETRACT); psp->PlayerP->Wpn[WPN_SWORD] = NULL; @@ -1778,7 +1778,7 @@ InitWeaponStar(PLAYERp pp) if (!pp->Wpn[WPN_STAR]) { psp = pp->Wpn[WPN_STAR] = pSpawnSprite(pp, ps_PresentStar, PRI_MID, STAR_XOFF, STAR_YOFF); - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; } if (pp->CurWpn == pp->Wpn[WPN_STAR]) @@ -1867,9 +1867,9 @@ pStarHide(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= STAR_YOFF + tilesizy[picnum]) + if (psp->y >= STAR_YOFF + tilesiz[picnum].y) { - psp->y = STAR_YOFF + tilesizy[picnum]; + psp->y = STAR_YOFF + tilesiz[picnum].y; pWeaponUnHideKeys(psp, psp->PresentState); } @@ -1930,7 +1930,7 @@ pStarRetract(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= STAR_YOFF + tilesizy[picnum]) + if (psp->y >= STAR_YOFF + tilesiz[picnum].y) { RESET(psp->PlayerP->Flags, PF_WEAPON_RETRACT); @@ -2322,7 +2322,7 @@ pUziReloadRetract(PANEL_SPRITEp nclip) gun->yfract = LSW(ygun); gun->y = MSW(ygun); - if (gun->y > UZI_RELOAD_YOFF + tilesizy[gun->picndx]) + if (gun->y > UZI_RELOAD_YOFF + tilesiz[gun->picndx].y) { pSetState(gun, ps_UziDoneReload); pKillSprite(nclip); @@ -2453,7 +2453,7 @@ InitWeaponUzi(PLAYERp pp) if (!pp->Wpn[WPN_UZI]) { psp = pp->Wpn[WPN_UZI] = pSpawnSprite(pp, ps_PresentUzi, PRI_MID, 160 + UZI_XOFF, UZI_YOFF); - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; } // if Current weapon is uzi @@ -2532,7 +2532,7 @@ InitWeaponUzi2(PANEL_SPRITEp uzi_orig) new = pSpawnSprite(pp, ps_PresentUzi2, PRI_MID, 160 - UZI_XOFF, UZI_YOFF); uzi_orig->sibling = new; - new->y += tilesizy[new->picndx]; + new->y += tilesiz[new->picndx].y; // Set up the new Weapon variables SET(new->flags, PANF_WEAPON_SPRITE); @@ -2556,7 +2556,7 @@ InitWeaponUziSecondaryReload(PANEL_SPRITEp uzi_orig) PLAYERp pp = uzi_orig->PlayerP; new = pSpawnSprite(pp, ps_PresentUzi, PRI_MID, 160 - UZI_XOFF, UZI_YOFF); - new->y += tilesizy[new->picndx]; + new->y += tilesiz[new->picndx].y; SET(new->flags, PANF_XFLIP); @@ -2654,9 +2654,9 @@ pUziHide(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= 200 + tilesizy[picnum]) + if (psp->y >= 200 + tilesiz[picnum].y) { - psp->y = 200 + tilesizy[picnum]; + psp->y = 200 + tilesiz[picnum].y; if (TEST(psp->flags, PANF_PRIMARY) && psp->PlayerP->WpnUziType != 1) { @@ -2812,7 +2812,7 @@ pUziRetract(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= 200 + tilesizy[picnum]) + if (psp->y >= 200 + tilesiz[picnum].y) { // if in the reload phase and its retracting then get rid of uzi // no matter whether it is PRIMARY/SECONDARY/neither. @@ -2905,7 +2905,7 @@ SpawnUziShell(PANEL_SPRITEp psp) } SET(shell->flags, PANF_WEAPON_SPRITE); - shell->y = shell->yorig = psp->y - tilesizy[psp->picndx] + 20; + shell->y = shell->yorig = psp->y - tilesiz[psp->picndx].y + 20; shell->sin_ndx = 0; shell->sin_amt = 13 + RANDOM_P2(8); @@ -3022,7 +3022,7 @@ SpawnShotgunShell(PANEL_SPRITEp psp) shell = pSpawnSprite(pp, ps_ShotgunShell, PRI_FRONT, 0, 0); shell->x = psp->x + 25; - shell->y = shell->yorig = psp->y - tilesizy[psp->picndx] + 85; + shell->y = shell->yorig = psp->y - tilesiz[psp->picndx].y + 85; shell->xspeed = ss->lo_xspeed + (RANDOM_RANGE((ss->hi_xspeed - ss->lo_xspeed)>>4) << 4); SET(shell->flags, PANF_WEAPON_SPRITE); @@ -3191,7 +3191,7 @@ InitWeaponShotgun(PLAYERp pp) if (!pp->Wpn[pp->WeaponType]) { psp = pp->Wpn[pp->WeaponType] = pSpawnSprite(pp, ps_PresentShotgun, PRI_MID, SHOTGUN_XOFF, SHOTGUN_YOFF); - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; } if (pp->CurWpn == pp->Wpn[pp->WeaponType]) @@ -3297,12 +3297,12 @@ pShotgunReloadDown(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= SHOTGUN_YOFF + (tilesizy[picnum]/2)) + if (psp->y >= SHOTGUN_YOFF + (tilesiz[picnum].y/2)) { PlaySound(DIGI_ROCKET_UP, &psp->PlayerP->posx, &psp->PlayerP->posy, &psp->PlayerP->posz,v3df_follow|v3df_dontpan|v3df_doppler); - psp->y = SHOTGUN_YOFF + (tilesizy[picnum]/2); + psp->y = SHOTGUN_YOFF + (tilesiz[picnum].y/2); pStatePlusOne(psp); } @@ -3414,9 +3414,9 @@ pShotgunHide(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= SHOTGUN_YOFF + tilesizy[picnum]) + if (psp->y >= SHOTGUN_YOFF + tilesiz[picnum].y) { - psp->y = SHOTGUN_YOFF + tilesizy[picnum]; + psp->y = SHOTGUN_YOFF + tilesiz[picnum].y; pWeaponUnHideKeys(psp, psp->PresentState); } @@ -3550,7 +3550,7 @@ pShotgunRetract(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= SHOTGUN_YOFF + tilesizy[picnum] + 50) + if (psp->y >= SHOTGUN_YOFF + tilesiz[picnum].y + 50) { RESET(psp->PlayerP->Flags, PF_WEAPON_RETRACT); psp->PlayerP->Wpn[psp->WeaponType] = NULL; @@ -3709,7 +3709,7 @@ InitWeaponRail(PLAYERp pp) if (!pp->Wpn[pp->WeaponType]) { psp = pp->Wpn[pp->WeaponType] = pSpawnSprite(pp, ps_PresentRail, PRI_MID, RAIL_XOFF, RAIL_YOFF); - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; } if (pp->CurWpn == pp->Wpn[pp->WeaponType]) @@ -3844,9 +3844,9 @@ pRailHide(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= RAIL_YOFF + tilesizy[picnum]) + if (psp->y >= RAIL_YOFF + tilesiz[picnum].y) { - psp->y = RAIL_YOFF + tilesizy[picnum]; + psp->y = RAIL_YOFF + tilesiz[picnum].y; pWeaponUnHideKeys(psp, psp->PresentState); } @@ -3953,7 +3953,7 @@ pRailRetract(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= RAIL_YOFF + tilesizy[picnum] + 50) + if (psp->y >= RAIL_YOFF + tilesiz[picnum].y + 50) { RESET(psp->PlayerP->Flags, PF_WEAPON_RETRACT); psp->PlayerP->Wpn[psp->WeaponType] = NULL; @@ -4164,7 +4164,7 @@ InitWeaponHothead(PLAYERp pp) if (!pp->Wpn[WPN_HOTHEAD]) { psp = pp->Wpn[WPN_HOTHEAD] = pSpawnSprite(pp, ps_PresentHothead, PRI_MID, HOTHEAD_XOFF, HOTHEAD_YOFF); - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; } if (pp->CurWpn == pp->Wpn[WPN_HOTHEAD]) @@ -4269,10 +4269,10 @@ pHotheadHide(PANEL_SPRITEp psp) psp->x += 3 * synctics; - if (psp->x >= HOTHEAD_XOFF + tilesizx[picnum] || psp->y >= HOTHEAD_YOFF + tilesizy[picnum]) + if (psp->x >= HOTHEAD_XOFF + tilesiz[picnum].x || psp->y >= HOTHEAD_YOFF + tilesiz[picnum].y) { psp->x = HOTHEAD_XOFF; - psp->y = HOTHEAD_YOFF + tilesizy[picnum]; + psp->y = HOTHEAD_YOFF + tilesiz[picnum].y; pWeaponUnHideKeys(psp, psp->PresentState); } @@ -4369,7 +4369,7 @@ pHotheadRetract(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= HOTHEAD_YOFF + tilesizy[picnum]) + if (psp->y >= HOTHEAD_YOFF + tilesiz[picnum].y) { RESET(psp->PlayerP->Flags, PF_WEAPON_RETRACT); psp->PlayerP->Wpn[WPN_HOTHEAD] = NULL; @@ -4417,7 +4417,7 @@ SpawnOnFire(PLAYERp pp) { fire = pSpawnSprite(pp, &ps_OnFire[RANDOM_P2(8<<8)>>8], PRI_FRONT, x, ON_FIRE_Y_BOT); SET(fire->flags, PANF_WEAPON_SPRITE); - x += tilesizx[fire->picndx]; + x += tilesiz[fire->picndx].x; } } @@ -4606,7 +4606,7 @@ InitWeaponMicro(PLAYERp pp) if (!pp->Wpn[WPN_MICRO]) { psp = pp->Wpn[WPN_MICRO] = pSpawnSprite(pp, ps_PresentMicro, PRI_MID, MICRO_XOFF, MICRO_YOFF); - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; } if (pp->CurWpn == pp->Wpn[WPN_MICRO]) @@ -4751,9 +4751,9 @@ pMicroHide(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= MICRO_YOFF + tilesizy[picnum] + 20) + if (psp->y >= MICRO_YOFF + tilesiz[picnum].y + 20) { - psp->y = MICRO_YOFF + tilesizy[picnum] + 20; + psp->y = MICRO_YOFF + tilesiz[picnum].y + 20; psp->x = MICRO_XOFF; pWeaponUnHideKeys(psp, psp->PresentState); @@ -4976,7 +4976,7 @@ pMicroRetract(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= MICRO_YOFF + tilesizy[picnum]) + if (psp->y >= MICRO_YOFF + tilesiz[picnum].y) { RESET(psp->PlayerP->Flags, PF_WEAPON_RETRACT); psp->PlayerP->Wpn[WPN_MICRO] = NULL; @@ -5116,7 +5116,7 @@ InitWeaponHeart(PLAYERp pp) if (!pp->Wpn[WPN_HEART]) { psp = pp->Wpn[WPN_HEART] = pSpawnSprite(pp, ps_PresentHeart, PRI_MID, 160 + 10, HEART_YOFF); - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; } if (pp->CurWpn == pp->Wpn[WPN_HEART]) @@ -5181,9 +5181,9 @@ pHeartHide(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= HEART_YOFF + tilesizy[picnum]) + if (psp->y >= HEART_YOFF + tilesiz[picnum].y) { - psp->y = HEART_YOFF + tilesizy[picnum]; + psp->y = HEART_YOFF + tilesiz[picnum].y; pWeaponUnHideKeys(psp, psp->PresentState); } @@ -5287,7 +5287,7 @@ pHeartRetract(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= HEART_YOFF + tilesizy[picnum]) + if (psp->y >= HEART_YOFF + tilesiz[picnum].y) { RESET(psp->PlayerP->Flags, PF_WEAPON_RETRACT); psp->PlayerP->Wpn[WPN_HEART] = NULL; @@ -5613,7 +5613,7 @@ InitWeaponGrenade(PLAYERp pp) if (!pp->Wpn[WPN_GRENADE]) { psp = pp->Wpn[WPN_GRENADE] = pSpawnSprite(pp, ps_PresentGrenade, PRI_MID, GRENADE_XOFF, GRENADE_YOFF); - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; } if (pp->CurWpn == pp->Wpn[WPN_GRENADE]) @@ -5662,10 +5662,10 @@ pGrenadeRecoilDown(PANEL_SPRITEp psp) psp->vel -= 24 * synctics; - // if (psp->y >= GRENADE_YOFF + tilesizy[picnum]) + // if (psp->y >= GRENADE_YOFF + tilesiz[picnum].y) if (psp->vel < 400) { - // psp->y = GRENADE_YOFF + tilesizy[picnum]; + // psp->y = GRENADE_YOFF + tilesiz[picnum].y; psp->vel = 400; psp->ang = NORM_ANGLE(psp->ang + 1024); @@ -5756,9 +5756,9 @@ pGrenadeHide(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= GRENADE_YOFF + tilesizy[picnum]) + if (psp->y >= GRENADE_YOFF + tilesiz[picnum].y) { - psp->y = GRENADE_YOFF + tilesizy[picnum]; + psp->y = GRENADE_YOFF + tilesiz[picnum].y; psp->x = GRENADE_XOFF; pGrenadePresentSetup(psp); @@ -5819,7 +5819,7 @@ pGrenadeRetract(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= GRENADE_YOFF + tilesizy[picnum]) + if (psp->y >= GRENADE_YOFF + tilesiz[picnum].y) { RESET(psp->PlayerP->Flags, PF_WEAPON_RETRACT); psp->PlayerP->Wpn[WPN_GRENADE] = NULL; @@ -5904,7 +5904,7 @@ InitWeaponMine(PLAYERp pp) if (!pp->Wpn[WPN_MINE]) { psp = pp->Wpn[WPN_MINE] = pSpawnSprite(pp, ps_PresentMine, PRI_MID, MINE_XOFF, MINE_YOFF); - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; } if (pp->CurWpn == pp->Wpn[WPN_MINE]) @@ -5945,11 +5945,11 @@ pMineLower(PANEL_SPRITEp psp) { psp->y += 4 * synctics; - if (psp->y > MINE_YOFF + tilesizy[psp->picndx]) + if (psp->y > MINE_YOFF + tilesiz[psp->picndx].y) { if (!WeaponOK(psp->PlayerP)) return; - psp->y = MINE_YOFF + tilesizy[psp->picndx]; + psp->y = MINE_YOFF + tilesiz[psp->picndx].y; pStatePlusOne(psp); } } @@ -6004,9 +6004,9 @@ pMineHide(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= MINE_YOFF + tilesizy[picnum]) + if (psp->y >= MINE_YOFF + tilesiz[picnum].y) { - psp->y = MINE_YOFF + tilesizy[picnum]; + psp->y = MINE_YOFF + tilesiz[picnum].y; psp->x = MINE_XOFF; pWeaponUnHideKeys(psp, psp->PresentState); @@ -6064,7 +6064,7 @@ pMineRetract(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= MINE_YOFF + tilesizy[picnum]) + if (psp->y >= MINE_YOFF + tilesiz[picnum].y) { RESET(psp->PlayerP->Flags, PF_WEAPON_RETRACT); psp->PlayerP->Wpn[WPN_MINE] = NULL; @@ -6173,7 +6173,7 @@ InitChops(PLAYERp pp) if (!pp->Chops) { psp = pp->Chops = pSpawnSprite(pp, ps_ChopsAttack1, PRI_MID, CHOPS_XOFF, CHOPS_YOFF); - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; } if (Prediction) @@ -6288,7 +6288,7 @@ pChopsRetract(PANEL_SPRITEp psp) psp->y += 6 * synctics; - if (psp->y >= CHOPS_YOFF + tilesizy[picnum]) + if (psp->y >= CHOPS_YOFF + tilesiz[picnum].y) { if (RANDOM_RANGE(1000) > 800) PlayerSound(DIGI_GETTINGSTIFF,&psp->PlayerP->posx,&psp->PlayerP->posy,&psp->PlayerP->posz,v3df_follow|v3df_dontpan,psp->PlayerP); @@ -6573,7 +6573,7 @@ InitWeaponFist(PLAYERp pp) if (!pp->Wpn[WPN_FIST]) { psp = pp->Wpn[WPN_FIST] = pSpawnSprite(pp, ps_PresentFist, PRI_MID, FIST_XOFF, FIST_YOFF); - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; } if (pp->CurWpn == pp->Wpn[WPN_FIST]) @@ -6765,7 +6765,7 @@ pFistSlideDown(PANEL_SPRITEp psp) pSetState(psp, psp->PresentState); psp->x = FIST_XOFF; psp->y = FIST_YOFF; - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; psp->yorig = psp->y; } } @@ -6893,7 +6893,7 @@ pFistSlideDownR(PANEL_SPRITEp psp) pSetState(psp, psp->PresentState); psp->x = FIST_XOFF; psp->y = FIST_YOFF; - psp->y += tilesizy[psp->picndx]; + psp->y += tilesiz[psp->picndx].y; psp->yorig = psp->y; } } @@ -6919,9 +6919,9 @@ pFistHide(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= FIST_YOFF + tilesizy[picnum]) + if (psp->y >= FIST_YOFF + tilesiz[picnum].y) { - psp->y = FIST_YOFF + tilesizy[picnum]; + psp->y = FIST_YOFF + tilesiz[picnum].y; pWeaponUnHideKeys(psp, psp->PresentState); } @@ -7026,7 +7026,7 @@ pFistRetract(PANEL_SPRITEp psp) psp->y += 3 * synctics; - if (psp->y >= FIST_YOFF + tilesizy[picnum]) + if (psp->y >= FIST_YOFF + tilesiz[picnum].y) { RESET(psp->PlayerP->Flags, PF_WEAPON_RETRACT); psp->PlayerP->Wpn[WPN_FIST] = NULL; @@ -7811,8 +7811,8 @@ void rotatespritetile(int thex, int they, short tilenum, { int x, y, xsiz, ysiz, tx1, ty1, tx2, ty2; - xsiz = tilesizx[tilenum]; tx1 = cx1/xsiz; tx2 = cx2/xsiz; - ysiz = tilesizy[tilenum]; ty1 = cy1/ysiz; ty2 = cy2/ysiz; + xsiz = tilesiz[tilenum].x; tx1 = cx1/xsiz; tx2 = cx2/xsiz; + ysiz = tilesiz[tilenum].y; ty1 = cy1/ysiz; ty2 = cy2/ysiz; for (x=tx1; x<=tx2; x++) { diff --git a/polymer/eduke32/source/sw/src/sprite.c b/polymer/eduke32/source/sw/src/sprite.c index bafe68bf3..83a77bb9f 100644 --- a/polymer/eduke32/source/sw/src/sprite.c +++ b/polymer/eduke32/source/sw/src/sprite.c @@ -4771,9 +4771,9 @@ getzrangepoint(int x, int y, int z, short sectnum, // These points will already have (x,y) subtracted from them cosang = sintable[NORM_ANGLE(spr->ang + 512)]; sinang = sintable[spr->ang]; - xspan = tilesizx[tilenum]; + xspan = tilesiz[tilenum].x; dax = ((xspan >> 1) + xoff) * spr->xrepeat; - yspan = tilesizy[tilenum]; + yspan = tilesiz[tilenum].y; day = ((yspan >> 1) + yoff) * spr->yrepeat; x1 = spr->x + dmulscale16(sinang, dax, cosang, day) - x; y1 = spr->y + dmulscale16(sinang, day, -cosang, dax) - y; diff --git a/polymer/eduke32/source/sw/src/text.c b/polymer/eduke32/source/sw/src/text.c index bfe1fbab1..aa5b812ef 100644 --- a/polymer/eduke32/source/sw/src/text.c +++ b/polymer/eduke32/source/sw/src/text.c @@ -91,7 +91,7 @@ DisplaySummaryString(PLAYERp pp, short xs, short ys, short color, short shade, c font_pic = font_base[color] + (ch - '0'); nsp = pSpawnFullScreenSprite(pp, font_pic, PRI_FRONT_MAX, x, ys); nsp->shade = shade; - size = tilesizx[font_pic] + 1; + size = tilesiz[font_pic].x + 1; } } @@ -203,7 +203,7 @@ PutStringTimer(PLAYERp pp, short x, short y, const char *string, short seconds) nsp->PanelSpriteFunc = func; nsp->kill_tics = kill_tics; nsp->ID = id; - offset += tilesizx[ac]; + offset += tilesiz[ac].x; } else if (c == asc_Space) offset += 4; // Special case for space char @@ -266,7 +266,7 @@ DisplayPanelNumber(PLAYERp pp, short xs, short ys, int number) pSpawnFullScreenSprite(pp, PANEL_FONT_G + (*ptr - '0'), PRI_FRONT_MAX, x, ys); - size = tilesizx[PANEL_FONT_G + (*ptr - '0')] + 1; + size = tilesiz[PANEL_FONT_G + (*ptr - '0')].x + 1; } } @@ -294,7 +294,7 @@ DisplayMiniBarNumber(PLAYERp pp, short xs, short ys, int number) pic, 0, 0, ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER, 0, 0, xdim - 1, ydim - 1); - size = tilesizx[PANEL_FONT_G + (*ptr - '0')] + 1; + size = tilesiz[PANEL_FONT_G + (*ptr - '0')].x + 1; } } @@ -407,7 +407,7 @@ DisplayFragNumbers(PLAYERp pp) // frag bar 0 or 1 frag_bar = ((pnum)/4); // move y down according to frag bar number - ys = ys + (tilesizy[FRAG_BAR]-2) * frag_bar; + ys = ys + (tilesiz[FRAG_BAR].y-2) * frag_bar; // move x over according to the number of players xs = xoffs[MOD4(pnum)]; @@ -441,7 +441,7 @@ DisplayFragNames(PLAYERp pp) // frag bar 0 or 1 frag_bar = ((pnum)/4); // move y down according to frag bar number - ys = ys + (tilesizy[FRAG_BAR]-2) * frag_bar; + ys = ys + (tilesiz[FRAG_BAR].y-2) * frag_bar; // move x over according to the number of players xs = xoffs[MOD4(pnum)]; diff --git a/polymer/eduke32/source/sw/src/weapon.c b/polymer/eduke32/source/sw/src/weapon.c index e83cb11a1..73465d972 100644 --- a/polymer/eduke32/source/sw/src/weapon.c +++ b/polymer/eduke32/source/sw/src/weapon.c @@ -16204,7 +16204,7 @@ WallSpriteInsideSprite(SPRITEp wsp, SPRITEp sp) // y delta day = sintable[NORM_ANGLE(wsp->ang + 1024 + 512)] * wsp->xrepeat; - xsiz = tilesizx[wsp->picnum]; + xsiz = tilesiz[wsp->picnum].x; mid_dist = DIV2(xsiz) + xoff; // starting from the center find the first point diff --git a/polymer/eduke32/source/testgame/src/bstub.c b/polymer/eduke32/source/testgame/src/bstub.c index 4e1338ef9..411b2124e 100644 --- a/polymer/eduke32/source/testgame/src/bstub.c +++ b/polymer/eduke32/source/testgame/src/bstub.c @@ -253,7 +253,7 @@ void ExtPreCheckKeys(void) horizval2 = dy*(320>>1)/dx+1; daviewingrange = scale(65536,16384*(xdim>>1),mindx-16); - daaspect = scale(daviewingrange,scale(320,tilesizx[4094],tilesizy[4094]),horizval2+6-horizval1); + daaspect = scale(daviewingrange,scale(320,tilesiz[4094].x,tilesiz[4094].y),horizval2+6-horizval1); setaspect(daviewingrange,scale(daaspect,ydim*320,xdim*i)); horiz = 100-divscale15(horizval1+horizval2,daviewingrange); } @@ -321,7 +321,7 @@ void ExtCheckKeys(void) #if 0 if (hang != 0) { - bufplc = waloff[4094]+(mulscale16(horiz-100,xdimenscale)+(tilesizx[4094]>>1))*tilesizy[4094]; + bufplc = waloff[4094]+(mulscale16(horiz-100,xdimenscale)+(tilesiz[4094].x>>1))*tilesiz[4094].y; setviewback(); cosang = sintable[(hang+512)&2047]; sinang = sintable[hang&2047]; @@ -329,7 +329,7 @@ void ExtCheckKeys(void) dy = dmulscale1(-ydim,cosang,xdim,sinang); begindrawing(); - tsizy = tilesizy[4094]; + tsizy = tilesiz[4094].y; tsizyup15 = (tsizy<<15); dx = mulscale14(dx,daviewingrange); dy = mulscale14(dy,daaspect); diff --git a/polymer/eduke32/source/testgame/src/game.c b/polymer/eduke32/source/testgame/src/game.c index d3b2e40d4..3ec91c606 100644 --- a/polymer/eduke32/source/testgame/src/game.c +++ b/polymer/eduke32/source/testgame/src/game.c @@ -1215,8 +1215,8 @@ void prepareboard(char *daboardfilename) subwaytrackcnt = 0; //Make a list of subways floormirrorcnt = 0; - tilesizx[FLOORMIRROR] = 0; - tilesizy[FLOORMIRROR] = 0; + tilesiz[FLOORMIRROR].x = 0; + tilesiz[FLOORMIRROR].y = 0; for(i=0;i>8)-((sprite[i].z>>8)-(tilesizy[sprite[i].picnum]>>1))) <= 40)) + if ((klabs(pos[snum].x-sprite[i].x)+klabs(pos[snum].y-sprite[i].y) < 512) && (klabs((pos[snum].z>>8)-((sprite[i].z>>8)-(tilesiz[sprite[i].picnum].y>>1))) <= 40)) { switch(sprite[i].picnum) { @@ -1682,7 +1682,7 @@ void checkgrabbertouchsprite(short snum, short sectnum) // Andy did this { nexti = nextspritesect[i]; if (sprite[i].cstat&0x8000) continue; - if ((klabs(sprite[snum].x-sprite[i].x)+klabs(sprite[snum].y-sprite[i].y) < 512) && (klabs((sprite[snum].z>>8)-((sprite[i].z>>8)-(tilesizy[sprite[i].picnum]>>1))) <= 40)) + if ((klabs(sprite[snum].x-sprite[i].x)+klabs(sprite[snum].y-sprite[i].y) < 512) && (klabs((sprite[snum].z>>8)-((sprite[i].z>>8)-(tilesiz[sprite[i].picnum].y>>1))) <= 40)) { switch(sprite[i].picnum) { @@ -1824,7 +1824,7 @@ void shootgun(short snum, const vec3_t *vector, else { wsayfollow("mondie.wav",4096L+(krand()&127)-64,256L,&hitinfo.pos.x,&hitinfo.pos.y,0); - sprite[hitinfo.sprite].z += ((tilesizy[sprite[hitinfo.sprite].picnum]*sprite[hitinfo.sprite].yrepeat)<<1); + sprite[hitinfo.sprite].z += ((tilesiz[sprite[hitinfo.sprite].picnum].y*sprite[hitinfo.sprite].yrepeat)<<1); sprite[hitinfo.sprite].picnum = GIFTBOX; sprite[hitinfo.sprite].cstat &= ~0x83; //Should not clip, foot-z changespritestat(hitinfo.sprite,12); @@ -2300,7 +2300,7 @@ void statuslistcode(void) //brown monster decides to shoot bullet if ((k&63) == 23) { - if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesizy[sprite[i].picnum]<<7),sprite[i].sectnum,pos[target].x,pos[target].y,pos[target].z,cursectnum[target]) == 0) + if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesiz[sprite[i].picnum].y<<7),sprite[i].sectnum,pos[target].x,pos[target].y,pos[target].z,cursectnum[target]) == 0) { if ((k&0xf00) == 0xb00) changespritestat(i,2); } @@ -2369,7 +2369,7 @@ void statuslistcode(void) if (globloz > sprite[i].z+(48<<8)) { sprite[i].x = dax; sprite[i].y = day; movestat = 1; } else - sprite[i].z = globloz-((tilesizy[sprite[i].picnum]*sprite[i].yrepeat)<<1); + sprite[i].z = globloz-((tilesiz[sprite[i].picnum].y*sprite[i].yrepeat)<<1); if ((sprite[i].sectnum != osectnum) && (sector[sprite[i].sectnum].lotag == 10)) { warpsprite((short)i); movestat = 0; } @@ -2424,7 +2424,7 @@ void statuslistcode(void) l = 0; if ((sprite[i].lotag&64) && (k < 2)) //Give him a chance to reproduce without seeing you l = 1; - else if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesizy[sprite[i].picnum]<<7),sprite[i].sectnum,pos[target].x,pos[target].y,pos[target].z,cursectnum[target]) == 1) + else if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesiz[sprite[i].picnum].y<<7),sprite[i].sectnum,pos[target].x,pos[target].y,pos[target].z,cursectnum[target]) == 1) l = 1; if (l != 0) { @@ -2445,7 +2445,7 @@ void statuslistcode(void) } if (k >= 208+((sprite[i].lotag&128)>>2)) //Al decides to shoot bullet { - if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesizy[sprite[i].picnum]<<7),sprite[i].sectnum,pos[target].x,pos[target].y,pos[target].z,cursectnum[target]) == 1) + if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesiz[sprite[i].picnum].y<<7),sprite[i].sectnum,pos[target].x,pos[target].y,pos[target].z,cursectnum[target]) == 1) { wsayfollow("zipguns.wav",5144L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,1); @@ -2482,7 +2482,7 @@ void statuslistcode(void) if (sprite[i].lotag&16) { - if (((k&124) >= 120) && (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesizy[sprite[i].picnum]<<7),sprite[i].sectnum,pos[target].x,pos[target].y,pos[target].z,cursectnum[target]) == 1)) + if (((k&124) >= 120) && (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesiz[sprite[i].picnum].y<<7),sprite[i].sectnum,pos[target].x,pos[target].y,pos[target].z,cursectnum[target]) == 1)) sprite[i].ang = getangle(pos[target].x-sprite[i].x,pos[target].y-sprite[i].y); else sprite[i].ang = (krand()&2047); @@ -2490,7 +2490,7 @@ void statuslistcode(void) if (movestat != 0) { - if ((k&2) && (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesizy[sprite[i].picnum]<<7),sprite[i].sectnum,pos[target].x,pos[target].y,pos[target].z,cursectnum[target]) == 1)) + if ((k&2) && (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesiz[sprite[i].picnum].y<<7),sprite[i].sectnum,pos[target].x,pos[target].y,pos[target].z,cursectnum[target]) == 1)) sprite[i].ang = getangle(pos[target].x-sprite[i].x,pos[target].y-sprite[i].y); else sprite[i].ang = (krand()&2047); @@ -2622,14 +2622,14 @@ void statuslistcode(void) { sprite[i].z += sprite[i].zvel; sprite[i].zvel += (TICSPERFRAME<<7); - if (sprite[i].z < globhiz+(tilesizy[BOMB]<<6)) + if (sprite[i].z < globhiz+(tilesiz[BOMB].y<<6)) { - sprite[i].z = globhiz+(tilesizy[BOMB]<<6); + sprite[i].z = globhiz+(tilesiz[BOMB].y<<6); sprite[i].zvel = -(sprite[i].zvel>>1); } - if (sprite[i].z > globloz-(tilesizy[BOMB]<<6)) + if (sprite[i].z > globloz-(tilesiz[BOMB].y<<6)) { - sprite[i].z = globloz-(tilesizy[BOMB]<<6); + sprite[i].z = globloz-(tilesiz[BOMB].y<<6); sprite[i].zvel = -(sprite[i].zvel>>1); } dax = sprite[i].xvel; day = sprite[i].yvel; @@ -2856,7 +2856,7 @@ void statuslistcode(void) else { wsayfollow("mondie.wav",4096L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,0); - sprite[j].z += ((tilesizy[sprite[j].picnum]*sprite[j].yrepeat)<<1); + sprite[j].z += ((tilesiz[sprite[j].picnum].y*sprite[j].yrepeat)<<1); sprite[j].picnum = GIFTBOX; sprite[j].cstat &= ~0x83; //Should not clip, foot-z @@ -2914,7 +2914,7 @@ bulletisdeletedskip: continue; //Use dot product to see if monster's angle is towards a player for(p=connecthead;p>=0;p=connectpoint2[p]) if (sintable[(sprite[i].ang+512)&2047]*(pos[p].x-sprite[i].x) + sintable[sprite[i].ang&2047]*(pos[p].y-sprite[i].y) >= 0) - if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesizy[sprite[i].picnum]<<7),sprite[i].sectnum,pos[p].x,pos[p].y,pos[p].z,cursectnum[p]) == 1) + if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesiz[sprite[i].picnum].y<<7),sprite[i].sectnum,pos[p].x,pos[p].y,pos[p].z,cursectnum[p]) == 1) { changespritestat(i,1); //if (sprite[i].lotag == 100) @@ -3070,7 +3070,7 @@ void bombexplode(int i) dist += (pos[j].y-sprite[i].y)*(pos[j].y-sprite[i].y); dist += ((pos[j].z-sprite[i].z)>>4)*((pos[j].z-sprite[i].z)>>4); if (dist < 4194304) - if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesizy[sprite[i].picnum]<<7),sprite[i].sectnum,pos[j].x,pos[j].y,pos[j].z,cursectnum[j]) == 1) + if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesiz[sprite[i].picnum].y<<7),sprite[i].sectnum,pos[j].x,pos[j].y,pos[j].z,cursectnum[j]) == 1) { k = ((32768/((dist>>16)+4))>>5); if (j == myconnectindex) @@ -3095,11 +3095,11 @@ void bombexplode(int i) dist += (sprite[j].y-sprite[i].y)*(sprite[j].y-sprite[i].y); dist += ((sprite[j].z-sprite[i].z)>>4)*((sprite[j].z-sprite[i].z)>>4); if (dist >= 4194304) continue; - if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesizy[sprite[i].picnum]<<7),sprite[i].sectnum,sprite[j].x,sprite[j].y,sprite[j].z-(tilesizy[sprite[j].picnum]<<7),sprite[j].sectnum) == 0) + if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesiz[sprite[i].picnum].y<<7),sprite[i].sectnum,sprite[j].x,sprite[j].y,sprite[j].z-(tilesiz[sprite[j].picnum].y<<7),sprite[j].sectnum) == 0) continue; if (sprite[j].picnum == BROWNMONSTER) { - sprite[j].z += ((tilesizy[sprite[j].picnum]*sprite[j].yrepeat)<<1); + sprite[j].z += ((tilesiz[sprite[j].picnum].y*sprite[j].yrepeat)<<1); sprite[j].picnum = GIFTBOX; sprite[j].cstat &= ~0x83; //Should not clip, foot-z changespritestat(j,12); @@ -3115,7 +3115,7 @@ void bombexplode(int i) dist += (sprite[j].y-sprite[i].y)*(sprite[j].y-sprite[i].y); dist += ((sprite[j].z-sprite[i].z)>>4)*((sprite[j].z-sprite[i].z)>>4); if (dist >= 4194304) continue; - if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesizy[sprite[i].picnum]<<7),sprite[i].sectnum,sprite[j].x,sprite[j].y,sprite[j].z-(tilesizy[sprite[j].picnum]<<7),sprite[j].sectnum) == 0) + if (cansee(sprite[i].x,sprite[i].y,sprite[i].z-(tilesiz[sprite[i].picnum].y<<7),sprite[i].sectnum,sprite[j].x,sprite[j].y,sprite[j].z-(tilesiz[sprite[j].picnum].y<<7),sprite[j].sectnum) == 0) continue; sprite[j].picnum = EVILALGRAVE; @@ -3963,8 +3963,8 @@ void drawscreen(short snum, int dasmoothratio) //Reset startdmost to bottom of screen if ((windowx1 == 0) && (windowx2 == 319) && (yxaspect == 65536) && (tiltlock == 0)) { - x1 = 160L-(tilesizx[GUNONBOTTOM]>>1); y1 = windowy2+1; - for(i=0;i>1); y1 = windowy2+1; + for(i=0;icstat&4) > 0) xoff = -xoff; k = spr->ang; l = spr->xrepeat; dax = sintable[k&2047]*l; day = sintable[(k+1536)&2047]*l; - l = tilesizx[tilenum]; k = (l>>1)+xoff; + l = tilesiz[tilenum].x; k = (l>>1)+xoff; x1 -= mulscale16(dax,k); x2 = x1+mulscale16(dax,l); y1 -= mulscale16(day,k); y2 = y1+mulscale16(day,l); @@ -5957,8 +5957,8 @@ void drawoverheadmap(int cposx, int cposy, int czoom, short cang) k = spr->ang; cosang = sintable[(k+512)&2047]; sinang = sintable[k]; - xspan = tilesizx[tilenum]; xrepeat = spr->xrepeat; - yspan = tilesizy[tilenum]; yrepeat = spr->yrepeat; + xspan = tilesiz[tilenum].x; xrepeat = spr->xrepeat; + yspan = tilesiz[tilenum].y; yrepeat = spr->yrepeat; dax = ((xspan>>1)+xoff)*xrepeat; day = ((yspan>>1)+yoff)*yrepeat; x1 = sprx + dmulscale16(sinang,dax,cosang,day); @@ -6016,8 +6016,8 @@ void drawoverheadmap(int cposx, int cposy, int czoom, short cang) if ((show2dwall[j>>3]&(1<<(j&7))) == 0) continue; - if (tilesizx[wal->picnum] == 0) continue; - if (tilesizy[wal->picnum] == 0) continue; + if (tilesiz[wal->picnum].x == 0) continue; + if (tilesiz[wal->picnum].y == 0) continue; if (j == k) { x1 = x2; y1 = y2; } @@ -6051,7 +6051,7 @@ int movesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordi spr = &sprite[spritenum]; if ((spr->cstat&128) == 0) - zoffs = -((tilesizy[spr->picnum]*spr->yrepeat)<<1); + zoffs = -((tilesiz[spr->picnum].y*spr->yrepeat)<<1); else zoffs = 0; @@ -6288,8 +6288,8 @@ void drawtilebackground (/*int thex, int they,*/ short tilenum, { int x, y, xsiz, ysiz, tx1, ty1, tx2, ty2; - xsiz = tilesizx[tilenum]; tx1 = cx1/xsiz; tx2 = cx2/xsiz; - ysiz = tilesizy[tilenum]; ty1 = cy1/ysiz; ty2 = cy2/ysiz; + xsiz = tilesiz[tilenum].x; tx1 = cx1/xsiz; tx2 = cx2/xsiz; + ysiz = tilesiz[tilenum].y; ty1 = cy1/ysiz; ty2 = cy2/ysiz; for(x=tx1;x<=tx2;x++) for(y=ty1;y<=ty2;y++)