[Scummvm-cvs-logs] SF.net SVN: scummvm:[45098] scummvm/trunk/sound/vag.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Oct 15 01:22:32 CEST 2009


Revision: 45098
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45098&view=rev
Author:   fingolfin
Date:     2009-10-14 23:22:32 +0000 (Wed, 14 Oct 2009)

Log Message:
-----------
cleanup

Modified Paths:
--------------
    scummvm/trunk/sound/vag.cpp

Modified: scummvm/trunk/sound/vag.cpp
===================================================================
--- scummvm/trunk/sound/vag.cpp	2009-10-14 22:41:03 UTC (rev 45097)
+++ scummvm/trunk/sound/vag.cpp	2009-10-14 23:22:32 UTC (rev 45098)
@@ -40,11 +40,14 @@
 	delete _stream;
 }
 
-double f[5][2] = { { 0.0, 0.0 },
-                    {  60.0 / 64.0,  0.0 },
-                    {  115.0 / 64.0, -52.0 / 64.0 },
-                    {  98.0 / 64.0, -55.0 / 64.0 },
-                    {  122.0 / 64.0, -60.0 / 64.0 } };
+static const double s_vagDataTable[5][2] =
+	{
+		{  0.0, 0.0 },
+		{  60.0 / 64.0,  0.0 },
+		{  115.0 / 64.0, -52.0 / 64.0 },
+		{  98.0 / 64.0, -55.0 / 64.0 },
+		{  122.0 / 64.0, -60.0 / 64.0 }
+	};
 
 int VagStream::readBuffer(int16 *buffer, const int numSamples) {
 	int32 samplesDecoded = 0;
@@ -53,7 +56,7 @@
 		byte i = 0;
 
 		for (i = 28 - _samplesRemaining; i < 28 && samplesDecoded < numSamples; i++) {
-			_samples[i] = _samples[i] + _s1 * f[_predictor][0] + _s2 * f[_predictor][1];
+			_samples[i] = _samples[i] + _s1 * s_vagDataTable[_predictor][0] + _s2 * s_vagDataTable[_predictor][1];
 			_s2 = _s1;
 			_s1 = _samples[i];
 			int16 d = (int) (_samples[i] + 0.5);
@@ -94,7 +97,7 @@
 		}
 
 		for (i = 0; i < 28 && samplesDecoded < numSamples; i++) {
-			_samples[i] = _samples[i] + _s1 * f[_predictor][0] + _s2 * f[_predictor][1];
+			_samples[i] = _samples[i] + _s1 * s_vagDataTable[_predictor][0] + _s2 * s_vagDataTable[_predictor][1];
 			_s2 = _s1;
 			_s1 = _samples[i];
 			int16 d = (int) (_samples[i] + 0.5);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list