forked from len0rd/rockbox
sdl: Remove platform-specific code
Also nuke the Makefiles of Duke Nukem 3D (pun intended). Change-Id: If2707cf079bfb9299347f9c5f980780134b6ecda
This commit is contained in:
parent
e19857e712
commit
183e45e8d0
49 changed files with 53 additions and 2191 deletions
|
|
@ -21,10 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "winquake.h"
|
||||
#endif
|
||||
|
||||
void S_Play(void);
|
||||
void S_PlayVol(void);
|
||||
void S_SoundList(void);
|
||||
|
|
@ -148,9 +144,7 @@ void S_Startup (void)
|
|||
|
||||
if (!rc)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
Con_Printf("S_Startup: SNDDMA_Init failed.\n");
|
||||
#endif
|
||||
sound_started = 0;
|
||||
return;
|
||||
}
|
||||
|
|
@ -561,11 +555,7 @@ void S_ClearBuffer (void)
|
|||
{
|
||||
int clear;
|
||||
|
||||
#ifdef _WIN32
|
||||
if (!sound_started || !shm || (!shm->buffer && !pDSBuf))
|
||||
#else
|
||||
if (!sound_started || !shm || !shm->buffer)
|
||||
#endif
|
||||
return;
|
||||
|
||||
if (shm->samplebits == 8)
|
||||
|
|
@ -573,43 +563,7 @@ void S_ClearBuffer (void)
|
|||
else
|
||||
clear = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
if (pDSBuf)
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD *pData;
|
||||
int reps;
|
||||
HRESULT hresult;
|
||||
|
||||
reps = 0;
|
||||
|
||||
while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, &pData, &dwSize, NULL, NULL, 0)) != DS_OK)
|
||||
{
|
||||
if (hresult != DSERR_BUFFERLOST)
|
||||
{
|
||||
Con_Printf ("S_ClearBuffer: DS::Lock Sound Buffer Failed\n");
|
||||
S_Shutdown ();
|
||||
return;
|
||||
}
|
||||
|
||||
if (++reps > 10000)
|
||||
{
|
||||
Con_Printf ("S_ClearBuffer: DS: couldn't restore buffer\n");
|
||||
S_Shutdown ();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Q_memset(pData, clear, shm->samples * shm->samplebits/8);
|
||||
|
||||
pDSBuf->lpVtbl->Unlock(pDSBuf, pData, dwSize, NULL, 0);
|
||||
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
Q_memset(shm->buffer, clear, shm->samples * shm->samplebits/8);
|
||||
}
|
||||
Q_memset(shm->buffer, clear, shm->samples * shm->samplebits/8);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -844,11 +798,6 @@ void GetSoundtime(void)
|
|||
|
||||
void S_ExtraUpdate (void)
|
||||
{
|
||||
|
||||
#ifdef _WIN32
|
||||
IN_Accumulate ();
|
||||
#endif
|
||||
|
||||
if (snd_noextraupdate.value)
|
||||
return; // don't pollute timings
|
||||
S_Update_();
|
||||
|
|
@ -880,25 +829,6 @@ void S_Update_(void)
|
|||
if (endtime - soundtime > samps)
|
||||
endtime = soundtime + samps;
|
||||
|
||||
#ifdef _WIN32
|
||||
// if the buffer was lost or stopped, restore it and/or restart it
|
||||
{
|
||||
DWORD dwStatus;
|
||||
|
||||
if (pDSBuf)
|
||||
{
|
||||
if (pDSBuf->lpVtbl->GetStatus (pDSBuf, &dwStatus) != DD_OK)
|
||||
Con_Printf ("Couldn't get sound buffer status\n");
|
||||
|
||||
if (dwStatus & DSBSTATUS_BUFFERLOST)
|
||||
pDSBuf->lpVtbl->Restore (pDSBuf);
|
||||
|
||||
if (!(dwStatus & DSBSTATUS_PLAYING))
|
||||
pDSBuf->lpVtbl->Play(pDSBuf, 0, 0, DSBPLAY_LOOPING);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
S_PaintChannels (endtime);
|
||||
|
||||
SNDDMA_Submit ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue