diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 0958892e4..bf00c558e 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -8422,8 +8422,8 @@ killsprite: int32_t yp = (zs<<1); int32_t zp = xs*cosglobalang+ys*singlobalang; - xs = ((double)xp*(halfxdimen<<12)/zp)+((halfxdimen+windowx1)<<12); - ys = ((double)yp*(xdimenscale<<12)/zp)+((globalhoriz+windowy1)<<12); + xs = ((double)xp*(halfxdimen<<12)/zp)+((halfxdimen+windowxy1.x)<<12); + ys = ((double)yp*(xdimenscale<<12)/zp)+((globalhoriz+windowxy1.y)<<12); if (xs >= INT32_MIN && xs <= INT32_MAX && ys >= INT32_MIN && ys <= INT32_MAX) { @@ -12409,7 +12409,7 @@ void completemirror(void) intptr_t p = frameplace + ylookup[windowxy1.y+mirrorsy1] + windowxy1.x+mirrorsx1; // Offset (wrt p) of a mirror line's left corner in the destination: - // p+destof == frameplace + ylookup[...] + windowx2-mirrorsx2 + // p+destof == frameplace + ylookup[...] + windowxy2.x-mirrorsx2 int const destofs = windowxy2.x-mirrorsx2-windowxy1.x-mirrorsx1; for (bssize_t y=0; y= 3) OSD_Printf("PR : Drawing rooms...\n"); diff --git a/polymer/eduke32/source/lunatic/defs_common.lua b/polymer/eduke32/source/lunatic/defs_common.lua index 572035a0e..34017fa62 100644 --- a/polymer/eduke32/source/lunatic/defs_common.lua +++ b/polymer/eduke32/source/lunatic/defs_common.lua @@ -385,7 +385,7 @@ const int32_t numyaxbunches; // XXX const int32_t totalclock; int32_t randomseed; // DEPRECATED const int32_t xdim, ydim; -const int32_t windowx1, windowy1, windowx2, windowy2; +const vec2_t windowxy1, windowxy2; ]] decl[[ diff --git a/polymer/eduke32/source/lunatic/dynsymlist b/polymer/eduke32/source/lunatic/dynsymlist index f665d8df3..2f5d5fe56 100644 --- a/polymer/eduke32/source/lunatic/dynsymlist +++ b/polymer/eduke32/source/lunatic/dynsymlist @@ -24,10 +24,8 @@ totalclock; randomseed; xdim; ydim; -windowx1; -windowy1; -windowx2; -windowy2; +windowxy1; +windowxy2; yxaspect; viewingrange; diff --git a/polymer/eduke32/source/lunatic/dynsymlist_m32 b/polymer/eduke32/source/lunatic/dynsymlist_m32 index 99f65e01f..4c16c1df0 100644 --- a/polymer/eduke32/source/lunatic/dynsymlist_m32 +++ b/polymer/eduke32/source/lunatic/dynsymlist_m32 @@ -24,10 +24,8 @@ totalclock; randomseed; xdim; ydim; -windowx1; -windowy1; -windowx2; -windowy2; +windowxy1; +windowxy2; yxaspect; viewingrange; diff --git a/polymer/eduke32/source/lunatic/lunacon.lua b/polymer/eduke32/source/lunatic/lunacon.lua index 095927362..b59d01b46 100644 --- a/polymer/eduke32/source/lunatic/lunacon.lua +++ b/polymer/eduke32/source/lunatic/lunacon.lua @@ -380,10 +380,10 @@ local function new_initial_gvartab() xdim = RO "_gv.xdim", ydim = RO "_gv.ydim", - windowx1 = RO "_gv.windowx1", - windowy1 = RO "_gv.windowy1", - windowx2 = RO "_gv.windowx2", - windowy2 = RO "_gv.windowy2", + windowx1 = RO "_gv.windowxy1.x", + windowy1 = RO "_gv.windowxy1.y", + windowx2 = RO "_gv.windowxy2.x", + windowy2 = RO "_gv.windowxy2.y", yxaspect = RO "_gv._get_yxaspect()", viewingrange = RO "_gv._get_viewingrange()", diff --git a/polymer/eduke32/source/sw/src/border.c b/polymer/eduke32/source/sw/src/border.c index c7ba794fd..fe6ffe14c 100644 --- a/polymer/eduke32/source/sw/src/border.c +++ b/polymer/eduke32/source/sw/src/border.c @@ -108,10 +108,10 @@ void SetCrosshair(void) { int wdx,wdy,x,y; - wdx = ((windowx2-windowx1)/2); - wdy = ((windowy2-windowy1)/2); - x = windowx1 + wdx; - y = windowy1 + wdy; + wdx = ((windowxy2.x-windowxy1.x)/2); + wdy = ((windowxy2.y-windowxy1.y)/2); + x = windowxy1.x + wdx; + y = windowxy1.y + wdy; CrosshairX = x / (xdim/320.0); CrosshairY = y / (ydim/200.0); @@ -197,12 +197,12 @@ SetFragBar(PLAYERp pp) //num_frag_bars = ((numplayers-1)/4)+1; num_frag_bars = ((OrigCommPlayers-1)/4)+1; - for (i = windowx1; i <= windowx2; i++) + for (i = windowxy1.x; i <= windowxy2.x; i++) { y = (tilesiz[FRAG_BAR].y * num_frag_bars) - (2 * (num_frag_bars-1)); y = y * (ydim/200.0); - if (windowy1 < y) + if (windowxy1.y < y) startumost[i] = y; } @@ -286,10 +286,10 @@ BorderShade(PLAYERp pp, SWBOOL refresh) PANEL_SPRITEp psp; uint8_t lines; - wx1 = windowx1 - 1; - wy1 = windowy1 - 1; - wx2 = windowx2 + 1; - wy2 = windowy2 + 1; + wx1 = windowxy1.x - 1; + wy1 = windowxy1.y - 1; + wx2 = windowxy2.x + 1; + wy2 = windowxy2.y + 1; for (lines = 0; lines < 4; lines++) { @@ -356,31 +356,31 @@ void DrawBorder(PLAYERp pp, short x, short y, short x2, short y2) k = i + tilesiz[BORDER_TILE].x; l = j + tilesiz[BORDER_TILE].y; - if (RectOverlap(i, j, k, l, x, y, windowx1-1, y2)) + if (RectOverlap(i, j, k, l, x, y, windowxy1.x-1, y2)) { // draw top box of the border - pSpawnFullScreenSpriteBox(pp, ID_BORDER_TOP, BORDER_TILE, PRI_BACK, i, j, x, y, windowx1-1, y2); + pSpawnFullScreenSpriteBox(pp, ID_BORDER_TOP, BORDER_TILE, PRI_BACK, i, j, x, y, windowxy1.x-1, y2); count++; } - if (RectOverlap(i, j, k, l, windowx2+1, y, x2, y2)) + if (RectOverlap(i, j, k, l, windowxy2.x+1, y, x2, y2)) { // draw bottom box of the border - pSpawnFullScreenSpriteBox(pp, ID_BORDER_BOTTOM, BORDER_TILE, PRI_BACK, i, j, windowx2+1, y, x2, y2); + pSpawnFullScreenSpriteBox(pp, ID_BORDER_BOTTOM, BORDER_TILE, PRI_BACK, i, j, windowxy2.x+1, y, x2, y2); count++; } - if (RectOverlap(i, j, k, l, windowx1, y, windowx2, windowy1-1)) + if (RectOverlap(i, j, k, l, windowxy1.x, y, windowxy2.x, windowxy1.y-1)) { // draw left box of the border - pSpawnFullScreenSpriteBox(pp, ID_BORDER_LEFT, BORDER_TILE, PRI_BACK, i, j, windowx1, y, windowx2, windowy1-1); + pSpawnFullScreenSpriteBox(pp, ID_BORDER_LEFT, BORDER_TILE, PRI_BACK, i, j, windowxy1.x, y, windowxy2.x, windowxy1.y-1); count++; } - if (RectOverlap(i, j, k, l, windowx1, windowy2+1, windowx2, y2)) + if (RectOverlap(i, j, k, l, windowxy1.x, windowxy2.y+1, windowxy2.x, y2)) { // draw right box of the border - pSpawnFullScreenSpriteBox(pp, ID_BORDER_RIGHT, BORDER_TILE, PRI_BACK, i, j, windowx1, windowy2+1, windowx2, y2); + pSpawnFullScreenSpriteBox(pp, ID_BORDER_RIGHT, BORDER_TILE, PRI_BACK, i, j, windowxy1.x, windowxy2.y+1, windowxy2.x, y2); count++; } } @@ -441,7 +441,7 @@ void BorderSetView(PLAYERp UNUSED(pp), int *Xdim, int *Ydim, int *ScreenSize) y2+=2; } - // global windowx1, windowx2, windowy1, windowy2 coords set here + // global windowxy1, windowxy2 coords set here setview(x, y, x2, y2); SetCrosshair(); } diff --git a/polymer/eduke32/source/sw/src/draw.c b/polymer/eduke32/source/sw/src/draw.c index 27af671a8..36f337087 100644 --- a/polymer/eduke32/source/sw/src/draw.c +++ b/polymer/eduke32/source/sw/src/draw.c @@ -1378,8 +1378,8 @@ void PrintLocationInfo(PLAYERp pp) { #define Y_STEP 7 #define AVERAGEFRAMES 16 - int x = windowx1+2; - int y = windowy1+2; + int x = windowxy1.x+2; + int y = windowxy1.y+2; static int frameval[AVERAGEFRAMES], framecnt = 0; int i; @@ -1421,8 +1421,8 @@ void SecretInfo(PLAYERp pp) { #define Y_STEP 7 #define AVERAGEFRAMES 16 - int x = windowx1+2; - int y = windowy1+2+8; + int x = windowxy1.x+2; + int y = windowxy1.y+2+8; extern short LevelSecrets,TotalKillable; if (CommEnabled || numplayers > 1) @@ -1444,8 +1444,8 @@ void SecretInfo(PLAYERp pp) void PrintSpriteInfo(PLAYERp pp) { #define Y_STEP 7 - int x = windowx1+2; - int y = windowy1+2; + int x = windowxy1.x+2; + int y = windowxy1.y+2; SPRITEp sp; USERp u; @@ -1843,8 +1843,8 @@ void DrawCrosshair(PLAYERp pp) if (dxy.x == 0) return; - wdx = windowx1 + ((windowx2-windowx1)/2); - wdy = windowy1 + ((windowy2-windowy1)/2); + wdx = windowxy1.x + ((windowxy2.x-windowxy1.x)/2); + wdy = windowxy1.y + ((windowxy2.y-windowxy1.y)/2); x = (dxy.y * wdx << 8) / dxy.x + (wdx << 8); y = (dz * wdx << 8) / dxy.x + (wdy << 8); diff --git a/polymer/eduke32/source/sw/src/game.c b/polymer/eduke32/source/sw/src/game.c index a80283619..350ccb1c5 100644 --- a/polymer/eduke32/source/sw/src/game.c +++ b/polymer/eduke32/source/sw/src/game.c @@ -5664,10 +5664,10 @@ SHOWSPRITE: if (sprisplayer) { if (gNet.MultiGameType != MULTI_GAME_COMMBAT || j == Player[screenpeek].PlayerSprite) - rotatesprite((x1 << 4) + (xdim << 15), (y1 << 4) + (ydim << 15), mulscale(czoom * (spr->yrepeat), yxaspect, 16), daang, 1196+pspr_ndx[myconnectindex], spr->shade, spr->pal, (spr->cstat & 2) >> 1, windowx1, windowy1, windowx2, windowy2); + rotatesprite((x1 << 4) + (xdim << 15), (y1 << 4) + (ydim << 15), mulscale(czoom * (spr->yrepeat), yxaspect, 16), daang, 1196+pspr_ndx[myconnectindex], spr->shade, spr->pal, (spr->cstat & 2) >> 1, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y); } else - rotatesprite((x1 << 4) + (xdim << 15), (y1 << 4) + (ydim << 15), mulscale(czoom * (spr->yrepeat), yxaspect, 16), daang, spr->picnum, spr->shade, spr->pal, (spr->cstat & 2) >> 1, windowx1, windowy1, windowx2, windowy2); + rotatesprite((x1 << 4) + (xdim << 15), (y1 << 4) + (ydim << 15), mulscale(czoom * (spr->yrepeat), yxaspect, 16), daang, spr->picnum, spr->shade, spr->pal, (spr->cstat & 2) >> 1, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y); } } } diff --git a/polymer/eduke32/source/sw/src/jsector.c b/polymer/eduke32/source/sw/src/jsector.c index 740f7ec6d..6f2222773 100644 --- a/polymer/eduke32/source/sw/src/jsector.c +++ b/polymer/eduke32/source/sw/src/jsector.c @@ -512,7 +512,8 @@ drawroomstotile(int daposx, int daposy, int daposz, int i, j, k, bakchainnumpages, bakvidoption; intptr_t bakframeplace; - int bakwindowx1, bakwindowy1, bakwindowx2, bakwindowy2, xsiz, ysiz; + vec2_t bakwindowxy1, bakwindowxy2; + int xsiz, ysiz; char *ptr1, *ptr2; // DRAWROOMS TO TILE BACKUP&SET CODE @@ -528,10 +529,8 @@ drawroomstotile(int daposx, int daposy, int daposz, loadtile(tilenume); bakframeplace = frameplace; frameplace = waloff[tilenume]; - bakwindowx1 = windowx1; - bakwindowy1 = windowy1; - bakwindowx2 = windowx2; - bakwindowy2 = windowy2; + bakwindowxy1 = windowxy1; + bakwindowxy2 = windowxy2; setview(0, 0, xsiz - 1, ysiz - 1); setvlinebpl(xsiz); j = 0; @@ -573,7 +572,7 @@ drawroomstotile(int daposx, int daposy, int daposz, } // DRAWROOMS TO TILE RESTORE CODE - setview(bakwindowx1, bakwindowy1, bakwindowx2, bakwindowy2); + setview(bakwindowxy1.x, bakwindowxy1.y, bakwindowxy2.x, bakwindowxy2.y); // chainnumpages = bakchainnumpages; numpages = bakchainnumpages; vidoption = bakvidoption; diff --git a/polymer/eduke32/source/sw/src/panel.c b/polymer/eduke32/source/sw/src/panel.c index 655175df4..23b53f925 100644 --- a/polymer/eduke32/source/sw/src/panel.c +++ b/polymer/eduke32/source/sw/src/panel.c @@ -7553,10 +7553,10 @@ pDisplaySprites(PLAYERp pp) } else { - x1 = windowx1; - y1 = windowy1; - x2 = windowx2; - y2 = windowy2; + x1 = windowxy1.x; + y1 = windowxy1.y; + x2 = windowxy2.x; + y2 = windowxy2.y; } if ((psp->State && TEST(psp->State->flags, psf_Xflip)) || TEST(psp->flags, PANF_XFLIP)) diff --git a/polymer/eduke32/source/testgame/src/bstub.c b/polymer/eduke32/source/testgame/src/bstub.c index 627f76c0f..33d499129 100644 --- a/polymer/eduke32/source/testgame/src/bstub.c +++ b/polymer/eduke32/source/testgame/src/bstub.c @@ -345,8 +345,8 @@ void ExtCheckKeys(void) dy = mulscale14(dy,daaspect); sinang = mulscale14(sinang,daviewingrange); cosang = mulscale14(cosang,daaspect); - p = ylookup[windowy1]+frameplace+windowx2+1; - for (y=windowy1; y<=windowy2; y++) + p = ylookup[windowxy1.y]+frameplace+windowxy2.x+1; + for (y=windowxy1.y; y<=windowxy2.y; y++) { i = divscale16(tsizyup15,dx); stretchhline(0,(xdim>>1)*i+tsizyup15,xdim>>2,i,mulscale32(i,dy)*tsizy+bufplc,p); diff --git a/polymer/eduke32/source/testgame/src/game.c b/polymer/eduke32/source/testgame/src/game.c index d4095b74c..c26828fb5 100644 --- a/polymer/eduke32/source/testgame/src/game.c +++ b/polymer/eduke32/source/testgame/src/game.c @@ -3884,20 +3884,20 @@ void drawscreen(short snum, int dasmoothratio) } drawmasks(); if ((numgrabbers[i] > 0) || (nummissiles[i] > 0) || (numbombs[i] > 0)) - rotatesprite(160<<16,184L<<16,65536,0,GUNONBOTTOM,sector[cursectnum[i]].floorshade,0,2,windowx1,windowy1,windowx2,windowy2); + rotatesprite(160<<16,184L<<16,65536,0,GUNONBOTTOM,sector[cursectnum[i]].floorshade,0,2,windowxy1.x,windowxy1.y,windowxy2.x,windowxy2.y); if (lockclock < 384) { if (lockclock < 128) - rotatesprite(320<<15,200<<15,lockclock<<9,lockclock<<4,DEMOSIGN,(128-lockclock)>>2,0,1+2,windowx1,windowy1,windowx2,windowy2); + rotatesprite(320<<15,200<<15,lockclock<<9,lockclock<<4,DEMOSIGN,(128-lockclock)>>2,0,1+2,windowxy1.x,windowxy1.y,windowxy2.x,windowxy2.y); else if (lockclock < 256) - rotatesprite(320<<15,200<<15,65536,0,DEMOSIGN,0,0,2,windowx1,windowy1,windowx2,windowy2); + rotatesprite(320<<15,200<<15,65536,0,DEMOSIGN,0,0,2,windowxy1.x,windowxy1.y,windowxy2.x,windowxy2.y); else - rotatesprite(320<<15,200<<15,(384-lockclock)<<9,lockclock<<4,DEMOSIGN,(lockclock-256)>>2,0,1+2,windowx1,windowy1,windowx2,windowy2); + rotatesprite(320<<15,200<<15,(384-lockclock)<<9,lockclock<<4,DEMOSIGN,(lockclock-256)>>2,0,1+2,windowxy1.x,windowxy1.y,windowxy2.x,windowxy2.y); } if (health[i] <= 0) - rotatesprite(320<<15,200<<15,(-health[i])<<11,(-health[i])<<5,NO,0,0,2,windowx1,windowy1,windowx2,windowy2); + rotatesprite(320<<15,200<<15,(-health[i])<<11,(-health[i])<<5,NO,0,0,2,windowxy1.x,windowxy1.y,windowxy2.x,windowxy2.y); } } else @@ -3962,9 +3962,9 @@ void drawscreen(short snum, int dasmoothratio) //Temp horizon if (getrendermode() == 0) { - l = scale(choriz-100,windowx2-windowx1,320)+((windowy1+windowy2)>>1); + l = scale(choriz-100,windowxy2.x-windowxy1.x,320)+((windowxy1.y+windowxy2.y)>>1); begindrawing(); //{{{ - for (y1=windowy1,y2=windowy2; y1 256) i = 512-i; i = sintable[i+512]*8 + sintable[i]*5L; if (detailmode == 0) i >>= 1; - rotatesprite(320<<15,200<<15,i,tiltlock+512,TILE_TILT,0,0,2+4+64,windowx1,windowy1,windowx2,windowy2); + rotatesprite(320<<15,200<<15,i,tiltlock+512,TILE_TILT,0,0,2+4+64,windowxy1.x,windowxy1.y,windowxy2.x,windowxy2.y); walock[TILE_TILT] = 1; } } @@ -4067,19 +4067,19 @@ void drawscreen(short snum, int dasmoothratio) if (((numgrabbers[screenpeek] > 0) || (nummissiles[screenpeek] > 0) || (numbombs[screenpeek] > 0)) && (cameradist < 0)) { //Reset startdmost to bottom of screen - if ((windowx1 == 0) && (windowx2 == 319) && (yxaspect == 65536) && (tiltlock == 0)) + if ((windowxy1.x == 0) && (windowxy2.x == 319) && (yxaspect == 65536) && (tiltlock == 0)) { - x1 = 160L-(tilesiz[GUNONBOTTOM].x>>1); y1 = windowy2+1; + x1 = 160L-(tilesiz[GUNONBOTTOM].x>>1); y1 = windowxy2.y+1; for (i=0; i>2,0,1+2,windowx1,windowy1,windowx2,windowy2); + rotatesprite(320<<15,200<<15,lockclock<<9,lockclock<<4,DEMOSIGN,(128-lockclock)>>2,0,1+2,windowxy1.x,windowxy1.y,windowxy2.x,windowxy2.y); else if (lockclock < 256) - rotatesprite(320<<15,200<<15,65536,0,DEMOSIGN,0,0,2,windowx1,windowy1,windowx2,windowy2); + rotatesprite(320<<15,200<<15,65536,0,DEMOSIGN,0,0,2,windowxy1.x,windowxy1.y,windowxy2.x,windowxy2.y); else - rotatesprite(320<<15,200<<15,(384-lockclock)<<9,lockclock<<4,DEMOSIGN,(lockclock-256)>>2,0,1+2,windowx1,windowy1,windowx2,windowy2); + rotatesprite(320<<15,200<<15,(384-lockclock)<<9,lockclock<<4,DEMOSIGN,(lockclock-256)>>2,0,1+2,windowxy1.x,windowxy1.y,windowxy2.x,windowxy2.y); } if (health[screenpeek] <= 0) - rotatesprite(320<<15,200<<15,(-health[screenpeek])<<11,(-health[screenpeek])<<5,NO,0,0,2,windowx1,windowy1,windowx2,windowy2); + rotatesprite(320<<15,200<<15,(-health[screenpeek])<<11,(-health[screenpeek])<<5,NO,0,0,2,windowxy1.x,windowxy1.y,windowxy2.x,windowxy2.y); } } @@ -6038,7 +6038,7 @@ void drawoverheadmap(int cposx, int cposy, int czoom, short cang) { daang = (spr->ang-cang)&2047; if (j == playersprite[screenpeek]) { x1 = 0; y1 = 0; daang = 0; } - rotatesprite((x1<<4)+(xdim<<15),(y1<<4)+(ydim<<15),mulscale16(czoom*spr->yrepeat,yxaspect),daang,spr->picnum,spr->shade,spr->pal,(spr->cstat&2)>>1,windowx1,windowy1,windowx2,windowy2); + rotatesprite((x1<<4)+(xdim<<15),(y1<<4)+(ydim<<15),mulscale16(czoom*spr->yrepeat,yxaspect),daang,spr->picnum,spr->shade,spr->pal,(spr->cstat&2)>>1,windowxy1.x,windowxy1.y,windowxy2.x,windowxy2.y); } } break;