mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-28 12:30:46 +00:00
- removed all remaining uses of tilesiz.
This commit is contained in:
parent
d60bc8be9f
commit
169d708547
17 changed files with 31 additions and 44 deletions
|
@ -1775,7 +1775,7 @@ void renderDrawMapView(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
|
|||
auto const spr = (uspritetype * )&sprite[tsprite[s].owner];
|
||||
if ((spr->cstat&48) == 32)
|
||||
{
|
||||
const int32_t xspan = tilesiz[spr->picnum].x;
|
||||
const int32_t xspan = tileWidth(spr->picnum);
|
||||
|
||||
int32_t npoints = 0;
|
||||
vec2_t v1 = { spr->x, spr->y }, v2, v3, v4;
|
||||
|
|
|
@ -928,7 +928,6 @@ void processSetAnim(const char* cmd, FScriptPosition& pos, SetAnim& imp)
|
|||
TileFiles.setAnim(imp.tile1, imp.type, imp.speed, count);
|
||||
}
|
||||
|
||||
TileSiz tilesiz;
|
||||
PicAnm picanm;
|
||||
|
||||
#if 0 // this only gets in if unavoidable. It'd be preferable if the script side can solely operate on texture names.
|
||||
|
|
|
@ -395,17 +395,6 @@ inline const uint8_t* tileRawData(int num)
|
|||
}
|
||||
|
||||
// Some hacks to allow accessing the no longer existing arrays as if they still were arrays to avoid changing hundreds of lines of code.
|
||||
struct TileSiz
|
||||
{
|
||||
const vec2_16_t operator[](size_t index)
|
||||
{
|
||||
assert(index < MAXTILES);
|
||||
vec2_16_t v = { (int16_t)TileFiles.tiledata[index].texture->GetDisplayWidth(), (int16_t)TileFiles.tiledata[index].texture->GetDisplayHeight() };
|
||||
return v;
|
||||
}
|
||||
};
|
||||
extern TileSiz tilesiz;
|
||||
|
||||
struct PicAnm
|
||||
{
|
||||
picanm_t& operator[](size_t index)
|
||||
|
@ -416,7 +405,6 @@ struct PicAnm
|
|||
};
|
||||
extern PicAnm picanm;
|
||||
|
||||
// Helpers to read the refactored tilesiz array.
|
||||
inline int tileWidth(int num)
|
||||
{
|
||||
assert(num < MAXTILES);
|
||||
|
|
|
@ -242,7 +242,7 @@ void DrawClock()
|
|||
int v2 = nVal & 0xF;
|
||||
int yPos = 32 - tileHeight(v2 + kClockSymbol1) / 2;
|
||||
|
||||
CopyTileToBitmap(v2 + kClockSymbol1, kTile3603, ebp - tilesiz[v2 + kClockSymbol1].x / 2, yPos);
|
||||
CopyTileToBitmap(v2 + kClockSymbol1, kTile3603, ebp - tileWidth(v2 + kClockSymbol1) / 2, yPos);
|
||||
|
||||
ebp -= 15;
|
||||
|
||||
|
@ -583,7 +583,7 @@ void CopyTileToBitmap(short nSrcTile, short nDestTile, int xPos, int yPos)
|
|||
|
||||
const uint8_t *pSrc = tilePtr(nSrcTile);
|
||||
|
||||
for (int x = 0; x < tilesiz[nSrcTile].x; x++)
|
||||
for (int x = 0; x < tileWidth(nSrcTile); x++)
|
||||
{
|
||||
pDest += destYSize;
|
||||
|
||||
|
@ -667,11 +667,11 @@ void SaveTextureState()
|
|||
fw->Write(&loaded, 1);
|
||||
if (Worktile) fw->Write(Worktile, WorktileSize);
|
||||
auto pixels = TileFiles.tileMakeWritable(kTile3603);
|
||||
fw->Write(pixels, tilesiz[kTile3603].x * tilesiz[kTile3603].y);
|
||||
fw->Write(pixels, tileWidth(kTile3603) * tileHeight(kTile3603));
|
||||
pixels = TileFiles.tileMakeWritable(kEnergy1);
|
||||
fw->Write(pixels, tilesiz[kEnergy1].x * tilesiz[kEnergy1].y);
|
||||
fw->Write(pixels, tileWidth(kEnergy1) * tileHeight(kEnergy1));
|
||||
pixels = TileFiles.tileMakeWritable(kEnergy2);
|
||||
fw->Write(pixels, tilesiz[kEnergy2].x * tilesiz[kEnergy2].y);
|
||||
fw->Write(pixels, tileWidth(kEnergy2) * tileHeight(kEnergy2));
|
||||
|
||||
}
|
||||
|
||||
|
@ -689,11 +689,11 @@ void LoadTextureState()
|
|||
fr.Read(Worktile, WorktileSize);
|
||||
}
|
||||
auto pixels = TileFiles.tileMakeWritable(kTile3603);
|
||||
fr.Read(pixels, tilesiz[kTile3603].x * tilesiz[kTile3603].y);
|
||||
fr.Read(pixels, tileWidth(kTile3603) * tileHeight(kTile3603));
|
||||
pixels = TileFiles.tileMakeWritable(kEnergy1);
|
||||
fr.Read(pixels, tilesiz[kEnergy1].x * tilesiz[kEnergy1].y);
|
||||
fr.Read(pixels, tileWidth(kEnergy1) * tileHeight(kEnergy1));
|
||||
pixels = TileFiles.tileMakeWritable(kEnergy2);
|
||||
fr.Read(pixels, tilesiz[kEnergy2].x * tilesiz[kEnergy2].y);
|
||||
fr.Read(pixels, tileWidth(kEnergy2) * tileHeight(kEnergy2));
|
||||
TileFiles.InvalidateTile(kTileRamsesWorkTile);
|
||||
TileFiles.InvalidateTile(kTile3603);
|
||||
TileFiles.InvalidateTile(kEnergy1);
|
||||
|
|
|
@ -630,7 +630,7 @@ void AddFlow(int nSprite, int nSpeed, int b)
|
|||
short nPic = sector[var_18].floorpicnum;
|
||||
short nAngle = sprite[nSprite].ang;
|
||||
|
||||
sFlowInfo[nFlow].field_14 = (tilesiz[nPic].x << 14) - 1;
|
||||
sFlowInfo[nFlow].field_14 = (tileWidth(nPic) << 14) - 1;
|
||||
sFlowInfo[nFlow].field_18 = (tileHeight(nPic) << 14) - 1;
|
||||
sFlowInfo[nFlow].field_C = -bcos(nAngle) * nSpeed;
|
||||
sFlowInfo[nFlow].field_10 = bsin(nAngle) * nSpeed;
|
||||
|
@ -649,7 +649,7 @@ void AddFlow(int nSprite, int nSpeed, int b)
|
|||
var_18 = nSprite;
|
||||
short nPic = wall[var_18].picnum;
|
||||
|
||||
sFlowInfo[nFlow].field_14 = (tilesiz[nPic].x * wall[var_18].xrepeat) << 8;
|
||||
sFlowInfo[nFlow].field_14 = (tileWidth(nPic) * wall[var_18].xrepeat) << 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;
|
||||
|
|
|
@ -243,7 +243,7 @@ void InitPlayerInventory(short nPlayer)
|
|||
|
||||
auto pixels = tilePtr(kTile3571 + nPlayer);
|
||||
|
||||
nPlayerColor[nPlayer] = pixels[tilesiz[nPlayer + kTile3571].x * tileHeight(nPlayer + kTile3571) / 2];
|
||||
nPlayerColor[nPlayer] = pixels[tileWidth(nPlayer + kTile3571) * tileHeight(nPlayer + kTile3571) / 2];
|
||||
}
|
||||
|
||||
// done
|
||||
|
|
|
@ -276,7 +276,7 @@ void DoSpiritHead()
|
|||
{
|
||||
int srctile = nMouthTile + 598;
|
||||
auto src = tilePtr(srctile);
|
||||
int sizx = tilesiz[srctile].x;
|
||||
int sizx = tileWidth(srctile);
|
||||
int sizy = tileHeight(srctile);
|
||||
int workptr = 212 * (97 - sizx / 2) + 159 - sizy;
|
||||
int srcptr = 0;
|
||||
|
|
|
@ -333,7 +333,7 @@ void seq_LoadSequences()
|
|||
#endif
|
||||
|
||||
nShadowPic = seq_GetFirstSeqPicnum(kSeqShadow);
|
||||
nShadowWidth = tilesiz[nShadowPic].x;
|
||||
nShadowWidth = tileWidth(nShadowPic);
|
||||
|
||||
nFlameHeight = tileHeight(seq_GetFirstSeqPicnum(kSeqFirePoof));
|
||||
|
||||
|
@ -618,7 +618,7 @@ int seq_PlotSequence(short nSprite, short edx, short nFrame, short ecx)
|
|||
{
|
||||
pTSprite->picnum = nShadowPic;
|
||||
|
||||
int edx = ((tilesiz[nPict].x << 5) / nShadowWidth) - ((nFloorZ - pTSprite->z) >> 10);
|
||||
int edx = ((tileWidth(nPict) << 5) / nShadowWidth) - ((nFloorZ - pTSprite->z) >> 10);
|
||||
if (edx < 1) {
|
||||
edx = 1;
|
||||
}
|
||||
|
|
|
@ -1283,7 +1283,7 @@ static bool weaponhitwall(DDukeActor *proj, int wal, const vec3_t& oldpos)
|
|||
j->s.yrepeat = 8;
|
||||
j->s.cstat = 16;
|
||||
j->s.ang = (j->s.ang + 512) & 2047;
|
||||
j->s.clipdist = mulscale7(s->xrepeat, tilesiz[s->picnum].x);
|
||||
j->s.clipdist = mulscale7(s->xrepeat, tileWidth(s->picnum));
|
||||
}
|
||||
deletesprite(proj);
|
||||
return true;
|
||||
|
@ -2080,7 +2080,7 @@ static void rrra_specialstats()
|
|||
{
|
||||
s->xrepeat <<= 1;
|
||||
s->yrepeat <<= 1;
|
||||
s->clipdist = mulscale7(s->xrepeat, tilesiz[s->picnum].x);
|
||||
s->clipdist = mulscale7(s->xrepeat, tileWidth(s->picnum));
|
||||
}
|
||||
else if (enemysizecheat == 2)
|
||||
{
|
||||
|
|
|
@ -210,11 +210,11 @@ static void setupbackdrop()
|
|||
{
|
||||
for (int i = 0; i < MAXUSERTILES; i++)
|
||||
{
|
||||
if (tilesiz[i].x == 512)
|
||||
if (tileWidth(i) == 512)
|
||||
{
|
||||
defineSky(i, 32768, 1, pskyoff);
|
||||
}
|
||||
else if (tilesiz[i].x == 1024)
|
||||
else if (tileWidth(i) == 1024)
|
||||
{
|
||||
defineSky(i, 32768, 0, pskyoff);
|
||||
}
|
||||
|
|
|
@ -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 - (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((320 - (tileWidth(SCUBAMASK) >> 1) - 15), (200 - (tileHeight(SCUBAMASK) >> 1) + bsinf(interpclock, -10)), 49152, 0, SCUBAMASK, 0, p, 2 + 16 + pin);
|
||||
hud_drawsprite((320 - tileWidth(SCUBAMASK + 4)), (200 - tileHeight(SCUBAMASK + 4)), 65536, 0, SCUBAMASK + 4, 0, p, 2 + 16 + pin);
|
||||
hud_drawsprite(tileWidth(SCUBAMASK + 4), (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);
|
||||
}
|
||||
|
|
|
@ -388,7 +388,7 @@ public:
|
|||
auto p = &ps[snum];
|
||||
int h = tileHeight(BOTTOMSTATUSBAR);
|
||||
int top = 200 - h;
|
||||
int left = (320 - tilesiz[BOTTOMSTATUSBAR].x) / 2;
|
||||
int left = (320 - tileWidth(BOTTOMSTATUSBAR)) / 2;
|
||||
BeginStatusBar(320, 200, h);
|
||||
DrawInventory(p, 160, 154, 0);
|
||||
if (hud_size == Hud_StbarOverlay) Set43ClipRect();
|
||||
|
|
|
@ -348,7 +348,7 @@ public:
|
|||
double h = tileHeight(BOTTOMSTATUSBAR) * scale;
|
||||
double wh = 0;
|
||||
if (hud_size < Hud_Stbar) wh = tileHeight(WEAPONBAR) * scale;
|
||||
double left = (320 - tilesiz[BOTTOMSTATUSBAR].x * scale) / 2;
|
||||
double left = (320 - tileWidth(BOTTOMSTATUSBAR) * scale) / 2;
|
||||
|
||||
double top = 200 - h;
|
||||
BeginStatusBar(320, 200, wh + h);
|
||||
|
|
|
@ -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, tileHeight(tilenume));
|
||||
TileFiles.MakeCanvas(tilenume, tileWidth(tilenume), tileHeight(tilenume));
|
||||
|
||||
auto canvas = renderSetTarget(tilenume);
|
||||
if (!canvas) return;
|
||||
|
|
|
@ -4024,7 +4024,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 += tilesiz[fire->picndx].x;
|
||||
x += tileWidth(fire->picndx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ private:
|
|||
|
||||
font_pic = font_base[color] + (ch - '0');
|
||||
DrawGraphic(tileGetTexture(font_pic), x, ys, DI_ITEM_LEFT_TOP, 1, -1, -1, 1, 1, shadeToLight(shade));
|
||||
x += tilesiz[font_pic].x + 1;
|
||||
x += tileWidth(font_pic) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -449,7 +449,7 @@ private:
|
|||
};
|
||||
|
||||
|
||||
xsize = tilesiz[PANEL_KEY_RED].x + 1;
|
||||
xsize = tileWidth(PANEL_KEY_RED) + 1;
|
||||
ysize = tileHeight(PANEL_KEY_RED) + 2;
|
||||
|
||||
i = 0;
|
||||
|
@ -607,7 +607,7 @@ private:
|
|||
auto NORM_CANG = [](int ang) { return (((ang)+32) & 31); };
|
||||
|
||||
int start_ang, ang;
|
||||
int x_size = tilesiz[COMPASS_NORTH].x;
|
||||
int x_size = tileWidth(COMPASS_NORTH);
|
||||
int x;
|
||||
int i;
|
||||
|
||||
|
@ -669,7 +669,7 @@ private:
|
|||
BeginStatusBar(320, 200, tileHeight(STATUS_BAR));
|
||||
|
||||
if (hud_size == Hud_StbarOverlay) Set43ClipRect();
|
||||
int left = (320 - tilesiz[STATUS_BAR].x) / 2;
|
||||
int left = (320 - tileWidth(STATUS_BAR)) / 2;
|
||||
DrawGraphic(tileGetTexture(STATUS_BAR), left, 200, DI_ITEM_LEFT_BOTTOM, 1, -1, -1, 1, 1);
|
||||
twod->ClearClipRect();
|
||||
DisplayPanelNumber(PANEL_HEALTH_BOX_X + PANEL_HEALTH_XOFF, PANEL_BOX_Y + PANEL_HEALTH_YOFF, u->Health);
|
||||
|
|
|
@ -16108,7 +16108,7 @@ WallSpriteInsideSprite(SPRITEp wsp, SPRITEp sp)
|
|||
// y delta
|
||||
day = -bcos(wsp->ang) * wsp->xrepeat;
|
||||
|
||||
xsiz = tilesiz[wsp->picnum].x;
|
||||
xsiz = tileWidth(wsp->picnum);
|
||||
mid_dist = DIV2(xsiz) + xoff;
|
||||
|
||||
// starting from the center find the first point
|
||||
|
|
Loading…
Reference in a new issue