mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-28 14:11:13 +00:00
- replaced approx 1/3 of all accesses to the tilesiz wrapper class.
This commit is contained in:
parent
fc359065ae
commit
bbf1352db1
13 changed files with 64 additions and 56 deletions
|
@ -2612,7 +2612,7 @@ void ConcussSprite(int a1, spritetype *pSprite, int x, int y, int z, int a6)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int size = (tilesiz[pSprite->picnum].x*pSprite->xrepeat*tilesiz[pSprite->picnum].y*pSprite->yrepeat)>>1;
|
int size = (tileWidth(pSprite->picnum)*pSprite->xrepeat*tileHeight(pSprite->picnum)*pSprite->yrepeat)>>1;
|
||||||
assert(mass > 0);
|
assert(mass > 0);
|
||||||
|
|
||||||
int t = scale(a6, size, mass);
|
int t = scale(a6, size, mass);
|
||||||
|
|
|
@ -1495,7 +1495,7 @@ int getRangeAttackDist(spritetype* pSprite, int minDist, int maxDist) {
|
||||||
}
|
}
|
||||||
|
|
||||||
dist = ClipRange(dist, minDist, maxDist);
|
dist = ClipRange(dist, minDist, maxDist);
|
||||||
//viewSetSystemMessage("DIST: %d, SPRHEIGHT: %d: YREPEAT: %d PIC: %d", dist, tilesiz[pSprite->picnum].y, yrepeat, picnum);
|
//viewSetSystemMessage("DIST: %d, SPRHEIGHT: %d: YREPEAT: %d PIC: %d", dist, tileHeight(pSprite->picnum), yrepeat, picnum);
|
||||||
return dist;
|
return dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -261,7 +261,7 @@ static tspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect)
|
||||||
pNSprite->z = pTSprite->z;
|
pNSprite->z = pTSprite->z;
|
||||||
pNSprite->picnum = 908;
|
pNSprite->picnum = 908;
|
||||||
pNSprite->statnum = kStatDecoration;
|
pNSprite->statnum = kStatDecoration;
|
||||||
pNSprite->xrepeat = pNSprite->yrepeat = (tilesiz[pTSprite->picnum].x*pTSprite->xrepeat)/64;
|
pNSprite->xrepeat = pNSprite->yrepeat = (tileWidth(pTSprite->picnum)*pTSprite->xrepeat)/64;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VIEW_EFFECT_6:
|
case VIEW_EFFECT_6:
|
||||||
|
@ -304,7 +304,7 @@ static tspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect)
|
||||||
pNSprite->z = top;
|
pNSprite->z = top;
|
||||||
pNSprite->picnum = 2101;
|
pNSprite->picnum = 2101;
|
||||||
pNSprite->shade = -128;
|
pNSprite->shade = -128;
|
||||||
pNSprite->xrepeat = pNSprite->yrepeat = (tilesiz[pTSprite->picnum].x*pTSprite->xrepeat)/32;
|
pNSprite->xrepeat = pNSprite->yrepeat = (tileWidth(pTSprite->picnum)*pTSprite->xrepeat)/32;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VIEW_EFFECT_5:
|
case VIEW_EFFECT_5:
|
||||||
|
@ -315,7 +315,7 @@ static tspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect)
|
||||||
pNSprite->z = bottom;
|
pNSprite->z = bottom;
|
||||||
pNSprite->picnum = 2101;
|
pNSprite->picnum = 2101;
|
||||||
pNSprite->shade = -128;
|
pNSprite->shade = -128;
|
||||||
pNSprite->xrepeat = pNSprite->yrepeat = (tilesiz[pTSprite->picnum].x*pTSprite->xrepeat)/32;
|
pNSprite->xrepeat = pNSprite->yrepeat = (tileWidth(pTSprite->picnum)*pTSprite->xrepeat)/32;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VIEW_EFFECT_0:
|
case VIEW_EFFECT_0:
|
||||||
|
@ -330,7 +330,7 @@ static tspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect)
|
||||||
pNSprite->yrepeat = pTSprite->yrepeat >> 2;
|
pNSprite->yrepeat = pTSprite->yrepeat >> 2;
|
||||||
pNSprite->picnum = pTSprite->picnum;
|
pNSprite->picnum = pTSprite->picnum;
|
||||||
pNSprite->pal = 5;
|
pNSprite->pal = 5;
|
||||||
int height = tilesiz[pNSprite->picnum].y;
|
int height = tileHeight(pNSprite->picnum);
|
||||||
int center = height / 2 + tileTopOffset(pNSprite->picnum);
|
int center = height / 2 + tileTopOffset(pNSprite->picnum);
|
||||||
pNSprite->z -= (pNSprite->yrepeat << 2) * (height - center);
|
pNSprite->z -= (pNSprite->yrepeat << 2) * (height - center);
|
||||||
}
|
}
|
||||||
|
|
|
@ -596,7 +596,7 @@ ReservedSpace GameInterface::GetReservedScreenSpace(int viewsize)
|
||||||
int top = 0;
|
int top = 0;
|
||||||
if (gGameOptions.nGameType > 0 && gGameOptions.nGameType <= 3)
|
if (gGameOptions.nGameType > 0 && gGameOptions.nGameType <= 3)
|
||||||
{
|
{
|
||||||
top = (tilesiz[2229].y * ((gNetPlayers + 3) / 4));
|
top = (tileHeight(2229) * ((gNetPlayers + 3) / 4));
|
||||||
}
|
}
|
||||||
return { top, 25 };
|
return { top, 25 };
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ void fxFlameLick(int nSprite) // 0
|
||||||
GetSpriteExtents(pSprite, &top, &bottom);
|
GetSpriteExtents(pSprite, &top, &bottom);
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
int nDist = (pSprite->xrepeat*(tilesiz[pSprite->picnum].x/2))>>3;
|
int nDist = (pSprite->xrepeat*(tileWidth(pSprite->picnum)/2))>>3;
|
||||||
int nAngle = Random(2048);
|
int nAngle = Random(2048);
|
||||||
int dx = mulscale30(nDist, Cos(nAngle));
|
int dx = mulscale30(nDist, Cos(nAngle));
|
||||||
int dy = mulscale30(nDist, Sin(nAngle));
|
int dy = mulscale30(nDist, Sin(nAngle));
|
||||||
|
@ -208,7 +208,7 @@ void fxDynPuff(int nSprite) // 8
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
if (zvel[nSprite])
|
if (zvel[nSprite])
|
||||||
{
|
{
|
||||||
int nDist = (pSprite->xrepeat*(tilesiz[pSprite->picnum].x/2))>>2;
|
int nDist = (pSprite->xrepeat*(tileWidth(pSprite->picnum)/2))>>2;
|
||||||
int x = pSprite->x + mulscale30(nDist, Cos(pSprite->ang-512));
|
int x = pSprite->x + mulscale30(nDist, Cos(pSprite->ang-512));
|
||||||
int y = pSprite->y + mulscale30(nDist, Sin(pSprite->ang-512));
|
int y = pSprite->y + mulscale30(nDist, Sin(pSprite->ang-512));
|
||||||
int z = pSprite->z;
|
int z = pSprite->z;
|
||||||
|
@ -313,7 +313,7 @@ void PlayerBubble(int nSprite) // 10
|
||||||
GetSpriteExtents(pSprite, &top, &bottom);
|
GetSpriteExtents(pSprite, &top, &bottom);
|
||||||
for (int i = 0; i < (pPlayer->bubbleTime>>6); i++)
|
for (int i = 0; i < (pPlayer->bubbleTime>>6); i++)
|
||||||
{
|
{
|
||||||
int nDist = (pSprite->xrepeat*(tilesiz[pSprite->picnum].x/2))>>2;
|
int nDist = (pSprite->xrepeat*(tileWidth(pSprite->picnum)/2))>>2;
|
||||||
int nAngle = Random(2048);
|
int nAngle = Random(2048);
|
||||||
int x = pSprite->x + mulscale30(nDist, Cos(nAngle));
|
int x = pSprite->x + mulscale30(nDist, Cos(nAngle));
|
||||||
int y = pSprite->y + mulscale30(nDist, Sin(nAngle));
|
int y = pSprite->y + mulscale30(nDist, Sin(nAngle));
|
||||||
|
@ -337,7 +337,7 @@ void EnemyBubble(int nSprite) // 11
|
||||||
GetSpriteExtents(pSprite, &top, &bottom);
|
GetSpriteExtents(pSprite, &top, &bottom);
|
||||||
for (int i = 0; i < (klabs(zvel[nSprite])>>18); i++)
|
for (int i = 0; i < (klabs(zvel[nSprite])>>18); i++)
|
||||||
{
|
{
|
||||||
int nDist = (pSprite->xrepeat*(tilesiz[pSprite->picnum].x/2))>>2;
|
int nDist = (pSprite->xrepeat*(tileWidth(pSprite->picnum)/2))>>2;
|
||||||
int nAngle = Random(2048);
|
int nAngle = Random(2048);
|
||||||
int x = pSprite->x + mulscale30(nDist, Cos(nAngle));
|
int x = pSprite->x + mulscale30(nDist, Cos(nAngle));
|
||||||
int y = pSprite->y + mulscale30(nDist, Sin(nAngle));
|
int y = pSprite->y + mulscale30(nDist, Sin(nAngle));
|
||||||
|
|
|
@ -880,11 +880,11 @@ int GetClosestSpriteSectors(int nSector, int x, int y, int nDist, uint8_t *pSect
|
||||||
}
|
}
|
||||||
|
|
||||||
int picWidth(short nPic, short repeat) {
|
int picWidth(short nPic, short repeat) {
|
||||||
return ClipLow((tilesiz[nPic].x * repeat) << 2, 0);
|
return ClipLow((tileWidth(nPic) * repeat) << 2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int picHeight(short nPic, short repeat) {
|
int picHeight(short nPic, short repeat) {
|
||||||
return ClipLow((tilesiz[nPic].y * repeat) << 2, 0);
|
return ClipLow((tileHeight(nPic) * repeat) << 2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1053,7 +1053,7 @@ void debrisConcuss(int nOwner, int listIndex, int x, int y, int z, int dmg) {
|
||||||
int dx = pSprite->x - x; int dy = pSprite->y - y; int dz = (pSprite->z - z) >> 4;
|
int dx = pSprite->x - x; int dy = pSprite->y - y; int dz = (pSprite->z - z) >> 4;
|
||||||
dmg = scale(0x40000, dmg, 0x40000 + dx * dx + dy * dy + dz * dz);
|
dmg = scale(0x40000, dmg, 0x40000 + dx * dx + dy * dy + dz * dz);
|
||||||
|
|
||||||
int size = (tilesiz[pSprite->picnum].x * pSprite->xrepeat * tilesiz[pSprite->picnum].y * pSprite->yrepeat) >> 1;
|
int size = (tileWidth(pSprite->picnum) * pSprite->xrepeat * tileHeight(pSprite->picnum) * pSprite->yrepeat) >> 1;
|
||||||
if (xsprite[pSprite->extra].physAttr & kPhysDebrisExplode) {
|
if (xsprite[pSprite->extra].physAttr & kPhysDebrisExplode) {
|
||||||
if (gSpriteMass[pSprite->extra].mass > 0) {
|
if (gSpriteMass[pSprite->extra].mass > 0) {
|
||||||
int t = scale(dmg, size, gSpriteMass[pSprite->extra].mass);
|
int t = scale(dmg, size, gSpriteMass[pSprite->extra].mass);
|
||||||
|
@ -2165,7 +2165,7 @@ void useEffectGen(XSPRITE* pXSource, spritetype* pSprite) {
|
||||||
pos = bottom;
|
pos = bottom;
|
||||||
break;
|
break;
|
||||||
case 2: // middle
|
case 2: // middle
|
||||||
pos = pSprite->z + (tilesiz[pSprite->picnum].y / 2 + tileTopOffset(pSprite->picnum));
|
pos = pSprite->z + (tileHeight(pSprite->picnum) / 2 + tileTopOffset(pSprite->picnum));
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
case 4:
|
case 4:
|
||||||
|
|
|
@ -200,8 +200,9 @@ private:
|
||||||
|
|
||||||
void TileHGauge(int nTile, double x, double y, int nMult, int nDiv, int nStat = 0, int nScale = 65536)
|
void TileHGauge(int nTile, double x, double y, int nMult, int nDiv, int nStat = 0, int nScale = 65536)
|
||||||
{
|
{
|
||||||
int bx = scale(mulscale16(tilesiz[nTile].x, nScale), nMult, nDiv) + x;
|
int w = tileWidth(nTile);
|
||||||
double scale = double(bx - x) / tileWidth(nTile);
|
int bx = scale(mulscale16(w, nScale), nMult, nDiv) + x;
|
||||||
|
double scale = double(bx - x) / w;
|
||||||
double sc = nScale / 65536.;
|
double sc = nScale / 65536.;
|
||||||
DrawGraphic(tileGetTexture(nTile, true), x, y, DI_ITEM_LEFT_TOP, 1., -1, -1, scale*sc, sc, 0xffffffff, 0, 0);
|
DrawGraphic(tileGetTexture(nTile, true), x, y, DI_ITEM_LEFT_TOP, 1., -1, -1, scale*sc, sc, 0xffffffff, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -346,7 +347,7 @@ private:
|
||||||
if (pPlayer->packSlots[i].curAmount)
|
if (pPlayer->packSlots[i].curAmount)
|
||||||
{
|
{
|
||||||
packs[nPacks++] = i;
|
packs[nPacks++] = i;
|
||||||
width += tilesiz[gPackIcons[i]].x + 1;
|
width += tileWidth(gPackIcons[i]) + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
width /= 2;
|
width /= 2;
|
||||||
|
@ -365,7 +366,7 @@ private:
|
||||||
else
|
else
|
||||||
nShade = 24;
|
nShade = 24;
|
||||||
DrawStatNumber("%3d", pPlayer->packSlots[nPack].curAmount, 2250, x - 4, y - 13, nShade, 0);
|
DrawStatNumber("%3d", pPlayer->packSlots[nPack].curAmount, 2250, x - 4, y - 13, nShade, 0);
|
||||||
x += tilesiz[gPackIcons[nPack]].x + 1;
|
x += tileWidth(gPackIcons[nPack]) + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -577,7 +578,7 @@ private:
|
||||||
|
|
||||||
void DrawStatusBar(int nPalette)
|
void DrawStatusBar(int nPalette)
|
||||||
{
|
{
|
||||||
BeginStatusBar(320, 200, tilesiz[2200].y);
|
BeginStatusBar(320, 200, tileHeight(2200));
|
||||||
|
|
||||||
PLAYER* pPlayer = gView;
|
PLAYER* pPlayer = gView;
|
||||||
XSPRITE* pXSprite = pPlayer->pXSprite;
|
XSPRITE* pXSprite = pPlayer->pXSprite;
|
||||||
|
@ -640,7 +641,7 @@ private:
|
||||||
{
|
{
|
||||||
TileHGauge(2260, 124, 175.5, pPlayer->throwPower, 65536);
|
TileHGauge(2260, 124, 175.5, pPlayer->throwPower, 65536);
|
||||||
}
|
}
|
||||||
drawInventory(pPlayer, 166, 200 - tilesiz[2200].y);
|
drawInventory(pPlayer, 166, 200 - tileHeight(2200));
|
||||||
// Depending on the scale we can lower the stats display. This needs some tweaking but this catches the important default case already.
|
// Depending on the scale we can lower the stats display. This needs some tweaking but this catches the important default case already.
|
||||||
PrintLevelStats(pPlayer, (hud_statscale <= 0.501f || hud_scalefactor < 0.7) && double(xdim)/ydim > 1.6? 28 : 56);
|
PrintLevelStats(pPlayer, (hud_statscale <= 0.501f || hud_scalefactor < 0.7) && double(xdim)/ydim > 1.6? 28 : 56);
|
||||||
|
|
||||||
|
@ -775,7 +776,7 @@ private:
|
||||||
if (pPlayer->throwPower)
|
if (pPlayer->throwPower)
|
||||||
TileHGauge(2260, 124, 175, pPlayer->throwPower, 65536);
|
TileHGauge(2260, 124, 175, pPlayer->throwPower, 65536);
|
||||||
else
|
else
|
||||||
drawInventory(pPlayer, 166, 200-tilesiz[2201].y / 2 - 30);
|
drawInventory(pPlayer, 166, 200-tileHeight(2201) / 2 - 30);
|
||||||
PrintLevelStats(pPlayer, 28);
|
PrintLevelStats(pPlayer, 28);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -810,7 +811,7 @@ private:
|
||||||
if (pPlayer->throwPower)
|
if (pPlayer->throwPower)
|
||||||
TileHGauge(2260, 124, 175, pPlayer->throwPower, 65536);
|
TileHGauge(2260, 124, 175, pPlayer->throwPower, 65536);
|
||||||
else
|
else
|
||||||
drawInventory(pPlayer, 166, 200 - tilesiz[2201].y / 2);
|
drawInventory(pPlayer, 166, 200 - tileHeight(2201) / 2);
|
||||||
}
|
}
|
||||||
if (hud_size == Hud_Mini)
|
if (hud_size == Hud_Mini)
|
||||||
{
|
{
|
||||||
|
|
|
@ -291,7 +291,7 @@ void UpdateSprite(int nXSprite, SEQFRAME* pFrame)
|
||||||
assert(pSprite->extra == nXSprite);
|
assert(pSprite->extra == nXSprite);
|
||||||
if (pSprite->flags & 2)
|
if (pSprite->flags & 2)
|
||||||
{
|
{
|
||||||
if (tilesiz[pSprite->picnum].y != tilesiz[seqGetTile(pFrame)].y || tileTopOffset(pSprite->picnum) != tileTopOffset(seqGetTile(pFrame))
|
if (tileHeight(pSprite->picnum) != tileHeight(seqGetTile(pFrame)) || tileTopOffset(pSprite->picnum) != tileTopOffset(seqGetTile(pFrame))
|
||||||
|| (pFrame->yrepeat && pFrame->yrepeat != pSprite->yrepeat))
|
|| (pFrame->yrepeat && pFrame->yrepeat != pSprite->yrepeat))
|
||||||
pSprite->flags |= 4;
|
pSprite->flags |= 4;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1198,7 +1198,7 @@ int32_t try_facespr_intersect(uspriteptr_t const spr, vec3_t const in,
|
||||||
vec2_t const off = { scale(vx, topu, bot), scale(vy, topu, bot) };
|
vec2_t const off = { scale(vx, topu, bot), scale(vy, topu, bot) };
|
||||||
int32_t const dist = off.x * off.x + off.y * off.y;
|
int32_t const dist = off.x * off.x + off.y * off.y;
|
||||||
|
|
||||||
siz = tilesiz[spr->picnum].x * spr->xrepeat;
|
siz = tileWidth(spr->picnum) * spr->xrepeat;
|
||||||
|
|
||||||
if (dist > mulscale7(siz, siz)) return 0;
|
if (dist > mulscale7(siz, siz)) return 0;
|
||||||
|
|
||||||
|
|
|
@ -1707,7 +1707,7 @@ void renderDrawMapView(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
|
||||||
if ((unsigned)globalpicnum >= (unsigned)MAXTILES) globalpicnum = 0;
|
if ((unsigned)globalpicnum >= (unsigned)MAXTILES) globalpicnum = 0;
|
||||||
tileUpdatePicnum(&globalpicnum, s);
|
tileUpdatePicnum(&globalpicnum, s);
|
||||||
setgotpic(globalpicnum);
|
setgotpic(globalpicnum);
|
||||||
if ((tilesiz[globalpicnum].x <= 0) || (tilesiz[globalpicnum].y <= 0)) continue;
|
if ((tileWidth(globalpicnum) <= 0) || (tileHeight(globalpicnum) <= 0)) continue;
|
||||||
|
|
||||||
globalshade = max(min<int>(sec->floorshade, numshades - 1), 0);
|
globalshade = max(min<int>(sec->floorshade, numshades - 1), 0);
|
||||||
if ((globalorientation&64) == 0)
|
if ((globalorientation&64) == 0)
|
||||||
|
@ -1820,7 +1820,7 @@ void renderDrawMapView(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
|
||||||
if ((unsigned)globalpicnum >= (unsigned)MAXTILES) globalpicnum = 0;
|
if ((unsigned)globalpicnum >= (unsigned)MAXTILES) globalpicnum = 0;
|
||||||
tileUpdatePicnum(&globalpicnum, s);
|
tileUpdatePicnum(&globalpicnum, s);
|
||||||
setgotpic(globalpicnum);
|
setgotpic(globalpicnum);
|
||||||
if ((tilesiz[globalpicnum].x <= 0) || (tilesiz[globalpicnum].y <= 0)) continue;
|
if ((tileWidth(globalpicnum) <= 0) || (tileHeight(globalpicnum) <= 0)) continue;
|
||||||
|
|
||||||
if ((sector[spr->sectnum].ceilingstat&1) > 0)
|
if ((sector[spr->sectnum].ceilingstat&1) > 0)
|
||||||
globalshade = ((int32_t)sector[spr->sectnum].ceilingshade);
|
globalshade = ((int32_t)sector[spr->sectnum].ceilingshade);
|
||||||
|
|
|
@ -255,7 +255,13 @@ static void polymost_updaterotmat(void)
|
||||||
renderSetVisibility(mulscale16(g_visibility, mulscale16(xdimenscale, viewingrangerecip)) * fviewingrange * (1.f / (65536.f * 65536.f)) / r_ambientlight);
|
renderSetVisibility(mulscale16(g_visibility, mulscale16(xdimenscale, viewingrangerecip)) * fviewingrange * (1.f / (65536.f * 65536.f)) / r_ambientlight);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void polymost_flatskyrender(vec2f_t const* const dpxy, int32_t const n, int32_t method, const vec2_16_t& tilesiz);
|
const vec2_16_t tileSize(size_t index)
|
||||||
|
{
|
||||||
|
vec2_16_t v = { (int16_t)tileWidth(index), (int16_t)tileHeight(index) };
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void polymost_flatskyrender(vec2f_t const* const dpxy, int32_t const n, int32_t method, const vec2_16_t& tilesize);
|
||||||
|
|
||||||
// Hack for Duke's camera until I can find out why this behaves erratically.
|
// Hack for Duke's camera until I can find out why this behaves erratically.
|
||||||
int skiptile = -1;
|
int skiptile = -1;
|
||||||
|
@ -790,7 +796,7 @@ skip: ;
|
||||||
|
|
||||||
int n = 4;
|
int n = 4;
|
||||||
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
||||||
polymost_drawpoly(dpxy, n, domostpolymethod, tilesiz[globalpicnum]);
|
polymost_drawpoly(dpxy, n, domostpolymethod, tileSize(globalpicnum));
|
||||||
|
|
||||||
vsp[i].cy[0] = n0.y;
|
vsp[i].cy[0] = n0.y;
|
||||||
vsp[i].cy[1] = n1.y;
|
vsp[i].cy[1] = n1.y;
|
||||||
|
@ -804,7 +810,7 @@ skip: ;
|
||||||
|
|
||||||
int n = 3;
|
int n = 3;
|
||||||
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
||||||
polymost_drawpoly(dpxy, n, domostpolymethod, tilesiz[globalpicnum]);
|
polymost_drawpoly(dpxy, n, domostpolymethod, tileSize(globalpicnum));
|
||||||
|
|
||||||
vsp[i].cy[0] = n0.y;
|
vsp[i].cy[0] = n0.y;
|
||||||
vsp[i].ctag = gtag;
|
vsp[i].ctag = gtag;
|
||||||
|
@ -817,7 +823,7 @@ skip: ;
|
||||||
|
|
||||||
int n = 3;
|
int n = 3;
|
||||||
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
||||||
polymost_drawpoly(dpxy, n, domostpolymethod, tilesiz[globalpicnum]);
|
polymost_drawpoly(dpxy, n, domostpolymethod, tileSize(globalpicnum));
|
||||||
|
|
||||||
vsp[i].cy[1] = n1.y;
|
vsp[i].cy[1] = n1.y;
|
||||||
vsp[i].ctag = gtag;
|
vsp[i].ctag = gtag;
|
||||||
|
@ -831,7 +837,7 @@ skip: ;
|
||||||
|
|
||||||
int n = 4;
|
int n = 4;
|
||||||
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
||||||
polymost_drawpoly(dpxy, n, domostpolymethod, tilesiz[globalpicnum]);
|
polymost_drawpoly(dpxy, n, domostpolymethod, tileSize(globalpicnum));
|
||||||
|
|
||||||
vsp[i].ctag = vsp[i].ftag = -1;
|
vsp[i].ctag = vsp[i].ftag = -1;
|
||||||
}
|
}
|
||||||
|
@ -852,7 +858,7 @@ skip: ;
|
||||||
|
|
||||||
int n = 4;
|
int n = 4;
|
||||||
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
||||||
polymost_drawpoly(dpxy, n, domostpolymethod, tilesiz[globalpicnum]);
|
polymost_drawpoly(dpxy, n, domostpolymethod, tileSize(globalpicnum));
|
||||||
|
|
||||||
vsp[i].fy[0] = n0.y;
|
vsp[i].fy[0] = n0.y;
|
||||||
vsp[i].fy[1] = n1.y;
|
vsp[i].fy[1] = n1.y;
|
||||||
|
@ -866,7 +872,7 @@ skip: ;
|
||||||
|
|
||||||
int n = 3;
|
int n = 3;
|
||||||
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
||||||
polymost_drawpoly(dpxy, n, domostpolymethod, tilesiz[globalpicnum]);
|
polymost_drawpoly(dpxy, n, domostpolymethod, tileSize(globalpicnum));
|
||||||
|
|
||||||
vsp[i].fy[0] = n0.y;
|
vsp[i].fy[0] = n0.y;
|
||||||
vsp[i].ftag = gtag;
|
vsp[i].ftag = gtag;
|
||||||
|
@ -879,7 +885,7 @@ skip: ;
|
||||||
|
|
||||||
int n = 3;
|
int n = 3;
|
||||||
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
||||||
polymost_drawpoly(dpxy, n, domostpolymethod, tilesiz[globalpicnum]);
|
polymost_drawpoly(dpxy, n, domostpolymethod, tileSize(globalpicnum));
|
||||||
|
|
||||||
vsp[i].fy[1] = n1.y;
|
vsp[i].fy[1] = n1.y;
|
||||||
vsp[i].ftag = gtag;
|
vsp[i].ftag = gtag;
|
||||||
|
@ -891,7 +897,7 @@ skip: ;
|
||||||
|
|
||||||
int n = 4;
|
int n = 4;
|
||||||
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
polymost_clipmost(dpxy, n, x0, x1, y0top, y0bot, y1top, y1bot);
|
||||||
polymost_drawpoly(dpxy, n, domostpolymethod, tilesiz[globalpicnum]);
|
polymost_drawpoly(dpxy, n, domostpolymethod, tileSize(globalpicnum));
|
||||||
|
|
||||||
vsp[i].ctag = vsp[i].ftag = -1;
|
vsp[i].ctag = vsp[i].ftag = -1;
|
||||||
}
|
}
|
||||||
|
@ -1273,7 +1279,7 @@ static void fgetzsofslope(usectorptr_t sec, float dax, float day, float* ceilz,
|
||||||
*florz += (sec->floorheinum*j)/i;
|
*florz += (sec->floorheinum*j)/i;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void polymost_flatskyrender(vec2f_t const* const dpxy, int32_t const n, int32_t method, const vec2_16_t &tilesiz)
|
static void polymost_flatskyrender(vec2f_t const* const dpxy, int32_t const n, int32_t method, const vec2_16_t &tilesize)
|
||||||
{
|
{
|
||||||
flatskyrender = 0;
|
flatskyrender = 0;
|
||||||
vec2f_t xys[8];
|
vec2f_t xys[8];
|
||||||
|
@ -1302,8 +1308,8 @@ static void polymost_flatskyrender(vec2f_t const* const dpxy, int32_t const n, i
|
||||||
float vv[2];
|
float vv[2];
|
||||||
float t = (float)((1<<(widthBits(globalpicnum)))<<dapskybits);
|
float t = (float)((1<<(widthBits(globalpicnum)))<<dapskybits);
|
||||||
vv[1] = dd*((float)xdimscale*fviewingrange) * (1.f/(daptileyscale*65536.f));
|
vv[1] = dd*((float)xdimscale*fviewingrange) * (1.f/(daptileyscale*65536.f));
|
||||||
vv[0] = dd*((float)((tilesiz.y>>1)+dapyoffs)) - vv[1]*ghoriz;
|
vv[0] = dd*((float)((tilesize.y>>1)+dapyoffs)) - vv[1]*ghoriz;
|
||||||
int ti = (1<<(heightBits(globalpicnum))); if (ti != tilesiz.y) ti += ti;
|
int ti = (1<<(heightBits(globalpicnum))); if (ti != tilesize.y) ti += ti;
|
||||||
vec3f_t o;
|
vec3f_t o;
|
||||||
|
|
||||||
skyclamphack = 0;
|
skyclamphack = 0;
|
||||||
|
@ -1455,7 +1461,7 @@ static void polymost_flatskyrender(vec2f_t const* const dpxy, int32_t const n, i
|
||||||
cxy[i].y = v.y * r + ghalfy;
|
cxy[i].y = v.y * r + ghalfy;
|
||||||
}
|
}
|
||||||
|
|
||||||
polymost_drawpoly(cxy, n3, method|DAMETH_WALL, tilesiz);
|
polymost_drawpoly(cxy, n3, method|DAMETH_WALL, tilesize);
|
||||||
|
|
||||||
otex = otexbak, xtex = xtexbak, ytex = ytexbak;
|
otex = otexbak, xtex = xtexbak, ytex = ytexbak;
|
||||||
}
|
}
|
||||||
|
@ -2075,7 +2081,7 @@ static void polymost_drawalls(int32_t const bunch)
|
||||||
int i = (!(wal->cstat&4)) ? sector[nextsectnum].ceilingz : sec->ceilingz;
|
int i = (!(wal->cstat&4)) ? sector[nextsectnum].ceilingz : sec->ceilingz;
|
||||||
|
|
||||||
// over
|
// over
|
||||||
calc_ypanning(i, ryp0, ryp1, x0, x1, wal->ypanning, wal->yrepeat, wal->cstat&4, tilesiz[globalpicnum]);
|
calc_ypanning(i, ryp0, ryp1, x0, x1, wal->ypanning, wal->yrepeat, wal->cstat&4, tileSize(globalpicnum));
|
||||||
|
|
||||||
if (wal->cstat&8) //xflip
|
if (wal->cstat&8) //xflip
|
||||||
{
|
{
|
||||||
|
@ -2110,7 +2116,7 @@ static void polymost_drawalls(int32_t const bunch)
|
||||||
int i = (!(nwal->cstat&4)) ? sector[nextsectnum].floorz : sec->ceilingz;
|
int i = (!(nwal->cstat&4)) ? sector[nextsectnum].floorz : sec->ceilingz;
|
||||||
|
|
||||||
// under
|
// under
|
||||||
calc_ypanning(i, ryp0, ryp1, x0, x1, nwal->ypanning, wal->yrepeat, !(nwal->cstat&4), tilesiz[globalpicnum]);
|
calc_ypanning(i, ryp0, ryp1, x0, x1, nwal->ypanning, wal->yrepeat, !(nwal->cstat&4), tileSize(globalpicnum));
|
||||||
|
|
||||||
if (wal->cstat&8) //xflip
|
if (wal->cstat&8) //xflip
|
||||||
{
|
{
|
||||||
|
@ -2155,7 +2161,7 @@ static void polymost_drawalls(int32_t const bunch)
|
||||||
else { i = nwcs4 ? sec->ceilingz : sec->floorz; }
|
else { i = nwcs4 ? sec->ceilingz : sec->floorz; }
|
||||||
|
|
||||||
// white / 1-way
|
// white / 1-way
|
||||||
calc_ypanning(i, ryp0, ryp1, x0, x1, wal->ypanning, wal->yrepeat, nwcs4 && !maskingOneWay, tilesiz[globalpicnum]);
|
calc_ypanning(i, ryp0, ryp1, x0, x1, wal->ypanning, wal->yrepeat, nwcs4 && !maskingOneWay, tileSize(globalpicnum));
|
||||||
|
|
||||||
if (wal->cstat&8) //xflip
|
if (wal->cstat&8) //xflip
|
||||||
{
|
{
|
||||||
|
@ -2725,7 +2731,7 @@ static void polymost_drawmaskwallinternal(int32_t wallIndex)
|
||||||
|
|
||||||
// mask
|
// mask
|
||||||
calc_ypanning((!(wal->cstat & 4)) ? max(nsec->ceilingz, sec->ceilingz) : min(nsec->floorz, sec->floorz), ryp0, ryp1,
|
calc_ypanning((!(wal->cstat & 4)) ? max(nsec->ceilingz, sec->ceilingz) : min(nsec->floorz, sec->floorz), ryp0, ryp1,
|
||||||
x0, x1, wal->ypanning, wal->yrepeat, 0, tilesiz[globalpicnum]);
|
x0, x1, wal->ypanning, wal->yrepeat, 0, tileSize(globalpicnum));
|
||||||
|
|
||||||
if (wal->cstat&8) //xflip
|
if (wal->cstat&8) //xflip
|
||||||
{
|
{
|
||||||
|
@ -2831,7 +2837,7 @@ static void polymost_drawmaskwallinternal(int32_t wallIndex)
|
||||||
pow2xsplit = 0;
|
pow2xsplit = 0;
|
||||||
skyclamphack = 0;
|
skyclamphack = 0;
|
||||||
|
|
||||||
polymost_drawpoly(dpxy, n, method, tilesiz[globalpicnum]);
|
polymost_drawpoly(dpxy, n, method, tileSize(globalpicnum));
|
||||||
}
|
}
|
||||||
|
|
||||||
void polymost_drawmaskwall(int32_t damaskwallcnt)
|
void polymost_drawmaskwall(int32_t damaskwallcnt)
|
||||||
|
|
|
@ -136,7 +136,6 @@ void DrawRel(int tile, double x, double y, int shade)
|
||||||
// this might be static within the DoPlasma function?
|
// this might be static within the DoPlasma function?
|
||||||
static uint8_t* PlasmaBuffer;
|
static uint8_t* PlasmaBuffer;
|
||||||
static int nPlasmaTile = kTile4092;
|
static int nPlasmaTile = kTile4092;
|
||||||
static int nLogoTile;
|
|
||||||
static unsigned int nSmokeBottom;
|
static unsigned int nSmokeBottom;
|
||||||
static unsigned int nSmokeRight;
|
static unsigned int nSmokeRight;
|
||||||
static unsigned int nSmokeTop;
|
static unsigned int nSmokeTop;
|
||||||
|
@ -161,15 +160,16 @@ enum
|
||||||
|
|
||||||
void menu_DoPlasma()
|
void menu_DoPlasma()
|
||||||
{
|
{
|
||||||
|
auto nLogoTile = GameLogo();
|
||||||
|
int lw = tileWidth(nLogoTile);
|
||||||
|
int lh = tileHeight(nLogoTile);
|
||||||
|
|
||||||
int ptile = nPlasmaTile;
|
int ptile = nPlasmaTile;
|
||||||
int pclock = I_GetBuildTime();
|
int pclock = I_GetBuildTime();
|
||||||
if (pclock >= nextPlasmaTic || !PlasmaBuffer)
|
if (pclock >= nextPlasmaTic || !PlasmaBuffer)
|
||||||
{
|
{
|
||||||
nextPlasmaTic = pclock + 4;
|
nextPlasmaTic = pclock + 4;
|
||||||
|
|
||||||
if (!nLogoTile)
|
|
||||||
nLogoTile = GameLogo();
|
|
||||||
|
|
||||||
if (!PlasmaBuffer)
|
if (!PlasmaBuffer)
|
||||||
{
|
{
|
||||||
auto pixels = TileFiles.tileCreate(kTile4092, kPlasmaWidth, kPlasmaHeight);
|
auto pixels = TileFiles.tileCreate(kTile4092, kPlasmaWidth, kPlasmaHeight);
|
||||||
|
@ -178,15 +178,16 @@ void menu_DoPlasma()
|
||||||
PlasmaBuffer = TileFiles.tileCreate(kTile4093, kPlasmaWidth, kPlasmaHeight);
|
PlasmaBuffer = TileFiles.tileCreate(kTile4093, kPlasmaWidth, kPlasmaHeight);
|
||||||
memset(PlasmaBuffer, 96, kPlasmaWidth * kPlasmaHeight);
|
memset(PlasmaBuffer, 96, kPlasmaWidth * kPlasmaHeight);
|
||||||
|
|
||||||
nSmokeLeft = 160 - tilesiz[nLogoTile].x / 2;
|
|
||||||
nSmokeRight = nSmokeLeft + tilesiz[nLogoTile].x;
|
|
||||||
|
|
||||||
nSmokeTop = 40 - tilesiz[nLogoTile].y / 2;
|
nSmokeLeft = 160 - lw / 2;
|
||||||
nSmokeBottom = nSmokeTop + tilesiz[nLogoTile].y - 1;
|
nSmokeRight = nSmokeLeft + lw;
|
||||||
|
|
||||||
|
nSmokeTop = 40 - lh / 2;
|
||||||
|
nSmokeBottom = nSmokeTop + lh - 1;
|
||||||
|
|
||||||
for (int i = 0; i < 5; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
int logoWidth = tilesiz[nLogoTile].x;
|
int logoWidth = lw;
|
||||||
plasma_C[i] = IntToFixed(nSmokeLeft + rand() % logoWidth);
|
plasma_C[i] = IntToFixed(nSmokeLeft + rand() % logoWidth);
|
||||||
plasma_B[i] = (rnd_plasma.GenRand32() % 327680) + 0x10000;
|
plasma_B[i] = (rnd_plasma.GenRand32() % 327680) + 0x10000;
|
||||||
|
|
||||||
|
@ -297,7 +298,7 @@ void menu_DoPlasma()
|
||||||
int pC = plasma_C[j];
|
int pC = plasma_C[j];
|
||||||
int badOffset = FixedToInt(pC) < nSmokeLeft || FixedToInt(pC) >= nSmokeRight;
|
int badOffset = FixedToInt(pC) < nSmokeLeft || FixedToInt(pC) >= nSmokeRight;
|
||||||
|
|
||||||
const uint8_t* ptr3 = (logopix + (FixedToInt(pC) - nSmokeLeft) * tilesiz[nLogoTile].y);
|
const uint8_t* ptr3 = (logopix + (FixedToInt(pC) - nSmokeLeft) * lh);
|
||||||
|
|
||||||
plasma_C[j] += plasma_B[j];
|
plasma_C[j] += plasma_B[j];
|
||||||
|
|
||||||
|
@ -332,7 +333,7 @@ void menu_DoPlasma()
|
||||||
{
|
{
|
||||||
nSmokeOffset = nSmokeBottom;
|
nSmokeOffset = nSmokeBottom;
|
||||||
|
|
||||||
ptr3 += tilesiz[nLogoTile].y - 1;
|
ptr3 += lh - 1;
|
||||||
|
|
||||||
while (nSmokeOffset > nSmokeTop)
|
while (nSmokeOffset > nSmokeTop)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue