aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/scummsys.h4
-rw-r--r--queen/cutaway.cpp12
-rw-r--r--sound/fmopl.cpp4
-rw-r--r--sound/resample.cpp24
-rw-r--r--sound/resample.h1
5 files changed, 22 insertions, 23 deletions
diff --git a/common/scummsys.h b/common/scummsys.h
index 0711c13a62..11cf9e87ca 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -30,6 +30,10 @@
#include "config.h"
#endif
+#ifndef PI
+#define PI 3.14159265358979323846
+#endif
+
#if defined(_MSC_VER)
#define scumm_stricmp stricmp
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp
index 00cf00b599..cf30d23e61 100644
--- a/queen/cutaway.cpp
+++ b/queen/cutaway.cpp
@@ -91,7 +91,7 @@ void QueenCutaway::load(const char *filename, QueenResource *queenResource) {
return;
}
- if (0 == strcasecmp(filename, "comic.cut"))
+ if (0 == scumm_stricmp(filename, "comic.cut"))
/* XXX _songBeforeComic = CURRSONG */;
strcpy(_basename, filename);
@@ -295,11 +295,11 @@ void QueenCutaway::dumpCutawayObject(int index, CutawayObject &object)
void QueenCutaway::actionSpecialMove(int index) {
- switch (index) {
- default:
+// switch (index) {
+// default:
warning("Unhandled special move: %i", index);
- break;
- }
+// break;
+// }
}
byte *QueenCutaway::turnOnPeople(byte *ptr, CutawayObject &object) {
@@ -1028,7 +1028,7 @@ static char *right(char *str, int count) {
void QueenCutaway::talk(char *nextFilename) {
// Lines 2119-2131 in cutaway.c
- if (0 == strcasecmp(right(_talkFile, 4), ".dog")) {
+ if (0 == scumm_stricmp(right(_talkFile, 4), ".dog")) {
warning("QueenCutaway::talk() needed but not yet implemented");
nextFilename[0] = '\0';
}
diff --git a/sound/fmopl.cpp b/sound/fmopl.cpp
index 69ccb7b055..8d1f9526f1 100644
--- a/sound/fmopl.cpp
+++ b/sound/fmopl.cpp
@@ -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 */
diff --git a/sound/resample.cpp b/sound/resample.cpp
index 5a772389fb..fbd501403b 100644
--- a/sound/resample.cpp
+++ b/sound/resample.cpp
@@ -59,10 +59,10 @@ static void LpFilter(double c[], int N, double frq, double Beta, int Num);
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 @@ static WORD FilterUD(HWORD Imp[], HWORD ImpD[], UHWORD Nwing, bool Interp,
#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 @@ static int SrcUp(HWORD X[], HWORD Y[], double factor, UWORD *Time,
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 @@ static int SrcUD(HWORD X[], HWORD Y[], double factor, UWORD *Time,
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 @@ void LpFilter(double c[], int N, double frq, double Beta, int Num)
/* 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 @@ int makeFilter(HWORD Imp[], HWORD ImpD[], UHWORD *LpScl, UHWORD Nwing,
#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 @@ WORD FilterUp(HWORD Imp[], HWORD ImpD[],
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 @@ static int resampleWithFilter( /* number of output samples returned */
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 @@ ResampleRateConverter::ResampleRateConverter(st_rate_t inrate, st_rate_t outrate
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);
}
diff --git a/sound/resample.h b/sound/resample.h
index 46c33244ce..8fd5f0f19b 100644
--- a/sound/resample.h
+++ b/sound/resample.h
@@ -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)