MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / StartTerrainSound

Function StartTerrainSound

Descent3/GameLoop.cpp:2864–2881  ·  view source on GitHub ↗

Starts the sound on the terrain

Source from the content-addressed store, hash-verified

2862
2863// Starts the sound on the terrain
2864void StartTerrainSound() {
2865 // Set to be full on or full off
2866 if (OBJECT_OUTSIDE(Player_object))
2867 Terrain_sound_fade = 1.0;
2868 else
2869 Terrain_sound_fade = Frametime / FADE_TIME; // will fade to zero first time
2870
2871 // Start the sounds
2872 for (int b = 0; b < NUM_TERRAIN_SOUND_BANDS; b++) {
2873 terrain_sound_band *tb = &Terrain_sound_bands[b];
2874 if (tb->sound_index != -1) {
2875 Terrain_sound_handles[b] = Sound_system.Play2dSound(tb->sound_index);
2876 }
2877 }
2878
2879 // Set the volumes
2880 UpdateTerrainSound();
2881}
2882
2883// The main loop for D3. It renders, gets input, etc. for one frame
2884extern bool Skip_render_game_frame;

Callers 1

StartLevelSoundsFunction · 0.85

Calls 2

UpdateTerrainSoundFunction · 0.85
Play2dSoundMethod · 0.80

Tested by

no test coverage detected