Mercurial > audlegacy-plugins
diff src/adplug/core/temuopl.cxx @ 955:4709ce4e209e trunk
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
author | chainsaw |
---|---|
date | Sat, 14 Apr 2007 15:23:50 -0700 |
parents | 48ebfc711a8c |
children |
line wrap: on
line diff
--- a/src/adplug/core/temuopl.cxx Sat Apr 14 08:48:41 2007 -0700 +++ b/src/adplug/core/temuopl.cxx Sat Apr 14 15:23:50 2007 -0700 @@ -21,55 +21,65 @@ #include "temuopl.h" -CTemuopl::CTemuopl(int rate, bool bit16, bool usestereo) - : use16bit(bit16), stereo(usestereo) +CTemuopl::CTemuopl (int rate, bool bit16, bool usestereo): +use16bit (bit16), +stereo (usestereo) { - opl = OPLCreate(OPL_TYPE_YM3812, 3579545, rate); + opl = OPLCreate (OPL_TYPE_YM3812, 3579545, rate); } -CTemuopl::~CTemuopl() +CTemuopl::~CTemuopl () { - OPLDestroy(opl); + OPLDestroy (opl); } -void CTemuopl::update(short *buf, int samples) +void +CTemuopl::update (short *buf, int samples) { int i; - if(use16bit) { - YM3812UpdateOne(opl,buf,samples); + if (use16bit) + { + YM3812UpdateOne (opl, buf, samples); - if(stereo) - for(i=samples-1;i>=0;i--) { - buf[i*2] = buf[i]; - buf[i*2+1] = buf[i]; + if (stereo) + for (i = samples - 1; i >= 0; i--) + { + buf[i * 2] = buf[i]; + buf[i * 2 + 1] = buf[i]; } - } else { - short *tempbuf = new short[stereo ? samples*2 : samples]; + } + else + { + short *tempbuf = new short[stereo ? samples * 2 : samples]; int i; - YM3812UpdateOne(opl,tempbuf,samples); + YM3812UpdateOne (opl, tempbuf, samples); - if(stereo) - for(i=samples-1;i>=0;i--) { - tempbuf[i*2] = tempbuf[i]; - tempbuf[i*2+1] = tempbuf[i]; + if (stereo) + for (i = samples - 1; i >= 0; i--) + { + tempbuf[i * 2] = tempbuf[i]; + tempbuf[i * 2 + 1] = tempbuf[i]; } - for(i=0;i<(stereo ? samples*2 : samples);i++) - ((char *)buf)[i] = (tempbuf[i] >> 8) ^ 0x80; + for (i = 0; i < (stereo ? samples * 2 : samples); i++) + ((char *) buf)[i] = (tempbuf[i] >> 8) ^ 0x80; - delete [] tempbuf; tempbuf = 0; + delete[]tempbuf; + tempbuf = 0; } } -void CTemuopl::write(int reg, int val) +void +CTemuopl::write (int reg, int val) { - OPLWrite(opl,0,reg); - OPLWrite(opl,1,val); + OPLWrite (opl, 0, reg); + OPLWrite (opl, 1, val); } -void CTemuopl::init() +void +CTemuopl::init () { - OPLResetChip(opl); + OPLResetChip (opl); }