[Scummvm-cvs-logs] SF.net SVN: scummvm: [28446] scummvm/trunk/engines/agi/sound.cpp

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Sat Aug 4 14:16:11 CEST 2007


Revision: 28446
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28446&view=rev
Author:   buddha_
Date:     2007-08-04 05:16:10 -0700 (Sat, 04 Aug 2007)

Log Message:
-----------
Fixes compilation error C2666: 'pow' : 7 overloads have similar conversions on Windows (VS2003), Xbox (VS2003) and Xbox 360 (VS2005). Thanks to Carch for reporting the compilation problems.

Modified Paths:
--------------
    scummvm/trunk/engines/agi/sound.cpp

Modified: scummvm/trunk/engines/agi/sound.cpp
===================================================================
--- scummvm/trunk/engines/agi/sound.cpp	2007-08-04 12:05:32 UTC (rev 28445)
+++ scummvm/trunk/engines/agi/sound.cpp	2007-08-04 12:16:10 UTC (rev 28446)
@@ -50,6 +50,9 @@
 	IIgsEnvelopeSegment seg[ENVELOPE_SEGMENT_COUNT];
 };
 
+// 2**(1/12) i.e. the 12th root of 2
+#define SEMITONE 1.059463094359295
+
 struct IIgsWaveInfo {
 	uint8 top;
 	uint8 addr;
@@ -199,7 +202,7 @@
 		if (readBytes == header.sampleSize) { // Check that we got all the data we requested
 			// Make an audio stream from the mono, 8 bit, unsigned input data
 			byte flags = Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_UNSIGNED;
-			int rate = (int) (1076 * pow(pow(2, 1/12.0), header.pitch));
+			int rate = (int) (1076 * pow(SEMITONE, header.pitch));
 			result = Audio::makeLinearInputStream(sampleData, header.sampleSize, rate, flags, 0, 0);
 		}
 	}


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