- Changed: Replaced weapons should not be given by generic cheats, only

when explicitly giving them.
- Changed 'give weapon' cheat so that in single player it only gives weapons
  belonging to the current game or are placed in a weapon slot to avoid
  giving the Chex Quest weapons in Doom and vice versa.
- Fixed: The texture manager must be the first thing to be initialized
  because MAPINFO and DECORATE both can reference textures and letting them
  create their own textures is not safe.


SVN r1230 (trunk)
This commit is contained in:
Christoph Oelckers 2008-09-17 00:14:33 +00:00
commit 3637c878cd
11 changed files with 50 additions and 70 deletions

View file

@ -330,33 +330,6 @@ void FTextureManager::ReplaceTexture (FTextureID picnum, FTexture *newtexture, b
}
}
//==========================================================================
//
// FTextureManager :: AddPatch
//
//==========================================================================
FTextureID FTextureManager::AddPatch (const char *patchname, int namespc, bool tryany)
{
if (patchname == NULL)
{
return FTextureID(-1);
}
FTextureID texnum = CheckForTexture (patchname, FTexture::TEX_MiscPatch, tryany);
if (texnum.Exists())
{
return texnum;
}
int lumpnum = Wads.CheckNumForName (patchname, namespc==ns_global? ns_graphics:namespc);
if (lumpnum < 0)
{
return FTextureID(-1);
}
return CreateTexture (lumpnum, FTexture::TEX_MiscPatch);
}
//==========================================================================
//
// FTextureManager :: AddGroup
@ -440,11 +413,6 @@ void FTextureManager::AddHiresTextures (int wadnum)
{
int amount = ListTextures(name, tlist);
if (amount == 0)
{
FTextureID oldtex = AddPatch(name);
if (oldtex.Exists()) tlist.Push(oldtex);
}
if (tlist.Size() == 0)
{
// A texture with this name does not yet exist
FTexture * newtex = FTexture::CreateTexture (firsttx, FTexture::TEX_Any);
@ -519,11 +487,6 @@ void FTextureManager::LoadTextureDefs(int wadnum, const char *lumpname)
tlist.Clear();
int amount = ListTextures(sc.String, tlist);
if (amount == 0)
{
FTextureID oldtex = AddPatch(sc.String);
if (oldtex.Exists()) tlist.Push(FTextureID(oldtex));
}
FName texname = sc.String;
sc.MustGetString();
@ -624,6 +587,10 @@ void FTextureManager::LoadTextureDefs(int wadnum, const char *lumpname)
{
ParseXTexture(sc, FTexture::TEX_Flat);
}
else if (sc.Compare("graphic"))
{
ParseXTexture(sc, FTexture::TEX_MiscPatch);
}
}
}
}
@ -843,6 +810,8 @@ void FTextureManager::SortTexturesByType(int start, int end)
void FTextureManager::Init()
{
FTexture::InitGrayMap();
int wadcnt = Wads.GetNumWads();
for(int i = 0; i< wadcnt; i++)
{