Important notice:A_StartSound and deprecation of A_PlaySound

Here, developers communicate stuff that does not go onto the main News section or the front page of the site.
[Dev Blog] [Development Builds] [Git Change Log] [GZDoom Github Repo]

Moderator: GZDoom Developers

Important notice:A_StartSound and deprecation of A_PlaySound

Postby Graf Zahl » Sat Jan 04, 2020 7:32 am

I just made a final change to the newly added ZScript sound API for unlimited sound channels:

A_StartSound had two boolean parameters that are now folded into the flag word.
- the looping flag is identical with passing 'CHANF_LOOP|CHANF_NOSTOP', so now these two flags need to be set instead. There's a convenience definition of CHANF_LOOPING that does this with one value
- the local flag must now be specifed as CHANF_LOCAL.

As a result of this change, all code from the last two weeks that used A_StartSound needs to be reviewed! If optional parameters are omitted this is very likely to produce incorrect results without a compiler error!
In addition, all internal code still using A_PlaySound has been converted to A_StartSound and A_PlaySound officially been deprecated.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Important notice:A_StartSound and deprecation of A_PlayS

Postby Nash » Sat Jan 04, 2020 8:44 am

Thank you for this amazing new feature (unlimited sound channels per actor).
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Important notice:A_StartSound and deprecation of A_PlayS

Postby Matt » Sat Jan 04, 2020 2:51 pm

Sweet.

Does this mean we can plug in any arbitrary number for the channel parameter, or is this just in reference to the effective result of CHANF_OVERLAP?
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Important notice:A_StartSound and deprecation of A_PlayS

Postby Graf Zahl » Sat Jan 04, 2020 3:03 pm

You can plug in any number, except 0 and -1.
0 is still CHAN_AUTO and -1 is being used by some function as a "don't care" substitute when checking state.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Developer Blog

Who is online

Users browsing this forum: No registered users and 0 guests