- Fixed: The HIRESTEX parser didn't check if a graphic specified in a remap

command actually existed.
- Fixed: My $Limit fix from yesterday didn't work because NearLimit was
  an unsigned byte and the comparisons with -1 didn't work. Made it a
  signed word instead.
- Made sfxinfo_t::Link an unsigned int because it limited the amount of 
  usable sounds to 65535. 

SVN r869 (trunk)
This commit is contained in:
Christoph Oelckers 2008-03-30 08:32:44 +00:00
parent f23e9df084
commit 868782a843
5 changed files with 25 additions and 8 deletions

View file

@ -1,3 +1,12 @@
March 30, 2008 (Changes by Graf Zahl)
- Fixed: The HIRESTEX parser didn't check if a graphic specified in a remap
command actually existed.
- Fixed: My $Limit fix from yesterday didn't work because NearLimit was
an unsigned byte and the comparisons with -1 didn't work. Made it a
signed word instead.
- Made sfxinfo_t::Link an unsigned int because it limited the amount of
usable sounds to 65535.
March 29, 2008 March 29, 2008
- Fixed: OPLMIDIDevice sent the wrong pitch wheel value to the player code. - Fixed: OPLMIDIDevice sent the wrong pitch wheel value to the player code.
Missimp.mid sounds a lot better now, though still a little off. Missimp.mid sounds a lot better now, though still a little off.

View file

@ -535,7 +535,7 @@ static int S_AddSound (const char *logicalname, int lumpnum, FScanner *sc)
sfx->bRandomHeader = false; sfx->bRandomHeader = false;
sfx->link = sfxinfo_t::NO_LINK; sfx->link = sfxinfo_t::NO_LINK;
sfx->bTentative = false; sfx->bTentative = false;
if (sfx->NearLimit == (BYTE)-1) sfx->NearLimit = 2; if (sfx->NearLimit == -1) sfx->NearLimit = 2;
//sfx->PitchMask = CurrentPitchMask; //sfx->PitchMask = CurrentPitchMask;
} }
else else
@ -1579,7 +1579,7 @@ static int S_LookupPlayerSound (int classidx, int gender, int refid)
// If we're not done parsing SNDINFO yet, assume that the target sound is valid // If we're not done parsing SNDINFO yet, assume that the target sound is valid
if (PlayerClassesIsSorted && if (PlayerClassesIsSorted &&
(sndnum == 0 || (sndnum == 0 ||
((S_sfx[sndnum].lumpnum == -1 || S_sfx[sndnum].lumpnum == sfx_empty) && S_sfx[sndnum].link == 0xffff))) ((S_sfx[sndnum].lumpnum == -1 || S_sfx[sndnum].lumpnum == sfx_empty) && S_sfx[sndnum].link == sfxinfo_t::NO_LINK)))
{ // This sound is unavailable. { // This sound is unavailable.
if (ingender != 0) if (ingender != 0)
{ // Try "male" { // Try "male"

View file

@ -44,7 +44,7 @@ struct sfxinfo_t
float Volume; float Volume;
BYTE PitchMask; BYTE PitchMask;
BYTE NearLimit; // 0 means unlimited SWORD NearLimit; // 0 means unlimited
WORD bRandomHeader:1; WORD bRandomHeader:1;
WORD bPlayerReserve:1; WORD bPlayerReserve:1;
@ -58,8 +58,8 @@ struct sfxinfo_t
WORD bTentative:1; WORD bTentative:1;
WORD RolloffType:2; WORD RolloffType:2;
WORD link; unsigned int link;
enum { NO_LINK = 0xffff }; enum { NO_LINK = 0xffffffff };
float MinDistance; float MinDistance;
union { float MaxDistance, RolloffFactor; }; union { float MaxDistance, RolloffFactor; };

View file

@ -79,6 +79,7 @@ FTexture * FTexture::CreateTexture (int lumpnum, int usetype)
{ FAutomapTexture::Check, FAutomapTexture::Create, TEX_Autopage }, { FAutomapTexture::Check, FAutomapTexture::Create, TEX_Autopage },
}; };
if (lumpnum == -1) return NULL;
FWadLump data = Wads.OpenLumpNum (lumpnum); FWadLump data = Wads.OpenLumpNum (lumpnum);

View file

@ -455,8 +455,11 @@ void FTextureManager::AddHiresTextures (int wadnum)
{ {
// A texture with this name does not yet exist // A texture with this name does not yet exist
FTexture * newtex = FTexture::CreateTexture (firsttx, FTexture::TEX_Any); FTexture * newtex = FTexture::CreateTexture (firsttx, FTexture::TEX_Any);
newtex->UseType=FTexture::TEX_Override; if (newtex != NULL)
AddTexture(newtex); {
newtex->UseType=FTexture::TEX_Override;
AddTexture(newtex);
}
} }
else else
{ {
@ -537,6 +540,11 @@ void FTextureManager::LoadHiresTex(int wadnum)
Printf("Attempting to remap non-existent texture %s to %s\n", Printf("Attempting to remap non-existent texture %s to %s\n",
texname.GetChars(), sc.String); texname.GetChars(), sc.String);
} }
else if (lumpnum == -1)
{
Printf("Attempting to remap texture %s to non-existent lump %s\n",
texname.GetChars(), sc.String);
}
else else
{ {
for(unsigned int i = 0; i < tlist.Size(); i++) for(unsigned int i = 0; i < tlist.Size(); i++)
@ -572,7 +580,6 @@ void FTextureManager::LoadHiresTex(int wadnum)
memcpy(src, sc.String, 8); memcpy(src, sc.String, 8);
int lumpnum = Wads.CheckNumForFullName(sc.String, true, ns_graphics); int lumpnum = Wads.CheckNumForFullName(sc.String, true, ns_graphics);
if (lumpnum < 0) lumpnum = Wads.CheckNumForName(sc.String, ns_graphics);
sc.GetString(); sc.GetString();
is32bit = !!sc.Compare("force32bit"); is32bit = !!sc.Compare("force32bit");