Changeset 3:c4af1e9ab8d1
- Timestamp:
- 08/01/08 22:07:29 (4 years ago)
- Branch:
- default
- convert_revision:
- svn:d0a2da98-017c-47d2-8c43-22b54484806d/trunk@4
- Files:
-
- 1 modified
-
music2/music.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
music2/music.cc
r0 r3 44 44 using namespace std; 45 45 46 #define MUSIC_VOLUME 0.2 47 46 48 int pcm_enable = 0; 47 49 Mix_Chunk *play_chunk[MIX_PCM_SIZE]; … … 199 201 } 200 202 } 203 204 int cur_vol = MUSIC_VOLUME*SDL_MIX_MAXVOLUME; 205 201 206 if (fadetime_total) { 202 207 // ²»³Ú€òÄä»ßÃæ (fade out) … … 208 213 } 209 214 // int cur_vol = 256*(count_total-fadecount)/count_total; 210 int cur_vol = SDL_MIX_MAXVOLUME*(count_total-fadecount)/count_total; 211 char* stream_dup = new char[len]; 212 memcpy(stream_dup, stream, len); 213 memset(stream, 0, len); 214 SDL_MixAudio(stream, (Uint8*)stream_dup, len, cur_vol); 215 cur_vol = cur_vol*(count_total-fadecount)/count_total; 215 216 fadecount += len/4; 216 217 } 218 219 char* stream_dup = new char[len]; 220 memcpy(stream_dup, stream, len); 221 memset(stream, 0, len); 222 SDL_MixAudio(stream, (Uint8*)stream_dup, len, cur_vol); 223 217 224 return; 218 225 } … … 243 250 fadecount = 0; 244 251 Mix_HookMusic( &(WavChunk::callback), (void*)&wav_playing); 245 Mix_VolumeMusic( 128);252 Mix_VolumeMusic(MUSIC_VOLUME*MIX_MAX_VOLUME); 246 253 return; 247 254 }
![(please configure the [header_logo] section in trac.ini)](/otakunoraifu/chrome/site/your_project_logo.png)