Thread: [Opentnl-cvs] tnl/zap main.cpp,1.22,1.23 sfx.cpp,1.12,1.13 sfx.h,1.7,1.8
Brought to you by:
mark_frohnmayer,
s_alanet
From: Ben G. <s_a...@us...> - 2004-05-07 04:58:20
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5288/zap Modified Files: main.cpp sfx.cpp sfx.h Log Message: - Added -joystick command line for automatically enabling joystick device. - Added -gain # command line option to deal with gain on microphones. (Necessary for my mike to be audible.) Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** main.cpp 6 May 2004 01:55:21 -0000 1.22 --- main.cpp 7 May 2004 04:58:00 -0000 1.23 *************** *** 318,321 **** --- 318,332 ---- gMasterAddressString = argv[i+1]; } + else if(!stricmp(argv[i], "-joystick")) + { + if(hasAdditionalArg) + OptionsMenuUserInterface::joystickEnabled = true; + + } + else if(!stricmp(argv[i], "-gain")) + { + if(hasAdditionalArg) + SFXObject::setCaptureGain(atoi(argv[i+1])); + } else if(!stricmp(argv[i], "-dedicated")) { Index: sfx.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** sfx.h 7 May 2004 02:21:46 -0000 1.7 --- sfx.h 7 May 2004 04:58:00 -0000 1.8 *************** *** 75,78 **** --- 75,79 ---- static Point mListenerVelocity; static F32 mMaxDistance; + static S32 mCaptureGain; U32 mSFXIndex; *************** *** 99,102 **** --- 100,104 ---- static bool startRecording(); static void captureSamples(ByteBufferPtr sampleBuffer); + static void setCaptureGain(S32 amt); static void stopRecording(); Index: sfx.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** sfx.cpp 7 May 2004 02:21:46 -0000 1.12 --- sfx.cpp 7 May 2004 04:58:00 -0000 1.13 *************** *** 47,50 **** --- 47,55 ---- static U32 lastReadOffset = 0; + void SFXObject::setCaptureGain(S32 amt) + { + mCaptureGain = amt; + } + bool SFXObject::startRecording() { *************** *** 124,127 **** --- 129,137 ---- captureBuffer->Unlock(buf1, count1, buf2, count2); + // Endeavour futilely to do a gain pass + S16 *data = (S16*)buffer->getBuffer(); + for(U32 i=start/2; i<(start+sizeAdd)/2; i++) + data[i] <<= mCaptureGain; + lastReadOffset += count1 + count2; lastReadOffset %= BufferBytes; *************** *** 210,213 **** --- 220,224 ---- Point SFXObject::mListenerVelocity; F32 SFXObject::mMaxDistance = 500; + S32 SFXObject::mCaptureGain = 0; static ALuint gBuffers[NumSFXBuffers]; |