aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2002-03-06 10:35:39 +0000
committerTravis Howell2002-03-06 10:35:39 +0000
commit4a98b9b9e96712e7dccf6c4c04533f3bd22430d8 (patch)
treec3a1c0c981453960f516a06a747450ad1819a8d6
parent4f560e976f040b84a99fa71aaed70a6682c4333c (diff)
downloadscummvm-rg350-4a98b9b9e96712e7dccf6c4c04533f3bd22430d8.tar.gz
scummvm-rg350-4a98b9b9e96712e7dccf6c4c04533f3bd22430d8.tar.bz2
scummvm-rg350-4a98b9b9e96712e7dccf6c4c04533f3bd22430d8.zip
Add Matti Hmlinen's patch to suppress warnings
svn-id: r3664
-rw-r--r--actor.cpp2
-rw-r--r--script_v2.cpp2
-rw-r--r--sound/fmopl.cpp96
3 files changed, 51 insertions, 49 deletions
diff --git a/actor.cpp b/actor.cpp
index e94076908c..f21bf1f488 100644
--- a/actor.cpp
+++ b/actor.cpp
@@ -385,7 +385,7 @@ void Scumm::startAnimActor(Actor *a, int frame) {
initActorCostumeData(a);
if (frame!=0x3E) {
- cost_decodeData(a, frame, -1);
+ cost_decodeData(a, frame, (uint) -1);
}
}
diff --git a/script_v2.cpp b/script_v2.cpp
index 8ed1e07ca1..dddc56e534 100644
--- a/script_v2.cpp
+++ b/script_v2.cpp
@@ -2486,7 +2486,7 @@ void Scumm::o6_miscOps() {
warning("o6_miscOps: stub11(%d)", args[1]);
break;
case 12:
- setCursorImg(args[1], -1, args[2]);
+ setCursorImg(args[1], (uint) -1, args[2]);
break;
case 13:
warning("o6_miscOps: stub13(%d,%d,%d,%d)",args[1],args[2],args[3],args[4]);
diff --git a/sound/fmopl.cpp b/sound/fmopl.cpp
index 3a2b8a3ec0..f079a71721 100644
--- a/sound/fmopl.cpp
+++ b/sound/fmopl.cpp
@@ -97,55 +97,57 @@ static const int slot_array[32]=
/* key scale level */
/* table is 3dB/OCT , DV converts this in TL step at 6dB/OCT */
-#define DV (EG_STEP/2)
+
+#define SC(mydb) ((UINT32) (mydb / (EG_STEP/2)))
+
static const UINT32 KSL_TABLE[8*16]=
{
/* OCT 0 */
- 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
- 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
- 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
- 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
+ SC(0.000), SC(0.000), SC(0.000), SC(0.000),
+ SC(0.000), SC(0.000), SC(0.000), SC(0.000),
+ SC(0.000), SC(0.000), SC(0.000), SC(0.000),
+ SC(0.000), SC(0.000), SC(0.000), SC(0.000),
/* OCT 1 */
- 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
- 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
- 0.000/DV, 0.750/DV, 1.125/DV, 1.500/DV,
- 1.875/DV, 2.250/DV, 2.625/DV, 3.000/DV,
+ SC(0.000), SC(0.000), SC(0.000), SC(0.000),
+ SC(0.000), SC(0.000), SC(0.000), SC(0.000),
+ SC(0.000), SC(0.750), SC(1.125), SC(1.500),
+ SC(1.875), SC(2.250), SC(2.625), SC(3.000),
/* OCT 2 */
- 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
- 0.000/DV, 1.125/DV, 1.875/DV, 2.625/DV,
- 3.000/DV, 3.750/DV, 4.125/DV, 4.500/DV,
- 4.875/DV, 5.250/DV, 5.625/DV, 6.000/DV,
+ SC(0.000), SC(0.000), SC(0.000), SC(0.000),
+ SC(0.000), SC(1.125), SC(1.875), SC(2.625),
+ SC(3.000), SC(3.750), SC(4.125), SC(4.500),
+ SC(4.875), SC(5.250), SC(5.625), SC(6.000),
/* OCT 3 */
- 0.000/DV, 0.000/DV, 0.000/DV, 1.875/DV,
- 3.000/DV, 4.125/DV, 4.875/DV, 5.625/DV,
- 6.000/DV, 6.750/DV, 7.125/DV, 7.500/DV,
- 7.875/DV, 8.250/DV, 8.625/DV, 9.000/DV,
+ SC(0.000), SC(0.000), SC(0.000), SC(1.875),
+ SC(3.000), SC(4.125), SC(4.875), SC(5.625),
+ SC(6.000), SC(6.750), SC(7.125), SC(7.500),
+ SC(7.875), SC(8.250), SC(8.625), SC(9.000),
/* OCT 4 */
- 0.000/DV, 0.000/DV, 3.000/DV, 4.875/DV,
- 6.000/DV, 7.125/DV, 7.875/DV, 8.625/DV,
- 9.000/DV, 9.750/DV,10.125/DV,10.500/DV,
- 10.875/DV,11.250/DV,11.625/DV,12.000/DV,
+ SC(0.000), SC(0.000), SC(3.000), SC(4.875),
+ SC(6.000), SC(7.125), SC(7.875), SC(8.625),
+ SC(9.000), SC(9.750), SC(10.125),SC(10.500),
+ SC(10.875),SC(11.250),SC(11.625),SC(12.000),
/* OCT 5 */
- 0.000/DV, 3.000/DV, 6.000/DV, 7.875/DV,
- 9.000/DV,10.125/DV,10.875/DV,11.625/DV,
- 12.000/DV,12.750/DV,13.125/DV,13.500/DV,
- 13.875/DV,14.250/DV,14.625/DV,15.000/DV,
+ SC(0.000), SC(3.000), SC(6.000), SC(7.875),
+ SC(9.000), SC(10.125),SC(10.875),SC(11.625),
+ SC(12.000),SC(12.750),SC(13.125),SC(13.500),
+ SC(13.875),SC(14.250),SC(14.625),SC(15.000),
/* OCT 6 */
- 0.000/DV, 6.000/DV, 9.000/DV,10.875/DV,
- 12.000/DV,13.125/DV,13.875/DV,14.625/DV,
- 15.000/DV,15.750/DV,16.125/DV,16.500/DV,
- 16.875/DV,17.250/DV,17.625/DV,18.000/DV,
+ SC(0.000), SC(6.000), SC(9.000), SC(10.875),
+ SC(12.000),SC(13.125),SC(13.875),SC(14.625),
+ SC(15.000),SC(15.750),SC(16.125),SC(16.500),
+ SC(16.875),SC(17.250),SC(17.625),SC(18.000),
/* OCT 7 */
- 0.000/DV, 9.000/DV,12.000/DV,13.875/DV,
- 15.000/DV,16.125/DV,16.875/DV,17.625/DV,
- 18.000/DV,18.750/DV,19.125/DV,19.500/DV,
- 19.875/DV,20.250/DV,20.625/DV,21.000/DV
+ SC(0.000), SC(9.000), SC(12.000),SC(13.875),
+ SC(15.000),SC(16.125),SC(16.875),SC(17.625),
+ SC(18.000),SC(18.750),SC(19.125),SC(19.500),
+ SC(19.875),SC(20.250),SC(20.625),SC(21.000)
};
-#undef DV
+#undef SC
/* sustain lebel 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) (db*((3/EG_STEP)*(1<<ENV_BITS)))+EG_DST
+#define SC(db) ((int) (db*((3/EG_STEP)*(1<<ENV_BITS)))+EG_DST)
static const INT32 SL_TABLE[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)
@@ -371,7 +373,7 @@ INLINE void set_ksl_tl(FM_OPL *OPL,int slot,int v)
int ksl = v>>6; /* 0 / 1.5 / 3 / 6 db/OCT */
SLOT->ksl = ksl ? 3-ksl : 31;
- SLOT->TL = (v&0x3f)*(0.75/EG_STEP); /* 0.75db step */
+ SLOT->TL = (INT32) ((v&0x3f)*(0.75/EG_STEP)); /* 0.75db step */
if( !(OPL->mode&0x80) )
{ /* not CSM latch total level */
@@ -462,7 +464,7 @@ INLINE void OPL_CALC_CH( OPL_CH *CH )
INLINE void OPL_CALC_RH( OPL_CH *CH )
{
UINT32 env_tam,env_sd,env_top,env_hh;
- int whitenoise = (rand()&1)*(WHITE_NOISE_db/EG_STEP);
+ int whitenoise = (int) ((rand()&1)*(WHITE_NOISE_db/EG_STEP));
INT32 tone8;
OPL_SLOT *SLOT;
@@ -555,8 +557,8 @@ static void init_timetables( FM_OPL *OPL , int ARRATE , int DRRATE )
if( i < 60 ) rate *= 1.0+(i&3)*0.25; /* b0-1 : x1 , x1.25 , x1.5 , x1.75 */
rate *= 1<<((i>>2)-1); /* b2-5 : shift bit */
rate *= (double)(EG_ENT<<ENV_BITS);
- OPL->AR_TABLE[i] = rate / ARRATE;
- OPL->DR_TABLE[i] = rate / DRRATE;
+ OPL->AR_TABLE[i] = (int) (rate / ARRATE);
+ OPL->DR_TABLE[i] = (int) (rate / DRRATE);
}
for (i = 60;i < 76;i++)
{
@@ -612,7 +614,7 @@ static int OPLOpenTable( void )
for (s = 1;s <= SIN_ENT/4;s++){
pom = sin(2*PI*s/SIN_ENT); /* sin */
pom = 20*log10(1/pom); /* decibel */
- j = pom / EG_STEP; /* TL_TABLE steps */
+ j = (int) (pom / EG_STEP); /* TL_TABLE steps */
/* degree 0 - 90 , degree 180 - 90 : plus section */
SIN_TABLE[ s] = SIN_TABLE[SIN_ENT/2-s] = &TL_TABLE[j];
@@ -643,16 +645,16 @@ static int OPLOpenTable( void )
for (i=0; i<AMS_ENT; i++)
{
pom = (1.0+sin(2*PI*i/AMS_ENT))/2; /* sin */
- AMS_TABLE[i] = (1.0/EG_STEP)*pom; /* 1dB */
- AMS_TABLE[AMS_ENT+i] = (4.8/EG_STEP)*pom; /* 4.8dB */
+ AMS_TABLE[i] = (int) ((1.0/EG_STEP)*pom); /* 1dB */
+ AMS_TABLE[AMS_ENT+i] = (int) ((4.8/EG_STEP)*pom); /* 4.8dB */
}
/* make LFO vibrate table */
for (i=0; i<VIB_ENT; i++)
{
/* 100cent = 1seminote = 6% ?? */
pom = (double)VIB_RATE*0.06*sin(2*PI*i/VIB_ENT); /* +-100sect step */
- VIB_TABLE[i] = VIB_RATE + (pom*0.07); /* +- 7cent */
- VIB_TABLE[VIB_ENT+i] = VIB_RATE + (pom*0.14); /* +-14cent */
+ VIB_TABLE[i] = (int) (VIB_RATE + (pom*0.07)); /* +- 7cent */
+ VIB_TABLE[VIB_ENT+i] = (int) (VIB_RATE + (pom*0.14)); /* +-14cent */
/* LOG(LOG_INF,("vib %d=%d\n",i,VIB_TABLE[VIB_ENT+i])); */
}
return 1;
@@ -698,11 +700,11 @@ static void OPL_initalize(FM_OPL *OPL)
/* make fnumber -> increment counter table */
for( fn=0 ; fn < 1024 ; fn++ )
{
- OPL->FN_TABLE[fn] = OPL->freqbase * fn * FREQ_RATE * (1<<7) / 2;
+ OPL->FN_TABLE[fn] = (int) (OPL->freqbase * fn * FREQ_RATE * (1<<7) / 2);
}
/* LFO freq.table */
- OPL->amsIncr = OPL->rate ? (double)AMS_ENT*(1<<AMS_SHIFT) / OPL->rate * 3.7 * ((double)OPL->clock/3600000) : 0;
- OPL->vibIncr = OPL->rate ? (double)VIB_ENT*(1<<VIB_SHIFT) / OPL->rate * 6.4 * ((double)OPL->clock/3600000) : 0;
+ OPL->amsIncr = (INT32) (OPL->rate ? (double)AMS_ENT*(1<<AMS_SHIFT) / OPL->rate * 3.7 * ((double)OPL->clock/3600000) : 0);
+ OPL->vibIncr = (INT32) (OPL->rate ? (double)VIB_ENT*(1<<VIB_SHIFT) / OPL->rate * 6.4 * ((double)OPL->clock/3600000) : 0);
}
/* ---------- write a OPL registers ---------- */