diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 9323e0093..c57f3fddc 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -1198,7 +1198,7 @@ static void sortsprites(int const start, int const end) if ((s->cstat&48) != 32) { int32_t yoff = tileTopOffset(s->picnum) + s->yoffset; - int32_t yspan = (tilesiz[s->picnum].y*s->yrepeat<<2); + int32_t yspan = (tileHeight(s->picnum) * s->yrepeat << 2); spritesxyz[k].z -= (yoff*s->yrepeat)<<2; diff --git a/source/build/src/mdsprite.cpp b/source/build/src/mdsprite.cpp index 51370b9a0..4f6f54391 100644 --- a/source/build/src/mdsprite.cpp +++ b/source/build/src/mdsprite.cpp @@ -1260,7 +1260,7 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr) const int32_t owner = tspr->owner; const spriteext_t *const sext = &spriteext[((unsigned)owner < MAXSPRITES+MAXUNIQHUDID) ? owner : MAXSPRITES+MAXUNIQHUDID-1]; const uint8_t lpal = ((unsigned)owner < MAXSPRITES) ? sprite[tspr->owner].pal : tspr->pal; - const int32_t sizyrep = tilesiz[tspr->picnum].y*tspr->yrepeat; + const int32_t sizyrep = tileHeight(tspr->picnum) * tspr->yrepeat; polymost_outputGLDebugMessage(3, "polymost_md3draw(m:%p, tspr:%p)", m, tspr); // if ((tspr->cstat&48) == 32) return 0; diff --git a/source/exhumed/src/bullet.cpp b/source/exhumed/src/bullet.cpp index f63b793d5..9c287ce00 100644 --- a/source/exhumed/src/bullet.cpp +++ b/source/exhumed/src/bullet.cpp @@ -148,7 +148,7 @@ void IgniteSprite(int nSprite) sprite[nAnimSprite].hitag = nSprite; changespritestat(nAnimSprite, kStatIgnited); - short yRepeat = (tilesiz[sprite[nAnimSprite].picnum].y * 32) / nFlameHeight; + short yRepeat = (tileHeight(sprite[nAnimSprite].picnum) * 32) / nFlameHeight; if (yRepeat < 1) yRepeat = 1; diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index 9fcbf267f..e8010126b 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -240,7 +240,7 @@ void DrawClock() while (nVal) { int v2 = nVal & 0xF; - int yPos = 32 - tilesiz[v2 + kClockSymbol1].y / 2; + int yPos = 32 - tileHeight(v2 + kClockSymbol1) / 2; CopyTileToBitmap(v2 + kClockSymbol1, kTile3603, ebp - tilesiz[v2 + kClockSymbol1].x / 2, yPos); @@ -570,7 +570,7 @@ void mydeletesprite(int nSprite) void CopyTileToBitmap(short nSrcTile, short nDestTile, int xPos, int yPos) { - int nOffs = tilesiz[nDestTile].y * xPos; + int nOffs = tileHeight(nDestTile) * xPos; auto pixels = TileFiles.tileMakeWritable(nDestTile); uint8_t *pDest = pixels + nOffs + yPos; @@ -578,8 +578,8 @@ void CopyTileToBitmap(short nSrcTile, short nDestTile, int xPos, int yPos) tileLoad(nSrcTile); - int destYSize = tilesiz[nDestTile].y; - int srcYSize = tilesiz[nSrcTile].y; + int destYSize = tileHeight(nDestTile); + int srcYSize = tileHeight(nSrcTile); const uint8_t *pSrc = tilePtr(nSrcTile); diff --git a/source/exhumed/src/lighting.cpp b/source/exhumed/src/lighting.cpp index 4692b85a2..8360270ea 100644 --- a/source/exhumed/src/lighting.cpp +++ b/source/exhumed/src/lighting.cpp @@ -631,7 +631,7 @@ void AddFlow(int nSprite, int nSpeed, int b) short nAngle = sprite[nSprite].ang; sFlowInfo[nFlow].field_14 = (tilesiz[nPic].x << 14) - 1; - sFlowInfo[nFlow].field_18 = (tilesiz[nPic].y << 14) - 1; + sFlowInfo[nFlow].field_18 = (tileHeight(nPic) << 14) - 1; sFlowInfo[nFlow].field_C = -bcos(nAngle) * nSpeed; sFlowInfo[nFlow].field_10 = bsin(nAngle) * nSpeed; } @@ -650,7 +650,7 @@ void AddFlow(int nSprite, int nSpeed, int b) short nPic = wall[var_18].picnum; sFlowInfo[nFlow].field_14 = (tilesiz[nPic].x * wall[var_18].xrepeat) << 8; - sFlowInfo[nFlow].field_18 = (tilesiz[nPic].y * wall[var_18].yrepeat) << 8; + sFlowInfo[nFlow].field_18 = (tileHeight(nPic) * wall[var_18].yrepeat) << 8; sFlowInfo[nFlow].field_C = -bcos(nAngle) * nSpeed; sFlowInfo[nFlow].field_10 = bsin(nAngle) * nSpeed; } diff --git a/source/exhumed/src/move.cpp b/source/exhumed/src/move.cpp index eddbc068a..e1b3a9eef 100644 --- a/source/exhumed/src/move.cpp +++ b/source/exhumed/src/move.cpp @@ -500,7 +500,7 @@ int movespritez(short nSprite, int z, int height, int, int clipdist) int GetSpriteHeight(int nSprite) { - return tilesiz[sprite[nSprite].picnum].y * sprite[nSprite].yrepeat * 4; + return tileHeight(sprite[nSprite].picnum) * sprite[nSprite].yrepeat * 4; } int movesprite(short nSprite, int dx, int dy, int dz, int, int flordist, unsigned int clipmask) @@ -1184,7 +1184,7 @@ int AngleChase(int nSprite, int nSprite2, int ebx, int ecx, int push1) } else { - int nHeight = tilesiz[sprite[nSprite2].picnum].y * sprite[nSprite2].yrepeat * 2; + int nHeight = tileHeight(sprite[nSprite2].picnum) * sprite[nSprite2].yrepeat * 2; int nMyAngle = GetMyAngle(sprite[nSprite2].x - sprite[nSprite].x, sprite[nSprite2].y - sprite[nSprite].y); diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index f3725f8e0..b79e00405 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -243,7 +243,7 @@ void InitPlayerInventory(short nPlayer) auto pixels = tilePtr(kTile3571 + nPlayer); - nPlayerColor[nPlayer] = pixels[tilesiz[nPlayer + kTile3571].x * tilesiz[nPlayer + kTile3571].y / 2]; + nPlayerColor[nPlayer] = pixels[tilesiz[nPlayer + kTile3571].x * tileHeight(nPlayer + kTile3571) / 2]; } // done diff --git a/source/exhumed/src/queen.cpp b/source/exhumed/src/queen.cpp index e77b8b0aa..4dbb29030 100644 --- a/source/exhumed/src/queen.cpp +++ b/source/exhumed/src/queen.cpp @@ -244,7 +244,7 @@ int QueenAngleChase(short nSprite, short nSprite2, int val1, int val2) else { spritetype *pSprite2 = &sprite[nSprite2]; - int nTileY = (tilesiz[pSprite2->picnum].y * pSprite2->yrepeat) * 2; + int nTileY = (tileHeight(pSprite2->picnum) * pSprite2->yrepeat) * 2; int nMyAngle = GetMyAngle(pSprite2->x - pSprite->x, pSprite2->y - pSprite->y); diff --git a/source/exhumed/src/ramses.cpp b/source/exhumed/src/ramses.cpp index 13fa68772..d285799ed 100644 --- a/source/exhumed/src/ramses.cpp +++ b/source/exhumed/src/ramses.cpp @@ -277,7 +277,7 @@ void DoSpiritHead() int srctile = nMouthTile + 598; auto src = tilePtr(srctile); int sizx = tilesiz[srctile].x; - int sizy = tilesiz[srctile].y; + int sizy = tileHeight(srctile); int workptr = 212 * (97 - sizx / 2) + 159 - sizy; int srcptr = 0; while (sizx > 0) diff --git a/source/exhumed/src/sequence.cpp b/source/exhumed/src/sequence.cpp index 4e3d7a44b..b279f69fa 100644 --- a/source/exhumed/src/sequence.cpp +++ b/source/exhumed/src/sequence.cpp @@ -335,7 +335,7 @@ void seq_LoadSequences() nShadowPic = seq_GetFirstSeqPicnum(kSeqShadow); nShadowWidth = tilesiz[nShadowPic].x; - nFlameHeight = tilesiz[seq_GetFirstSeqPicnum(kSeqFirePoof)].y; + nFlameHeight = tileHeight(seq_GetFirstSeqPicnum(kSeqFirePoof)); nBackgroundPic = seq_GetFirstSeqPicnum(kSeqBackgrnd); diff --git a/source/exhumed/src/spider.cpp b/source/exhumed/src/spider.cpp index f1ff26cf8..d12184b11 100644 --- a/source/exhumed/src/spider.cpp +++ b/source/exhumed/src/spider.cpp @@ -225,7 +225,7 @@ void FuncSpider(int a, int nDamage, int nRun) if (sprite[nSprite].cstat & 8) { sprite[nSprite].zvel = 0; - sprite[nSprite].z = sector[nSector].ceilingz + (tilesiz[sprite[nSprite].picnum].y << 5); + sprite[nSprite].z = sector[nSector].ceilingz + (tileHeight(sprite[nSprite].picnum) << 5); if (sector[nSector].ceilingstat & 1) { diff --git a/source/exhumed/src/status.cpp b/source/exhumed/src/status.cpp index f9c59ae16..40fc665f7 100644 --- a/source/exhumed/src/status.cpp +++ b/source/exhumed/src/status.cpp @@ -124,7 +124,7 @@ void InitStatus() nMagicFrame = 0; nHealthLevel = 0; nMagicLevel = 0; - nMeterRange = tilesiz[nPicNum].y; + nMeterRange = tileHeight(nPicNum); magicperline = 1000 / nMeterRange; healthperline = 800 / nMeterRange; nAirFrames = SeqSize[nStatusSeqOffset + 133]; diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 52d094857..018c89455 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -2086,7 +2086,7 @@ static void rrra_specialstats() { s->xrepeat >>= 1; s->yrepeat >>= 1; - s->clipdist = mulscale7(s->xrepeat, tilesiz[s->picnum].y); + s->clipdist = mulscale7(s->xrepeat, tileHeight(s->picnum)); } break; } diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index 16a63d852..74193b023 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -381,8 +381,8 @@ int startrts(int lumpNum, int localPlayer) ReservedSpace GameInterface::GetReservedScreenSpace(int viewsize) { - // todo: factor in the frag bar: tilesiz[TILE_FRAGBAR].y - int sbar = tilesiz[TILE_BOTTOMSTATUSBAR].y; + // todo: factor in the frag bar: tileHeight(TILE_FRAGBAR) + int sbar = tileHeight(TILE_BOTTOMSTATUSBAR); if (isRR()) { sbar >>= 1; diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 9b9c45efd..ae426fa4f 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -1740,7 +1740,7 @@ int ParseState::parse(void) insptr++; - if ((g_sp->picnum == TILE_APLAYER && g_sp->yrepeat < 36) || *insptr < g_sp->yrepeat || ((g_sp->yrepeat * (tilesiz[g_sp->picnum].y + 8)) << 2) < (g_ac->floorz - g_ac->ceilingz)) + if ((g_sp->picnum == TILE_APLAYER && g_sp->yrepeat < 36) || *insptr < g_sp->yrepeat || ((g_sp->yrepeat * (tileHeight(g_sp->picnum) + 8)) << 2) < (g_ac->floorz - g_ac->ceilingz)) { j = ((*insptr) - g_sp->yrepeat) << 1; if (abs(j)) g_sp->yrepeat += ksgn(j); diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index b68e2221f..9c0af6c37 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -197,8 +197,9 @@ void displaymasks_d(int snum, double) if (ps[snum].scuba_on) { - hud_drawsprite(44, (200 - tilesiz[SCUBAMASK].y), 65536, 0, SCUBAMASK, 0, p, 2 + 16); - hud_drawsprite((320 - 43), (200 - tilesiz[SCUBAMASK].y), 65536, 0, SCUBAMASK, 0, p, 2 + 4 + 16); + int y = 200 - tileHeight(SCUBAMASK); + hud_drawsprite(44, y, 65536, 0, SCUBAMASK, 0, p, 2 + 16); + hud_drawsprite((320 - 43), y, 65536, 0, SCUBAMASK, 0, p, 2 + 4 + 16); } } diff --git a/source/games/duke/src/hudweapon_r.cpp b/source/games/duke/src/hudweapon_r.cpp index 925d993ee..228b23cfa 100644 --- a/source/games/duke/src/hudweapon_r.cpp +++ b/source/games/duke/src/hudweapon_r.cpp @@ -80,9 +80,9 @@ void displaymasks_r(int snum, double smoothratio) // to get the proper clock value with regards to interpolation we have add a smoothratio based offset to the value. double interpclock = ud.levelclock + (TICSPERFRAME/65536.) * smoothratio; int pin = RS_STRETCH; - hud_drawsprite((320 - (tilesiz[SCUBAMASK].x >> 1) - 15), (200 - (tilesiz[SCUBAMASK].y >> 1) + bsinf(interpclock, -10)), 49152, 0, SCUBAMASK, 0, p, 2 + 16 + pin); - hud_drawsprite((320 - tilesiz[SCUBAMASK + 4].x), (200 - tilesiz[SCUBAMASK + 4].y), 65536, 0, SCUBAMASK + 4, 0, p, 2 + 16 + pin); - hud_drawsprite(tilesiz[SCUBAMASK + 4].x, (200 - tilesiz[SCUBAMASK + 4].y), 65536, 0, SCUBAMASK + 4, 0, p, 2 + 4 + 16 + pin); + hud_drawsprite((320 - (tilesiz[SCUBAMASK].x >> 1) - 15), (200 - (tileHeight(SCUBAMASK) >> 1) + bsinf(interpclock, -10)), 49152, 0, SCUBAMASK, 0, p, 2 + 16 + pin); + hud_drawsprite((320 - tilesiz[SCUBAMASK + 4].x), (200 - tileHeight(SCUBAMASK + 4)), 65536, 0, SCUBAMASK + 4, 0, p, 2 + 16 + pin); + hud_drawsprite(tilesiz[SCUBAMASK + 4].x, (200 - tileHeight(SCUBAMASK + 4)), 65536, 0, SCUBAMASK + 4, 0, p, 2 + 4 + 16 + pin); hud_drawsprite(35, (-1), 65536, 0, SCUBAMASK + 3, 0, p, 2 + 16 + pin); hud_drawsprite(285, 200, 65536, 1024, SCUBAMASK + 3, 0, p, 2 + 16 + pin); } diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 917a6a431..bc11ca362 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -1038,7 +1038,7 @@ void shoot_d(DDukeActor* actor, int atwith) sa = s->ang; sx = s->x; sy = s->y; - sz = s->z - ((s->yrepeat * tilesiz[s->picnum].y) << 1) + (4 << 8); + sz = s->z - (s->yrepeat * tileHeight(s->picnum) << 1) + (4 << 8); if (s->picnum != ROTATEGUN) { sz -= (7 << 8); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 74b69ccf7..f9037e6ac 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -858,7 +858,7 @@ void shoot_r(DDukeActor* actor, int atwith) sa = s->ang; sx = s->x; sy = s->y; - sz = s->z - ((s->yrepeat * tilesiz[s->picnum].y) << 1) + (4 << 8); + sz = s->z - ((s->yrepeat * tileHeight(s->picnum)) << 1) + (4 << 8); sz -= (7 << 8); if (badguy(s)) { diff --git a/source/games/duke/src/sbar_d.cpp b/source/games/duke/src/sbar_d.cpp index 72a9e1142..c47347866 100644 --- a/source/games/duke/src/sbar_d.cpp +++ b/source/games/duke/src/sbar_d.cpp @@ -67,7 +67,7 @@ public: digiFont = Create(DigiFont, 1, Off, 1, 1 ); // optionally draw at the top of the screen. - SetSize(tilesiz[TILE_BOTTOMSTATUSBAR].y); + SetSize(tileHeight(TILE_BOTTOMSTATUSBAR)); scale = 1; ammo_sprites = { -1, AMMO, SHOTGUNAMMO, BATTERYAMMO, RPGAMMO, HBOMBAMMO, CRYSTALAMMO, DEVISTATORAMMO, TRIPBOMBSPRITE, FREEZEAMMO + 1, HBOMBAMMO, GROWAMMO, FLAMETHROWERAMMO + 1 }; @@ -283,13 +283,13 @@ public: { DrawInventory(p, 0, -46, DI_SCREEN_CENTER_BOTTOM); FullscreenHUD1(p, snum); - PrintLevelStats(tilesiz[BIGALPHANUM].y +10); + PrintLevelStats(tileHeight(BIGALPHANUM) +10); } else if (style == 2) { DrawInventory(p, (ud.multimode > 1) ? 56 : 65, -28, DI_SCREEN_CENTER_BOTTOM); FullscreenHUD2(p); - PrintLevelStats(tilesiz[HEALTHBOX].y + 4); + PrintLevelStats(tileHeight(HEALTHBOX) + 4); } else { @@ -386,7 +386,7 @@ public: void Statusbar(int snum) { auto p = &ps[snum]; - int h = tilesiz[BOTTOMSTATUSBAR].y; + int h = tileHeight(BOTTOMSTATUSBAR); int top = 200 - h; int left = (320 - tilesiz[BOTTOMSTATUSBAR].x) / 2; BeginStatusBar(320, 200, h); diff --git a/source/games/duke/src/sbar_r.cpp b/source/games/duke/src/sbar_r.cpp index 41cd9fdd7..14280b2b6 100644 --- a/source/games/duke/src/sbar_r.cpp +++ b/source/games/duke/src/sbar_r.cpp @@ -57,7 +57,7 @@ public: digiFont = Create(DigiFont, 2, Off, 1, 1 ); // optionally draw at the top of the screen. - SetSize(tilesiz[BOTTOMSTATUSBAR].y); + SetSize(tileHeight(BOTTOMSTATUSBAR)); scale = 0.5; ammo_sprites = { -1, AMMO, SHOTGUNAMMO, BATTERYAMMO, HBOMBAMMO, HBOMBAMMO, SAWAMMO, DEVISTATORAMMO, TRIPBOMBSPRITE, GROWSPRITEICON, HBOMBAMMO, -1, BOWLINGBALLSPRITE, MOTOAMMO, BOATAMMO, -1, RPG2SPRITE }; item_icons = { 0, FIRSTAID_ICON, STEROIDS_ICON, HOLODUKE_ICON, JETPACK_ICON, HEAT_ICON, AIRTANK_ICON, BOOT_ICON }; @@ -277,13 +277,13 @@ public: y -= 4; DrawInventory(p, 0, y, DI_SCREEN_CENTER_BOTTOM); FullscreenHUD1(p, snum); - PrintLevelStats(scale * tilesiz[BIGALPHANUM].y + 10); + PrintLevelStats(scale * tileHeight(BIGALPHANUM) + 10); } else if (style == 2) { DrawInventory(p, 56, -20, DI_SCREEN_CENTER_BOTTOM); FullscreenHUD2(p); - PrintLevelStats(scale * tilesiz[HEALTHBOX].y + 4); + PrintLevelStats(scale * tileHeight(HEALTHBOX) + 4); } else { @@ -345,9 +345,9 @@ public: void Statusbar(int snum) { auto p = &ps[snum]; - double h = tilesiz[BOTTOMSTATUSBAR].y * scale; + double h = tileHeight(BOTTOMSTATUSBAR) * scale; double wh = 0; - if (hud_size < Hud_Stbar) wh = tilesiz[WEAPONBAR].y * scale; + if (hud_size < Hud_Stbar) wh = tileHeight(WEAPONBAR) * scale; double left = (320 - tilesiz[BOTTOMSTATUSBAR].x * scale) / 2; double top = 200 - h; diff --git a/source/sw/src/jsector.cpp b/source/sw/src/jsector.cpp index d3c007783..81533527b 100644 --- a/source/sw/src/jsector.cpp +++ b/source/sw/src/jsector.cpp @@ -462,7 +462,7 @@ void JS_InitMirrors(void) void drawroomstotile(int daposx, int daposy, int daposz, fixed_t daq16ang, fixed_t daq16horiz, short dacursectnum, short tilenume) { - TileFiles.MakeCanvas(tilenume, tilesiz[tilenume].x, tilesiz[tilenume].y); + TileFiles.MakeCanvas(tilenume, tilesiz[tilenume].x, tileHeight(tilenume)); auto canvas = renderSetTarget(tilenume); if (!canvas) return; diff --git a/source/sw/src/panel.cpp b/source/sw/src/panel.cpp index 6fb42da50..7cc4c783f 100644 --- a/source/sw/src/panel.cpp +++ b/source/sw/src/panel.cpp @@ -876,7 +876,7 @@ void SpecialUziRetractFunc(PANEL_SPRITEp psp) psp->oy = psp->y; psp->y += 4 * synctics; - if (psp->y >= 200 + tilesiz[psp->picnum].y) + if (psp->y >= 200 + tileHeight(psp->picnum)) { pKillSprite(psp); } @@ -1983,7 +1983,7 @@ pUziReloadRetract(PANEL_SPRITEp nclip) gun->yfract = LSW(ygun); gun->y = ygun / FRACUNIT; - if (gun->y > UZI_RELOAD_YOFF + tilesiz[gun->picndx].y) + if (gun->y > UZI_RELOAD_YOFF + tileHeight(gun->picndx)) { pSetState(gun, ps_UziDoneReload); pKillSprite(nclip); @@ -2193,7 +2193,7 @@ InitWeaponUzi2(PANEL_SPRITEp uzi_orig) pp->WpnUziType = 0; // 0 is up, 1 is retract New = pSpawnSprite(pp, ps_PresentUzi2, PRI_MID, 160 - UZI_XOFF, UZI_YOFF); - New->y += tilesiz[New->picndx].y; + New->y += tileHeight(New->picndx); New->oy = New->y; uzi_orig->sibling = New; @@ -2219,7 +2219,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 += tilesiz[New->picndx].y; + New->y += tileHeight(New->picndx); New->oy = New->y; SET(New->flags, PANF_XFLIP); diff --git a/source/sw/src/sbar.cpp b/source/sw/src/sbar.cpp index 1b5d8bfbb..9dbb243ce 100644 --- a/source/sw/src/sbar.cpp +++ b/source/sw/src/sbar.cpp @@ -274,7 +274,7 @@ private: // frag bar 0 or 1 frag_bar = ((pnum) / 4); // move y down according to frag bar number - ys = ys + (tilesiz[FRAG_BAR].y - 2) * frag_bar; + ys = ys + (tileHeight(FRAG_BAR) - 2) * frag_bar; // move x over according to the number of players xs = xoffs[MOD4(pnum)]; @@ -308,7 +308,7 @@ private: // frag bar 0 or 1 frag_bar = ((pnum) / 4); // move y down according to frag bar number - ys = ys + (tilesiz[FRAG_BAR].y - 2) * frag_bar; + ys = ys + (tileHeight(FRAG_BAR) - 2) * frag_bar; // move x over according to the number of players xs = xoffs[MOD4(pnum)]; @@ -345,14 +345,14 @@ private: for (i = windowxy1.x; i <= windowxy2.x; i++) { - y = (tilesiz[FRAG_BAR].y * num_frag_bars) - (2 * (num_frag_bars - 1)); + y = (tileHeight(FRAG_BAR) * num_frag_bars) - (2 * (num_frag_bars - 1)); y = y * (ydim / 200.0); } for (i = 0, y = 0; i < num_frag_bars; i++) { DrawGraphic(tileGetTexture(FRAG_BAR), 0, y, DI_ITEM_LEFT_TOP, 1, -1, -1, 1, 1); - y += tilesiz[FRAG_BAR].y - 2; + y += tileHeight(FRAG_BAR) - 2; } DisplayFragNames(); DisplayFragNumbers(); @@ -450,7 +450,7 @@ private: xsize = tilesiz[PANEL_KEY_RED].x + 1; - ysize = tilesiz[PANEL_KEY_RED].y + 2; + ysize = tileHeight(PANEL_KEY_RED) + 2; i = 0; for (row = 0; row < 2; row++) diff --git a/source/sw/src/weapon.cpp b/source/sw/src/weapon.cpp index e657d3126..25a858219 100644 --- a/source/sw/src/weapon.cpp +++ b/source/sw/src/weapon.cpp @@ -16098,7 +16098,7 @@ WallSpriteInsideSprite(SPRITEp wsp, SPRITEp sp) x1 = wsp->x; y1 = wsp->y; - xoff = (int) TILE_XOFF(wsp->picnum) + (int) wsp->xoffset; + xoff = (int) tileLeftOffset(wsp->picnum) + (int) wsp->xoffset; if (TEST(wsp->cstat, CSTAT_SPRITE_XFLIP)) xoff = -xoff;