aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-07-30 18:40:28 +0000
committerMax Horn2003-07-30 18:40:28 +0000
commit26d05c0190c9cca1444cc7a004c1149b3358ab10 (patch)
treeb4b472b94378fe50cffd6b05313d9e94c73cb70d
parentcae96f35b071de517b0097419504678c3d271629 (diff)
downloadscummvm-rg350-26d05c0190c9cca1444cc7a004c1149b3358ab10.tar.gz
scummvm-rg350-26d05c0190c9cca1444cc7a004c1149b3358ab10.tar.bz2
scummvm-rg350-26d05c0190c9cca1444cc7a004c1149b3358ab10.zip
the VC warning for unknown pragmas is now gloabally disabled, no need to work around it locally
svn-id: r9300
-rw-r--r--common/str.cpp4
-rw-r--r--gui/PopUpWidget.cpp4
-rw-r--r--gui/newgui.cpp4
-rw-r--r--gui/widget.cpp5
-rw-r--r--scumm/dialogs.cpp5
-rw-r--r--scumm/gfx.cpp5
-rw-r--r--scumm/scummvm.cpp4
-rw-r--r--sound/audiostream.cpp58
8 files changed, 47 insertions, 42 deletions
diff --git a/common/str.cpp b/common/str.cpp
index ea1240adf1..2c0de82f7d 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -23,10 +23,6 @@
#include <ctype.h>
-#ifdef _MSC_VER
-# pragma warning( disable : 4068 ) // unknown pragmas
-#endif
-
namespace ScummVM {
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp
index 2a8402fe98..dfd168bd47 100644
--- a/gui/PopUpWidget.cpp
+++ b/gui/PopUpWidget.cpp
@@ -24,10 +24,6 @@
#include "newgui.h"
#include "common/engine.h"
-#ifdef _MSC_VER
-# pragma warning( disable : 4068 ) // unknown pragmas
-#endif
-
#define UP_DOWN_BOX_HEIGHT 10
// Little up/down arrow
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index 28b76f4561..8e8f687732 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -27,10 +27,6 @@
# include "palm.h"
#endif
-#ifdef _MSC_VER
-# pragma warning( disable : 4068 ) // unknown pragma
-#endif
-
/*
* TODO list
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 4eadad7956..d16de51d0c 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -24,11 +24,6 @@
#include "newgui.h"
-#ifdef _MSC_VER
-# pragma warning( disable : 4068 ) // unknown pragma
-#endif
-
-
Widget::Widget (Dialog *boss, int x, int y, int w, int h)
: _type(0), _boss(boss), _x(x), _y(y), _w(w), _h(h),
_id(0), _flags(0), _hasFocus(false) {
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp
index bdaef6383e..ba2b72d258 100644
--- a/scumm/dialogs.cpp
+++ b/scumm/dialogs.cpp
@@ -44,11 +44,6 @@ extern void save_key_mapping();
extern void load_key_mapping();
#endif
-
-#ifdef _MSC_VER
-# pragma warning( disable : 4068 )
-#endif
-
struct ResString {
int num;
char string[80];
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index dcfaf800c9..a56c365a6d 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -29,11 +29,6 @@
#include "util.h"
-#ifdef _MSC_VER
-# pragma warning( disable : 4068 ) // turn off "unknown pragma" warning
-#endif
-
-
enum {
kScrolltime = 500, // ms scrolling is supposed to take
kPictureDelay = 20
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index caab9e2aff..faef46e4fd 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -52,10 +52,6 @@
#include <sys/stat.h>
#endif
-#ifdef _MSC_VER
-# pragma warning( disable : 4068 ) // turn off "unknown pragma" warning
-#endif
-
#ifdef _WIN32_WCE
extern bool isSmartphone(void);
#endif
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index d88ea852a9..ad40877fce 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -41,11 +41,9 @@ static inline int16 readSample(const byte *ptr) {
}
}
-#ifndef _MSC_VER
#pragma mark -
#pragma mark --- LinearMemoryStream ---
#pragma mark -
-#endif
template<bool stereo, bool is16Bit, bool isUnsigned>
@@ -75,11 +73,9 @@ public:
};
-#ifndef _MSC_VER
#pragma mark -
#pragma mark --- WrappedMemoryStream ---
#pragma mark -
-#endif
// Wrapped memory stream, to be used by the ChannelStream class (and possibly others?)
@@ -158,34 +154,76 @@ void WrappedMemoryStream<stereo, is16Bit, isUnsigned>::append(const byte *data,
}
-#ifndef _MSC_VER
#pragma mark -
#pragma mark --- MP3 (MAD) stream ---
#pragma mark -
-#endif
+/*
#ifdef USE_MAD
class MP3InputStream : public AudioInputStream {
struct mad_stream _stream;
struct mad_frame _frame;
struct mad_synth _synth;
uint32 _posInFrame;
+ int _chan;
+
+ void refill();
public:
// TODO
MP3InputStream();
};
MP3InputStream::MP3InputStream() {
+ _chan = 0;
}
-#endif
+void MP3InputStream::refill() {
+ // TODO
+}
+
+static inline int scale_sample(mad_fixed_t sample) {
+ // round
+ sample += (1L << (MAD_F_FRACBITS - 16));
+
+ // clip
+ if (sample > MAD_F_ONE - 1)
+ sample = MAD_F_ONE - 1;
+ else if (sample < -MAD_F_ONE)
+ sample = -MAD_F_ONE;
+
+ // quantize and scale to not saturate when mixing a lot of channels
+ return sample >> (MAD_F_FRACBITS + 1 - 16);
+}
+
+int16 MP3InputStream::read() {
+ if (_posInFrame >= _synth.pcm.length) {
+ refill();
+ }
+
+ int16 sample;
+ if (stereo) {
+ sample = (int16)scale_sample(_synth.pcm.samples[_chan][_posInFrame];
+ if (_chan == 0) {
+ _chan = 1;
+ } else {
+ _posInFrame++;
+ _chan = 0;
+ }
+ } else {
+ sample = (int16)scale_sample(_synth.pcm.samples[0][_posInFrame];
+ _posInFrame++;
+ }
+
+ return sample;
+}
+
+#endif
+*/
-#ifndef _MSC_VER
#pragma mark -
#pragma mark --- Ogg Vorbis stream ---
#pragma mark -
-#endif
#ifdef USE_VORBIS
@@ -264,11 +302,9 @@ void VorbisInputStream::refill() {
#endif
-#ifndef _MSC_VER
#pragma mark -
#pragma mark --- Input stream factories ---
#pragma mark -
-#endif
template<bool stereo>