mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-31 22:00:48 +00:00
- removed the string assignment operators.
These all caught literal 0's as well
This commit is contained in:
parent
d173c0453c
commit
b89c4affae
9 changed files with 17 additions and 27 deletions
|
@ -44,16 +44,6 @@ public:
|
|||
}
|
||||
FSoundID(const FSoundID &other) = default;
|
||||
FSoundID &operator=(const FSoundID &other) = default;
|
||||
FSoundID &operator=(const char *name)
|
||||
{
|
||||
ID = GetSoundIndex(name);
|
||||
return *this;
|
||||
}
|
||||
FSoundID &operator=(const FString &name)
|
||||
{
|
||||
ID = GetSoundIndex(name.GetChars());
|
||||
return *this;
|
||||
}
|
||||
bool operator !=(FSoundID other) const
|
||||
{
|
||||
return ID != other.ID;
|
||||
|
|
|
@ -1358,12 +1358,12 @@ FSerializer &Serialize(FSerializer &arc, const char *key, FSoundID &sid, FSoundI
|
|||
}
|
||||
else if (val->IsNull())
|
||||
{
|
||||
sid = 0;
|
||||
sid = NO_SOUND;
|
||||
}
|
||||
else
|
||||
{
|
||||
Printf(TEXTCOLOR_RED "string type expected for '%s'\n", key);
|
||||
sid = 0;
|
||||
sid = NO_SOUND;
|
||||
arc.mErrors++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@ static void ParseOuter (FScanner &sc)
|
|||
static void SetSplashDefaults (FSplashDef *splashdef)
|
||||
{
|
||||
splashdef->SmallSplashSound =
|
||||
splashdef->NormalSplashSound = 0;
|
||||
splashdef->NormalSplashSound = NO_SOUND;
|
||||
splashdef->SmallSplash =
|
||||
splashdef->SplashBase =
|
||||
splashdef->SplashChunk = NULL;
|
||||
|
|
|
@ -87,7 +87,7 @@ void FTextureAnimator::InitSwitchList ()
|
|||
def2 = (FSwitchDef *)M_Malloc (sizeof(FSwitchDef));
|
||||
def1->PreTexture = def2->frames[0].Texture = TexMan.CheckForTexture (list_p /* .name1 */, ETextureType::Wall, texflags);
|
||||
def2->PreTexture = def1->frames[0].Texture = TexMan.CheckForTexture (list_p + 9, ETextureType::Wall, texflags);
|
||||
def1->Sound = def2->Sound = 0;
|
||||
def1->Sound = def2->Sound = NO_SOUND;
|
||||
def1->NumFrames = def2->NumFrames = 1;
|
||||
def1->frames[0].TimeMin = def2->frames[0].TimeMin = 0;
|
||||
def1->frames[0].TimeRnd = def2->frames[0].TimeRnd = 0;
|
||||
|
|
|
@ -419,7 +419,7 @@ FStrifeDialogueNode *MapLoader::ReadTeaserNode (const char *name, FileReader &lu
|
|||
}
|
||||
else
|
||||
{
|
||||
node->SpeakerVoice = 0;
|
||||
node->SpeakerVoice = NO_SOUND;
|
||||
}
|
||||
|
||||
// The speaker's name, if any.
|
||||
|
|
|
@ -3489,7 +3489,7 @@ bool FSlide::BounceWall(AActor *mo)
|
|||
|
||||
if (line->special == Line_Horizon || ((mo->BounceFlags & BOUNCE_NotOnSky) && line->hitSkyWall(mo)))
|
||||
{
|
||||
mo->SeeSound = mo->BounceSound = 0; // it might make a sound otherwise
|
||||
mo->SeeSound = mo->BounceSound = NO_SOUND; // it might make a sound otherwise
|
||||
mo->Destroy();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -886,7 +886,7 @@ void R_InitSkins (void)
|
|||
}
|
||||
|
||||
// Register any sounds this skin provides
|
||||
aliasid = 0;
|
||||
aliasid = NO_SOUND;
|
||||
for (j = 0; j < NUMSKINSOUNDS; j++)
|
||||
{
|
||||
if (sndlumps[j] != -1)
|
||||
|
|
|
@ -337,7 +337,7 @@ void S_CheckIntegrity()
|
|||
auto& sfx = *soundEngine->GetWritableSfx(FSoundID::fromInt(i));
|
||||
Printf(TEXTCOLOR_RED "Sound %s has been disabled\n", sfx.name.GetChars());
|
||||
sfx.bRandomHeader = false;
|
||||
sfx.link = 0; // link to the empty sound.
|
||||
sfx.link = NO_SOUND; // link to the empty sound.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -440,7 +440,7 @@ static FSoundID S_AddSound (const char *logicalname, int lumpnum, FScanner *sc)
|
|||
{
|
||||
FRandomSoundList* rnd = soundEngine->ResolveRandomSound(sfx);
|
||||
rnd->Choices.Reset();
|
||||
rnd->Owner = 0;
|
||||
rnd->Owner = NO_SOUND;
|
||||
}
|
||||
sfx->lumpnum = lumpnum;
|
||||
sfx->bRandomHeader = false;
|
||||
|
@ -668,7 +668,7 @@ static void S_AddSNDINFO (int lump)
|
|||
ambient->periodmax = 0;
|
||||
ambient->volume = 0;
|
||||
ambient->attenuation = 0;
|
||||
ambient->sound = 0;
|
||||
ambient->sound = NO_SOUND;
|
||||
|
||||
sc.MustGetString ();
|
||||
ambient->sound = FSoundID(soundEngine->FindSoundTentative(sc.String));
|
||||
|
|
|
@ -581,7 +581,7 @@ void S_ParseSndSeq (int levellump)
|
|||
S_ClearSndSeq();
|
||||
|
||||
// be gone, compiler warnings
|
||||
stopsound = 0;
|
||||
stopsound = NO_SOUND;
|
||||
|
||||
memset (SeqTrans, -1, sizeof(SeqTrans));
|
||||
lastlump = 0;
|
||||
|
@ -618,7 +618,7 @@ void S_ParseSndSeq (int levellump)
|
|||
Sequences.Push (NULL);
|
||||
}
|
||||
ScriptTemp.Clear();
|
||||
stopsound = 0;
|
||||
stopsound = NO_SOUND;
|
||||
slot = NAME_None;
|
||||
if (seqtype == '[')
|
||||
{
|
||||
|
@ -828,7 +828,7 @@ void DSeqNode::ActivateSequence (int sequence)
|
|||
m_Sequence = sequence;
|
||||
m_DelayTics = 0;
|
||||
m_StopSound = Sequences[sequence]->StopSound;
|
||||
m_CurrentSoundID = 0;
|
||||
m_CurrentSoundID = NO_SOUND;
|
||||
m_Volume = 1; // Start at max volume...
|
||||
m_Atten = ATTN_IDLE; // ...and idle attenuation
|
||||
}
|
||||
|
@ -1214,7 +1214,7 @@ void DSeqNode::Tick ()
|
|||
if (!IsPlaying())
|
||||
{
|
||||
m_SequencePtr++;
|
||||
m_CurrentSoundID = 0;
|
||||
m_CurrentSoundID = NO_SOUND;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1273,13 +1273,13 @@ void DSeqNode::Tick ()
|
|||
case SS_CMD_DELAY:
|
||||
m_DelayTics = GetData(*m_SequencePtr);
|
||||
m_SequencePtr++;
|
||||
m_CurrentSoundID = 0;
|
||||
m_CurrentSoundID = NO_SOUND;
|
||||
return;
|
||||
|
||||
case SS_CMD_DELAYRAND:
|
||||
m_DelayTics = GetData(m_SequencePtr[0]) + pr_sndseq(m_SequencePtr[1]);
|
||||
m_SequencePtr += 2;
|
||||
m_CurrentSoundID = 0;
|
||||
m_CurrentSoundID = NO_SOUND;
|
||||
return;
|
||||
|
||||
case SS_CMD_VOLUME:
|
||||
|
@ -1383,7 +1383,7 @@ void SN_StopAllSequences (FLevelLocals *Level)
|
|||
for (node = Level->SequenceListHead; node; )
|
||||
{
|
||||
DSeqNode *next = node->NextSequence();
|
||||
node->m_StopSound = 0; // don't play any stop sounds
|
||||
node->m_StopSound = NO_SOUND; // don't play any stop sounds
|
||||
node->Destroy ();
|
||||
node = next;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue