diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index eaae01e6e..19020c6c5 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -228,7 +228,7 @@ void viewGetFontInfo(int id, const char *unk1, int *pXSize, int *pYSize) for (const char *pBuf = unk1; *pBuf != 0; pBuf++) { int tile = ((*pBuf-32)&127)+pFont->tile; - if (tilesiz[tile].x != 0 && tilesiz[tile].y != 0) + if (tileGetTexture(tile)->isValid()) width += tilesiz[tile].x+pFont->space; } if (pXSize) diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 9307e74ce..6b029638a 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -3936,7 +3936,7 @@ PALONLY: // XXX: t->picnum can be out-of-bounds by bad user code. if (viewtype > 0) - while (tilesiz[t->picnum].x == 0 && t->picnum > 0) + while (!tileGetTexture(t->picnum)->isValid() && t->picnum > 0) t->picnum -= l; //Hack, for actors if (actor[i].dispicnum >= 0) diff --git a/source/duke3d/src/sbar.cpp b/source/duke3d/src/sbar.cpp index 479bb4045..94651edff 100644 --- a/source/duke3d/src/sbar.cpp +++ b/source/duke3d/src/sbar.cpp @@ -1052,7 +1052,7 @@ void G_DrawBackground(void) // XXX: if dapicnum is not available, this might leave the menu background // not drawn, leading to "HOM". - if ((dapicnum >= 0 && tilesiz[dapicnum].x == 0) || (dapicnum >= 0 && tilesiz[dapicnum].y == 0) || + if ((dapicnum >= 0 && !tileGetTexture(dapicnum)->isValid()) || (windowxy1.x-1 <= 0 && windowxy2.x >= xdim-1 && windowxy1.y-1 <= 0 && windowxy2.y >= ydim-1) || dapicnum < 0) { diff --git a/source/duke3d/src/screens.cpp b/source/duke3d/src/screens.cpp index aafe1a255..4a9014b6f 100644 --- a/source/duke3d/src/screens.cpp +++ b/source/duke3d/src/screens.cpp @@ -446,8 +446,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 { if (wal->nextwall >= 0) continue; - if (tilesiz[wal->picnum].x == 0) continue; - if (tilesiz[wal->picnum].y == 0) continue; + if (!tileGetTexture(wal->picnum)->isValid()) continue; if (j == k) { diff --git a/source/exhumed/src/map.cpp b/source/exhumed/src/map.cpp index 7ebe07cbe..0515b1f9c 100644 --- a/source/exhumed/src/map.cpp +++ b/source/exhumed/src/map.cpp @@ -383,8 +383,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 { if (wal->nextwall >= 0) continue; - if (tilesiz[wal->picnum].x == 0) continue; - if (tilesiz[wal->picnum].y == 0) continue; + if (!tileGetTexture(wal->picnum)->isValid()) continue; if (j == k) { diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index 6e61b1be2..4f4cfdc6d 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -5349,7 +5349,7 @@ default_case2: // XXX: t->picnum can be out-of-bounds by bad user code. if (l > 0) - while (tilesiz[t->picnum].x == 0 && t->picnum > 0) + while (!tileGetTexture(t->picnum)->isValid() && t->picnum > 0) t->picnum -= l; //Hack, for actors if (actor[i].dispicnum >= 0) diff --git a/source/rr/src/rrdh.cpp b/source/rr/src/rrdh.cpp index 51606eecc..a57247323 100644 --- a/source/rr/src/rrdh.cpp +++ b/source/rr/src/rrdh.cpp @@ -3453,8 +3453,7 @@ void sub_57B38(long cposx, long cposy, long czoom, short cang) if ((show2dwall[j>>3]&(1<<(j&7))) == 0) continue; - if (tilesiz[wal->picnum].x == 0) continue; - if (tilesiz[wal->picnum].y == 0) continue; + if (!tileGetTexture(wal->picnum)->isValid()) continue; if (j == k) { x1 = x2; y1 = y2; } diff --git a/source/rr/src/sbar.cpp b/source/rr/src/sbar.cpp index d69f64dc5..d42984cec 100644 --- a/source/rr/src/sbar.cpp +++ b/source/rr/src/sbar.cpp @@ -1461,7 +1461,7 @@ void G_DrawBackground(void) // XXX: if dapicnum is not available, this might leave the menu background // not drawn, leading to "HOM". - if ((dapicnum >= 0 && tilesiz[dapicnum].x == 0) || (dapicnum >= 0 && tilesiz[dapicnum].y == 0) || + if ((dapicnum >= 0 && !tileGetTexture(dapicnum)->isValid()) || (windowxy1.x-1 <= 0 && windowxy2.x >= xdim-1 && windowxy1.y-1 <= 0 && windowxy2.y >= ydim-1) || dapicnum < 0) { diff --git a/source/rr/src/screens.cpp b/source/rr/src/screens.cpp index 341f873d7..d08ae07c9 100644 --- a/source/rr/src/screens.cpp +++ b/source/rr/src/screens.cpp @@ -446,8 +446,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 { if (wal->nextwall >= 0) continue; - if (tilesiz[wal->picnum].x == 0) continue; - if (tilesiz[wal->picnum].y == 0) continue; + if (!tileGetTexture(wal->picnum)->isValid()) continue; if (j == k) { diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 5c0c75ad8..2c15a42bc 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -3679,10 +3679,7 @@ SHOWSPRITE: if (!mapcheat && (show2dwall[j >> 3] & (1 << (j & 7))) == 0) continue; - if (tilesiz[wal->picnum].x == 0) - continue; - if (tilesiz[wal->picnum].y == 0) - continue; + if (!tileGetTexture(wal->picnum)->isValid()) continue; ox = wal->x - cposx; oy = wal->y - cposy;