- removed the string constructors from FSoundID.

Due to C++ conversion rules this was a bit too volatile. There's really not enough places where being able to pass a string directly into the sound API was beneficial - the two most frequent functions now got overloaded variants.
This commit is contained in:
Christoph Oelckers 2022-11-24 16:49:04 +01:00
commit 65a26d6779
26 changed files with 66 additions and 70 deletions

View file

@ -504,17 +504,17 @@ static void ParseInsideDecoration (Baggage &bag, AActor *defaults,
sc.Compare ("DeathSound"))
{
sc.MustGetString ();
defaults->DeathSound = sc.String;
defaults->DeathSound = S_FindSound(sc.String);
}
else if (def == DEF_BreakableDecoration && sc.Compare ("BurnDeathSound"))
{
sc.MustGetString ();
defaults->ActiveSound = sc.String;
defaults->ActiveSound = S_FindSound(sc.String);
}
else if (def == DEF_Projectile && sc.Compare ("SpawnSound"))
{
sc.MustGetString ();
defaults->SeeSound = sc.String;
defaults->SeeSound = S_FindSound(sc.String);
}
else if (def == DEF_Projectile && sc.Compare ("DoomBounce"))
{

View file

@ -144,7 +144,7 @@ FxExpression *ParseParameter(FScanner &sc, PClassActor *cls, PType *type)
if (type == TypeSound)
{
sc.MustGetString();
x = new FxConstant(FSoundID(sc.String), sc);
x = new FxConstant(S_FindSound(sc.String), sc);
}
else if (type == TypeBool || type == TypeSInt32 || type == TypeFloat64)
{
@ -879,7 +879,7 @@ static void DispatchScriptProperty(FScanner &sc, PProperty *prop, AActor *defaul
else if (f->Type == TypeSound)
{
sc.MustGetString();
*(FSoundID*)addr = sc.String;
*(FSoundID*)addr = S_FindSound(sc.String);
}
else if (f->Type == TypeColor)
{

View file

@ -467,7 +467,7 @@ void ZCCDoomCompiler::DispatchScriptProperty(PProperty *prop, ZCC_PropertyStmt *
}
else if (f->Type == TypeSound)
{
*(FSoundID*)addr = GetStringConst(ex, ctx);
*(FSoundID*)addr = S_FindSound(GetStringConst(ex, ctx));
}
else if (f->Type == TypeColor && ex->ValueType == TypeString) // colors can also be specified as ints.
{