aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMatthew Hoops2012-04-02 10:07:45 -0400
committerMatthew Hoops2012-04-02 10:07:45 -0400
commitb6374a3103787415eaad1eb2ea29559bd4c7d372 (patch)
tree05defd71f9cd141917e2c36b7fab215718763063 /common
parent47ae65e49577b1f881c2f5956ad8550f0089a4fe (diff)
parentd50e34c1bd1152170737bea6bd85c08566426eb6 (diff)
downloadscummvm-rg350-b6374a3103787415eaad1eb2ea29559bd4c7d372.tar.gz
scummvm-rg350-b6374a3103787415eaad1eb2ea29559bd4c7d372.tar.bz2
scummvm-rg350-b6374a3103787415eaad1eb2ea29559bd4c7d372.zip
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'common')
-rw-r--r--common/gui_options.cpp9
-rw-r--r--common/gui_options.h13
-rw-r--r--common/quicktime.cpp15
-rw-r--r--common/quicktime.h36
-rw-r--r--common/rect.h5
5 files changed, 56 insertions, 22 deletions
diff --git a/common/gui_options.cpp b/common/gui_options.cpp
index 32a7cc9c41..e463232276 100644
--- a/common/gui_options.cpp
+++ b/common/gui_options.cpp
@@ -52,7 +52,6 @@ const struct GameOpt {
{ GUIO_MIDIGM, "midiGM" },
{ GUIO_NOASPECT, "noAspect" },
- { GUIO_EGAUNDITHER, "egaUndither" },
{ GUIO_RENDERHERCGREEN, "hercGreen" },
{ GUIO_RENDERHERCAMBER, "hercAmber" },
@@ -64,6 +63,14 @@ const struct GameOpt {
{ GUIO_RENDERPC9821, "pc9821" },
{ GUIO_RENDERPC9801, "pc9801" },
+ { GUIO_GAMEOPTIONS1, "gameOption1" },
+ { GUIO_GAMEOPTIONS2, "gameOption2" },
+ { GUIO_GAMEOPTIONS3, "gameOption3" },
+ { GUIO_GAMEOPTIONS4, "gameOption4" },
+ { GUIO_GAMEOPTIONS5, "gameOption5" },
+ { GUIO_GAMEOPTIONS6, "gameOption6" },
+ { GUIO_GAMEOPTIONS7, "gameOption7" },
+
{ GUIO_NONE, 0 }
};
diff --git a/common/gui_options.h b/common/gui_options.h
index 33ecccad63..9da19b1c3e 100644
--- a/common/gui_options.h
+++ b/common/gui_options.h
@@ -44,7 +44,6 @@
#define GUIO_MIDIGM "\021"
#define GUIO_NOASPECT "\022"
-#define GUIO_EGAUNDITHER "\023"
#define GUIO_RENDERHERCGREEN "\030"
#define GUIO_RENDERHERCAMBER "\031"
@@ -56,6 +55,16 @@
#define GUIO_RENDERPC9821 "\037"
#define GUIO_RENDERPC9801 "\040"
+// Special GUIO flags for the AdvancedDetector's caching of game specific
+// options.
+#define GUIO_GAMEOPTIONS1 "\041"
+#define GUIO_GAMEOPTIONS2 "\042"
+#define GUIO_GAMEOPTIONS3 "\043"
+#define GUIO_GAMEOPTIONS4 "\044"
+#define GUIO_GAMEOPTIONS5 "\045"
+#define GUIO_GAMEOPTIONS6 "\046"
+#define GUIO_GAMEOPTIONS7 "\047"
+
#define GUIO0() (GUIO_NONE)
#define GUIO1(a) (a)
#define GUIO2(a,b) (a b)
@@ -63,6 +72,8 @@
#define GUIO4(a,b,c,d) (a b c d)
#define GUIO5(a,b,c,d,e) (a b c d e)
#define GUIO6(a,b,c,d,e,f) (a b c d e f)
+#define GUIO7(a,b,c,d,e,f,g) (a b c d e f g)
+#define GUIO8(a,b,c,d,e,f,g,h) (a b c d e f g h)
namespace Common {
diff --git a/common/quicktime.cpp b/common/quicktime.cpp
index fb01e8de28..5176f83a35 100644
--- a/common/quicktime.cpp
+++ b/common/quicktime.cpp
@@ -164,6 +164,7 @@ void QuickTimeParser::initParseTable() {
{ &QuickTimeParser::readCMOV, MKTAG('c', 'm', 'o', 'v') },
{ &QuickTimeParser::readWAVE, MKTAG('w', 'a', 'v', 'e') },
{ &QuickTimeParser::readESDS, MKTAG('e', 's', 'd', 's') },
+ { &QuickTimeParser::readSMI, MKTAG('S', 'M', 'I', ' ') },
{ 0, 0 }
};
@@ -687,7 +688,7 @@ int QuickTimeParser::readWAVE(Atom atom) {
return -1;
if (track->sampleDescs[0]->getCodecTag() == MKTAG('Q', 'D', 'M', '2')) // Read extra data for QDM2
- track->extraData = _fd->readStream(atom.size - 8);
+ track->extraData = _fd->readStream(atom.size);
else if (atom.size > 8)
return readDefault(atom);
else
@@ -761,6 +762,18 @@ int QuickTimeParser::readESDS(Atom atom) {
return 0;
}
+int QuickTimeParser::readSMI(Atom atom) {
+ if (_tracks.empty())
+ return 0;
+
+ Track *track = _tracks.back();
+
+ // This atom just contains SVQ3 extra data
+ track->extraData = _fd->readStream(atom.size);
+
+ return 0;
+}
+
void QuickTimeParser::close() {
for (uint32 i = 0; i < _tracks.size(); i++)
delete _tracks[i];
diff --git a/common/quicktime.h b/common/quicktime.h
index efd2adbd21..974502d075 100644
--- a/common/quicktime.h
+++ b/common/quicktime.h
@@ -77,25 +77,13 @@ public:
*/
void setChunkBeginOffset(uint32 offset) { _beginOffset = offset; }
+ /** Find out if this parser has an open file handle */
bool isOpen() const { return _fd != 0; }
protected:
// This is the file handle from which data is read from. It can be the actual file handle or a decompressed stream.
SeekableReadStream *_fd;
- DisposeAfterUse::Flag _disposeFileHandle;
-
- struct Atom {
- uint32 type;
- uint32 offset;
- uint32 size;
- };
-
- struct ParseTable {
- int (QuickTimeParser::*func)(Atom atom);
- uint32 type;
- };
-
struct TimeToSampleEntry {
int count;
int duration;
@@ -174,18 +162,33 @@ protected:
virtual SampleDesc *readSampleDesc(Track *track, uint32 format) = 0;
- const ParseTable *_parseTable;
- bool _foundMOOV;
uint32 _timeScale;
uint32 _duration;
Rational _scaleFactorX;
Rational _scaleFactorY;
Array<Track *> _tracks;
+
+ void init();
+
+private:
+ struct Atom {
+ uint32 type;
+ uint32 offset;
+ uint32 size;
+ };
+
+ struct ParseTable {
+ int (QuickTimeParser::*func)(Atom atom);
+ uint32 type;
+ };
+
+ DisposeAfterUse::Flag _disposeFileHandle;
+ const ParseTable *_parseTable;
uint32 _beginOffset;
MacResManager *_resFork;
+ bool _foundMOOV;
void initParseTable();
- void init();
int readDefault(Atom atom);
int readLeaf(Atom atom);
@@ -205,6 +208,7 @@ protected:
int readCMOV(Atom atom);
int readWAVE(Atom atom);
int readESDS(Atom atom);
+ int readSMI(Atom atom);
};
} // End of namespace Common
diff --git a/common/rect.h b/common/rect.h
index e48ca53667..8d1243f7e4 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -261,9 +261,8 @@ struct Rect {
* @note the center point is rounded up and left when given an odd width and height
*/
static Rect center(int16 cx, int16 cy, int16 w, int16 h) {
- int dx = w / 2;
- int dy = h / 2;
- return Rect(cx - dx, cy - dy, cx + dx + (w & 1), cy + dy + (h & 1));
+ int x = cx - w / 2, y = cy - h / 2;
+ return Rect(x, y, x + w, y + h);
}
};