diff options
| -rw-r--r-- | build/data/sounds/music_inside1.mp3 | bin | 0 -> 12400849 bytes | |||
| -rw-r--r-- | build/zombies.exe | bin | 2097376 -> 2097887 bytes | |||
| -rw-r--r-- | data/sounds/music_inside1.mp3 | bin | 0 -> 12400849 bytes | |||
| -rw-r--r-- | include/asset_defs.h | 1 | ||||
| -rw-r--r-- | include/audio.h | 1 | ||||
| -rw-r--r-- | main.c | 2 | ||||
| -rw-r--r-- | src/asset_defs.c | 3 | ||||
| -rw-r--r-- | src/audio.c | 5 | ||||
| -rw-r--r-- | src/rounds.c | 1 |
9 files changed, 12 insertions, 1 deletions
diff --git a/build/data/sounds/music_inside1.mp3 b/build/data/sounds/music_inside1.mp3 Binary files differnew file mode 100644 index 0000000..96e791e --- /dev/null +++ b/build/data/sounds/music_inside1.mp3 diff --git a/build/zombies.exe b/build/zombies.exe Binary files differindex 7406319..bba25ee 100644 --- a/build/zombies.exe +++ b/build/zombies.exe diff --git a/data/sounds/music_inside1.mp3 b/data/sounds/music_inside1.mp3 Binary files differnew file mode 100644 index 0000000..96e791e --- /dev/null +++ b/data/sounds/music_inside1.mp3 diff --git a/include/asset_defs.h b/include/asset_defs.h index 9cfc48b..e1dd72a 100644 --- a/include/asset_defs.h +++ b/include/asset_defs.h @@ -73,6 +73,7 @@ Mix_Chunk* wav_character; Mix_Chunk* wav_round_change; Mix_Chunk* wav_step; +Mix_Music* music_inside1; void load_assets(); font* get_font(platform_window* window, float scale); diff --git a/include/audio.h b/include/audio.h index b2bdf1b..705748e 100644 --- a/include/audio.h +++ b/include/audio.h @@ -42,6 +42,7 @@ audio_event audio_events[MAX_AUDIO_EVENTS] = {0}; bool audio_channel_usage[NUM_AUDIO_CHANNELS] = {0}; int max_audio_events = MAX_AUDIO_EVENTS; +void play_music(Mix_Music* music); void audio_channel_finished(int channel); void add_throwable_audio_event_to_queue(audio_event_type event, throwable_type throwable, u32 playerid, vec3f position); void add_zombie_audio_event_to_queue(audio_event_type event, zombie_type zombie, u32 playerid, vec3f position); @@ -85,6 +85,8 @@ void handle_args(int argc, char **argv) { log_info("STATE: GAMESTATE_PLAYING"); global_state.state = GAMESTATE_PLAYING; + + play_music(music_inside1); } int main(int argc, char **argv) diff --git a/src/asset_defs.c b/src/asset_defs.c index 6bf6718..f53c5ea 100644 --- a/src/asset_defs.c +++ b/src/asset_defs.c @@ -69,6 +69,9 @@ void load_assets() { wav_round_change = Mix_LoadWAV("data/sounds/round_change.wav"); wav_character = Mix_LoadWAV("data/sounds/character.wav"); wav_step = Mix_LoadWAV("data/sounds/step.wav"); + + // music + music_inside1 = Mix_LoadMUS("data/sounds/music_inside1.mp3"); } font* get_font(platform_window* window, float scale) { diff --git a/src/audio.c b/src/audio.c index f741570..696b9ec 100644 --- a/src/audio.c +++ b/src/audio.c @@ -132,6 +132,11 @@ void audio_channel_finished(int channel) { audio_channel_usage[channel] = false; } +void play_music(Mix_Music* music) { + Mix_FadeInMusic(music, -1, 2000); + Mix_VolumeMusic(MIX_MAX_VOLUME/4); +} + void play_positioned_sound(int channel, Mix_Chunk* wav, vec3f pos, float max_audible_dist) { player* p = get_player_by_id(player_id); if (!p) return; diff --git a/src/rounds.c b/src/rounds.c index 88166c6..f5082a4 100644 --- a/src/rounds.c +++ b/src/rounds.c @@ -100,7 +100,6 @@ void update_round_server() if (characters_visible_count > round_text_len) characters_visible_count = round_text_len; if (visible_previously_count < characters_visible_count) { add_ui_audio_event_to_queue(EVENT_CHARACTER_TYPE); - log_info("CHARACTER!"); visible_previously_count = characters_visible_count; } } |
