mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-20 08:00:56 +00:00
- let tileDelete create a new null texture instead of using the default one.
This is to ensure that marker textures are still unique.
This commit is contained in:
parent
028cf2daf5
commit
bfef616981
2 changed files with 9 additions and 4 deletions
|
@ -504,8 +504,7 @@ int tileImportFromTexture(const char* fn, int tilenum, int alphacut, int istextu
|
||||||
|
|
||||||
// create a new game texture here - we want to give it a different name!
|
// create a new game texture here - we want to give it a different name!
|
||||||
tex = MakeGameTexture(tex->GetTexture(), FStringf("#%05d", tilenum), ETextureType::Override);
|
tex = MakeGameTexture(tex->GetTexture(), FStringf("#%05d", tilenum), ETextureType::Override);
|
||||||
TexMan.AddGameTexture(tex);
|
TileFiles.AddTile(tilenum, tex);
|
||||||
TileFiles.tiledata[tilenum].texture = tex;
|
|
||||||
if (istexture)
|
if (istexture)
|
||||||
tileSetHightileReplacement(tilenum, 0, fn, (float)(255 - alphacut) * (1.f / 255.f), 1.0f, 1.0f, 1.0, 1.0);
|
tileSetHightileReplacement(tilenum, 0, fn, (float)(255 - alphacut) * (1.f / 255.f), 1.0f, 1.0f, 1.0, 1.0);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -570,13 +569,17 @@ void tileCopy(int tile, int source, int pal, int xoffset, int yoffset, int flags
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
FImageSource* CreateEmptyTexture();
|
||||||
|
|
||||||
void tileDelete(int tile)
|
void tileDelete(int tile)
|
||||||
{
|
{
|
||||||
if (TileFiles.locked)
|
if (TileFiles.locked)
|
||||||
I_FatalError("Modifying tiles after startup is not allowed.");
|
I_FatalError("Modifying tiles after startup is not allowed.");
|
||||||
TileFiles.tiledata[tile].texture = TexMan.GameByIndex(0);
|
|
||||||
TileFiles.tiledata[tile].replacement = ReplacementType::Art; // whatever this was, now it isn't anymore. (SW tries to nuke camera textures with this, :( )
|
// explicitly deleted textures must be unique null textures
|
||||||
|
auto nulltex = MakeGameTexture(new FImageTexture(CreateEmptyTexture()), FStringf("#%05d", tile), ETextureType::Null);
|
||||||
|
TileFiles.AddTile(tile, nulltex);
|
||||||
|
TileFiles.tiledata[tile].replacement = ReplacementType::Art; // whatever this was, now it isn't anymore.
|
||||||
tiletovox[tile] = -1; // clear the link but don't clear the voxel. It may be in use for another tile.
|
tiletovox[tile] = -1; // clear the link but don't clear the voxel. It may be in use for another tile.
|
||||||
modelManager.UndefineTile(tile);
|
modelManager.UndefineTile(tile);
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,11 +310,13 @@ void PreloadCache()
|
||||||
seqPrecacheId(dudeInfo[31].seqStartID + 17, 0);
|
seqPrecacheId(dudeInfo[31].seqStartID + 17, 0);
|
||||||
seqPrecacheId(dudeInfo[31].seqStartID + 18, 0);
|
seqPrecacheId(dudeInfo[31].seqStartID + 18, 0);
|
||||||
|
|
||||||
|
/* fixme: cache the composite sky. These are useless.
|
||||||
if (skyTile > -1 && skyTile < kMaxTiles)
|
if (skyTile > -1 && skyTile < kMaxTiles)
|
||||||
{
|
{
|
||||||
for (int i = 1; i < gSkyCount; i++)
|
for (int i = 1; i < gSkyCount; i++)
|
||||||
tilePrecacheTile(skyTile + i, 0, 0);
|
tilePrecacheTile(skyTile + i, 0, 0);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
WeaponPrecache();
|
WeaponPrecache();
|
||||||
viewPrecacheTiles();
|
viewPrecacheTiles();
|
||||||
|
|
Loading…
Reference in a new issue