mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- Removed the unused sfx_ variables for the chainsaw sounds.
- Fixed map name checks in idclev, hxvisit, for +map and the titlemap. - Changed handling of Zips so that the patches/, graphics/, sounds/ and music/ subdirectories no longer are placed in the global namespace. Instead new namespaces are defined. These namespaces aren't merged, however and searching in them either returns a lump inside it or one from the global namespace when it doesn't come from a Zip file. Proper order of files is still observed though. As a result proper use of the directories inside Zips is strictly enforced now so that for example anything used as a patch must be in the patches/ directory and won't be found anywhere else. SVN r199 (trunk)
This commit is contained in:
parent
a42f98af15
commit
cf7d8ab43b
19 changed files with 95 additions and 65 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
June 19, 2006 (Changes by Graf Zahl)
|
||||||
|
- Removed the unused sfx_ variables for the chainsaw sounds.
|
||||||
|
- Fixed map name checks in idclev, hxvisit, for +map and the titlemap.
|
||||||
|
- Changed handling of Zips so that the patches/, graphics/, sounds/ and
|
||||||
|
music/ subdirectories no longer are placed in the global namespace. Instead
|
||||||
|
new namespaces are defined. These namespaces aren't merged, however and
|
||||||
|
searching in them either returns a lump inside it or one from the global
|
||||||
|
namespace when it doesn't come from a Zip file. Proper order of files is
|
||||||
|
still observed though. As a result proper use of the directories inside Zips
|
||||||
|
is strictly enforced now so that for example anything used as a patch must be
|
||||||
|
in the patches/ directory and won't be found anywhere else.
|
||||||
|
|
||||||
June 18, 2006 (Changes by Graf Zahl)
|
June 18, 2006 (Changes by Graf Zahl)
|
||||||
- Added another set of ACS inventory functions which take a tid for the actor
|
- Added another set of ACS inventory functions which take a tid for the actor
|
||||||
and aren't limited to the script's activator.
|
and aren't limited to the script's activator.
|
||||||
|
|
|
@ -257,10 +257,13 @@ CCMD (idclev)
|
||||||
|
|
||||||
// Catch invalid maps.
|
// Catch invalid maps.
|
||||||
mapname = CalcMapName (epsd, map);
|
mapname = CalcMapName (epsd, map);
|
||||||
if (Wads.CheckNumForName (mapname) == -1)
|
|
||||||
|
MapData * mapd = P_OpenMapData(mapname);
|
||||||
|
if (mapd == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// So be it.
|
// So be it.
|
||||||
|
delete mapd;
|
||||||
Printf ("%s\n", GStrings("STSTR_CLEV"));
|
Printf ("%s\n", GStrings("STSTR_CLEV"));
|
||||||
G_DeferedInitNew (mapname);
|
G_DeferedInitNew (mapname);
|
||||||
players[0].health = 0; // Force reset
|
players[0].health = 0; // Force reset
|
||||||
|
@ -281,9 +284,12 @@ CCMD (hxvisit)
|
||||||
if (CheckWarpTransMap (mapname, false))
|
if (CheckWarpTransMap (mapname, false))
|
||||||
{
|
{
|
||||||
// Just because it's in MAPINFO doesn't mean it's in the wad.
|
// Just because it's in MAPINFO doesn't mean it's in the wad.
|
||||||
if (Wads.CheckNumForName (mapname) != -1)
|
|
||||||
|
MapData * map = P_OpenMapData(mapname);
|
||||||
|
if (map != NULL)
|
||||||
{
|
{
|
||||||
// So be it.
|
// So be it.
|
||||||
|
delete map;
|
||||||
Printf ("%s\n", GStrings("STSTR_CLEV"));
|
Printf ("%s\n", GStrings("STSTR_CLEV"));
|
||||||
G_DeferedInitNew (mapname);
|
G_DeferedInitNew (mapname);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -810,7 +810,7 @@ void D_DoStrifeAdvanceDemo ()
|
||||||
case 0:
|
case 0:
|
||||||
pagetic = 6 * TICRATE;
|
pagetic = 6 * TICRATE;
|
||||||
pagename = "TITLEPIC";
|
pagename = "TITLEPIC";
|
||||||
if (Wads.CheckNumForName ("d_logo") < 0)
|
if (Wads.CheckNumForName ("d_logo", ns_music) < 0)
|
||||||
{ // strife0.wad does not have d_logo
|
{ // strife0.wad does not have d_logo
|
||||||
S_StartMusic ("");
|
S_StartMusic ("");
|
||||||
}
|
}
|
||||||
|
@ -925,7 +925,9 @@ void D_DoAdvanceDemo (void)
|
||||||
|
|
||||||
// [RH] If you want something more dynamic for your title, create a map
|
// [RH] If you want something more dynamic for your title, create a map
|
||||||
// and name it TITLEMAP. That map will be loaded and used as the title.
|
// and name it TITLEMAP. That map will be loaded and used as the title.
|
||||||
if (Wads.CheckNumForName ("TITLEMAP") >= 0)
|
|
||||||
|
MapData * map = P_OpenMapData("TITLEMAP");
|
||||||
|
if (map != NULL)
|
||||||
{
|
{
|
||||||
G_InitNew ("TITLEMAP", true);
|
G_InitNew ("TITLEMAP", true);
|
||||||
return;
|
return;
|
||||||
|
@ -2129,12 +2131,14 @@ void D_DoomMain (void)
|
||||||
p = Args.CheckParm ("+map");
|
p = Args.CheckParm ("+map");
|
||||||
if (p && p < Args.NumArgs()-1)
|
if (p && p < Args.NumArgs()-1)
|
||||||
{
|
{
|
||||||
if (Wads.CheckNumForName (Args.GetArg (p+1)) == -1)
|
MapData * map = P_OpenMapData(Args.GetArg (p+1));
|
||||||
|
if (map == NULL)
|
||||||
{
|
{
|
||||||
Printf ("Can't find map %s\n", Args.GetArg (p+1));
|
Printf ("Can't find map %s\n", Args.GetArg (p+1));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
delete map;
|
||||||
strncpy (startmap, Args.GetArg (p+1), 8);
|
strncpy (startmap, Args.GetArg (p+1), 8);
|
||||||
Args.GetArg (p)[0] = '-';
|
Args.GetArg (p)[0] = '-';
|
||||||
autostart = true;
|
autostart = true;
|
||||||
|
|
|
@ -470,7 +470,7 @@ void FDecalLib::ParseDecal ()
|
||||||
case DECAL_PIC:
|
case DECAL_PIC:
|
||||||
SC_MustGetString ();
|
SC_MustGetString ();
|
||||||
picnum = TexMan.CheckForTexture (sc_String, FTexture::TEX_Any);
|
picnum = TexMan.CheckForTexture (sc_String, FTexture::TEX_Any);
|
||||||
if (picnum < 0 && (picnum = Wads.CheckNumForName (sc_String)) >= 0)
|
if (picnum < 0 && (picnum = Wads.CheckNumForName (sc_String, ns_graphics)) >= 0)
|
||||||
{
|
{
|
||||||
picnum = TexMan.CreateTexture (picnum, FTexture::TEX_Decal);
|
picnum = TexMan.CreateTexture (picnum, FTexture::TEX_Decal);
|
||||||
}
|
}
|
||||||
|
|
|
@ -624,14 +624,9 @@ static void G_DoParseMapInfo (int lump)
|
||||||
strcpy (levelinfo->skypic2, levelinfo->skypic1);
|
strcpy (levelinfo->skypic2, levelinfo->skypic1);
|
||||||
}
|
}
|
||||||
SetLevelNum (levelinfo, levelinfo->levelnum); // Wipe out matching levelnums from other maps.
|
SetLevelNum (levelinfo, levelinfo->levelnum); // Wipe out matching levelnums from other maps.
|
||||||
if (levelinfo->pname[0] != 0 && TexMan.CheckForTexture (levelinfo->pname, FTexture::TEX_MiscPatch) < 0)
|
if (levelinfo->pname[0] != 0)
|
||||||
{
|
{
|
||||||
int lumpnum = Wads.CheckNumForName (levelinfo->pname);
|
if (TexMan.AddPatch(levelinfo->pname) < 0)
|
||||||
if (lumpnum >= 0)
|
|
||||||
{
|
|
||||||
TexMan.CreateTexture (lumpnum, FTexture::TEX_MiscPatch);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
levelinfo->pname[0] = 0;
|
levelinfo->pname[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,10 +104,10 @@ CUSTOM_CVAR (Int, crosshair, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||||
}
|
}
|
||||||
size = (SCREENWIDTH < 640) ? 'S' : 'B';
|
size = (SCREENWIDTH < 640) ? 'S' : 'B';
|
||||||
sprintf (name, "XHAIR%c%d", size, num);
|
sprintf (name, "XHAIR%c%d", size, num);
|
||||||
if ((lump = Wads.CheckNumForName (name)) == -1)
|
if ((lump = Wads.CheckNumForName (name, ns_graphics)) == -1)
|
||||||
{
|
{
|
||||||
sprintf (name, "XHAIR%c1", size);
|
sprintf (name, "XHAIR%c1", size);
|
||||||
if ((lump = Wads.CheckNumForName (name)) == -1)
|
if ((lump = Wads.CheckNumForName (name, ns_graphics)) == -1)
|
||||||
{
|
{
|
||||||
strcpy (name, "XHAIRS1");
|
strcpy (name, "XHAIRS1");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1381,11 +1381,11 @@ void M_DrawReadThis ()
|
||||||
{
|
{
|
||||||
char name[9];
|
char name[9];
|
||||||
name[8] = 0;
|
name[8] = 0;
|
||||||
Wads.GetLumpName (name, Wads.GetNumForName (gameinfo.info.indexed.basePage) + InfoType);
|
Wads.GetLumpName (name, Wads.GetNumForName (gameinfo.info.indexed.basePage, ns_graphics) + InfoType);
|
||||||
tex = TexMan[name];
|
tex = TexMan[name];
|
||||||
if (InfoType > 1)
|
if (InfoType > 1)
|
||||||
{
|
{
|
||||||
Wads.GetLumpName (name, Wads.GetNumForName (gameinfo.info.indexed.basePage) + InfoType - 1);
|
Wads.GetLumpName (name, Wads.GetNumForName (gameinfo.info.indexed.basePage, ns_graphics) + InfoType - 1);
|
||||||
prevpic = TexMan[name];
|
prevpic = TexMan[name];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -499,7 +499,7 @@ OPLmusicWriter::OPLmusicWriter (const char *songname, const char *filename)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SharingData = false;
|
SharingData = false;
|
||||||
int lumpnum = Wads.CheckNumForName (songname);
|
int lumpnum = Wads.CheckNumForName (songname, ns_music);
|
||||||
if (lumpnum == -1)
|
if (lumpnum == -1)
|
||||||
{
|
{
|
||||||
Printf ("Song %s is unknown.\n", songname);
|
Printf ("Song %s is unknown.\n", songname);
|
||||||
|
|
|
@ -1931,11 +1931,7 @@ void DLevelScript::DoSetFont (int fontnum)
|
||||||
num = TexMan.CheckForTexture (fontname, FTexture::TEX_Any);
|
num = TexMan.CheckForTexture (fontname, FTexture::TEX_Any);
|
||||||
if (num <= 0)
|
if (num <= 0)
|
||||||
{
|
{
|
||||||
num = Wads.CheckNumForName (fontname);
|
num = TexMan.AddPatch(fontname);
|
||||||
if (num > 0)
|
|
||||||
{
|
|
||||||
num = TexMan.CreateTexture (num);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (num > 0)
|
if (num > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -241,7 +241,7 @@ int FTextureManager::CreateTexture (int lumpnum, int usetype)
|
||||||
} first4bytes;
|
} first4bytes;
|
||||||
|
|
||||||
// Must check the length of the lump. Zero length flat markers (F1_START etc.) will come through here.
|
// Must check the length of the lump. Zero length flat markers (F1_START etc.) will come through here.
|
||||||
// 13 is the minimum length of andthing valid (i.e a 1x1 pixel Doom patch.)
|
// 13 is the minimum length of anything valid (i.e a 1x1 pixel Doom patch.)
|
||||||
if (lumpnum < 0 || Wads.LumpLength(lumpnum)<13)
|
if (lumpnum < 0 || Wads.LumpLength(lumpnum)<13)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -426,7 +426,7 @@ int FTextureManager::AddPatch (const char *patchname, int namespc)
|
||||||
{
|
{
|
||||||
return lumpnum;
|
return lumpnum;
|
||||||
}
|
}
|
||||||
lumpnum = Wads.CheckNumForName (patchname, namespc);
|
lumpnum = Wads.CheckNumForName (patchname, namespc==ns_global? ns_graphics:namespc);
|
||||||
if (lumpnum < 0)
|
if (lumpnum < 0)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -603,7 +603,7 @@ void FTextureManager::AddPatches (int lumpnum)
|
||||||
|
|
||||||
if (CheckForTexture (name, FTexture::TEX_WallPatch, false) == -1)
|
if (CheckForTexture (name, FTexture::TEX_WallPatch, false) == -1)
|
||||||
{
|
{
|
||||||
CreateTexture (Wads.CheckNumForName (name), FTexture::TEX_WallPatch);
|
CreateTexture (Wads.CheckNumForName (name, ns_patches), FTexture::TEX_WallPatch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1163,7 +1163,7 @@ void FPatchTexture::GetDimensions ()
|
||||||
if (dummy.width <= 0 || dummy.height <= 0 || dummy.width > 2048 || dummy.height > 2048)
|
if (dummy.width <= 0 || dummy.height <= 0 || dummy.width > 2048 || dummy.height > 2048)
|
||||||
{
|
{
|
||||||
delete lump;
|
delete lump;
|
||||||
lump = Wads.ReopenLumpNum ( Wads.GetNumForName("-BADPATC") );
|
lump = Wads.ReopenLumpNum ( Wads.GetNumForName("-BADPATC", ns_graphics) );
|
||||||
(*lump) >> dummy.width >> dummy.height;
|
(*lump) >> dummy.width >> dummy.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -512,7 +512,7 @@ void R_InitSkins (void)
|
||||||
int lump = Wads.CheckNumForName (sc_String, skins[i].namespc);
|
int lump = Wads.CheckNumForName (sc_String, skins[i].namespc);
|
||||||
if (lump == -1)
|
if (lump == -1)
|
||||||
{
|
{
|
||||||
lump = Wads.CheckNumForName (sc_String);
|
lump = Wads.CheckNumForName (sc_String, ns_sounds);
|
||||||
}
|
}
|
||||||
if (lump != -1)
|
if (lump != -1)
|
||||||
{
|
{
|
||||||
|
@ -545,7 +545,7 @@ void R_InitSkins (void)
|
||||||
sndlumps[j] = Wads.CheckNumForName (sc_String, skins[i].namespc);
|
sndlumps[j] = Wads.CheckNumForName (sc_String, skins[i].namespc);
|
||||||
if (sndlumps[j] == -1)
|
if (sndlumps[j] == -1)
|
||||||
{ // Replacement not found, try finding it in the global namespace
|
{ // Replacement not found, try finding it in the global namespace
|
||||||
sndlumps[j] = Wads.CheckNumForName (sc_String);
|
sndlumps[j] = Wads.CheckNumForName (sc_String, ns_sounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -440,7 +440,7 @@ int S_FindSoundTentative (const char *name)
|
||||||
int S_AddSound (const char *logicalname, const char *lumpname)
|
int S_AddSound (const char *logicalname, const char *lumpname)
|
||||||
{
|
{
|
||||||
return S_AddSound (logicalname,
|
return S_AddSound (logicalname,
|
||||||
lumpname ? Wads.CheckNumForName (lumpname) : -1);
|
lumpname ? Wads.CheckNumForName (lumpname, ns_sounds) : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int S_AddSound (const char *logicalname, int lumpnum)
|
static int S_AddSound (const char *logicalname, int lumpnum)
|
||||||
|
@ -494,7 +494,7 @@ int S_AddPlayerSound (const char *pclass, int gender, int refid,
|
||||||
const char *lumpname)
|
const char *lumpname)
|
||||||
{
|
{
|
||||||
return S_AddPlayerSound (pclass, gender, refid,
|
return S_AddPlayerSound (pclass, gender, refid,
|
||||||
lumpname ? Wads.CheckNumForName (lumpname) : -1);
|
lumpname ? Wads.CheckNumForName (lumpname, ns_sounds) : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int S_AddPlayerSound (const char *pclass, int gender, int refid, int lumpnum, bool fromskin)
|
int S_AddPlayerSound (const char *pclass, int gender, int refid, int lumpnum, bool fromskin)
|
||||||
|
@ -648,15 +648,7 @@ void S_ParseSndInfo ()
|
||||||
|
|
||||||
S_ShrinkPlayerSoundLists ();
|
S_ShrinkPlayerSoundLists ();
|
||||||
|
|
||||||
// [RH] Hack for pitch varying
|
sfx_empty = Wads.CheckNumForName ("dsempty", ns_sounds);
|
||||||
sfx_sawup = S_FindSound ("weapons/sawup");
|
|
||||||
sfx_sawidl = S_FindSound ("weapons/sawidle");
|
|
||||||
sfx_sawful = S_FindSound ("weapons/sawfull");
|
|
||||||
sfx_sawhit = S_FindSound ("weapons/sawhit");
|
|
||||||
sfx_itemup = S_FindSound ("misc/i_pkup");
|
|
||||||
sfx_tink = S_FindSound ("misc/chat2");
|
|
||||||
|
|
||||||
sfx_empty = Wads.CheckNumForName ("dsempty");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -152,10 +152,6 @@ static FPlayList *PlayList;
|
||||||
|
|
||||||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||||
|
|
||||||
// [RH] Hacks for pitch variance
|
|
||||||
int sfx_sawup, sfx_sawidl, sfx_sawful, sfx_sawhit;
|
|
||||||
int sfx_itemup, sfx_tink;
|
|
||||||
|
|
||||||
int sfx_empty;
|
int sfx_empty;
|
||||||
|
|
||||||
int numChannels;
|
int numChannels;
|
||||||
|
@ -1500,7 +1496,7 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
|
||||||
|
|
||||||
if (!FileExists (musicname))
|
if (!FileExists (musicname))
|
||||||
{
|
{
|
||||||
if ((lumpnum = Wads.CheckNumForName (musicname)) == -1)
|
if ((lumpnum = Wads.CheckNumForName (musicname, ns_music)) == -1)
|
||||||
{
|
{
|
||||||
if ((lumpnum = Wads.CheckNumForFullName (musicname)) == -1)
|
if ((lumpnum = Wads.CheckNumForFullName (musicname)) == -1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -641,7 +641,7 @@ void AltSoundRenderer::LoadSound (sfxinfo_t *sfx)
|
||||||
size = sfx->lumpnum >= 0 ? Wads.LumpLength (sfx->lumpnum) : 0;
|
size = sfx->lumpnum >= 0 ? Wads.LumpLength (sfx->lumpnum) : 0;
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
{
|
{
|
||||||
sfx->lumpnum = Wads.GetNumForName ("dsempty");
|
sfx->lumpnum = Wads.GetNumForName ("dsempty", ns_sounds);
|
||||||
size = Wads.LumpLength (sfx->lumpnum);
|
size = Wads.LumpLength (sfx->lumpnum);
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
{
|
{
|
||||||
|
@ -792,7 +792,7 @@ badwave:
|
||||||
delete[] sfxdata;
|
delete[] sfxdata;
|
||||||
sfxdata = NULL;
|
sfxdata = NULL;
|
||||||
}
|
}
|
||||||
sfx->lumpnum = Wads.GetNumForName ("dsempty");
|
sfx->lumpnum = Wads.GetNumForName ("dsempty", ns_sounds);
|
||||||
LoadSound (sfx);
|
LoadSound (sfx);
|
||||||
}
|
}
|
||||||
if (sfxdata != NULL) delete[] sfxdata;
|
if (sfxdata != NULL) delete[] sfxdata;
|
||||||
|
|
|
@ -1054,7 +1054,7 @@ void FMODSoundRenderer::DoLoad (void **slot, sfxinfo_t *sfx)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errcount)
|
if (errcount)
|
||||||
sfx->lumpnum = Wads.GetNumForName ("dsempty");
|
sfx->lumpnum = Wads.GetNumForName ("dsempty", ns_sounds);
|
||||||
|
|
||||||
size = Wads.LumpLength (sfx->lumpnum);
|
size = Wads.LumpLength (sfx->lumpnum);
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
|
@ -1187,7 +1187,7 @@ void FMODSoundRenderer::getsfx (sfxinfo_t *sfx)
|
||||||
// If the sound doesn't exist, replace it with the empty sound.
|
// If the sound doesn't exist, replace it with the empty sound.
|
||||||
if (sfx->lumpnum == -1)
|
if (sfx->lumpnum == -1)
|
||||||
{
|
{
|
||||||
sfx->lumpnum = Wads.GetNumForName ("dsempty");
|
sfx->lumpnum = Wads.GetNumForName ("dsempty", ns_sounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
// See if there is another sound already initialized with this lump. If so,
|
// See if there is another sound already initialized with this lump. If so,
|
||||||
|
|
|
@ -193,15 +193,15 @@ FFont::FFont (const char *name, const char *nametemplate, int first, int count,
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
sprintf (buffer, nametemplate, i + start);
|
sprintf (buffer, nametemplate, i + start);
|
||||||
lump = Wads.CheckNumForName (buffer);
|
lump = Wads.CheckNumForName (buffer, ns_graphics);
|
||||||
if (doomtemplate && lump >= 0 && i + start == 121)
|
if (doomtemplate && lump >= 0 && i + start == 121)
|
||||||
{ // HACKHACK: Don't load STCFN121 in doom(2), because
|
{ // HACKHACK: Don't load STCFN121 in doom(2), because
|
||||||
// it's not really a lower-case 'y' but an upper-case 'I'.
|
// it's not really a lower-case 'y' but an upper-case 'I'.
|
||||||
// Because a lot of wads with their own font seem to foolishly
|
// Because a lot of wads with their own font seem to foolishly
|
||||||
// copy STCFN121 and make it an 'I' themselves, wads must
|
// copy STCFN121 and make it an 'I' themselves, wads must
|
||||||
// provide STCFN120 (x) and STCFN122 (z) for STCFN121 to load.
|
// provide STCFN120 (x) and STCFN122 (z) for STCFN121 to load.
|
||||||
if (Wads.CheckNumForName ("STCFN120") == -1 ||
|
if (Wads.CheckNumForName ("STCFN120", ns_graphics) == -1 ||
|
||||||
Wads.CheckNumForName ("STCFN122") == -1)
|
Wads.CheckNumForName ("STCFN122", ns_graphics) == -1)
|
||||||
{
|
{
|
||||||
lump = -1;
|
lump = -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -867,7 +867,7 @@ void V_Init (void)
|
||||||
{
|
{
|
||||||
SmallFont = new FFont ("SmallFont", "STCFN%.3d", HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART);
|
SmallFont = new FFont ("SmallFont", "STCFN%.3d", HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART);
|
||||||
}
|
}
|
||||||
if (Wads.CheckNumForName ("STBFN033") >= 0)
|
if (Wads.CheckNumForName ("STBFN033", ns_graphics) >= 0)
|
||||||
{
|
{
|
||||||
SmallFont2 = new FFont ("SmallFont2", "STBFN%.3d", HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART);
|
SmallFont2 = new FFont ("SmallFont2", "STBFN%.3d", HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART);
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,9 @@ struct FWadCollection::LumpRecord
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
LUMPF_BLOODCRYPT = 1, // Lump uses Blood-style encryption
|
LUMPF_BLOODCRYPT = 1, // Lump uses Blood-style encryption
|
||||||
LUMPF_COMPRESSED = 2 // Zip-compressed
|
LUMPF_COMPRESSED = 2, // Zip-compressed
|
||||||
|
LUMPF_ZIPFILE = 4, // Inside a Zip file - used to enforce use of special directories insize Zips
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class FWadCollection::WadFileRecord : public FileReader
|
class FWadCollection::WadFileRecord : public FileReader
|
||||||
|
@ -592,6 +594,10 @@ void FWadCollection::AddFile (const char *filename, const char * data, int lengt
|
||||||
lump_p->fullname = copystring(name);
|
lump_p->fullname = copystring(name);
|
||||||
lump_p->position = LittleLong(zip_fh->dwFileOffset) + sizeof(FZipLocalHeader) + LittleShort(zip_fh->wFileNameSize);
|
lump_p->position = LittleLong(zip_fh->dwFileOffset) + sizeof(FZipLocalHeader) + LittleShort(zip_fh->wFileNameSize);
|
||||||
lump_p->size = zip_fh->dwSize;
|
lump_p->size = zip_fh->dwSize;
|
||||||
|
|
||||||
|
// Map some directories to WAD namespaces.
|
||||||
|
// Note that some of these namespaces don't exist in WADS.
|
||||||
|
// CheckNumForName will handle any request for these namespaces accordingly.
|
||||||
lump_p->namespc = !strncmp(name, "flats/", 6) ? ns_flats :
|
lump_p->namespc = !strncmp(name, "flats/", 6) ? ns_flats :
|
||||||
!strncmp(name, "textures/", 9) ? ns_newtextures :
|
!strncmp(name, "textures/", 9) ? ns_newtextures :
|
||||||
!strncmp(name, "hires/", 6) ? ns_hires :
|
!strncmp(name, "hires/", 6) ? ns_hires :
|
||||||
|
@ -599,10 +605,10 @@ void FWadCollection::AddFile (const char *filename, const char * data, int lengt
|
||||||
!strncmp(name, "colormaps/", 10) ? ns_colormaps :
|
!strncmp(name, "colormaps/", 10) ? ns_colormaps :
|
||||||
!strncmp(name, "acs/", 4) ? ns_acslibrary :
|
!strncmp(name, "acs/", 4) ? ns_acslibrary :
|
||||||
!strncmp(name, "voices/", 7) ? ns_strifevoices :
|
!strncmp(name, "voices/", 7) ? ns_strifevoices :
|
||||||
!strncmp(name, "patches/", 8) ? ns_global :
|
!strncmp(name, "patches/", 8) ? ns_patches :
|
||||||
!strncmp(name, "graphics/", 9) ? ns_global :
|
!strncmp(name, "graphics/", 9) ? ns_graphics :
|
||||||
!strncmp(name, "sounds/", 7) ? ns_global :
|
!strncmp(name, "sounds/", 7) ? ns_sounds :
|
||||||
!strncmp(name, "music/", 6) ? ns_global :
|
!strncmp(name, "music/", 6) ? ns_music :
|
||||||
!strchr(name, '/') ? ns_global : -1;
|
!strchr(name, '/') ? ns_global : -1;
|
||||||
|
|
||||||
// Anything that is not in one of these subdirectories or the main directory
|
// Anything that is not in one of these subdirectories or the main directory
|
||||||
|
@ -614,7 +620,8 @@ void FWadCollection::AddFile (const char *filename, const char * data, int lengt
|
||||||
}
|
}
|
||||||
|
|
||||||
lump_p->wadnum = (WORD)NumWads;
|
lump_p->wadnum = (WORD)NumWads;
|
||||||
lump_p->flags = LittleShort(zip_fh->wCompression) == Z_DEFLATED? LUMPF_COMPRESSED : 0;
|
lump_p->flags = LittleShort(zip_fh->wCompression) == Z_DEFLATED?
|
||||||
|
LUMPF_COMPRESSED|LUMPF_ZIPFILE : LUMPF_ZIPFILE;
|
||||||
lump_p->compressedsize = LittleLong(zip_fh->dwCompressedSize);
|
lump_p->compressedsize = LittleLong(zip_fh->dwCompressedSize);
|
||||||
|
|
||||||
// Since '\' can't be used as a file name's part inside a ZIP
|
// Since '\' can't be used as a file name's part inside a ZIP
|
||||||
|
@ -816,10 +823,20 @@ int FWadCollection::CheckNumForName (const char *name, int space)
|
||||||
uppercopy (uname, name);
|
uppercopy (uname, name);
|
||||||
i = FirstLumpIndex[LumpNameHash (uname) % NumLumps];
|
i = FirstLumpIndex[LumpNameHash (uname) % NumLumps];
|
||||||
|
|
||||||
while (i != NULL_INDEX &&
|
while (i != NULL_INDEX)
|
||||||
(*(__int64 *)&LumpInfo[i].name != *(__int64 *)&uname ||
|
|
||||||
LumpInfo[i].namespc != space))
|
|
||||||
{
|
{
|
||||||
|
if (*(__int64 *)&LumpInfo[i].name == *(__int64 *)&uname)
|
||||||
|
{
|
||||||
|
if (LumpInfo[i].namespc == space) break;
|
||||||
|
// If the lump is from one of the special namespaces exclusive to Zips
|
||||||
|
// the check has to be done differently:
|
||||||
|
// If we find a lump with this name in the global namespace that does not come
|
||||||
|
// from a Zip return that. WADs don't know these namespaces and single lumps must
|
||||||
|
// work as well.
|
||||||
|
if (space > ns_specialzipdirectory &&
|
||||||
|
LumpInfo[i].namespc == ns_global &&
|
||||||
|
!(LumpInfo[i].flags & LUMPF_ZIPFILE)) break;
|
||||||
|
}
|
||||||
i = NextLumpIndex[i];
|
i = NextLumpIndex[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -858,11 +875,11 @@ int FWadCollection::CheckNumForName (const char *name, int space, int wadnum)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
int FWadCollection::GetNumForName (const char *name)
|
int FWadCollection::GetNumForName (const char *name, int space)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
i = CheckNumForName (name);
|
i = CheckNumForName (name, space);
|
||||||
|
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
I_Error ("W_GetNumForName: %s not found!", name);
|
I_Error ("W_GetNumForName: %s not found!", name);
|
||||||
|
|
14
src/w_wad.h
14
src/w_wad.h
|
@ -74,6 +74,16 @@ typedef enum {
|
||||||
ns_bloodmisc,
|
ns_bloodmisc,
|
||||||
ns_strifevoices,
|
ns_strifevoices,
|
||||||
ns_hires,
|
ns_hires,
|
||||||
|
|
||||||
|
// These namespaces are only used to mark lumps in special subdirectories
|
||||||
|
// so that their contents doesn't interfere with the global namespace.
|
||||||
|
// searching for data in these namespaces works differently for lumps coming
|
||||||
|
// from Zips or other files.
|
||||||
|
ns_specialzipdirectory,
|
||||||
|
ns_sounds,
|
||||||
|
ns_patches,
|
||||||
|
ns_graphics,
|
||||||
|
ns_music,
|
||||||
} namespace_t;
|
} namespace_t;
|
||||||
|
|
||||||
// [RH] Copy an 8-char string and uppercase it.
|
// [RH] Copy an 8-char string and uppercase it.
|
||||||
|
@ -157,12 +167,14 @@ public:
|
||||||
|
|
||||||
int CheckNumForName (const char *name, int namespc);
|
int CheckNumForName (const char *name, int namespc);
|
||||||
int CheckNumForName (const char *name, int namespc, int wadfile);
|
int CheckNumForName (const char *name, int namespc, int wadfile);
|
||||||
int GetNumForName (const char *name);
|
int GetNumForName (const char *name, int namespc);
|
||||||
|
|
||||||
inline int CheckNumForName (const byte *name) { return CheckNumForName ((const char *)name, ns_global); }
|
inline int CheckNumForName (const byte *name) { return CheckNumForName ((const char *)name, ns_global); }
|
||||||
inline int CheckNumForName (const char *name) { return CheckNumForName (name, ns_global); }
|
inline int CheckNumForName (const char *name) { return CheckNumForName (name, ns_global); }
|
||||||
inline int CheckNumForName (const byte *name, int ns) { return CheckNumForName ((const char *)name, ns); }
|
inline int CheckNumForName (const byte *name, int ns) { return CheckNumForName ((const char *)name, ns); }
|
||||||
|
inline int GetNumForName (const char *name) { return GetNumForName (name, ns_global); }
|
||||||
inline int GetNumForName (const byte *name) { return GetNumForName ((const char *)name); }
|
inline int GetNumForName (const byte *name) { return GetNumForName ((const char *)name); }
|
||||||
|
inline int GetNumForName (const byte *name, int ns) { return GetNumForName ((const char *)name, ns); }
|
||||||
|
|
||||||
int CheckNumForFullName (const char *name);
|
int CheckNumForFullName (const char *name);
|
||||||
int CheckNumForFullName (const char *name, int wadfile);
|
int CheckNumForFullName (const char *name, int wadfile);
|
||||||
|
|
Loading…
Reference in a new issue