- //
- // find which sound blocks have completed
- //
- while (1)
- {
- if ( snd_completed == snd_sent )
- {
- Con_DPrint("Sound overrun\n");
- break;
- }
-
- if ( ! (lpWaveHdr[ snd_completed & WAV_MASK].dwFlags & WHDR_DONE) )
- {
- break;
- }
-
- snd_completed++; // this buffer has been played
- }
+ paintpot += (paintedtime - prev_painted) * shm->format.channels * shm->format.width;
+ if (paintpot > WAV_BUFFERS * WAV_BUFFER_SIZE)
+ paintpot = WAV_BUFFERS * WAV_BUFFER_SIZE;
+ prev_painted = paintedtime;