Cube  Diff

Differences From Artifact [7cef1841c0]:

To Artifact [285830fef5]:


83
84
85
86
87
88
89
90
91
92
93
94
95
96






97
98
99
100


101
102
103
104



105
106
107


108
109
110
111
112
113





114
115
116
117
118
119
120
121







122
123
124


125
126
127
128
129
130
131
132
133
83
84
85
86
87
88
89







90
91
92
93
94
95
96
97


98
99




100
101
102
103


104
105






106
107
108
109
110








111
112
113
114
115
116
117



118
119
120

121
122
123
124
125
126
127







-
-
-
-
-
-
-
+
+
+
+
+
+


-
-
+
+
-
-
-
-
+
+
+

-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+

-







void
music(OFString *name)
{
	if (nosound)
		return;
	stopsound();
	if (soundvol && musicvol) {
		@autoreleasepool {
			name = [name stringByReplacingOccurrencesOfString:@"\\"
			                                       withString:@"/"];
			OFString *path =
			    [OFString stringWithFormat:@"packages/%@", name];
			OFIRI *IRI = [Cube.sharedInstance.gameDataIRI
			    IRIByAppendingPathComponent:path];
		name = [name stringByReplacingOccurrencesOfString:@"\\"
		                                       withString:@"/"];
		OFString *path =
		    [OFString stringWithFormat:@"packages/%@", name];
		OFIRI *IRI = [Cube.sharedInstance.gameDataIRI
		    IRIByAppendingPathComponent:path];

#ifdef USE_MIXER
			if ((mod = Mix_LoadMUS(
			         IRI.fileSystemRepresentation.UTF8String)) !=
		if ((mod = Mix_LoadMUS(
		         IRI.fileSystemRepresentation.UTF8String)) != NULL) {
			    NULL) {
				Mix_PlayMusic(mod, -1);
				Mix_VolumeMusic((musicvol * MAXVOL) / 255);
			}
			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) {
			    NULL) {
				FMUSIC_PlaySong(mod);
				FMUSIC_SetMasterVolume(mod, musicvol);
			} else if (stream = FSOUND_Stream_Open(
			               IRI.fileSystemRepresentation.UTF8String,
			               FSOUND_LOOP_NORMAL, 0, 0)) {
			FMUSIC_PlaySong(mod);
			FMUSIC_SetMasterVolume(mod, musicvol);
		} else if (stream = FSOUND_Stream_Open(
		               IRI.fileSystemRepresentation.UTF8String,
		               FSOUND_LOOP_NORMAL, 0, 0)) {
				int chan =
				    FSOUND_Stream_Play(FSOUND_FREE, stream);
				if (chan >= 0) {
					FSOUND_SetVolume(
					    chan, (musicvol * MAXVOL) / 255);
					FSOUND_SetPaused(chan, false);
				}
			} else {
			int chan = FSOUND_Stream_Play(FSOUND_FREE, stream);
			if (chan >= 0) {
				FSOUND_SetVolume(
				    chan, (musicvol * MAXVOL) / 255);
				FSOUND_SetPaused(chan, false);
			}
		} else {
				conoutf(
				    @"could not play music: %@", IRI.string);
			}
			conoutf(@"could not play music: %@", IRI.string);
		}
#endif
		}
	}
}
COMMAND(music, ARG_1STR)

#ifdef USE_MIXER
vector<Mix_Chunk *> samples;
#else