============ S_Update Called once each time through the main loop ============ */
| 2693 | ============ |
| 2694 | */ |
| 2695 | void S_Update( void ) { |
| 2696 | int i; |
| 2697 | channel_t *ch; |
| 2698 | |
| 2699 | if ( !s_soundStarted || s_soundMuted ) { |
| 2700 | return; |
| 2701 | } |
| 2702 | |
| 2703 | // |
| 2704 | // debugging output |
| 2705 | // |
| 2706 | if ( s_show->integer == 2 ) { |
| 2707 | //int total = 0; |
| 2708 | //int totalMeg =0; |
| 2709 | ch = s_channels; |
| 2710 | for (i=0 ; i<MAX_CHANNELS; i++, ch++) { |
| 2711 | if ( ch->thesfx && (ch->leftvol || ch->rightvol) ) { |
| 2712 | Com_Printf ("(%i) %3i %3i %s\n", ch->entnum, ch->leftvol, ch->rightvol, ch->thesfx->sSoundName); |
| 2713 | //total++; |
| 2714 | //totalMeg += Z_Size(ch->thesfx->pSoundData); |
| 2715 | //if (ch->thesfx->pMP3StreamHeader) |
| 2716 | //{ |
| 2717 | // totalMeg += sizeof(*ch->thesfx->pMP3StreamHeader); |
| 2718 | //} |
| 2719 | } |
| 2720 | } |
| 2721 | |
| 2722 | //if (total) |
| 2723 | // Com_Printf ("----(%i)---- painted: %i, SND %.2fMB\n", total, s_paintedtime, totalMeg/1024.0f/1024.0f); |
| 2724 | } |
| 2725 | |
| 2726 | // The Open AL code, handles background music in the S_UpdateRawSamples function |
| 2727 | #ifdef USE_OPENAL |
| 2728 | if (!s_UseOpenAL) |
| 2729 | #endif |
| 2730 | { |
| 2731 | // add raw data from streamed samples |
| 2732 | S_UpdateBackgroundTrack(); |
| 2733 | } |
| 2734 | |
| 2735 | // mix some sound |
| 2736 | S_Update_(); |
| 2737 | } |
| 2738 | |
| 2739 | void S_GetSoundtime(void) |
| 2740 | { |
no test coverage detected