Changeset 5285 for trunk/src


Ignore:
Timestamp:
Mar 6, 2001, 9:11:17 PM (24 years ago)
Author:
mike
Message:

Slightly modified for building with Watcom.

Location:
trunk/src/dsound
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/dsound/DSOUND.CPP

    r3099 r5285  
    1 /* $Id: DSOUND.CPP,v 1.7 2000-03-13 12:47:44 sandervl Exp $ */
     1/* $Id: DSOUND.CPP,v 1.8 2001-03-06 20:11:16 mike Exp $ */
    22
    33/*
     
    2929
    3030OS2IDirectSound *DS = NULL;
     31
     32extern "C" {
    3133
    3234//******************************************************************************
     
    241243  return S_FALSE;
    242244}//******************************************************************************
    243 
     245}
  • trunk/src/dsound/OS2PrimBuff.cpp

    r3925 r5285  
    1 /* $Id: OS2PrimBuff.cpp,v 1.4 2000-08-02 15:48:26 bird Exp $ */
     1/* $Id: OS2PrimBuff.cpp,v 1.5 2001-03-06 20:11:16 mike Exp $ */
    22/*
    33 *  DirectSound Primary Buffer
     
    5454OS2PrimBuff::OS2PrimBuff(OS2IDirectSound *DSound, const DSBUFFERDESC *lpDSBufferDesc )
    5555{
    56    LONG rc;
    57 
    5856   lpVtbl = &Vtbl;
    5957   Vtbl.AddRef               = PrimBufAddRef;
     
    224222   OS2PrimBuff *me = (OS2PrimBuff *)This;
    225223   LONG lDartPos;
    226    LONG lBytesPerSec;
    227224
    228225   dprintf(("DSOUND-PrimBuff: GetCurrentPosition"));
     
    266263   }
    267264
    268    copysize = min(dwSizeAllocated, (me->lpfxFormat->cbSize + sizeof(WAVEFORMATEX)));
     265   copysize = MIN(dwSizeAllocated, (me->lpfxFormat->cbSize + sizeof(WAVEFORMATEX)));
    269266   memcpy(lpfxFormat, me->lpfxFormat, copysize);
    270267
  • trunk/src/dsound/OS2PrimBuff.h

    r3555 r5285  
    4444
    4545    long  rate;    // Samples per second
    46     long  bps;     // Bits per sample 8 or 16 !!
    47     long  channels;// Number of Channels 1 or 2 MONO/Stereo
     46    WORD  bps;     // Bits per sample 8 or 16 !!
     47    WORD  channels;// Number of Channels 1 or 2 MONO/Stereo
    4848
    4949    OS2IDirectSound3DListener* listener;  // pointer to the associated 3DListener object
  • trunk/src/dsound/OS2SNDBUFFER.CPP

    r3555 r5285  
    1 /* $Id: OS2SNDBUFFER.CPP,v 1.8 2000-05-18 20:37:09 mike Exp $ */
     1/* $Id: OS2SNDBUFFER.CPP,v 1.9 2001-03-06 20:11:16 mike Exp $ */
    22
    33/*
     
    7777   // get the primary buffer from the DSound instance.
    7878   primary = DSound->primary;
    79  
     79
    8080   // We can still to the below logic just in case!!  Should not be required thow!
    8181   // If the primary SoundBuffer doesn't exist by now, we have to create it!
     
    328328      return DSERR_INVALIDPARAM;
    329329   }
    330    copysize = min(ddwSizeAllocated, (me->lpfxFormat->cbSize + sizeof(WAVEFORMATEX)));
     330   copysize = MIN(ddwSizeAllocated, (me->lpfxFormat->cbSize + sizeof(WAVEFORMATEX)));
    331331   memcpy(lpwfxFormat, me->lpfxFormat, copysize);
    332332
     
    457457{
    458458   OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
    459 
    460    ULONG ulBytesToPlay;
    461459
    462460   dprintf(("DSOUND-OS2IDirectSoundBuffer::SoundBufPlay (buf=%X)", me));
  • trunk/src/dsound/dart.cpp

    r3925 r5285  
    1 /* $Id: dart.cpp,v 1.3 2000-08-02 15:48:26 bird Exp $ */
     1/* $Id: dart.cpp,v 1.4 2001-03-06 20:11:16 mike Exp $ */
    22/*
    33 *  Dart Interface..
     
    345345long Dart_Stop(USHORT usDeviceID)
    346346{
    347    ULONG   rc;
    348 
    349347   dprintf(("DSOUND-DART: Dart_Stop"));
    350348
  • trunk/src/dsound/dsmixer.cpp

    r3925 r5285  
    1 /* $Id: dsmixer.cpp,v 1.3 2000-08-02 15:48:27 bird Exp $ */
     1/* $Id: dsmixer.cpp,v 1.4 2001-03-06 20:11:17 mike Exp $ */
    22/*
    33 * DirectSound Software Mixer
     
    161161   tomix = cbMix * 8 / outbits / outnch;
    162162
    163    memset(&mixbuf, 0, tomix * 2 * sizeof(mixbuf[0]));
     163   memset(&mixbuf[0], 0, tomix * 2 * sizeof(mixbuf[0]));
    164164
    165165   while (inBuf != NULL) {
     
    177177         if (mixbuf[i] <= -32768) data16b[outpos] = -32768;
    178178         else if (mixbuf[i] >= 32767) data16b[outpos] = 32767;
    179          else data16b[outpos] = mixbuf[i];
     179         else data16b[outpos] = (signed short)mixbuf[i];
    180180         outpos++;
    181181         if (outpos >= outlen) outpos = 0;
     
    186186         if (mixbuf[i] <= -32768) data8b[outpos] = 0;
    187187         else if (mixbuf[i] >= 32767) data8b[outpos] = 255;
    188          else data8b[outpos] = mixbuf[i] / 256 + 128;
     188         else data8b[outpos] = (signed short)mixbuf[i] / 256 + 128;
    189189         outpos++;
    190190         if (outpos >= outlen) outpos = 0;
  • trunk/src/dsound/initterm.cpp

    r5135 r5285  
    4646//******************************************************************************
    4747//******************************************************************************
    48 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
     48BOOL WINAPI OdinLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
    4949{
    5050   switch (fdwReason)
    5151   {
    5252   case DLL_PROCESS_ATTACH:
    53         return TRUE;
     53        return TRUE;
    5454
    5555   case DLL_THREAD_ATTACH:
    5656   case DLL_THREAD_DETACH:
    57         return TRUE;
     57        return TRUE;
    5858
    5959   case DLL_PROCESS_DETACH:
    60         ctordtorTerm();
    61         return TRUE;
     60#ifdef __IBMCPP__
     61        ctordtorTerm();
     62#endif
     63        return TRUE;
    6264   }
    6365   return FALSE;
     
    7173/* calling this function.                                                   */
    7274/****************************************************************************/
    73 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long
    74                                    ulFlag)
     75#ifdef __IBMCPP__
     76unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long ulFlag)
     77#else
     78unsigned long APIENTRY LibMain(unsigned long hModule, unsigned long ulFlag)
     79#endif
    7580{
    76    size_t i;
    77    APIRET rc;
    7881
    7982   /*-------------------------------------------------------------------------*/
     
    8689      case 0 :
    8790      {
    88          DosQueryModuleName(hModule, CCHMAXPATH, dsoundPath);
     91         DosQueryModuleName(hModule, CCHMAXPATH, dsoundPath);
    8992         char *endofpath = strrchr(dsoundPath, '\\');
    9093         if(endofpath) *(endofpath+1) = 0;
     94#ifdef __IBMCPP__
    9195         ctordtorInit();
    92 
     96#endif
    9397         CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    9498
    95          dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab);
    96          if(dllHandle == 0) 
    97                 return 0UL;
     99         dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&_Resource_PEResTab);
     100         if(dllHandle == 0)
     101                return 0UL;
    98102
    99103         break;
     
    102106      case 1 :
    103107         if(dllHandle) {
    104                 UnregisterLxDll(dllHandle);
     108                UnregisterLxDll(dllHandle);
    105109         }
    106110         break;
Note: See TracChangeset for help on using the changeset viewer.