char levelname[20];
char leveltheme[20];
char str[10];
+int sound_pos;
+
/* Local function prototypes: */
current_music = LEVEL_MUSIC;
halt_music();
}
+
if (!playing_music())
+ {
play_music( level_song, 1 );
+ sound_pos = 0;
+ }
+
if (tux_invincible_time > 0)
tux_invincible_time--;
+
+ if (current_music == LEVEL_MUSIC && time_left < 250)
+ {
+ if ((frame % 10) == 0)
+ {
+ set_music_position(sound_pos);
+ sound_pos++;
+ }
+ }
+ else
+ {
+ sound_pos = 0;
+ }
}
bill@newbreedsoftware.com
http://www.newbreedsoftware.com/supertux/
- April 22, 2000 - July 15, 2002
+ April 22, 2000 - December 27, 2003
*/
/*
#ifndef NOSOUND
+#include <SDL_mixer.h>
+
/* --- OPEN THE AUDIO DEVICE --- */
int open_audio (int frequency, Uint16 format, int channels, int chunksize)
}
+void set_music_position(int pos)
+{
+ if ((use_music == YES) && (audio_device == YES))
+ {
+ if (Mix_PlayingMusic())
+ {
+ Mix_SetMusicPosition(pos);
+ }
+ }
+}
+
+
+
void free_music(Mix_Music *music)
{
if ( music != NULL )
bill@newbreedsoftware.com
http://www.newbreedsoftware.com/supertux/
- April 22, 2000 - July 15, 2002
+ April 22, 2000 - December 27, 2003
Current maintainer:
Duong-Khang NGUYEN <neoneurone@users.sf.net>
int playing_music(void);
int halt_music(void);
int play_music(Mix_Music*music, int loops);
+void set_music_position(int pos);
void free_music(Mix_Music*music);
void free_chunk(Mix_Chunk*chunk);