[Scummvm-cvs-logs] CVS: scummvm/sound fmopl.cpp,1.10,1.11
Bertrand Augereau
tramboi at users.sourceforge.net
Sun Jun 1 14:53:06 CEST 2003
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/sky cd_intro.cpp,1.10,1.11 grid.cpp,1.8,1.9 intro.cpp,1.23,1.24 logic.cpp,1.76,1.77 logic.h,1.22,1.23 screen.cpp,1.18,1.19 sky.cpp,1.48,1.49 sky.h,1.27,1.28 sound.cpp,1.11,1.12 text.cpp,1.27,1.28 text.h,1.16,1.17
- Next message: [Scummvm-cvs-logs] CVS: scummvm/sky cd_intro.cpp,1.11,1.12 intro.cpp,1.24,1.25 screen.cpp,1.19,1.20 sky.cpp,1.49,1.50 sky.h,1.28,1.29
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv7419
Modified Files:
fmopl.cpp
Log Message:
Made some conversions explicit to prevent VC.NET 2003 from complaining
Index: fmopl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/fmopl.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- fmopl.cpp 4 May 2003 21:17:41 -0000 1.10
+++ fmopl.cpp 1 Jun 2003 21:52:53 -0000 1.11
@@ -88,9 +88,9 @@
#define FREQ_MASK ((1<<FREQ_SH)-1)
/* envelope output entries */
-#define ENV_BITS 10
-#define ENV_LEN (1<<ENV_BITS)
-#define ENV_STEP (128.0/ENV_LEN)
+static const int ENV_BITS = 10;
+static const int ENV_LEN = 1<<ENV_BITS;
+static const float ENV_STEP = 128.f/ENV_LEN;
#define MAX_ATT_INDEX ((1<<(ENV_BITS-1))-1) /*511*/
#define MIN_ATT_INDEX (0)
@@ -345,6 +345,7 @@
/* sustain level table (3dB per step) */
/* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/
#define SC(db) (UINT32) ( db * (2.0/ENV_STEP) )
+
static const UINT32 sl_tab[16]={
SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7),
SC( 8),SC( 9),SC(10),SC(11),SC(12),SC(13),SC(14),SC(31)
@@ -1125,7 +1126,7 @@
for (x=0; x<TL_RES_LEN; x++)
{
- m = (1<<16) / pow(2, (x+1) * (ENV_STEP/4.0) / 8.0);
+ m = (1<<16) / pow(2.0, (x+1) * (ENV_STEP/4.0) / 8.0);
m = floor(m);
/* we never reach (1<<16) here due to the (x+1) */
@@ -1165,9 +1166,9 @@
/* we never reach zero here due to ((i*2)+1) */
if (m>0.0)
- o = 8*log(1.0/m)/log(2); /* convert to 'decibels' */
+ o = 8*log(1.0/m)/log(2.0); /* convert to 'decibels' */
else
- o = 8*log(-1.0/m)/log(2); /* convert to 'decibels' */
+ o = 8*log(-1.0/m)/log(2.0); /* convert to 'decibels' */
o = o / (ENV_STEP/4);
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/sky cd_intro.cpp,1.10,1.11 grid.cpp,1.8,1.9 intro.cpp,1.23,1.24 logic.cpp,1.76,1.77 logic.h,1.22,1.23 screen.cpp,1.18,1.19 sky.cpp,1.48,1.49 sky.h,1.27,1.28 sound.cpp,1.11,1.12 text.cpp,1.27,1.28 text.h,1.16,1.17
- Next message: [Scummvm-cvs-logs] CVS: scummvm/sky cd_intro.cpp,1.11,1.12 intro.cpp,1.24,1.25 screen.cpp,1.19,1.20 sky.cpp,1.49,1.50 sky.h,1.28,1.29
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list