mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-28 12:30:46 +00:00
- reinstated setuptile.
Apparently this is needed by some hires packs to fudge the sprite offsets. Fortunately, setting sprite offsets is the only thing this was ever used for so it's relatively uninvasive.
This commit is contained in:
parent
8690c633d8
commit
5a76dce5f8
4 changed files with 59 additions and 4 deletions
|
@ -605,6 +605,50 @@ static int32_t defsparser(scriptfile *script)
|
|||
TileFiles.LoadArtFile(fn, nullptr, tile);
|
||||
}
|
||||
break;
|
||||
case T_SETUPTILE:
|
||||
{
|
||||
int tile, tmp;
|
||||
|
||||
if (scriptfile_getsymbol(script,&tile)) break;
|
||||
if (check_tile("setuptile", tile, script, pos))
|
||||
break;
|
||||
auto& tiled = TileFiles.tiledata[tile];
|
||||
if (scriptfile_getsymbol(script,&tmp)) break; // XXX
|
||||
tiled.h_xsize = tmp;
|
||||
if (scriptfile_getsymbol(script,&tmp)) break;
|
||||
tiled.h_ysize = tmp;
|
||||
if (scriptfile_getsymbol(script,&tmp)) break;
|
||||
tiled.h_xoffs = tmp;
|
||||
if (scriptfile_getsymbol(script,&tmp)) break;
|
||||
tiled.h_yoffs = tmp;
|
||||
break;
|
||||
}
|
||||
case T_SETUPTILERANGE:
|
||||
{
|
||||
int tile1,tile2,xsiz,ysiz,xoffs,yoffs,i;
|
||||
|
||||
if (scriptfile_getsymbol(script,&tile1)) break;
|
||||
if (scriptfile_getsymbol(script,&tile2)) break;
|
||||
if (scriptfile_getnumber(script,&xsiz)) break;
|
||||
if (scriptfile_getnumber(script,&ysiz)) break;
|
||||
if (scriptfile_getsymbol(script,&xoffs)) break;
|
||||
if (scriptfile_getsymbol(script,&yoffs)) break;
|
||||
|
||||
if (check_tile_range("setuptilerange", &tile1, &tile2, script, pos))
|
||||
break;
|
||||
|
||||
for (i=tile1; i<=tile2; i++)
|
||||
{
|
||||
auto& tiled = TileFiles.tiledata[i];
|
||||
|
||||
tiled.h_xsize = xsiz;
|
||||
tiled.h_ysize = ysiz;
|
||||
tiled.h_xoffs = xoffs;
|
||||
tiled.h_yoffs = yoffs;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case T_ANIMTILERANGE:
|
||||
{
|
||||
SetAnim set;
|
||||
|
|
|
@ -3053,8 +3053,9 @@ void polymost_drawsprite(int32_t snum)
|
|||
|
||||
if ((globalorientation & 48) != 48) // only non-voxel sprites should do this
|
||||
{
|
||||
off = { (int32_t)tspr->xoffset + (tileLeftOffset(globalpicnum)),
|
||||
(int32_t)tspr->yoffset + (tileTopOffset(globalpicnum)) };
|
||||
int const flag = hw_hightile && TileFiles.tiledata[globalpicnum].h_xsize;
|
||||
off = { (int32_t)tspr->xoffset + (flag ? TileFiles.tiledata[globalpicnum].h_xoffs : tileLeftOffset(globalpicnum)),
|
||||
(int32_t)tspr->yoffset + (flag ? TileFiles.tiledata[globalpicnum].h_yoffs : tileTopOffset(globalpicnum)) };
|
||||
}
|
||||
|
||||
int32_t method = DAMETH_MASK | DAMETH_CLAMPED;
|
||||
|
@ -3110,8 +3111,12 @@ void polymost_drawsprite(int32_t snum)
|
|||
pos.y -= (sintable[(tspr->ang) & 2047] >> 13);
|
||||
}
|
||||
|
||||
vec2_16_t const oldsiz = tilesiz[globalpicnum];
|
||||
vec2_t tsiz = { oldsiz.x, oldsiz.y };
|
||||
vec2_t tsiz;
|
||||
|
||||
if (hw_hightile && TileFiles.tiledata[globalpicnum].h_xsize)
|
||||
tsiz = { TileFiles.tiledata[globalpicnum].h_xsize, TileFiles.tiledata[globalpicnum].h_ysize };
|
||||
else
|
||||
tsiz = { tileWidth(globalpicnum), tileHeight(globalpicnum) };
|
||||
|
||||
if (tsiz.x <= 0 || tsiz.y <= 0)
|
||||
return;
|
||||
|
|
|
@ -140,6 +140,7 @@ void BuildTiles::Init()
|
|||
tile.RotTile = { -1,-1 };
|
||||
tile.replacement = ReplacementType::Art;
|
||||
tile.alphaThreshold = 0.5;
|
||||
tile.h_xsize = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -274,6 +274,11 @@ struct TileDesc
|
|||
TArray<HightileReplacement> Hightiles;
|
||||
ReplacementType replacement;
|
||||
float alphaThreshold;
|
||||
|
||||
// Sprite offset hackery for hires replacements. This only gets used for sprites in the 3D view, nothing else.
|
||||
uint16_t h_xsize, h_ysize;
|
||||
int8_t h_xoffs, h_yoffs;
|
||||
|
||||
};
|
||||
|
||||
struct TexturePick
|
||||
|
|
Loading…
Reference in a new issue