[Scummvm-cvs-logs] CVS: scummvm/sound fmopl.cpp,1.16,1.17 resample.cpp,1.10,1.11 resample.h,1.3,1.4

Pawel Kolodziejski aquadran at users.sourceforge.net
Fri Oct 3 00:46:03 CEST 2003


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv10077/sound

Modified Files:
	fmopl.cpp resample.cpp resample.h 
Log Message:
fixed compilation under msvc7

Index: fmopl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/fmopl.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- fmopl.cpp	19 Sep 2003 21:29:59 -0000	1.16
+++ fmopl.cpp	3 Oct 2003 07:45:41 -0000	1.17
@@ -34,10 +34,6 @@
 
 #include "common/util.h"
 
-#ifndef PI
-#define PI 3.14159265358979323846
-#endif
-
 /* -------------------- preliminary define section --------------------- */
 /* attack/decay rate time rate */
 #define OPL_ARRATE     141280  /* RATE 4 =  2826.24ms @ 3.6MHz */

Index: resample.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/resample.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- resample.cpp	8 Sep 2003 15:32:36 -0000	1.10
+++ resample.cpp	3 Oct 2003 07:45:41 -0000	1.11
@@ -59,10 +59,10 @@
 static int makeFilter(HWORD Imp[], HWORD ImpD[], UHWORD *LpScl, UHWORD Nwing,
 	       double Froll, double Beta);
 
-static WORD FilterUp(HWORD Imp[], HWORD ImpD[], UHWORD Nwing, bool Interp,
+static int32 FilterUp(HWORD Imp[], HWORD ImpD[], UHWORD Nwing, bool Interp,
 	      HWORD *Xp, HWORD Inc, HWORD Ph);
 
-static WORD FilterUD(HWORD Imp[], HWORD ImpD[], UHWORD Nwing, bool Interp,
+static int32 FilterUD(HWORD Imp[], HWORD ImpD[], UHWORD Nwing, bool Interp,
 	      HWORD *Xp, HWORD Ph, HWORD Inc, UHWORD dhb);
 
 
@@ -144,7 +144,7 @@
 
 #define IBUFFSIZE 4096                         /* Input buffer size */
 
-static inline HWORD WordToHword(WORD v, int scl)
+static inline HWORD WordToHword(int32 v, int scl)
 {
     HWORD out;
 
@@ -167,7 +167,7 @@
                  HWORD Imp[], HWORD ImpD[], bool Interp)
 {
     HWORD *Xp, *Ystart;
-    WORD v;
+    int32 v;
     
     double dt;                  /* Step through input signal */ 
     UWORD dtb;                  /* Fixed-point version of Dt */
@@ -203,7 +203,7 @@
                  HWORD Imp[], HWORD ImpD[], bool Interp)
 {
     HWORD *Xp, *Ystart;
-    WORD v;
+    int32 v;
     
     double dh;                  /* Step through filter impulse response */
     double dt;                  /* Step through input signal */
@@ -267,7 +267,7 @@
    /* Calculate ideal lowpass filter impulse response coefficients: */
    c[0] = 2.0*frq;
    for (i=1; i<N; i++) {
-       temp = M_PI*(double)i/(double)Num;
+       temp = PI*(double)i/(double)Num;
        c[i] = sin(2.0*temp*frq)/temp; /* Analog sinc function, cutoff = frq */
    }
 
@@ -346,13 +346,13 @@
 #pragma mark -
 
 
-WORD FilterUp(HWORD Imp[], HWORD ImpD[], 
+int32 FilterUp(HWORD Imp[], HWORD ImpD[], 
 		     UHWORD Nwing, bool Interp,
 		     HWORD *Xp, HWORD Ph, HWORD Inc)
 {
     HWORD *Hp, *Hdp = NULL, *End;
     HWORD a = 0;
-    WORD v, t;
+    int32 v, t;
     
     v=0;
     Hp = &Imp[Ph>>Na];
@@ -397,7 +397,7 @@
     return(v);
 }
 
-WORD FilterUD( HWORD Imp[], HWORD ImpD[],
+int32 FilterUD( HWORD Imp[], HWORD ImpD[],
 		     UHWORD Nwing, bool Interp,
 		     HWORD *Xp, HWORD Ph, HWORD Inc, UHWORD dhb)
 {
@@ -492,7 +492,7 @@
     
     for (i=0; i<Xoff; X1[i++]=0); /* Need Xoff zeros at begining of sample */
     for (i=0; i<Xoff; X2[i++]=0); /* Need Xoff zeros at begining of sample */
-        
+    
     do {
         if (!last)              /* If haven't read last sample yet */
         {
@@ -932,8 +932,8 @@
 	Xread = Xoff;               /* Position in input array to read into */
 	Time = (Xoff<<Np);          /* Current-time pointer for converter */
 	
-	Nout = SrcUp(X1, Y1, factor, &Time, Nx, Nwing, LpScl, Imp, ImpD, quadr);
-	Nout = SrcUD(X1, Y1, factor, &Time, Nx, Nwing, LpScl, Imp, ImpD, quadr);
+	Nout = SrcUp(X1, Y1, factor, &Time, Nx, Nwing, LpScl, Imp, ImpD, quadr != 0);
+	Nout = SrcUD(X1, Y1, factor, &Time, Nx, Nwing, LpScl, Imp, ImpD, quadr != 0);
 
 //	st_resample_start(&rstuff, inrate, outrate);
 }

Index: resample.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/resample.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- resample.h	8 Sep 2003 15:32:37 -0000	1.3
+++ resample.h	3 Oct 2003 07:45:41 -0000	1.4
@@ -31,7 +31,6 @@
 // From resample's stddef.h
 typedef int16	HWORD;
 typedef uint16	UHWORD;
-typedef int32	WORD;
 typedef uint32	UWORD;
 
 #define MAX_HWORD (32767)





More information about the Scummvm-git-logs mailing list