Migrate projectile to a class

FossilOrigin-Name: d3b4b2d476d809f7ab00502eed47614c949264690b3eccc7a96c73687d0f05bf
This commit is contained in:
Jonathan Schleifer 2025-03-09 11:24:01 +00:00
parent dae9d5553c
commit 410e244ed6
9 changed files with 97 additions and 82 deletions

View file

@ -92,14 +92,16 @@ music(OFString *name)
IRIByAppendingPathComponent:path];
#ifdef USE_MIXER
if (mod = Mix_LoadMUS(
IRI.fileSystemRepresentation.UTF8String)) {
if ((mod = Mix_LoadMUS(
IRI.fileSystemRepresentation.UTF8String)) !=
NULL) {
Mix_PlayMusic(mod, -1);
Mix_VolumeMusic((musicvol * MAXVOL) / 255);
}
#else
if (mod = FMUSIC_LoadSong(
IRI.fileSystemRepresentation.UTF8String)) {
if ((mod = FMUSIC_LoadSong(
IRI.fileSystemRepresentation.UTF8String)) !=
NULL) {
FMUSIC_PlaySong(mod);
FMUSIC_SetMasterVolume(mod, musicvol);
} else if (stream = FSOUND_Stream_Open(
@ -166,8 +168,8 @@ cleansound()
VAR(stereo, 0, 1, 1);
void
updatechanvol(int chan, OFVector3D *loc)
static void
updatechanvol(int chan, const OFVector3D *loc)
{
int vol = soundvol, pan = 255 / 2;
if (loc) {
@ -194,8 +196,8 @@ updatechanvol(int chan, OFVector3D *loc)
#endif
}
void
newsoundloc(int chan, OFVector3D *loc)
static void
newsoundloc(int chan, const OFVector3D *loc)
{
assert(chan >= 0 && chan < MAXCHAN);
soundlocs[chan].loc = *loc;
@ -230,7 +232,7 @@ playsoundc(int n)
int soundsatonce = 0, lastsoundmillis = 0;
void
playsound(int n, OFVector3D *loc)
playsound(int n, const OFVector3D *loc)
{
if (nosound)
return;