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

Post Reply
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Important notice:A_StartSound and deprecation of A_PlaySound

Post by Graf Zahl »

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
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Important notice:A_StartSound and deprecation of A_PlayS

Post by Nash »

Thank you for this amazing new feature (unlimited sound channels per actor).
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Important notice:A_StartSound and deprecation of A_PlayS

Post by Matt »

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Important notice:A_StartSound and deprecation of A_PlayS

Post by Graf Zahl »

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.
Post Reply

Return to “Developer Blog”