- Timestamp:
- Mar 6, 2001, 9:11:17 PM (24 years ago)
- 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 sandervlExp $ */1 /* $Id: DSOUND.CPP,v 1.8 2001-03-06 20:11:16 mike Exp $ */ 2 2 3 3 /* … … 29 29 30 30 OS2IDirectSound *DS = NULL; 31 32 extern "C" { 31 33 32 34 //****************************************************************************** … … 241 243 return S_FALSE; 242 244 }//****************************************************************************** 243 245 } -
trunk/src/dsound/OS2PrimBuff.cpp
r3925 r5285 1 /* $Id: OS2PrimBuff.cpp,v 1. 4 2000-08-02 15:48:26 birdExp $ */1 /* $Id: OS2PrimBuff.cpp,v 1.5 2001-03-06 20:11:16 mike Exp $ */ 2 2 /* 3 3 * DirectSound Primary Buffer … … 54 54 OS2PrimBuff::OS2PrimBuff(OS2IDirectSound *DSound, const DSBUFFERDESC *lpDSBufferDesc ) 55 55 { 56 LONG rc;57 58 56 lpVtbl = &Vtbl; 59 57 Vtbl.AddRef = PrimBufAddRef; … … 224 222 OS2PrimBuff *me = (OS2PrimBuff *)This; 225 223 LONG lDartPos; 226 LONG lBytesPerSec;227 224 228 225 dprintf(("DSOUND-PrimBuff: GetCurrentPosition")); … … 266 263 } 267 264 268 copysize = min(dwSizeAllocated, (me->lpfxFormat->cbSize + sizeof(WAVEFORMATEX)));265 copysize = MIN(dwSizeAllocated, (me->lpfxFormat->cbSize + sizeof(WAVEFORMATEX))); 269 266 memcpy(lpfxFormat, me->lpfxFormat, copysize); 270 267 -
trunk/src/dsound/OS2PrimBuff.h
r3555 r5285 44 44 45 45 long rate; // Samples per second 46 longbps; // Bits per sample 8 or 16 !!47 longchannels;// Number of Channels 1 or 2 MONO/Stereo46 WORD bps; // Bits per sample 8 or 16 !! 47 WORD channels;// Number of Channels 1 or 2 MONO/Stereo 48 48 49 49 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:09mike Exp $ */1 /* $Id: OS2SNDBUFFER.CPP,v 1.9 2001-03-06 20:11:16 mike Exp $ */ 2 2 3 3 /* … … 77 77 // get the primary buffer from the DSound instance. 78 78 primary = DSound->primary; 79 79 80 80 // We can still to the below logic just in case!! Should not be required thow! 81 81 // If the primary SoundBuffer doesn't exist by now, we have to create it! … … 328 328 return DSERR_INVALIDPARAM; 329 329 } 330 copysize = min(ddwSizeAllocated, (me->lpfxFormat->cbSize + sizeof(WAVEFORMATEX)));330 copysize = MIN(ddwSizeAllocated, (me->lpfxFormat->cbSize + sizeof(WAVEFORMATEX))); 331 331 memcpy(lpwfxFormat, me->lpfxFormat, copysize); 332 332 … … 457 457 { 458 458 OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This; 459 460 ULONG ulBytesToPlay;461 459 462 460 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 birdExp $ */1 /* $Id: dart.cpp,v 1.4 2001-03-06 20:11:16 mike Exp $ */ 2 2 /* 3 3 * Dart Interface.. … … 345 345 long Dart_Stop(USHORT usDeviceID) 346 346 { 347 ULONG rc;348 349 347 dprintf(("DSOUND-DART: Dart_Stop")); 350 348 -
trunk/src/dsound/dsmixer.cpp
r3925 r5285 1 /* $Id: dsmixer.cpp,v 1. 3 2000-08-02 15:48:27 birdExp $ */1 /* $Id: dsmixer.cpp,v 1.4 2001-03-06 20:11:17 mike Exp $ */ 2 2 /* 3 3 * DirectSound Software Mixer … … 161 161 tomix = cbMix * 8 / outbits / outnch; 162 162 163 memset(&mixbuf , 0, tomix * 2 * sizeof(mixbuf[0]));163 memset(&mixbuf[0], 0, tomix * 2 * sizeof(mixbuf[0])); 164 164 165 165 while (inBuf != NULL) { … … 177 177 if (mixbuf[i] <= -32768) data16b[outpos] = -32768; 178 178 else if (mixbuf[i] >= 32767) data16b[outpos] = 32767; 179 else data16b[outpos] = mixbuf[i];179 else data16b[outpos] = (signed short)mixbuf[i]; 180 180 outpos++; 181 181 if (outpos >= outlen) outpos = 0; … … 186 186 if (mixbuf[i] <= -32768) data8b[outpos] = 0; 187 187 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; 189 189 outpos++; 190 190 if (outpos >= outlen) outpos = 0; -
trunk/src/dsound/initterm.cpp
r5135 r5285 46 46 //****************************************************************************** 47 47 //****************************************************************************** 48 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)48 BOOL WINAPI OdinLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) 49 49 { 50 50 switch (fdwReason) 51 51 { 52 52 case DLL_PROCESS_ATTACH: 53 53 return TRUE; 54 54 55 55 case DLL_THREAD_ATTACH: 56 56 case DLL_THREAD_DETACH: 57 57 return TRUE; 58 58 59 59 case DLL_PROCESS_DETACH: 60 ctordtorTerm(); 61 return TRUE; 60 #ifdef __IBMCPP__ 61 ctordtorTerm(); 62 #endif 63 return TRUE; 62 64 } 63 65 return FALSE; … … 71 73 /* calling this function. */ 72 74 /****************************************************************************/ 73 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long 74 ulFlag) 75 #ifdef __IBMCPP__ 76 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long ulFlag) 77 #else 78 unsigned long APIENTRY LibMain(unsigned long hModule, unsigned long ulFlag) 79 #endif 75 80 { 76 size_t i;77 APIRET rc;78 81 79 82 /*-------------------------------------------------------------------------*/ … … 86 89 case 0 : 87 90 { 88 91 DosQueryModuleName(hModule, CCHMAXPATH, dsoundPath); 89 92 char *endofpath = strrchr(dsoundPath, '\\'); 90 93 if(endofpath) *(endofpath+1) = 0; 94 #ifdef __IBMCPP__ 91 95 ctordtorInit(); 92 96 #endif 93 97 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 94 98 95 dllHandle = RegisterLxDll(hModule,LibMain, (PVOID)&_Resource_PEResTab);96 if(dllHandle == 0) 97 99 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&_Resource_PEResTab); 100 if(dllHandle == 0) 101 return 0UL; 98 102 99 103 break; … … 102 106 case 1 : 103 107 if(dllHandle) { 104 108 UnregisterLxDll(dllHandle); 105 109 } 106 110 break;
Note:
See TracChangeset
for help on using the changeset viewer.