From 82ab3056fa52f78309ae3271114dbec28ceb9684 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 29 Feb 2012 16:48:25 +0100 Subject: ENGINES: Implement per-game options caching in AdvancedDetector via GUIO flags. --- common/gui_options.cpp | 8 ++++++++ common/gui_options.h | 10 ++++++++++ 2 files changed, 18 insertions(+) (limited to 'common') diff --git a/common/gui_options.cpp b/common/gui_options.cpp index 32a7cc9c41..59fbfb38d1 100644 --- a/common/gui_options.cpp +++ b/common/gui_options.cpp @@ -64,6 +64,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..1ea2b777d0 100644 --- a/common/gui_options.h +++ b/common/gui_options.h @@ -56,6 +56,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) -- cgit v1.2.3 From 4b2ca672f0ecc505f62736e8b08f0018ceacea06 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 29 Feb 2012 17:06:13 +0100 Subject: KYRA: Add per-game GUI option support. --- common/gui_options.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common') diff --git a/common/gui_options.h b/common/gui_options.h index 1ea2b777d0..774e57e133 100644 --- a/common/gui_options.h +++ b/common/gui_options.h @@ -73,6 +73,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 { -- cgit v1.2.3 From 57abb8f8439e9f8aeaf584a0d7b2e6407f09ea3c Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 22 Mar 2012 00:38:12 -0400 Subject: COMMON: Make Rect::center() more readable Thanks to Fingolfin for the suggestion --- common/rect.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/rect.h b/common/rect.h index 50ef0201dd..2bd3affafe 100644 --- a/common/rect.h +++ b/common/rect.h @@ -247,9 +247,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); } }; -- cgit v1.2.3 From 346c1fe46120ef89348971a55b0181ca37d0582b Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 25 Mar 2012 18:51:23 +0300 Subject: GUI: Change the undithering checkbox to be an engine-specific option --- common/gui_options.cpp | 1 - common/gui_options.h | 1 - 2 files changed, 2 deletions(-) (limited to 'common') diff --git a/common/gui_options.cpp b/common/gui_options.cpp index 59fbfb38d1..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" }, diff --git a/common/gui_options.h b/common/gui_options.h index 774e57e133..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" -- cgit v1.2.3 From 7c4787e0dcef994999185faf594faf748d5f2ad8 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Fri, 30 Mar 2012 13:27:20 -0400 Subject: COMMON: Read in QuickTime extra data for SVQ3 --- common/quicktime.cpp | 13 +++++++++++++ common/quicktime.h | 1 + 2 files changed, 14 insertions(+) (limited to 'common') diff --git a/common/quicktime.cpp b/common/quicktime.cpp index fb01e8de28..ae009da805 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 } }; @@ -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..12d79beb7b 100644 --- a/common/quicktime.h +++ b/common/quicktime.h @@ -205,6 +205,7 @@ protected: int readCMOV(Atom atom); int readWAVE(Atom atom); int readESDS(Atom atom); + int readSMI(Atom atom); }; } // End of namespace Common -- cgit v1.2.3 From e9f8d0e1a299fb23195648bdc9f455e1cebf1769 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Fri, 30 Mar 2012 13:38:21 -0400 Subject: COMMON: Clean up the QuickTime class a bit --- common/quicktime.h | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'common') diff --git a/common/quicktime.h b/common/quicktime.h index 12d79beb7b..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 _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); -- cgit v1.2.3 From 68e1a0418347ed79e3fe1bc9797b4ac32365b960 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Fri, 30 Mar 2012 14:40:14 -0400 Subject: AUDIO: Fix QDM2 extra data parsing --- common/quicktime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/quicktime.cpp b/common/quicktime.cpp index ae009da805..5176f83a35 100644 --- a/common/quicktime.cpp +++ b/common/quicktime.cpp @@ -688,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 -- cgit v1.2.3