From aef8d2b04bfc2f3e28a5b58e55a7a27fa9da74ee Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Mon, 8 Jun 2009 17:47:37 +0000
Subject: Fix out of bounds memory access in Screen::drawShape.
svn-id: r41379
---
engines/kyra/screen.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index 2b3a9366e6..1a28f9b48f 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -1409,6 +1409,9 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
_dsOffscreenLeft /= _dsScaleW;
}
+ if (shapeHeight <= 0 || shpWidthScaled1 <= 0)
+ return;
+
if (pageNum == 0 || pageNum == 1)
addDirtyRect(x, y, shpWidthScaled1, shapeHeight);
clearOverlayRect(pageNum, x, y, shpWidthScaled1, shapeHeight);
--
cgit v1.2.3
From 51d0005af37140451afe4a448c22d14e973f5801 Mon Sep 17 00:00:00 2001
From: Fabio Battaglia
Date: Mon, 8 Jun 2009 17:54:44 +0000
Subject: sword1: slight cleanup of psx related sound code and comments
svn-id: r41380
---
engines/sword1/music.cpp | 2 +-
engines/sword1/sound.cpp | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp
index 9f602aca2c..fb9068dde7 100644
--- a/engines/sword1/music.cpp
+++ b/engines/sword1/music.cpp
@@ -272,7 +272,7 @@ bool MusicHandle::playPSX(uint16 id, bool loop) {
tableFile.close();
- if (size != 0xffffffff && size) {
+ if ((size != 0) && (size != 0xffffffff)) {
_file.seek(offset, SEEK_SET);
_audioSource = new Audio::VagStream(_file.readStream(size), loop);
fadeUp();
diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp
index 306d23db57..5577c66fc6 100644
--- a/engines/sword1/sound.cpp
+++ b/engines/sword1/sound.cpp
@@ -226,14 +226,14 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) {
return false;
}
- uint16 numRooms = file.readUint16LE(); // Number of rooms
+ uint16 numRooms = file.readUint16LE(); // Read number of rooms referenced in this file
file.seek(locIndex * 4 + 2); // 4 bytes per room, skip first 2 bytes
uint16 numLines = file.readUint16LE();
uint16 roomOffset = file.readUint16LE();
- file.seek(2 + numRooms * 4 + roomOffset * 2); // The offset is in terms of uint16's, so multiply by 2. Skip the 0x112 byte header too.
+ file.seek(2 + numRooms * 4 + roomOffset * 2); // The offset is in terms of uint16's, so multiply by 2. Skip the room indexes too.
locIndex = 0xFFFFFFFF;
--
cgit v1.2.3
From 0f116f1c38106015c9dbd068e306472c40bfeeee Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Mon, 8 Jun 2009 18:30:28 +0000
Subject: Cleanup.
svn-id: r41381
---
engines/kyra/screen.cpp | 57 ------------------------------------------
engines/kyra/screen.h | 4 ---
engines/kyra/seqplayer.cpp | 4 +--
engines/kyra/sequences_lok.cpp | 24 +++++++++---------
4 files changed, 14 insertions(+), 75 deletions(-)
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index 1a28f9b48f..0fe23552b7 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -656,63 +656,6 @@ void Screen::copyBlockToPage(int pageNum, int x, int y, int w, int h, const uint
}
}
-void Screen::copyFromCurPageBlock(int x, int y, int w, int h, const uint8 *src) {
- if (x < 0)
- x = 0;
- else if (x >= 40)
- return;
-
- if (x + w > 40)
- w = 40 - x;
-
- if (y < 0)
- y = 0;
- else if (y >= 200)
- return;
-
- if (y + h > 200)
- h = 200 - y;
-
- uint8 *dst = getPagePtr(_curPage) + y * SCREEN_W + x * 8;
-
- if (_curPage == 0 || _curPage == 1)
- addDirtyRect(x*8, y, w*8, h);
-
- clearOverlayRect(_curPage, x*8, y, w*8, h);
-
- while (h--) {
- memcpy(dst, src, w*8);
- dst += SCREEN_W;
- src += w*8;
- }
-}
-
-void Screen::copyCurPageBlock(int x, int y, int w, int h, uint8 *dst) {
- assert(dst);
- if (x < 0)
- x = 0;
- else if (x >= 40)
- return;
-
- if (x + w > 40)
- w = 40 - x;
-
- if (y < 0)
- y = 0;
- else if (y >= 200)
- return;
-
- if (y + h > 200)
- h = 200 - y;
-
- const uint8 *src = getPagePtr(_curPage) + y * SCREEN_W + x * 8;
- while (h--) {
- memcpy(dst, src, w*8);
- dst += w*8;
- src += SCREEN_W;
- }
-}
-
void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPage, int ticks, bool transparent) {
assert(sx >= 0 && w <= SCREEN_W);
int x;
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index 1691c73a90..8cbc606247 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -110,10 +110,6 @@ public:
// page cur. functions
int setCurPage(int pageNum);
-
- void copyFromCurPageBlock(int x, int y, int w, int h, const uint8 *src);
- void copyCurPageBlock(int x, int y, int w, int h, uint8 *dst);
-
void clearCurPage();
// page 0 functions
diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp
index 54d6f2cbe3..dd01cefb85 100644
--- a/engines/kyra/seqplayer.cpp
+++ b/engines/kyra/seqplayer.cpp
@@ -196,7 +196,7 @@ void SeqPlayer::s1_shuffleScreen() {
_screen->shuffleScreen(0, 16, 320, 128, 2, 0, 0, false);
_screen->_curPage = 2;
if (_specialBuffer)
- _screen->copyCurPageBlock(0, 16, 40, 128, _specialBuffer);
+ _screen->copyRegionToBuffer(_screen->_curPage, 0, 16, 40, 128, _specialBuffer);
_screen->_curPage = 0;
}
@@ -451,7 +451,7 @@ void SeqPlayer::s1_allocTempBuffer() {
assert(_specialBuffer);
int page = _screen->_curPage;
_screen->_curPage = 0;
- _screen->copyCurPageBlock(0, 0, 320, 128, _specialBuffer);
+ _screen->copyRegionToBuffer(_screen->_curPage, 0, 0, 320, 128, _specialBuffer);
_screen->_curPage = page;
}
}
diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp
index 12ede98ad4..d22dbd423d 100644
--- a/engines/kyra/sequences_lok.cpp
+++ b/engines/kyra/sequences_lok.cpp
@@ -1353,7 +1353,7 @@ int KyraEngine_LoK::handleBeadState() {
switch (_beadStateVar) {
case 0:
if (beadState1.x != -1 && _endSequenceBackUpRect) {
- _screen->copyFromCurPageBlock(beadState1.x >> 3, beadState1.y, beadState1.width, beadState1.height, _endSequenceBackUpRect);
+ _screen->copyBlockToPage(_screen->_curPage, beadState1.x, beadState1.y, beadState1.width << 3, beadState1.height, _endSequenceBackUpRect);
_screen->addBitBlitRect(beadState1.x, beadState1.y, beadState1.width2, beadState1.height);
}
@@ -1367,7 +1367,7 @@ int KyraEngine_LoK::handleBeadState() {
case 1:
if (beadState1.x != -1) {
if (_endSequenceBackUpRect) {
- _screen->copyFromCurPageBlock(beadState1.x >> 3, beadState1.y, beadState1.width, beadState1.height, _endSequenceBackUpRect);
+ _screen->copyBlockToPage(_screen->_curPage, beadState1.x, beadState1.y, beadState1.width << 3, beadState1.height, _endSequenceBackUpRect);
_screen->addBitBlitRect(beadState1.x, beadState1.y, beadState1.width2, beadState1.height);
}
beadState1.x = -1;
@@ -1402,14 +1402,14 @@ int KyraEngine_LoK::handleBeadState() {
beadState1.dstY = beadState1.y;
return 0;
} else {
- _screen->copyFromCurPageBlock(beadState1.x >> 3, beadState1.y, beadState1.width, beadState1.height, _endSequenceBackUpRect);
+ _screen->copyBlockToPage(_screen->_curPage, beadState1.x, beadState1.y, beadState1.width << 3, beadState1.height, _endSequenceBackUpRect);
_screen->addBitBlitRect(beadState1.x, beadState1.y, beadState1.width2, beadState1.height);
beadState1.x = x;
beadState1.y = y;
}
}
- _screen->copyCurPageBlock(x >> 3, y, beadState1.width, beadState1.height, _endSequenceBackUpRect);
+ _screen->copyRegionToBuffer(_screen->_curPage, x, y, beadState1.width << 3, beadState1.height, _endSequenceBackUpRect);
_screen->drawShape(2, _panPagesTable[_lastDisplayedPanPage++], x, y, 0, 0);
if (_lastDisplayedPanPage > 17)
@@ -1422,12 +1422,12 @@ int KyraEngine_LoK::handleBeadState() {
case 3:
if (_system->getMillis() >= timer1) {
timer1 = _system->getMillis() + 4 * _tickLength;
- _screen->copyFromCurPageBlock(beadState1.x >> 3, beadState1.y, beadState1.width, beadState1.height, _endSequenceBackUpRect);
+ _screen->copyBlockToPage(_screen->_curPage, beadState1.x, beadState1.y, beadState1.width << 3, beadState1.height, _endSequenceBackUpRect);
_screen->addBitBlitRect(beadState1.x, beadState1.y, beadState1.width2, beadState1.height);
beadState1.x = beadState1.dstX + table1[beadState1.tableIndex];
beadState1.y = beadState1.dstY + table2[beadState1.tableIndex];
- _screen->copyCurPageBlock(beadState1.x >> 3, beadState1.y, beadState1.width, beadState1.height, _endSequenceBackUpRect);
+ _screen->copyRegionToBuffer(_screen->_curPage, beadState1.x, beadState1.y, beadState1.width << 3, beadState1.height, _endSequenceBackUpRect);
_screen->drawShape(2, _panPagesTable[_lastDisplayedPanPage++], beadState1.x, beadState1.y, 0, 0);
if (_lastDisplayedPanPage >= 17)
@@ -1476,11 +1476,11 @@ int KyraEngine_LoK::handleBeadState() {
_beadStateVar = 0;
}
} else {
- _screen->copyFromCurPageBlock(beadState1.x >> 3, beadState1.y, beadState1.width, beadState1.height, _endSequenceBackUpRect);
+ _screen->copyBlockToPage(_screen->_curPage, beadState1.x >> 3, beadState1.y, beadState1.width, beadState1.height, _endSequenceBackUpRect);
_screen->addBitBlitRect(beadState1.x, beadState1.y, beadState1.width2, beadState1.height);
beadState1.x = x;
beadState1.y = y;
- _screen->copyCurPageBlock(beadState1.x >> 3, beadState1.y, beadState1.width, beadState1.height, _endSequenceBackUpRect);
+ _screen->copyRegionToBuffer(_screen->_curPage, beadState1.x, beadState1.y, beadState1.width << 3, beadState1.height, _endSequenceBackUpRect);
_screen->drawShape(2, _panPagesTable[_lastDisplayedPanPage++], x, y, 0, 0);
if (_lastDisplayedPanPage > 17) {
_lastDisplayedPanPage = 0;
@@ -1496,7 +1496,7 @@ int KyraEngine_LoK::handleBeadState() {
int x = 0, y = 0;
if (processBead(beadState1.x, beadState1.y, x, y, &beadState2)) {
if (beadState2.dstX == 290) {
- _screen->copyFromCurPageBlock(beadState1.x >> 3, beadState1.y, beadState1.width, beadState1.height, _endSequenceBackUpRect);
+ _screen->copyBlockToPage(_screen->_curPage, beadState1.x, beadState1.y, beadState1.width << 3, beadState1.height, _endSequenceBackUpRect);
uint32 nextRun = 0;
for (int i = 0; i < 8; ++i) {
nextRun = _system->getMillis() + _tickLength;
@@ -1513,7 +1513,7 @@ int KyraEngine_LoK::handleBeadState() {
}
initBeadState(beadState1.x, beadState1.y, 63, 60, 12, &beadState2);
} else {
- _screen->copyFromCurPageBlock(beadState1.x >> 3, beadState1.y, beadState1.width, beadState1.height, _endSequenceBackUpRect);
+ _screen->copyBlockToPage(_screen->_curPage, beadState1.x, beadState1.y, beadState1.width << 3, beadState1.height, _endSequenceBackUpRect);
_screen->addBitBlitRect(beadState1.x, beadState1.y, beadState1.width2, beadState1.height);
beadState1.x = -1;
beadState1.tableIndex = 0;
@@ -1521,11 +1521,11 @@ int KyraEngine_LoK::handleBeadState() {
_malcolmFlag = 9;
}
} else {
- _screen->copyFromCurPageBlock(beadState1.x >> 3, beadState1.y, beadState1.width, beadState1.height, _endSequenceBackUpRect);
+ _screen->copyBlockToPage(_screen->_curPage, beadState1.x, beadState1.y, beadState1.width << 3, beadState1.height, _endSequenceBackUpRect);
_screen->addBitBlitRect(beadState1.x, beadState1.y, beadState1.width2, beadState1.height);
beadState1.x = x;
beadState1.y = y;
- _screen->copyCurPageBlock(beadState1.x >> 3, beadState1.y, beadState1.width, beadState1.height, _endSequenceBackUpRect);
+ _screen->copyRegionToBuffer(_screen->_curPage, beadState1.x, beadState1.y, beadState1.width << 3, beadState1.height, _endSequenceBackUpRect);
_screen->drawShape(2, _panPagesTable[_lastDisplayedPanPage++], x, y, 0, 0);
if (_lastDisplayedPanPage > 17)
_lastDisplayedPanPage = 0;
--
cgit v1.2.3
From 7f5b28ee8378c031bf39f2937414d61b2f842f96 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Mon, 8 Jun 2009 20:11:07 +0000
Subject: - Cleanup - Fix regression in Kyra1 outro
svn-id: r41384
---
engines/kyra/seqplayer.cpp | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp
index dd01cefb85..5f792d07c6 100644
--- a/engines/kyra/seqplayer.cpp
+++ b/engines/kyra/seqplayer.cpp
@@ -194,21 +194,18 @@ void SeqPlayer::s1_copyWaitTicks() {
void SeqPlayer::s1_shuffleScreen() {
_screen->shuffleScreen(0, 16, 320, 128, 2, 0, 0, false);
- _screen->_curPage = 2;
if (_specialBuffer)
- _screen->copyRegionToBuffer(_screen->_curPage, 0, 16, 40, 128, _specialBuffer);
+ _screen->copyRegionToBuffer(2, 0, 16, 320, 128, _specialBuffer);
_screen->_curPage = 0;
}
void SeqPlayer::s1_copyView() {
- int y = 128;
- if (!_copyViewOffs)
- y -= 8;
+ int h = !_copyViewOffs ? 120 : 128;
if (_specialBuffer && !_copyViewOffs)
- _screen->copyToPage0(16, y, 3, _specialBuffer);
+ _screen->copyToPage0(16, h, 3, _specialBuffer);
else
- _screen->copyRegion(0, 16, 0, 16, 320, y, 2, 0);
+ _screen->copyRegion(0, 16, 0, 16, 320, h, 2, 0);
}
void SeqPlayer::s1_loopInit() {
@@ -449,10 +446,7 @@ void SeqPlayer::s1_allocTempBuffer() {
if (!_specialBuffer && !_copyViewOffs) {
_specialBuffer = new uint8[40960];
assert(_specialBuffer);
- int page = _screen->_curPage;
- _screen->_curPage = 0;
- _screen->copyRegionToBuffer(_screen->_curPage, 0, 0, 320, 128, _specialBuffer);
- _screen->_curPage = page;
+ _screen->copyRegionToBuffer(2, 0, 16, 320, 128, _specialBuffer);
}
}
}
--
cgit v1.2.3
From 8b1a6b1b6d7b56c1f71f573466d5197dfeddf2d5 Mon Sep 17 00:00:00 2001
From: John Willis
Date: Mon, 8 Jun 2009 20:31:49 +0000
Subject: Virtual Keyboard: Add some quick changes to the virtual keyboard to
activate submit and cancel events from the default lowercase keyboards. This
makes it possible to cancel and submit without having to call
Common::KEYCODE_F7 again. Sorry for the nasty (temp) graphics.
svn-id: r41385
---
backends/vkeybd/packs/vkeybd_default.zip | Bin 505646 -> 508756 bytes
.../packs/vkeybd_default/lowercase320x240.bmp | Bin 153654 -> 153654 bytes
.../packs/vkeybd_default/lowercase640x480.bmp | Bin 612534 -> 612534 bytes
.../vkeybd/packs/vkeybd_default/vkeybd_default.xml | 6 ++++++
4 files changed, 6 insertions(+)
diff --git a/backends/vkeybd/packs/vkeybd_default.zip b/backends/vkeybd/packs/vkeybd_default.zip
index c58c26fc5f..9311b2a902 100644
Binary files a/backends/vkeybd/packs/vkeybd_default.zip and b/backends/vkeybd/packs/vkeybd_default.zip differ
diff --git a/backends/vkeybd/packs/vkeybd_default/lowercase320x240.bmp b/backends/vkeybd/packs/vkeybd_default/lowercase320x240.bmp
index 27a450f2d2..3270bf21e4 100644
Binary files a/backends/vkeybd/packs/vkeybd_default/lowercase320x240.bmp and b/backends/vkeybd/packs/vkeybd_default/lowercase320x240.bmp differ
diff --git a/backends/vkeybd/packs/vkeybd_default/lowercase640x480.bmp b/backends/vkeybd/packs/vkeybd_default/lowercase640x480.bmp
index 3df2a58b83..610f0844d0 100644
Binary files a/backends/vkeybd/packs/vkeybd_default/lowercase640x480.bmp and b/backends/vkeybd/packs/vkeybd_default/lowercase640x480.bmp differ
diff --git a/backends/vkeybd/packs/vkeybd_default/vkeybd_default.xml b/backends/vkeybd/packs/vkeybd_default/vkeybd_default.xml
index aba31b1096..982c4f45ef 100644
--- a/backends/vkeybd/packs/vkeybd_default/vkeybd_default.xml
+++ b/backends/vkeybd/packs/vkeybd_default/vkeybd_default.xml
@@ -76,6 +76,8 @@
+
+
@@ -151,6 +153,8 @@
+
+
@@ -223,6 +227,8 @@
+
+
--
cgit v1.2.3
From cfae0162008fb27dfd8e0e6c8aeab1721974c562 Mon Sep 17 00:00:00 2001
From: Kari Salminen
Date: Mon, 8 Jun 2009 20:46:21 +0000
Subject: Convert FWRenderer and OSRenderer to use Cine::Palette. Also fix some
bugs that came up in testing of Cine::Palette.
svn-id: r41386
---
engines/cine/gfx.cpp | 327 +++++++++++++--------------------------------------
engines/cine/gfx.h | 14 +--
engines/cine/pal.cpp | 85 +++----------
engines/cine/pal.h | 17 +--
4 files changed, 108 insertions(+), 335 deletions(-)
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index d388a9e206..87e0e0aa5b 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -90,9 +90,9 @@ static const byte cursorPalette[] = {
/*! \brief Initialize renderer
*/
-FWRenderer::FWRenderer() : _background(NULL), _palette(NULL), _cmd(""),
+FWRenderer::FWRenderer() : _background(NULL), _backupPal(), _cmd(""),
_cmdY(0), _messageBg(0), _backBuffer(new byte[_screenSize]),
- _activeLowPal(NULL), _changePal(0), _showCollisionPage(false) {
+ _activePal(), _changePal(0), _showCollisionPage(false) {
assert(_backBuffer);
@@ -104,21 +104,17 @@ FWRenderer::FWRenderer() : _background(NULL), _palette(NULL), _cmd(""),
*/
FWRenderer::~FWRenderer() {
delete[] _background;
- delete[] _palette;
delete[] _backBuffer;
- delete[] _activeLowPal;
}
/* \brief Reset renderer state
*/
void FWRenderer::clear() {
delete[] _background;
- delete[] _palette;
- delete[] _activeLowPal;
_background = NULL;
- _palette = NULL;
- _activeLowPal = NULL;
+ _backupPal.clear();
+ _activePal.clear();
memset(_backBuffer, 0, _screenSize);
@@ -550,59 +546,39 @@ void FWRenderer::setCommand(Common::String cmd) {
/*! \brief Refresh current palette
*/
void FWRenderer::refreshPalette() {
- int i;
- byte pal[16*4];
-
- assert(_activeLowPal);
-
- for (i = 0; i < 16; i++) {
- pal[i * 4 + 2] = ((_activeLowPal[i] & 0x007) >> 0) * 32;
- pal[i * 4 + 1] = ((_activeLowPal[i] & 0x070) >> 4) * 32;
- pal[i * 4 + 0] = ((_activeLowPal[i] & 0x700) >> 8) * 32;
- pal[i * 4 + 3] = 0;
- }
-
- g_system->setPalette(pal, 0, 16);
+ assert(_activePal.isValid() && !_activePal.empty());
+ _activePal.setGlobalOSystemPalette();
_changePal = 0;
}
/*! \brief Load palette of current background
*/
void FWRenderer::reloadPalette() {
- assert(_palette);
-
- if (!_activeLowPal) {
- _activeLowPal = new uint16[_lowPalSize];
- }
-
- assert(_activeLowPal);
-
- memcpy(_activeLowPal, _palette, _lowPalSize * sizeof (uint16));
+ assert(_backupPal.isValid() && !_backupPal.empty());
+ _activePal = _backupPal;
_changePal = 1;
}
/*! \brief Load background into renderer
* \param bg Raw background data
+ * \todo Combine with OSRenderer's version of loadBg16
*/
void FWRenderer::loadBg16(const byte *bg, const char *name, unsigned int idx) {
assert(idx == 0);
- int i;
if (!_background) {
_background = new byte[_screenSize];
}
- if (!_palette) {
- _palette = new uint16[_lowPalSize];
- }
-
- assert(_background && _palette);
+ assert(_background);
strcpy(_bgName, name);
- for (i = 0; i < _lowPalSize; i++, bg += 2) {
- _palette[i] = READ_BE_UINT16(bg);
- }
+ // Load the 16 color palette
+ _backupPal.load(bg, kLowPalNumBytes, kLowPalFormat, kLowPalNumColors, CINE_BIG_ENDIAN);
+
+ // Jump over the palette data to the background data
+ bg += kLowPalNumBytes;
gfxConvertSpriteToRaw(_background, bg, 160, 200);
}
@@ -668,25 +644,15 @@ const char *FWRenderer::getBgName(uint idx) const {
* \param fHandle Savefile open for reading
*/
void FWRenderer::restorePalette(Common::SeekableReadStream &fHandle) {
- int i;
+ byte buf[kLowPalNumBytes];
- if (!_palette) {
- _palette = new uint16[_lowPalSize];
- }
+ // Load the active 16 color palette from file
+ fHandle.read(buf, kLowPalNumBytes);
+ _activePal.load(buf, sizeof(buf), kLowPalFormat, kLowPalNumColors, CINE_BIG_ENDIAN);
- if (!_activeLowPal) {
- _activeLowPal = new uint16[_lowPalSize];
- }
-
- assert(_palette && _activeLowPal);
-
- for (i = 0; i < _lowPalSize; i++) {
- _activeLowPal[i] = fHandle.readUint16BE();
- }
-
- for (i = 0; i < _lowPalSize; i++) {
- _palette[i] = fHandle.readUint16BE();
- }
+ // Load the backup 16 color palette from file
+ fHandle.read(buf, kLowPalNumBytes);
+ _backupPal.load(buf, sizeof(buf), kLowPalFormat, kLowPalNumColors, CINE_BIG_ENDIAN);
_changePal = 1;
}
@@ -695,58 +661,59 @@ void FWRenderer::restorePalette(Common::SeekableReadStream &fHandle) {
* \param fHandle Savefile open for writing
*/
void FWRenderer::savePalette(Common::OutSaveFile &fHandle) {
- int i;
+ byte buf[kLowPalNumBytes];
- assert(_palette && _activeLowPal);
+ // Make sure the active palette has the correct format and color count
+ assert(_activePal.colorFormat() == kLowPalFormat);
+ assert(_activePal.colorCount() == kLowPalNumColors);
- for (i = 0; i < _lowPalSize; i++) {
- fHandle.writeUint16BE(_activeLowPal[i]);
- }
+ // Make sure the backup palette has the correct format and color count
+ assert(_backupPal.colorFormat() == kLowPalFormat);
+ assert(_backupPal.colorCount() == kLowPalNumColors);
- for (i = 0; i < _lowPalSize; i++) {
- fHandle.writeUint16BE(_palette[i]);
- }
+ // Write the active palette to the file
+ _activePal.save(buf, sizeof(buf), CINE_BIG_ENDIAN);
+ fHandle.write(buf, kLowPalNumBytes);
+
+ // Write the backup palette to the file
+ _backupPal.save(buf, sizeof(buf), CINE_BIG_ENDIAN);
+ fHandle.write(buf, kLowPalNumBytes);
}
/*! \brief Write active and backup palette to save
* \param fHandle Savefile open for writing
+ * \todo Add support for saving the palette in the 16 color version of Operation Stealth.
+ * Possibly combine with FWRenderer's savePalette-method?
*/
void OSRenderer::savePalette(Common::OutSaveFile &fHandle) {
- int i;
+ byte buf[kHighPalNumBytes];
- assert(_activeHiPal);
+ // Make sure the active palette has the correct format and color count
+ assert(_activePal.colorFormat() == kHighPalFormat);
+ assert(_activePal.colorCount() == kHighPalNumColors);
// Write the active 256 color palette.
- for (i = 0; i < _hiPalSize; i++) {
- fHandle.writeByte(_activeHiPal[i]);
- }
+ _activePal.save(buf, sizeof(buf), CINE_LITTLE_ENDIAN);
+ fHandle.write(buf, kHighPalNumBytes);
// Write the active 256 color palette a second time.
// FIXME: The backup 256 color palette should be saved here instead of the active one.
- for (i = 0; i < _hiPalSize; i++) {
- fHandle.writeByte(_activeHiPal[i]);
- }
+ fHandle.write(buf, kHighPalNumBytes);
}
/*! \brief Restore active and backup palette from save
* \param fHandle Savefile open for reading
*/
void OSRenderer::restorePalette(Common::SeekableReadStream &fHandle) {
- int i;
-
- if (!_activeHiPal) {
- _activeHiPal = new byte[_hiPalSize];
- }
+ byte buf[kHighPalNumBytes];
- assert(_activeHiPal);
-
- for (i = 0; i < _hiPalSize; i++) {
- _activeHiPal[i] = fHandle.readByte();
- }
+ // Load the active 256 color palette from file
+ fHandle.read(buf, kHighPalNumBytes);
+ _activePal.load(buf, sizeof(buf), kHighPalFormat, kHighPalNumColors, CINE_LITTLE_ENDIAN);
// Jump over the backup 256 color palette.
// FIXME: Load the backup 256 color palette and use it properly.
- fHandle.seek(_hiPalSize, SEEK_CUR);
+ fHandle.seek(kHighPalNumBytes, SEEK_CUR);
_changePal = 1;
}
@@ -754,10 +721,10 @@ void OSRenderer::restorePalette(Common::SeekableReadStream &fHandle) {
/*! \brief Rotate active palette
* \param a First color to rotate
* \param b Last color to rotate
- * \param c Possibly rotation step, must be equal to 1 at the moment
+ * \param c Possibly rotation step, must be 0 or 1 at the moment
*/
void FWRenderer::rotatePalette(int a, int b, int c) {
- palRotate(_activeLowPal, a, b, c);
+ _activePal.rotateRight(a, b, c);
refreshPalette();
}
@@ -769,12 +736,11 @@ void FWRenderer::rotatePalette(int a, int b, int c) {
* \param b Blue channel transformation
*/
void FWRenderer::transformPalette(int first, int last, int r, int g, int b) {
- if (!_activeLowPal) {
- _activeLowPal = new uint16[_lowPalSize];
- memset(_activeLowPal, 0, _lowPalSize * sizeof (uint16));
+ if (!_activePal.isValid() || _activePal.empty()) {
+ _activePal = Cine::Palette(kLowPalFormat, kLowPalNumColors);
}
- transformPaletteRange(_activeLowPal, _palette, first, last, r, g, b);
+ _backupPal.saturatedAddColor(_activePal, first, last, r, g, b);
refreshPalette();
}
@@ -889,22 +855,16 @@ void FWRenderer::drawInputBox(const char *info, const char *input, int cursor, i
}
/*! \brief Fade to black
+ * \bug Operation Stealth sometimes seems to fade to black using
+ * transformPalette resulting in double fadeout
*/
void FWRenderer::fadeToBlack() {
- // FIXME: _activeLowPal is invalid when starting Operation Stealth
- // Adding this sanity check fixes a crash when the game
- // starts, but I'm not sure if this is the best place to check it
- if (!_activeLowPal) {
- warning("_activeLowPal is invalid");
- return;
- }
-
- assert(_activeLowPal);
+ assert(_activePal.isValid() && !_activePal.empty());
for (int i = 0; i < 8; i++) {
- for (int j = 0; j < 16; j++) {
- _activeLowPal[j] = transformColor(_activeLowPal[j], -1, -1, -1);
- }
+ // Fade out the whole palette by 1/7th
+ // (Operation Stealth used 36 / 252, which is 1 / 7. Future Wars used 1 / 7 directly).
+ _activePal.saturatedAddNormalizedGray(_activePal, 0, _activePal.colorCount() - 1, -1, 7);
refreshPalette();
g_system->updateScreen();
@@ -914,14 +874,13 @@ void FWRenderer::fadeToBlack() {
/*! \brief Initialize Operation Stealth renderer
*/
-OSRenderer::OSRenderer() : _activeHiPal(NULL), _currentBg(0), _scrollBg(0),
+OSRenderer::OSRenderer() : FWRenderer(), _currentBg(0), _scrollBg(0),
_bgShift(0) {
int i;
for (i = 0; i < 9; i++) {
_bgTable[i].bg = NULL;
- _bgTable[i].lowPal = NULL;
- _bgTable[i].hiPal = NULL;
+ _bgTable[i].pal.clear();
memset(_bgTable[i].name, 0, sizeof (_bgTable[i].name));
}
}
@@ -929,29 +888,20 @@ OSRenderer::OSRenderer() : _activeHiPal(NULL), _currentBg(0), _scrollBg(0),
/*! \brief Destroy Operation Stealth renderer
*/
OSRenderer::~OSRenderer() {
- delete[] _activeHiPal;
-
for (int i = 0; i < 9; i++) {
delete[] _bgTable[i].bg;
- delete[] _bgTable[i].lowPal;
- delete[] _bgTable[i].hiPal;
+ _bgTable[i].pal.clear();
}
}
/*! \brief Reset Operation Stealth renderer state
*/
void OSRenderer::clear() {
- delete[] _activeHiPal;
- _activeHiPal = NULL;
-
for (int i = 0; i < 9; i++) {
delete[] _bgTable[i].bg;
- delete[] _bgTable[i].lowPal;
- delete[] _bgTable[i].hiPal;
_bgTable[i].bg = NULL;
- _bgTable[i].lowPal = NULL;
- _bgTable[i].hiPal = NULL;
+ _bgTable[i].pal.clear();
memset(_bgTable[i].name, 0, sizeof (_bgTable[i].name));
}
@@ -1159,28 +1109,6 @@ void OSRenderer::renderOverlay(const Common::List::iterator &it) {
}
}
-/*! \brief Refresh current palette
- */
-void OSRenderer::refreshPalette() {
- if (!_activeHiPal) {
- FWRenderer::refreshPalette();
- return;
- }
-
- int i;
- byte pal[256*4];
-
- for (i = 0; i < 256; i++) {
- pal[i * 4 + 0] = _activeHiPal[i * 3 + 0];
- pal[i * 4 + 1] = _activeHiPal[i * 3 + 1];
- pal[i * 4 + 2] = _activeHiPal[i * 3 + 2];
- pal[i * 4 + 3] = 0;
- }
-
- g_system->setPalette(pal, 0, 256);
- _changePal = 0;
-}
-
/*! \brief Load palette of current background
*/
void OSRenderer::reloadPalette() {
@@ -1188,49 +1116,12 @@ void OSRenderer::reloadPalette() {
// and 14, shift background has it right
palBg *bg = _bgShift ? &_bgTable[_scrollBg] : &_bgTable[_currentBg];
- assert(bg->lowPal || bg->hiPal);
-
- if (bg->lowPal) {
- if (!_activeLowPal) {
- _activeLowPal = new uint16[_lowPalSize];
- }
-
- assert(_activeLowPal);
+ assert(bg->pal.isValid() && !(bg->pal.empty()));
- delete[] _activeHiPal;
- _activeHiPal = NULL;
-
- memcpy(_activeLowPal, bg->lowPal, _lowPalSize * sizeof (uint16));
- } else {
- if (!_activeHiPal) {
- _activeHiPal = new byte[_hiPalSize];
- }
-
- assert(_activeHiPal);
-
- delete[] _activeLowPal;
- _activeLowPal = NULL;
-
- memcpy(_activeHiPal, bg->hiPal, _hiPalSize);
- }
+ _activePal = bg->pal;
_changePal = 1;
}
-/*! \brief Rotate active palette
- * \param a First color to rotate
- * \param b Last color to rotate
- * \param c Possibly rotation step, must be equal to 1 at the moment
- */
-void OSRenderer::rotatePalette(int a, int b, int c) {
- if (_activeLowPal) {
- FWRenderer::rotatePalette(a, b, c);
- return;
- }
-
- palRotate(_activeHiPal, a, b, c);
- refreshPalette();
-}
-
/*! \brief Copy part of backup palette to active palette and transform
* \param first First color to transform
* \param last Last color to transform
@@ -1241,28 +1132,12 @@ void OSRenderer::rotatePalette(int a, int b, int c) {
void OSRenderer::transformPalette(int first, int last, int r, int g, int b) {
palBg *bg = _bgShift ? &_bgTable[_scrollBg] : &_bgTable[_currentBg];
- if (!bg->lowPal) {
- if (!_activeHiPal) {
- _activeHiPal = new byte[_hiPalSize];
- memset(_activeHiPal, 0, _hiPalSize);
- }
-
- delete[] _activeLowPal;
- _activeLowPal = NULL;
-
- transformPaletteRange(_activeHiPal, bg->hiPal, first, last, r, g, b);
- } else {
- if (!_activeLowPal) {
- _activeLowPal = new uint16[_lowPalSize];
- memset(_activeLowPal, 0, _lowPalSize * sizeof (uint16));
- }
-
- delete[] _activeHiPal;
- _activeHiPal = NULL;
-
- transformPaletteRange(_activeLowPal, bg->lowPal, first, last, r, g, b);
+ // Initialize active palette to current background's palette format and size if they differ
+ if (_activePal.colorFormat() != bg->pal.colorFormat() || _activePal.colorCount() != bg->pal.colorCount()) {
+ _activePal = Cine::Palette(bg->pal.colorFormat(), bg->pal.colorCount());
}
+ bg->pal.saturatedAddColor(_activePal, first, last, r, g, b, kLowPalFormat);
refreshPalette();
}
@@ -1270,29 +1145,24 @@ void OSRenderer::transformPalette(int first, int last, int r, int g, int b) {
* \param bg Raw background data
* \param name Background filename
* \param pos Background index
+ * \todo Combine with FWRenderer's version of loadBg16
*/
void OSRenderer::loadBg16(const byte *bg, const char *name, unsigned int idx) {
- int i;
assert(idx < 9);
if (!_bgTable[idx].bg) {
_bgTable[idx].bg = new byte[_screenSize];
}
- if (!_bgTable[idx].lowPal) {
- _bgTable[idx].lowPal = new uint16[_lowPalSize];
- }
-
- assert(_bgTable[idx].bg && _bgTable[idx].lowPal);
-
- delete[] _bgTable[idx].hiPal;
- _bgTable[idx].hiPal = NULL;
+ assert(_bgTable[idx].bg);
strcpy(_bgTable[idx].name, name);
- for (i = 0; i < _lowPalSize; i++, bg += 2) {
- _bgTable[idx].lowPal[i] = READ_BE_UINT16(bg);
- }
+ // Load the 16 color palette
+ _bgTable[idx].pal.load(bg, kLowPalNumBytes, kLowPalFormat, kLowPalNumColors, CINE_BIG_ENDIAN);
+
+ // Jump over the palette data to the background data
+ bg += kLowPalNumBytes;
gfxConvertSpriteToRaw(_bgTable[idx].bg, bg, 160, 200);
}
@@ -1317,18 +1187,11 @@ void OSRenderer::loadBg256(const byte *bg, const char *name, unsigned int idx) {
_bgTable[idx].bg = new byte[_screenSize];
}
- if (!_bgTable[idx].hiPal) {
- _bgTable[idx].hiPal = new byte[_hiPalSize];
- }
-
- assert(_bgTable[idx].bg && _bgTable[idx].hiPal);
-
- delete[] _bgTable[idx].lowPal;
- _bgTable[idx].lowPal = NULL;
+ assert(_bgTable[idx].bg);
strcpy(_bgTable[idx].name, name);
- memcpy(_bgTable[idx].hiPal, bg, _hiPalSize);
- memcpy(_bgTable[idx].bg, bg + _hiPalSize, _screenSize);
+ _bgTable[idx].pal.load(bg, kHighPalNumBytes, kHighPalFormat, kHighPalNumColors, CINE_LITTLE_ENDIAN);
+ memcpy(_bgTable[idx].bg, bg + kHighPalNumBytes, _screenSize);
}
/*! \brief Load 256 color CT data as background into renderer
@@ -1344,7 +1207,7 @@ void OSRenderer::loadCt256(const byte *ct, const char *name) {
*/
void OSRenderer::selectBg(unsigned int idx) {
assert(idx < 9 && _bgTable[idx].bg);
- assert(_bgTable[idx].lowPal || _bgTable[idx].hiPal);
+ assert(_bgTable[idx].pal.isValid() && !(_bgTable[idx].pal.empty()));
_currentBg = idx;
reloadPalette();
@@ -1393,11 +1256,8 @@ void OSRenderer::removeBg(unsigned int idx) {
}
delete[] _bgTable[idx].bg;
- delete[] _bgTable[idx].lowPal;
- delete[] _bgTable[idx].hiPal;
_bgTable[idx].bg = NULL;
- _bgTable[idx].lowPal = NULL;
- _bgTable[idx].hiPal = NULL;
+ _bgTable[idx].pal.clear();
memset(_bgTable[idx].name, 0, sizeof (_bgTable[idx].name));
}
@@ -1412,27 +1272,6 @@ const char *OSRenderer::getBgName(uint idx) const {
return _bgTable[idx].name;
}
-/*! \brief Fade to black
- * \bug Operation Stealth sometimes seems to fade to black using
- * transformPalette resulting in double fadeout
- */
-void OSRenderer::fadeToBlack() {
- if (!_activeHiPal) {
- FWRenderer::fadeToBlack();
- return;
- }
-
- for (int i = 0; i < 8; i++) {
- for (int j = 0; j < _hiPalSize; j++) {
- _activeHiPal[j] = CLIP(_activeHiPal[j] - 32, 0, 255);
- }
-
- refreshPalette();
- g_system->updateScreen();
- g_system->delayMillis(50);
- }
-}
-
void setMouseCursor(int cursor) {
static int currentMouseCursor = -1;
assert(cursor >= 0 && cursor < 3);
diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h
index 0ed1626ab0..839f37a0b1 100644
--- a/engines/cine/gfx.h
+++ b/engines/cine/gfx.h
@@ -35,8 +35,7 @@ namespace Cine {
*/
struct palBg {
byte *bg; ///< Background data
- byte *hiPal; ///< 256 color palette
- uint16 *lowPal; ///< 16 color palette
+ Cine::Palette pal; ///< Background color palette
char name[15]; ///< Background filename
};
@@ -46,10 +45,10 @@ struct palBg {
* without calling drawFrame() all the time
*/
class FWRenderer : public Common::NonCopyable {
+protected:
private:
byte *_background; ///< Current background
char _bgName[13]; ///< Background filename
- uint16 *_palette; ///< 16 color backup palette
Common::String _cmd; ///< Player command string
@@ -57,10 +56,10 @@ protected:
static const int _screenSize = 320 * 200; ///< Screen size
static const int _screenWidth = 320; ///< Screen width
static const int _screenHeight = 200; ///< Screen height
- static const int _lowPalSize = 16; ///< 16 color palette size
byte *_backBuffer; ///< Screen backbuffer
- uint16 *_activeLowPal; ///< Active 16 color palette
+ Cine::Palette _backupPal; ///< The backup color palette
+ Cine::Palette _activePal; ///< The active color palette
int _changePal; ///< Load active palette to video backend on next frame
bool _showCollisionPage; ///< Should we show the collision page instead of the back buffer? Used for debugging.
@@ -132,13 +131,11 @@ class OSRenderer : public FWRenderer {
private:
// FIXME: Background table's size is probably 8 instead of 9. Check to make sure and correct if necessary.
palBg _bgTable[9]; ///< Table of backgrounds loaded into renderer
- byte *_activeHiPal; ///< Active 256 color palette
unsigned int _currentBg; ///< Current background
unsigned int _scrollBg; ///< Current scroll background
unsigned int _bgShift; ///< Background shift
protected:
- static const int _hiPalSize = 256 * 3; ///< 256 color palette size
void drawSprite(const objectStruct &obj);
int drawChar(char character, int x, int y);
@@ -169,14 +166,11 @@ public:
void saveBgNames(Common::OutSaveFile &fHandle);
const char *getBgName(uint idx = 0) const;
- void refreshPalette();
void reloadPalette();
void restorePalette(Common::SeekableReadStream &fHandle);
void savePalette(Common::OutSaveFile &fHandle);
- void rotatePalette(int a, int b, int c);
void transformPalette(int first, int last, int r, int g, int b);
- void fadeToBlack();
};
void gfxDrawSprite(byte *src4, uint16 sw, uint16 sh, byte *dst4, int16 sx, int16 sy);
diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp
index 49edaef5e4..b3e3629239 100644
--- a/engines/cine/pal.cpp
+++ b/engines/cine/pal.cpp
@@ -103,65 +103,6 @@ void loadRelatedPalette(const char *fileName) {
}
}
-void palRotate(uint16 *pal, byte a, byte b, byte c) {
- assert(pal);
-
- if (c == 1) {
- uint16 currentColor = pal[b];
-
- for (int i = b; i > a; i--) {
- pal[i] = pal[i - 1];
- }
-
- pal[a] = currentColor;
- }
-}
-
-void palRotate(byte *pal, byte a, byte b, byte c) {
- assert(pal);
-
- if (c == 1) {
- byte currentR = pal[3 * b + 0];
- byte currentG = pal[3 * b + 1];
- byte currentB = pal[3 * b + 2];
-
- for (int i = b; i > a; i--) {
- pal[3 * i + 0] = pal[3 * (i - 1) + 0];
- pal[3 * i + 1] = pal[3 * (i - 1) + 1];
- pal[3 * i + 2] = pal[3 * (i - 1) + 2];
- }
-
- pal[3 * a + 0] = currentR;
- pal[3 * a + 1] = currentG;
- pal[3 * a + 2] = currentB;
- }
-}
-
-uint16 transformColor(uint16 baseColor, int r, int g, int b) {
- int8 oriR = CLIP( (baseColor & 0x007) + b, 0, 7);
- int8 oriG = CLIP(((baseColor & 0x070) >> 4) + g, 0, 7);
- int8 oriB = CLIP(((baseColor & 0x700) >> 8) + r, 0, 7);
-
- return oriR | (oriG << 4) | (oriB << 8);
-}
-
-void transformPaletteRange(uint16 *dstPal, uint16 *srcPal, int startColor, int stopColor, int r, int g, int b) {
- assert(srcPal && dstPal);
-
- for (int i = startColor; i <= stopColor; i++)
- dstPal[i] = transformColor(srcPal[i], r, g, b);
-}
-
-void transformPaletteRange(byte *dstPal, byte *srcPal, int startColor, int stopColor, int r, int g, int b) {
- assert(srcPal && dstPal);
-
- for (int i = startColor; i <= stopColor; i++) {
- dstPal[3 * i + 0] = CLIP(srcPal[3 * i + 0] + r * 36, 0, 252);
- dstPal[3 * i + 1] = CLIP(srcPal[3 * i + 1] + g * 36, 0, 252);
- dstPal[3 * i + 2] = CLIP(srcPal[3 * i + 2] + b * 36, 0, 252);
- }
-}
-
/*! \brief Shift byte to the left by given amount (Handles negative shifting amounts too, otherwise this would be trivial). */
byte shiftByteLeft(const byte value, const signed shiftLeft) {
if (shiftLeft >= 0)
@@ -198,13 +139,17 @@ int bytePos(const int bitPos, const int numBytes, const bool bigEndian) {
}
// a.k.a. palRotate
-Palette &Palette::rotateRight(byte firstIndex, byte lastIndex) {
- const Color lastColor = _colors[lastIndex];
+Palette &Palette::rotateRight(byte firstIndex, byte lastIndex, signed rotationAmount) {
+ assert(rotationAmount == 0 || rotationAmount == 1);
+
+ if (rotationAmount == 1) {
+ const Color lastColor = _colors[lastIndex];
- for (int i = lastIndex; i > firstIndex; i--)
- _colors[i] = _colors[i - 1];
+ for (int i = lastIndex; i > firstIndex; i--)
+ _colors[i] = _colors[i - 1];
- _colors[firstIndex] = lastColor;
+ _colors[firstIndex] = lastColor;
+ }
return *this;
}
@@ -277,18 +222,18 @@ Palette &Palette::saturatedAddColor(Palette& output, byte firstIndex, byte lastI
Palette &Palette::saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed rSource, signed gSource, signed bSource, const Graphics::PixelFormat &sourceFormat) {
// Convert the source color to the internal color format ensuring that no divide by zero will happen
- const signed r = _format.rMax() * rSource / MAX(sourceFormat.rMax(), 1);
- const signed g = _format.gMax() * gSource / MAX(sourceFormat.gMax(), 1);
- const signed b = _format.bMax() * bSource / MAX(sourceFormat.bMax(), 1);
+ const signed r = ((signed) _format.rMax()) * rSource / MAX(sourceFormat.rMax(), 1);
+ const signed g = ((signed) _format.gMax()) * gSource / MAX(sourceFormat.gMax(), 1);
+ const signed b = ((signed) _format.bMax()) * bSource / MAX(sourceFormat.bMax(), 1);
return saturatedAddColor(output, firstIndex, lastIndex, r, g, b);
}
Palette &Palette::saturatedAddNormalizedGray(Palette& output, byte firstIndex, byte lastIndex, int grayDividend, int grayDenominator) {
assert(grayDenominator != 0);
- const signed r = _format.rMax() * grayDividend / grayDenominator;
- const signed g = _format.gMax() * grayDividend / grayDenominator;
- const signed b = _format.bMax() * grayDividend / grayDenominator;
+ const signed r = ((signed) _format.rMax()) * grayDividend / grayDenominator;
+ const signed g = ((signed) _format.gMax()) * grayDividend / grayDenominator;
+ const signed b = ((signed) _format.bMax()) * grayDividend / grayDenominator;
return saturatedAddColor(output, firstIndex, lastIndex, r, g, b);
}
diff --git a/engines/cine/pal.h b/engines/cine/pal.h
index f59dee53df..4764d5a474 100644
--- a/engines/cine/pal.h
+++ b/engines/cine/pal.h
@@ -73,16 +73,8 @@ void loadPal(const char *fileName);
void loadRelatedPalette(const char *fileName);
-void palRotate(uint16 *pal, byte a, byte b, byte c);
-void palRotate(byte *pal, byte a, byte b, byte c);
-uint16 transformColor(uint16 baseColor, int r, int g, int b);
-void transformPaletteRange(uint16 *srcPal, uint16 *dstPal, int startColor, int stopColor, int r, int g, int b);
-void transformPaletteRange(byte *srcPal, byte *dstPal, int startColor, int stopColor, int r, int g, int b);
-
-// This class might be used for handling Cine-engine's palettes in the future. WIP!
-// TODO: Document
-// TODO: Make use of
-// TODO: Test
+// A class for handling Cine-engine's palettes.
+// TODO: Test a bit more
class Palette {
public:
struct Color {
@@ -135,7 +127,10 @@ public:
*/
byte *save(byte *buf, const uint size, const Graphics::PixelFormat format, const uint numColors, const EndianType endian, const byte firstIndex = 0) const;
- Palette &rotateRight(byte firstIndex, byte lastIndex);
+ /*! \brief Rotate the palette in color range [firstIndex, lastIndex] to the right by the specified rotation amount.
+ * \param rotationAmount Amount to rotate the sub-palette to the right. Only values 0 and 1 are currently supported!
+ */
+ Palette &rotateRight(byte firstIndex, byte lastIndex, signed rotationAmount = 1);
Palette &saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed r, signed g, signed b);
/*! \brief Saturated add an RGB color in given color format to current palette's subset and save the modified colors in the given output palette.
--
cgit v1.2.3
From 03423bbabd6ccca872afb08166772209957a36f6 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Mon, 8 Jun 2009 21:52:32 +0000
Subject: Actually we /did not/ put periods at ends of the sentences in
majority of past entries
svn-id: r41389
---
NEWS | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/NEWS b/NEWS
index f06ac36c47..3a7805771c 100644
--- a/NEWS
+++ b/NEWS
@@ -3,44 +3,44 @@ For a more comprehensive changelog for the latest experimental SVN code, see:
0.14.0 (2009-??-??)
New Games:
- - Added support for Discworld.
+ - Added support for Discworld
- Added support for Discworld 2 - Missing Presumed ...!?
- - Added support for Return to Zork.
- - Added support for Leather Goddesses of Phobos 2.
- - Added support for The Manhole.
- - Added support for Rodney's Funscreen.
+ - Added support for Return to Zork
+ - Added support for Leather Goddesses of Phobos 2
+ - Added support for The Manhole
+ - Added support for Rodney's Funscreen
General:
- - Added experimental AdLib emulator from DOSBox.
- - Added quick search to Launcher.
- - Improved modern GUI theme look.
- - Added per-game GUI options.
- - Improved Mass Add dialog.
+ - Added experimental AdLib emulator from DOSBox
+ - Added quick search to Launcher
+ - Improved modern GUI theme look
+ - Added per-game GUI options
+ - Improved Mass Add dialog
AGI:
- - Increased compatibility for Sierra games.
- - Implemented all 'unknown' commands.
+ - Increased compatibility for Sierra games
+ - Implemented all 'unknown' commands
Beneath a Steel Sky:
- Changed the game speed to match the original game (previously
- it ran too fast).
+ it ran too fast)
Broken Sword 1:
- - Added support for the original cutscenes.
- - Dropped support for the now obsolete MPEG2 cutscenes.
- - Added support for the PlayStation version.
+ - Added support for the original cutscenes
+ - Dropped support for the now obsolete MPEG2 cutscenes
+ - Added support for the PlayStation version
Broken Sword 2:
- - Added support for the original cutscenes.
- - Dropped support for the now obsolete MPEG2 cutscenes.
- - Dropped support for playing cutscene sound without the video.
- - Added support for the PlayStation version.
+ - Added support for the original cutscenes
+ - Dropped support for the now obsolete MPEG2 cutscenes
+ - Dropped support for playing cutscene sound without the video
+ - Added support for the PlayStation version
KYRA:
- - Added support for PC Speaker based music and sound effects.
+ - Added support for PC Speaker based music and sound effects
New Ports:
- - Added GP2X Wiz port.
+ - Added GP2X Wiz port
0.13.1 (2009-04-27)
AGOS:
--
cgit v1.2.3
From 741de2812c79e9ba96f7698fb3f849fe6597ccbb Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Tue, 9 Jun 2009 00:00:24 +0000
Subject: Correct check for font data table used in The Feeble Files.
svn-id: r41393
---
engines/agos/charset-fontdata.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/engines/agos/charset-fontdata.cpp b/engines/agos/charset-fontdata.cpp
index 910c5cd5a6..d23e772306 100644
--- a/engines/agos/charset-fontdata.cpp
+++ b/engines/agos/charset-fontdata.cpp
@@ -2105,9 +2105,9 @@ void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) {
w = getFeebleFontSize(chr);
if (_language == Common::PL_POL)
- src = feeble_windowFont + (chr - 32) * 13;
- else
src = polish_feeble_windowFont + (chr - 32) * 13;
+ else
+ src = feeble_windowFont + (chr - 32) * 13;
} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
dst = (byte *)screen->pixels + y * _dxSurfacePitch + x + window->textColumnOffset;
h = 8;
--
cgit v1.2.3
From 4a1029dee41adddc804eaba63dd2f1df2474b684 Mon Sep 17 00:00:00 2001
From: Travis Howell
Date: Tue, 9 Jun 2009 06:37:42 +0000
Subject: Remove unused old code.
svn-id: r41395
---
engines/agos/animation.cpp | 8 +-------
engines/agos/animation.h | 1 -
2 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp
index 3be552a083..36399a7b2f 100644
--- a/engines/agos/animation.cpp
+++ b/engines/agos/animation.cpp
@@ -367,12 +367,7 @@ bool MoviePlayerDXA::processFrame() {
copyFrameToBuffer((byte *)screen->pixels, (_vm->_screenWidth - getWidth()) / 2, (_vm->_screenHeight - getHeight()) / 2, _vm->_screenWidth);
_vm->_system->unlockScreen();
- if ((_bgSoundStream == NULL) || ((int)(_mixer->getSoundElapsedTime(_bgSound) * getFrameRate()) / 1000 < getCurFrame() + 1) ||
- _frameSkipped > getFrameRate()) {
- if (_frameSkipped > getFrameRate()) {
- warning("force frame %i redraw", getCurFrame());
- _frameSkipped = 0;
- }
+ if ((_bgSoundStream == NULL) || ((int)(_mixer->getSoundElapsedTime(_bgSound) * getFrameRate()) / 1000 < getCurFrame() + 1)) {
if (_bgSoundStream && _mixer->isSoundHandleActive(_bgSound)) {
while (_mixer->isSoundHandleActive(_bgSound) && (_mixer->getSoundElapsedTime(_bgSound) * getFrameRate()) / 1000 < (uint32)getCurFrame()) {
@@ -392,7 +387,6 @@ bool MoviePlayerDXA::processFrame() {
}
warning("dropped frame %i", getCurFrame());
- _frameSkipped++;
return false;
}
diff --git a/engines/agos/animation.h b/engines/agos/animation.h
index 9cd6913f08..4ebcb3d4b3 100644
--- a/engines/agos/animation.h
+++ b/engines/agos/animation.h
@@ -52,7 +52,6 @@ class MoviePlayer {
bool _rightButtonDown;
bool _skipMovie;
uint32 _ticks;
- uint16 _frameSkipped;
char baseName[40];
public:
--
cgit v1.2.3
From ac46c98fb82f124bad5f2ece496b885a344e2cde Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Tue, 9 Jun 2009 11:26:15 +0000
Subject: - Moved Screen_v2::copyWsaRect to Screen::copyWsaRect - Made
WSAMovie_v1::displayFrame code match the original - Changed
WSAMovieAmiga::displayFrame to use Screen::copyWsaRect too - Got rid of '...'
parameter usage in all WSA player classes
svn-id: r41398
---
engines/kyra/animator_mr.cpp | 2 +-
engines/kyra/gui.cpp | 2 +-
engines/kyra/gui_hof.cpp | 4 +-
engines/kyra/gui_lol.cpp | 4 +-
engines/kyra/gui_mr.cpp | 22 +++----
engines/kyra/kyra_hof.cpp | 6 +-
engines/kyra/kyra_mr.cpp | 16 ++---
engines/kyra/lol.cpp | 22 +++----
engines/kyra/scene_lol.cpp | 2 +-
engines/kyra/screen.cpp | 142 +++++++++++++++++++++++++++++++++++++++++
engines/kyra/screen.h | 3 +
engines/kyra/screen_v2.cpp | 142 -----------------------------------------
engines/kyra/screen_v2.h | 3 -
engines/kyra/script_lok.cpp | 16 ++---
engines/kyra/script_lol.cpp | 8 +--
engines/kyra/script_tim.cpp | 14 ++--
engines/kyra/seqplayer.cpp | 6 +-
engines/kyra/sequences_hof.cpp | 32 +++++-----
engines/kyra/sequences_lok.cpp | 20 +++---
engines/kyra/sequences_lol.cpp | 8 +--
engines/kyra/text_mr.cpp | 2 +-
engines/kyra/wsamovie.cpp | 128 +++++++++----------------------------
engines/kyra/wsamovie.h | 18 +++---
23 files changed, 277 insertions(+), 345 deletions(-)
diff --git a/engines/kyra/animator_mr.cpp b/engines/kyra/animator_mr.cpp
index d7139a9e70..faf1b150a2 100644
--- a/engines/kyra/animator_mr.cpp
+++ b/engines/kyra/animator_mr.cpp
@@ -119,7 +119,7 @@ void KyraEngine_MR::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer) {
flags |= 0x8000;
x = obj->xPos2 - _sceneAnimMovie[obj->animNum]->xAdd();
y = obj->yPos2 - _sceneAnimMovie[obj->animNum]->yAdd();
- _sceneAnimMovie[obj->animNum]->displayFrame(obj->shapeIndex3, 2, x, y, flags | layer);
+ _sceneAnimMovie[obj->animNum]->displayFrame(obj->shapeIndex3, 2, x, y, flags | layer, 0, 0);
}
}
}
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index faea2c9a72..429f76cfe2 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -404,7 +404,7 @@ void MainMenu::updateAnimation() {
if (now > _nextUpdate) {
_nextUpdate = now + _anim.delay * _vm->tickLength();
- _anim.anim->displayFrame(_animIntern.curFrame, 0, 0, 0);
+ _anim.anim->displayFrame(_animIntern.curFrame, 0, 0, 0, 0, 0, 0);
_animIntern.curFrame += _animIntern.direction ;
if (_animIntern.curFrame < _anim.startFrame) {
_animIntern.curFrame = _anim.startFrame;
diff --git a/engines/kyra/gui_hof.cpp b/engines/kyra/gui_hof.cpp
index a37ac7b306..57c780d137 100644
--- a/engines/kyra/gui_hof.cpp
+++ b/engines/kyra/gui_hof.cpp
@@ -272,7 +272,7 @@ void KyraEngine_HoF::redrawInventory(int page) {
}
void KyraEngine_HoF::scrollInventoryWheel() {
- WSAMovie_v2 movie(this, _screen);
+ WSAMovie_v2 movie(this);
movie.open("INVWHEEL.WSA", 0, 0);
int frames = movie.opened() ? movie.frames() : 6;
memcpy(_screenBuffer, _screen->getCPagePtr(2), 64000);
@@ -287,7 +287,7 @@ void KyraEngine_HoF::scrollInventoryWheel() {
for (int i = 0; i <= 6 && !breakFlag; ++i) {
if (movie.opened()) {
_screen->hideMouse();
- movie.displayFrame(i % frames, 0, 0, 0, 0);
+ movie.displayFrame(i % frames, 0, 0, 0, 0, 0, 0);
_screen->showMouse();
_screen->updateScreen();
}
diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp
index af8bc6aa97..d9c229fb16 100644
--- a/engines/kyra/gui_lol.cpp
+++ b/engines/kyra/gui_lol.cpp
@@ -1364,7 +1364,7 @@ int LoLEngine::clickedInventorySlot(Button *button) {
(_itemsInPlay[hItem].itemPropertyIndex == 220 || _itemsInPlay[slotItem].itemPropertyIndex == 220)) {
// merge ruby of truth
- WSAMovie_v2 *wsa = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *wsa = new WSAMovie_v2(this);
wsa->open("truth.wsa", 0, 0);
_screen->hideMouse();
@@ -1377,7 +1377,7 @@ int LoLEngine::clickedInventorySlot(Button *button) {
for (int i = 0; i < 25; i++) {
uint32 delayTimer = _system->getMillis() + 7 * _tickLength;
_screen->copyRegion(button->x, button->y - 3, 0, 0, 25, 27, 2, 2);
- wsa->displayFrame(i, 2, 0, 0, 0x4000);
+ wsa->displayFrame(i, 2, 0, 0, 0x4000, 0, 0);
_screen->copyRegion(0, 0, button->x, button->y - 3, 25, 27, 2, 0);
_screen->updateScreen();
delayUntil(delayTimer);
diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp
index c4d804c14d..d2ba783b2f 100644
--- a/engines/kyra/gui_mr.cpp
+++ b/engines/kyra/gui_mr.cpp
@@ -352,10 +352,10 @@ void KyraEngine_MR::drawMalcolmsMoodPointer(int frame, int page) {
frame = 13;
if (page == 0) {
- _invWsa->displayFrame(frame, 0, 0, 0, 0);
+ _invWsa->displayFrame(frame, 0, 0, 0, 0, 0, 0);
_screen->updateScreen();
} else if (page == 30) {
- _invWsa->displayFrame(frame, 2, 0, -144, 0);
+ _invWsa->displayFrame(frame, 2, 0, -144, 0, 0, 0);
}
_invWsaFrame = frame;
@@ -685,10 +685,10 @@ void KyraEngine_MR::showAlbum() {
loadAlbumPageWSA();
if (_album.leftPage.wsa->opened())
- _album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 2, _albumWSAX[_album.nextPage+0], _albumWSAY[_album.nextPage+0], 0x4000);
+ _album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 2, _albumWSAX[_album.nextPage+0], _albumWSAY[_album.nextPage+0], 0x4000, 0, 0);
if (_album.rightPage.wsa->opened())
- _album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 2, _albumWSAX[_album.nextPage+1], _albumWSAY[_album.nextPage+1], 0x4000);
+ _album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 2, _albumWSAX[_album.nextPage+1], _albumWSAY[_album.nextPage+1], 0x4000, 0, 0);
printAlbumPageText();
_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
@@ -843,10 +843,10 @@ void KyraEngine_MR::processAlbum() {
loadAlbumPageWSA();
if (_album.leftPage.wsa->opened())
- _album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 2, _albumWSAX[_album.nextPage+0], _albumWSAY[_album.nextPage+0], 0x4000);
+ _album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 2, _albumWSAX[_album.nextPage+0], _albumWSAY[_album.nextPage+0], 0x4000, 0, 0);
if (_album.rightPage.wsa->opened())
- _album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 2, _albumWSAX[_album.nextPage+1], _albumWSAY[_album.nextPage+1], 0x4000);
+ _album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 2, _albumWSAX[_album.nextPage+1], _albumWSAY[_album.nextPage+1], 0x4000, 0, 0);
printAlbumPageText();
@@ -899,7 +899,7 @@ void KyraEngine_MR::albumUpdateAnims() {
nextRun = _album.leftPage.timer + 5 * _tickLength;
if (nextRun < _system->getMillis() && _album.leftPage.wsa->opened()) {
- _album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 2, _albumWSAX[_album.nextPage+0], _albumWSAY[_album.nextPage+0], 0x4000);
+ _album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 2, _albumWSAX[_album.nextPage+0], _albumWSAY[_album.nextPage+0], 0x4000, 0, 0);
_screen->copyRegion(40, 17, 40, 17, 87, 73, 2, 0, Screen::CR_NO_P_CHECK);
++_album.leftPage.curFrame;
@@ -918,7 +918,7 @@ void KyraEngine_MR::albumUpdateAnims() {
nextRun = _album.rightPage.timer + 5 * _tickLength;
if (nextRun < _system->getMillis() && _album.rightPage.wsa->opened()) {
- _album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 2, _albumWSAX[_album.nextPage+1], _albumWSAY[_album.nextPage+1], 0x4000);
+ _album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 2, _albumWSAX[_album.nextPage+1], _albumWSAY[_album.nextPage+1], 0x4000, 0, 0);
_screen->copyRegion(194, 20, 194, 20, 85, 69, 2, 0, Screen::CR_NO_P_CHECK);
++_album.rightPage.curFrame;
@@ -936,13 +936,13 @@ void KyraEngine_MR::albumUpdateAnims() {
void KyraEngine_MR::albumAnim1() {
for (int i = 6; i >= 3; --i) {
albumRestoreRect();
- _album.wsa->displayFrame(i, 2, -100, 90, 0x4000);
+ _album.wsa->displayFrame(i, 2, -100, 90, 0x4000, 0, 0);
albumUpdateRect();
delayWithTicks(1);
}
albumRestoreRect();
- _album.wsa->displayFrame(14, 2, -100, 90, 0x4000);
+ _album.wsa->displayFrame(14, 2, -100, 90, 0x4000, 0, 0);
albumUpdateRect();
delayWithTicks(1);
}
@@ -950,7 +950,7 @@ void KyraEngine_MR::albumAnim1() {
void KyraEngine_MR::albumAnim2() {
for (int i = 3; i <= 6; ++i) {
albumRestoreRect();
- _album.wsa->displayFrame(i, 2, -100, 90, 0x4000);
+ _album.wsa->displayFrame(i, 2, -100, 90, 0x4000, 0, 0);
albumUpdateRect();
delayWithTicks(1);
}
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp
index c2c36dcc95..518755839b 100644
--- a/engines/kyra/kyra_hof.cpp
+++ b/engines/kyra/kyra_hof.cpp
@@ -381,10 +381,10 @@ void KyraEngine_HoF::startup() {
memset(_sceneAnims, 0, sizeof(_sceneAnims));
for (int i = 0; i < ARRAYSIZE(_sceneAnimMovie); ++i)
- _sceneAnimMovie[i] = new WSAMovie_v2(this, _screen);
+ _sceneAnimMovie[i] = new WSAMovie_v2(this);
memset(_wsaSlots, 0, sizeof(_wsaSlots));
for (int i = 0; i < ARRAYSIZE(_wsaSlots); ++i)
- _wsaSlots[i] = new WSAMovie_v2(this, _screen);
+ _wsaSlots[i] = new WSAMovie_v2(this);
_screen->_curPage = 0;
@@ -1550,7 +1550,7 @@ void KyraEngine_HoF::loadInvWsa(const char *filename, int run_, int delayTime, i
wsaFlags |= 2;
if (!_invWsa.wsa)
- _invWsa.wsa = new WSAMovie_v2(this, _screen);
+ _invWsa.wsa = new WSAMovie_v2(this);
if (!_invWsa.wsa->open(filename, wsaFlags, 0))
error("Couldn't open inventory WSA file '%s'", filename);
diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp
index f2ea0c91df..b9210c6093 100644
--- a/engines/kyra/kyra_mr.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -274,14 +274,14 @@ Common::Error KyraEngine_MR::go() {
for (int i = 0; i < 64 && !shouldQuit(); ++i) {
uint32 nextRun = _system->getMillis() + 3 * _tickLength;
- _menuAnim->displayFrame(i, 0, 0, 0, 0);
+ _menuAnim->displayFrame(i, 0, 0, 0, 0, 0, 0);
_screen->updateScreen();
delayUntil(nextRun);
}
for (int i = 64; i > 29 && !shouldQuit(); --i) {
uint32 nextRun = _system->getMillis() + 3 * _tickLength;
- _menuAnim->displayFrame(i, 0, 0, 0, 0);
+ _menuAnim->displayFrame(i, 0, 0, 0, 0, 0, 0);
_screen->updateScreen();
delayUntil(nextRun);
}
@@ -327,7 +327,7 @@ Common::Error KyraEngine_MR::go() {
}
void KyraEngine_MR::initMainMenu() {
- _menuAnim = new WSAMovie_v2(this, _screen);
+ _menuAnim = new WSAMovie_v2(this);
_menuAnim->open("REVENGE.WSA", 1, _screen->getPalette(0));
memset(_screen->getPalette(0), 0, 3);
@@ -541,11 +541,11 @@ void KyraEngine_MR::initMouseShapes() {
}
void KyraEngine_MR::startup() {
- _album.wsa = new WSAMovie_v2(this, _screen);
+ _album.wsa = new WSAMovie_v2(this);
assert(_album.wsa);
- _album.leftPage.wsa = new WSAMovie_v2(this, _screen);
+ _album.leftPage.wsa = new WSAMovie_v2(this);
assert(_album.leftPage.wsa);
- _album.rightPage.wsa = new WSAMovie_v2(this, _screen);
+ _album.rightPage.wsa = new WSAMovie_v2(this);
assert(_album.rightPage.wsa);
musicUpdate(0);
@@ -598,7 +598,7 @@ void KyraEngine_MR::startup() {
for (int i = 0; i < 16; ++i) {
_sceneAnims[i].flags = 0;
- _sceneAnimMovie[i] = new WSAMovie_v2(this, _screen);
+ _sceneAnimMovie[i] = new WSAMovie_v2(this);
assert(_sceneAnimMovie[i]);
}
@@ -655,7 +655,7 @@ void KyraEngine_MR::startup() {
musicUpdate(0);
runStartupScript(1, 0);
_res->exists("MOODOMTR.WSA", true);
- _invWsa = new WSAMovie_v2(this, _screen);
+ _invWsa = new WSAMovie_v2(this);
assert(_invWsa);
_invWsa->open("MOODOMTR.WSA", 1, 0);
_invWsaFrame = 6;
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 3461fa5da9..25d0a6a5d2 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -1919,7 +1919,7 @@ int LoLEngine::castHealOnSingleCharacter(ActiveSpell *a) {
}
int LoLEngine::processMagicSpark(int charNum, int spellLevel) {
- WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *mov = new WSAMovie_v2(this);
_screen->copyPage(0, 12);
mov->open("spark1.wsa", 0, 0);
@@ -2156,7 +2156,7 @@ int LoLEngine::processMagicIce(int charNum, int spellLevel) {
int sX = 112;
int sY = 0;
- WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *mov = new WSAMovie_v2(this);
if (spellLevel == 0) {
sX = 0;
@@ -2417,7 +2417,7 @@ int LoLEngine::processMagicHandOfFate(int spellLevel) {
int cp = _screen->setCurPage(2);
_screen->copyPage(0, 12);
- WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *mov = new WSAMovie_v2(this);
mov->open("hand.wsa", 1, 0);
if (!mov->opened())
error("Hand: Unable to load HAND.WSA");
@@ -2509,7 +2509,7 @@ int LoLEngine::processMagicMistOfDoom(int charNum, int spellLevel) {
char wsafile[13];
snprintf(wsafile, 13, "mists%0d.wsa", spellLevel + 1);
- WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *mov = new WSAMovie_v2(this);
mov->open(wsafile, 1, 0);
if (!mov->opened())
error("Mist: Unable to load mists.wsa");
@@ -2541,7 +2541,7 @@ int LoLEngine::processMagicLightning(int charNum, int spellLevel) {
char wsafile[13];
snprintf(wsafile, 13, "litning%d.wsa", spellLevel + 1);
- WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *mov = new WSAMovie_v2(this);
mov->open(wsafile, 1, 0);
if (!mov->opened())
error("Litning: Unable to load litning.wsa");
@@ -2570,7 +2570,7 @@ int LoLEngine::processMagicFog() {
int cp = _screen->setCurPage(2);
_screen->copyPage(0, 12);
- WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *mov = new WSAMovie_v2(this);
int numFrames = mov->open("fog.wsa", 0, 0);
if (!mov->opened())
error("Fog: Unable to load fog.wsa");
@@ -2646,7 +2646,7 @@ int LoLEngine::processMagicSwarm(int charNum, int damage) {
_monsters[destIds[i]].fightCurTick = destTicks[i];
}
- WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *mov = new WSAMovie_v2(this);
mov->open("swarm.wsa", 0, 0);
if (!mov->opened())
@@ -2734,7 +2734,7 @@ int LoLEngine::processMagicGuardian(int charNum) {
_screen->copyPage(0, 2);
_screen->copyPage(2, 12);
- WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *mov = new WSAMovie_v2(this);
mov->open("guardian.wsa", 0, 0);
if (!mov->opened())
error("Guardian: Unable to load guardian.wsa");
@@ -2871,7 +2871,7 @@ void LoLEngine::transferSpellToScollAnimation(int charNum, int spell, int slot)
snd_playSoundEffect(_updateSpellBookAnimData[(spell << 2) + 3], -1);
snd_playSoundEffect(95, -1);
- WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *mov = new WSAMovie_v2(this);
mov->open("getspell.wsa", 0, 0);
if (!mov->opened())
@@ -3529,7 +3529,7 @@ void LoLEngine::launchMagicViper() {
_screen->copyPage(0, 12);
snd_playSoundEffect(148, -1);
- WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *mov = new WSAMovie_v2(this);
int numFrames = mov->open("viper.wsa", 1, 0);
if (!mov->opened())
error("Viper: Unable to load viper.wsa");
@@ -3579,7 +3579,7 @@ void LoLEngine::breakIceWall(uint8 *pal1, uint8 *pal2) {
gui_drawScene(2);
_screen->copyPage(2, 10);
- WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *mov = new WSAMovie_v2(this);
int numFrames = mov->open("shatter.wsa", 1, 0);
if (!mov->opened())
error("Shatter: Unable to load shatter.wsa");
diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp
index 0236e4fa7d..370940c4e4 100644
--- a/engines/kyra/scene_lol.cpp
+++ b/engines/kyra/scene_lol.cpp
@@ -1312,7 +1312,7 @@ void LoLEngine::processGasExplosion(int soundId) {
uint8 *p2 = _screen->getPalette(3);
if (dist) {
- WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *mov = new WSAMovie_v2(this);
char file[13];
snprintf(file, 13, "gasexp%0d.wsa", dist);
mov->open(file, 1, 0);
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index 0fe23552b7..5077720133 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -339,6 +339,148 @@ void Screen::clearCurPage() {
clearOverlayPage(_curPage);
}
+void Screen::copyWsaRect(int x, int y, int w, int h, int dimState, int plotFunc, const uint8 *src,
+ int unk1, const uint8 *unkPtr1, const uint8 *unkPtr2) {
+ uint8 *dstPtr = getPagePtr(_curPage);
+ uint8 *origDst = dstPtr;
+
+ const ScreenDim *dim = getScreenDim(dimState);
+ int dimX1 = dim->sx << 3;
+ int dimX2 = dim->w << 3;
+ dimX2 += dimX1;
+
+ int dimY1 = dim->sy;
+ int dimY2 = dim->h;
+ dimY2 += dimY1;
+
+ int temp = y - dimY1;
+ if (temp < 0) {
+ if ((temp += h) <= 0)
+ return;
+ else {
+ SWAP(temp, h);
+ y += temp - h;
+ src += (temp - h) * w;
+ }
+ }
+
+ temp = dimY2 - y;
+ if (temp <= 0)
+ return;
+
+ if (temp < h)
+ h = temp;
+
+ int srcOffset = 0;
+ temp = x - dimX1;
+ if (temp < 0) {
+ temp = -temp;
+ srcOffset = temp;
+ x += temp;
+ w -= temp;
+ }
+
+ int srcAdd = 0;
+
+ temp = dimX2 - x;
+ if (temp <= 0)
+ return;
+
+ if (temp < w) {
+ SWAP(w, temp);
+ temp -= w;
+ srcAdd = temp;
+ }
+
+ dstPtr += y * SCREEN_W + x;
+ uint8 *dst = dstPtr;
+
+ if (_curPage == 0 || _curPage == 1)
+ addDirtyRect(x, y, w, h);
+
+ clearOverlayRect(_curPage, x, y, w, h);
+
+ temp = h;
+ int curY = y;
+ while (h--) {
+ src += srcOffset;
+ ++curY;
+ int cW = w;
+
+ switch (plotFunc) {
+ case 0:
+ memcpy(dst, src, cW);
+ dst += cW; src += cW;
+ break;
+
+ case 1:
+ while (cW--) {
+ uint8 d = *src++;
+ uint8 t = unkPtr1[d];
+ if (t != 0xFF)
+ d = unkPtr2[*dst + (t << 8)];
+ *dst++ = d;
+ }
+ break;
+
+ case 4:
+ while (cW--) {
+ uint8 d = *src++;
+ if (d)
+ *dst = d;
+ ++dst;
+ }
+ break;
+
+ case 5:
+ while (cW--) {
+ uint8 d = *src++;
+ if (d) {
+ uint8 t = unkPtr1[d];
+ if (t != 0xFF)
+ d = unkPtr2[*dst + (t << 8)];
+ *dst = d;
+ }
+ ++dst;
+ }
+ break;
+
+ case 8:
+ case 9:
+ while (cW--) {
+ uint8 d = *src++;
+ uint8 t = _shapePages[0][dst - origDst] & 7;
+ if (unk1 < t && (curY > _maskMinY && curY < _maskMaxY))
+ d = _shapePages[1][dst - origDst];
+ *dst++ = d;
+ }
+ break;
+
+ case 12:
+ case 13:
+ while (cW--) {
+ uint8 d = *src++;
+ if (d) {
+ uint8 t = _shapePages[0][dst - origDst] & 7;
+ if (unk1 < t && (curY > _maskMinY && curY < _maskMaxY))
+ d = _shapePages[1][dst - origDst];
+ *dst++ = d;
+ } else {
+ d = _shapePages[1][dst - origDst];
+ *dst++ = d;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ dst = (dstPtr += SCREEN_W);
+ src += srcAdd;
+ }
+}
+
uint8 Screen::getPagePixel(int pageNum, int x, int y) {
assert(pageNum < SCREEN_PAGE_NUM);
assert(x >= 0 && x < SCREEN_W && y >= 0 && y < SCREEN_H);
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index 8cbc606247..0192fd7400 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -112,6 +112,9 @@ public:
int setCurPage(int pageNum);
void clearCurPage();
+ void copyWsaRect(int x, int y, int w, int h, int dimState, int plotFunc, const uint8 *src,
+ int unk1, const uint8 *unkPtr1, const uint8 *unkPtr2);
+
// page 0 functions
void copyToPage0(int y, int h, uint8 page, uint8 *seqBuf);
void shakeScreen(int times);
diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_v2.cpp
index a4e014e8c1..454040d86e 100644
--- a/engines/kyra/screen_v2.cpp
+++ b/engines/kyra/screen_v2.cpp
@@ -137,148 +137,6 @@ void Screen_v2::getFadeParams(const uint8 *palette, int delay, int &delayInc, in
}
}
-void Screen_v2::copyWsaRect(int x, int y, int w, int h, int dimState, int plotFunc, const uint8 *src,
- int unk1, const uint8 *unkPtr1, const uint8 *unkPtr2) {
- uint8 *dstPtr = getPagePtr(_curPage);
- uint8 *origDst = dstPtr;
-
- const ScreenDim *dim = getScreenDim(dimState);
- int dimX1 = dim->sx << 3;
- int dimX2 = dim->w << 3;
- dimX2 += dimX1;
-
- int dimY1 = dim->sy;
- int dimY2 = dim->h;
- dimY2 += dimY1;
-
- int temp = y - dimY1;
- if (temp < 0) {
- if ((temp += h) <= 0)
- return;
- else {
- SWAP(temp, h);
- y += temp - h;
- src += (temp - h) * w;
- }
- }
-
- temp = dimY2 - y;
- if (temp <= 0)
- return;
-
- if (temp < h)
- h = temp;
-
- int srcOffset = 0;
- temp = x - dimX1;
- if (temp < 0) {
- temp = -temp;
- srcOffset = temp;
- x += temp;
- w -= temp;
- }
-
- int srcAdd = 0;
-
- temp = dimX2 - x;
- if (temp <= 0)
- return;
-
- if (temp < w) {
- SWAP(w, temp);
- temp -= w;
- srcAdd = temp;
- }
-
- dstPtr += y * SCREEN_W + x;
- uint8 *dst = dstPtr;
-
- if (_curPage == 0 || _curPage == 1)
- addDirtyRect(x, y, w, h);
-
- clearOverlayRect(_curPage, x, y, w, h);
-
- temp = h;
- int curY = y;
- while (h--) {
- src += srcOffset;
- ++curY;
- int cW = w;
-
- switch (plotFunc) {
- case 0:
- memcpy(dst, src, cW);
- dst += cW; src += cW;
- break;
-
- case 1:
- while (cW--) {
- uint8 d = *src++;
- uint8 t = unkPtr1[d];
- if (t != 0xFF)
- d = unkPtr2[*dst + (t << 8)];
- *dst++ = d;
- }
- break;
-
- case 4:
- while (cW--) {
- uint8 d = *src++;
- if (d)
- *dst = d;
- ++dst;
- }
- break;
-
- case 5:
- while (cW--) {
- uint8 d = *src++;
- if (d) {
- uint8 t = unkPtr1[d];
- if (t != 0xFF)
- d = unkPtr2[*dst + (t << 8)];
- *dst = d;
- }
- ++dst;
- }
- break;
-
- case 8:
- case 9:
- while (cW--) {
- uint8 d = *src++;
- uint8 t = _shapePages[0][dst - origDst] & 7;
- if (unk1 < t && (curY > _maskMinY && curY < _maskMaxY))
- d = _shapePages[1][dst - origDst];
- *dst++ = d;
- }
- break;
-
- case 12:
- case 13:
- while (cW--) {
- uint8 d = *src++;
- if (d) {
- uint8 t = _shapePages[0][dst - origDst] & 7;
- if (unk1 < t && (curY > _maskMinY && curY < _maskMaxY))
- d = _shapePages[1][dst - origDst];
- *dst++ = d;
- } else {
- d = _shapePages[1][dst - origDst];
- *dst++ = d;
- }
- }
- break;
-
- default:
- break;
- }
-
- dst = (dstPtr += SCREEN_W);
- src += srcAdd;
- }
-}
-
const uint8 *Screen_v2::getPtrToShape(const uint8 *shpFile, int shape) {
uint16 shapes = READ_LE_UINT16(shpFile);
diff --git a/engines/kyra/screen_v2.h b/engines/kyra/screen_v2.h
index 18bac764ec..8b94eb40d2 100644
--- a/engines/kyra/screen_v2.h
+++ b/engines/kyra/screen_v2.h
@@ -37,9 +37,6 @@ public:
~Screen_v2();
// screen page handling
- void copyWsaRect(int x, int y, int w, int h, int dimState, int plotFunc, const uint8 *src,
- int unk1, const uint8 *unkPtr1, const uint8 *unkPtr2);
-
void checkedPageUpdate(int srcPage, int dstPage);
// palette handling
diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp
index 03a5d4efc1..0d18e03f29 100644
--- a/engines/kyra/script_lok.cpp
+++ b/engines/kyra/script_lok.cpp
@@ -427,7 +427,7 @@ int KyraEngine_LoK::o1_runWSAFromBeginningToEnd(EMCState *script) {
int wsaFrame = 0;
while (running) {
- _movieObjects[wsaIndex]->displayFrame(wsaFrame++, 0, xpos, ypos);
+ _movieObjects[wsaIndex]->displayFrame(wsaFrame++, 0, xpos, ypos, 0, 0, 0);
_animator->_updateScreen = true;
if (wsaFrame >= _movieObjects[wsaIndex]->frames())
running = false;
@@ -458,7 +458,7 @@ int KyraEngine_LoK::o1_displayWSAFrame(EMCState *script) {
int waitTime = stackPos(3);
int wsaIndex = stackPos(4);
_screen->hideMouse();
- _movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos);
+ _movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
_animator->_updateScreen = true;
uint32 continueTime = waitTime * _tickLength + _system->getMillis();
while (_system->getMillis() < continueTime) {
@@ -500,7 +500,7 @@ int KyraEngine_LoK::o1_runWSAFrames(EMCState *script) {
_screen->hideMouse();
for (; startFrame <= endFrame; ++startFrame) {
uint32 nextRun = _system->getMillis() + delayTime * _tickLength;
- _movieObjects[wsaIndex]->displayFrame(startFrame, 0, xpos, ypos);
+ _movieObjects[wsaIndex]->displayFrame(startFrame, 0, xpos, ypos, 0, 0, 0);
_animator->_updateScreen = true;
while (_system->getMillis() < nextRun) {
_sprites->updateSceneAnims();
@@ -682,7 +682,7 @@ int KyraEngine_LoK::o1_displayWSAFrameOnHidPage(EMCState *script) {
_screen->hideMouse();
uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- _movieObjects[wsaIndex]->displayFrame(frame, 2, xpos, ypos);
+ _movieObjects[wsaIndex]->displayFrame(frame, 2, xpos, ypos, 0, 0, 0);
_animator->_updateScreen = true;
while (_system->getMillis() < continueTime) {
_sprites->updateSceneAnims();
@@ -753,7 +753,7 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
// what shouldn't happen. So we're not updating the screen for this special
// case too.
if (startFrame == 18 && endFrame == 18 && _currentRoom == 45) {
- _movieObjects[wsaIndex]->displayFrame(18, 0, xpos, ypos);
+ _movieObjects[wsaIndex]->displayFrame(18, 0, xpos, ypos, 0, 0, 0);
delay(waitTime * _tickLength);
return 0;
}
@@ -765,7 +765,7 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
int frame = startFrame;
while (endFrame >= frame) {
uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- _movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos);
+ _movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
if (waitTime)
_animator->_updateScreen = true;
while (_system->getMillis() < continueTime) {
@@ -783,7 +783,7 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
int frame = startFrame;
while (endFrame <= frame) {
uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- _movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos);
+ _movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
if (waitTime)
_animator->_updateScreen = true;
while (_system->getMillis() < continueTime) {
@@ -1276,7 +1276,7 @@ int KyraEngine_LoK::o1_makeAmuletAppear(EMCState *script) {
if (code == 14)
snd_playSoundEffect(0x73);
- amulet.displayFrame(code, 0, 224, 152);
+ amulet.displayFrame(code, 0, 224, 152, 0, 0, 0);
_animator->_updateScreen = true;
while (_system->getMillis() < nextTime) {
diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp
index 3d57b23181..474a0eec86 100644
--- a/engines/kyra/script_lol.cpp
+++ b/engines/kyra/script_lol.cpp
@@ -2126,7 +2126,7 @@ int LoLEngine::olol_paletteFlash(EMCState *script) {
int LoLEngine::olol_restoreMagicShroud(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_restoreMagicShroud(%p)", (const void *)script);
- WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *mov = new WSAMovie_v2(this);
mov->open("DARKLITE.WSA", 2, 0);
if (!mov->opened())
return 0;
@@ -2148,7 +2148,7 @@ int LoLEngine::olol_restoreMagicShroud(EMCState *script) {
for (int i = 0; i < 21; i++) {
uint32 etime = _system->getMillis() + 20 * _tickLength;
- mov->displayFrame(i, 0, 0, 0, 0);
+ mov->displayFrame(i, 0, 0, 0, 0, 0, 0);
_screen->updateScreen();
_screen->setScreenPalette(tpal3);
tpal3 += 768;
@@ -2163,7 +2163,7 @@ int LoLEngine::olol_restoreMagicShroud(EMCState *script) {
for (int i = 22; i < 38; i++) {
uint32 etime = _system->getMillis() + 12 * _tickLength;
- mov->displayFrame(i, 0, 0, 0, 0);
+ mov->displayFrame(i, 0, 0, 0, 0, 0, 0);
_screen->updateScreen();
if (i == 22 || i == 24 || i == 28 || i == 32) {
snd_playSoundEffect(131, -1);
@@ -2566,7 +2566,7 @@ int LoLEngine::tlol_displayAnimFrame(const TIM *tim, const uint16 *param) {
if (param[1] == 0xFFFF) {
_screen->copyRegion(0, 0, 0, 0, 320, 200, 0, 2, Screen::CR_NO_P_CHECK);
} else {
- anim->wsa->displayFrame(param[1], 2, anim->x, anim->y, 0);
+ anim->wsa->displayFrame(param[1], 2, anim->x, anim->y, 0, 0, 0);
_screen->copyRegion(anim->wsa->xAdd(), anim->wsa->yAdd(), anim->wsa->xAdd(), anim->wsa->yAdd(), anim->wsa->width(), anim->wsa->height(), 2, 0);
}
diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp
index e9ca23a4c9..2beabf459a 100644
--- a/engines/kyra/script_tim.cpp
+++ b/engines/kyra/script_tim.cpp
@@ -471,7 +471,7 @@ TIMInterpreter::Animation *TIMInterpreter::initAnimStruct(int index, const char
if (isLoLDemo)
anim->wsa = new WSAMovie_v1(_vm);
else
- anim->wsa = new WSAMovie_v2(_vm, _screen);
+ anim->wsa = new WSAMovie_v2(_vm);
assert(anim->wsa);
anim->wsa->open(file, wsaOpenFlags, (index == 1) ? _screen->getPalette(0) : 0);
@@ -518,7 +518,7 @@ TIMInterpreter::Animation *TIMInterpreter::initAnimStruct(int index, const char
_screen->updateScreen();
}
- anim->wsa->displayFrame(0, 0, x, y, 0);
+ anim->wsa->displayFrame(0, 0, x, y, 0, 0, 0);
}
if (wsaFlags & 2)
@@ -941,7 +941,7 @@ TIMInterpreter::Animation *TIMInterpreter_LoL::initAnimStruct(int index, const c
snprintf(file, 32, "%s.WSA", filename);
if (_vm->resource()->exists(file)) {
- anim->wsa = new WSAMovie_v2(_vm, TIMInterpreter::_screen);
+ anim->wsa = new WSAMovie_v2(_vm);
assert(anim->wsa);
anim->wsa->open(file, wsaOpenFlags, _screen->getPalette(3));
}
@@ -955,7 +955,7 @@ TIMInterpreter::Animation *TIMInterpreter_LoL::initAnimStruct(int index, const c
}
if (wsaFlags & 7)
- anim->wsa->displayFrame(0, 0, x, y, 0);
+ anim->wsa->displayFrame(0, 0, x, y, 0, 0, 0);
if (wsaFlags & 3) {
_screen->loadSpecialColors(_screen->getPalette(3));
@@ -1051,7 +1051,7 @@ void TIMInterpreter_LoL::startBackgroundAnimation(int animIndex, int part) {
// WORKAROUND for some bugged scripts that will try to display frames of non-existent animations
if (anim->wsa)
- anim->wsa->displayFrame(anim->curFrame - 1, 0, anim->x, anim->y, 0);
+ anim->wsa->displayFrame(anim->curFrame - 1, 0, anim->x, anim->y, 0, 0, 0);
}
void TIMInterpreter_LoL::stopBackgroundAnimation(int animIndex) {
@@ -1110,7 +1110,7 @@ void TIMInterpreter_LoL::updateBackgroundAnimation(int animIndex) {
anim->nextFrame += (anim->frameDelay * _vm->_tickLength);
- anim->wsa->displayFrame(anim->curFrame - 1, 0, anim->x, anim->y, 0);
+ anim->wsa->displayFrame(anim->curFrame - 1, 0, anim->x, anim->y, 0, 0, 0);
anim->nextFrame += _system->getMillis();
}
@@ -1126,7 +1126,7 @@ void TIMInterpreter_LoL::playAnimationPart(int animIndex, int firstFrame, int la
_screen->copyRegion(112, 0, 112, 0, 176, 120, 2, 0);
_screen->updateScreen();
} else {
- anim->wsa->displayFrame(i - 1, 0, anim->x, anim->y, 0);
+ anim->wsa->displayFrame(i - 1, 0, anim->x, anim->y, 0, 0, 0);
_screen->updateScreen();
}
_vm->delayUntil(next);
diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp
index 5f792d07c6..713a2251b0 100644
--- a/engines/kyra/seqplayer.cpp
+++ b/engines/kyra/seqplayer.cpp
@@ -148,7 +148,7 @@ void SeqPlayer::s1_wsaPlayFrame() {
_seqMovies[wsaObj].pos.x = READ_LE_UINT16(_seqData); _seqData += 2;
_seqMovies[wsaObj].pos.y = *_seqData++;
assert(_seqMovies[wsaObj].movie);
- _seqMovies[wsaObj].movie->displayFrame(frame, _seqMovies[wsaObj].page, _seqMovies[wsaObj].pos.x, _seqMovies[wsaObj].pos.y);
+ _seqMovies[wsaObj].movie->displayFrame(frame, _seqMovies[wsaObj].page, _seqMovies[wsaObj].pos.x, _seqMovies[wsaObj].pos.y, 0, 0, 0);
_seqMovies[wsaObj].frame = frame;
}
@@ -160,7 +160,7 @@ void SeqPlayer::s1_wsaPlayNextFrame() {
frame = 0;
_seqMovies[wsaObj].frame = 0;
}
- _seqMovies[wsaObj].movie->displayFrame(frame, _seqMovies[wsaObj].page, _seqMovies[wsaObj].pos.x, _seqMovies[wsaObj].pos.y);
+ _seqMovies[wsaObj].movie->displayFrame(frame, _seqMovies[wsaObj].page, _seqMovies[wsaObj].pos.x, _seqMovies[wsaObj].pos.y, 0, 0, 0);
}
void SeqPlayer::s1_wsaPlayPrevFrame() {
@@ -171,7 +171,7 @@ void SeqPlayer::s1_wsaPlayPrevFrame() {
frame = _seqMovies[wsaObj].numFrames;
_seqMovies[wsaObj].frame = frame;
} else {
- _seqMovies[wsaObj].movie->displayFrame(frame, _seqMovies[wsaObj].page, _seqMovies[wsaObj].pos.x, _seqMovies[wsaObj].pos.y);
+ _seqMovies[wsaObj].movie->displayFrame(frame, _seqMovies[wsaObj].page, _seqMovies[wsaObj].pos.x, _seqMovies[wsaObj].pos.y, 0, 0, 0);
}
}
diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp
index 4e53399fbf..bc5bb7f307 100644
--- a/engines/kyra/sequences_hof.cpp
+++ b/engines/kyra/sequences_hof.cpp
@@ -102,7 +102,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
_seqWsa->close();
_seqWsa->open(cseq.wsaFile, 0, _screen->getPalette(0));
_screen->setScreenPalette(_screen->getPalette(0));
- _seqWsa->displayFrame(0, 2, cseq.xPos, cseq.yPos, 0);
+ _seqWsa->displayFrame(0, 2, cseq.xPos, cseq.yPos, 0, 0, 0);
}
if (cseq.flags & 4) {
@@ -174,7 +174,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
if (_seqWsa) {
int f = _seqWsaCurrentFrame % _seqWsa->frames();
- _seqWsa->displayFrame(f, 2, cseq.xPos, cseq.yPos, 0);
+ _seqWsa->displayFrame(f, 2, cseq.xPos, cseq.yPos, 0, 0, 0);
}
_screen->copyPage(2, 12);
@@ -2201,7 +2201,7 @@ void KyraEngine_HoF::seq_loadNestedSequence(int wsaNum, int seqNum) {
NestedSequence s = _sequences->seqn[seqNum];
if (!_activeWSA[wsaNum].movie) {
- _activeWSA[wsaNum].movie = new WSAMovie_v2(this, _screen);
+ _activeWSA[wsaNum].movie = new WSAMovie_v2(this);
assert(_activeWSA[wsaNum].movie);
}
@@ -2246,7 +2246,7 @@ void KyraEngine_HoF::seq_nestedSequenceFrame(int command, int wsaNum) {
case 0:
xa = -_activeWSA[wsaNum].movie->xAdd();
ya = -_activeWSA[wsaNum].movie->yAdd();
- _activeWSA[wsaNum].movie->displayFrame(0, 8, xa, ya, 0);
+ _activeWSA[wsaNum].movie->displayFrame(0, 8, xa, ya, 0, 0, 0);
seq_animatedSubFrame(8, 2, 7, 8, _activeWSA[wsaNum].movie->xAdd(), _activeWSA[wsaNum].movie->yAdd(),
_activeWSA[wsaNum].movie->width(), _activeWSA[wsaNum].movie->height(), 1, 2);
break;
@@ -2254,7 +2254,7 @@ void KyraEngine_HoF::seq_nestedSequenceFrame(int command, int wsaNum) {
case 1:
xa = -_activeWSA[wsaNum].movie->xAdd();
ya = -_activeWSA[wsaNum].movie->yAdd();
- _activeWSA[wsaNum].movie->displayFrame(0, 8, xa, ya, 0);
+ _activeWSA[wsaNum].movie->displayFrame(0, 8, xa, ya, 0, 0, 0);
seq_animatedSubFrame(8, 2, 7, 8, _activeWSA[wsaNum].movie->xAdd(), _activeWSA[wsaNum].movie->yAdd(),
_activeWSA[wsaNum].movie->width(), _activeWSA[wsaNum].movie->height(), 1, 1);
break;
@@ -2263,21 +2263,21 @@ void KyraEngine_HoF::seq_nestedSequenceFrame(int command, int wsaNum) {
seq_waitForTextsTimeout();
xa = -_activeWSA[wsaNum].movie->xAdd();
ya = -_activeWSA[wsaNum].movie->yAdd();
- _activeWSA[wsaNum].movie->displayFrame(0x15, 8, xa, ya, 0);
+ _activeWSA[wsaNum].movie->displayFrame(0x15, 8, xa, ya, 0, 0, 0);
seq_animatedSubFrame(8, 2, 7, 8, _activeWSA[wsaNum].movie->xAdd(), _activeWSA[wsaNum].movie->yAdd(),
_activeWSA[wsaNum].movie->width(), _activeWSA[wsaNum].movie->height(), 0, 2);
break;
case 3:
_screen->copyPage(2, 10);
- _activeWSA[wsaNum].movie->displayFrame(0, 2, 0, 0, 0);
+ _activeWSA[wsaNum].movie->displayFrame(0, 2, 0, 0, 0, 0, 0);
_screen->copyPage(2, 12);
seq_cmpFadeFrame("scene2.cmp");
break;
case 4:
_screen->copyPage(2, 10);
- _activeWSA[wsaNum].movie->displayFrame(0, 2, 0, 0, 0);
+ _activeWSA[wsaNum].movie->displayFrame(0, 2, 0, 0, 0, 0, 0);
_screen->copyPage(2, 12);
seq_cmpFadeFrame("scene3.cmp");
break;
@@ -2364,10 +2364,10 @@ bool KyraEngine_HoF::seq_processNextSubFrame(int wsaNum) {
if (_activeWSA[wsaNum].movie) {
if (_activeWSA[wsaNum].flags & 0x20) {
- _activeWSA[wsaNum].movie->displayFrame(_activeWSA[wsaNum].control[currentFrame].index, 2, _activeWSA[wsaNum].x, _activeWSA[wsaNum].y, 0x4000);
+ _activeWSA[wsaNum].movie->displayFrame(_activeWSA[wsaNum].control[currentFrame].index, 2, _activeWSA[wsaNum].x, _activeWSA[wsaNum].y, 0x4000, 0, 0);
_activeWSA[wsaNum].frameDelay = _activeWSA[wsaNum].control[currentFrame].delay;
} else {
- _activeWSA[wsaNum].movie->displayFrame(currentFrame % _activeWSA[wsaNum].movie->frames(), 2, _activeWSA[wsaNum].x, _activeWSA[wsaNum].y, 0x4000);
+ _activeWSA[wsaNum].movie->displayFrame(currentFrame % _activeWSA[wsaNum].movie->frames(), 2, _activeWSA[wsaNum].x, _activeWSA[wsaNum].y, 0x4000, 0, 0);
}
}
@@ -2477,7 +2477,7 @@ void KyraEngine_HoF::seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, i
_seqWsaChatFrameTimeout = _seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
if (wsa)
- wsa->displayFrame(curframe % wsa->frames(), 2, wsaXpos, wsaYpos, 0);
+ wsa->displayFrame(curframe % wsa->frames(), 2, wsaXpos, wsaYpos, 0, 0, 0);
_screen->copyPage(2, 12);
@@ -2721,7 +2721,7 @@ void KyraEngine_HoF::seq_scrollPage(int bottom, int top) {
}
void KyraEngine_HoF::seq_showStarcraftLogo() {
- WSAMovie_v2 *ci = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *ci = new WSAMovie_v2(this);
assert(ci);
_screen->clearPage(2);
_res->loadPakFile("INTROGEN.PAK");
@@ -2732,21 +2732,21 @@ void KyraEngine_HoF::seq_showStarcraftLogo() {
return;
}
_screen->hideMouse();
- ci->displayFrame(0, 2, 0, 0, 0);
+ ci->displayFrame(0, 2, 0, 0, 0, 0, 0);
_screen->copyPage(2, 0);
_screen->fadeFromBlack();
for (int i = 1; i < endframe; i++) {
_seqEndTime = _system->getMillis() + 50;
if (skipFlag())
break;
- ci->displayFrame(i, 2, 0, 0, 0);
+ ci->displayFrame(i, 2, 0, 0, 0, 0, 0);
_screen->copyPage(2, 0);
_screen->updateScreen();
delay(_seqEndTime - _system->getMillis());
}
if (!skipFlag()) {
_seqEndTime = _system->getMillis() + 50;
- ci->displayFrame(0, 2, 0, 0, 0);
+ ci->displayFrame(0, 2, 0, 0, 0, 0, 0);
_screen->copyPage(2, 0);
_screen->updateScreen();
delay(_seqEndTime - _system->getMillis());
@@ -2760,7 +2760,7 @@ void KyraEngine_HoF::seq_showStarcraftLogo() {
void KyraEngine_HoF::seq_init() {
_seqProcessedString = new char[200];
- _seqWsa = new WSAMovie_v2(this, _screen);
+ _seqWsa = new WSAMovie_v2(this);
_activeWSA = new ActiveWSA[8];
_activeText = new ActiveText[10];
diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp
index d22dbd423d..a380849fe0 100644
--- a/engines/kyra/sequences_lok.cpp
+++ b/engines/kyra/sequences_lok.cpp
@@ -966,7 +966,7 @@ int KyraEngine_LoK::seq_playEnd() {
else if (i == 20)
snd_playSoundEffect(0x0E);
nextTime = _system->getMillis() + 8 * _tickLength;
- _finalA->displayFrame(i, 0, 8, 8);
+ _finalA->displayFrame(i, 0, 8, 8, 0, 0, 0);
_screen->updateScreen();
}
delete _finalA;
@@ -1198,7 +1198,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
case 2:
if (_system->getMillis() >= timer2) {
- _finalA->displayFrame(frame, 0, 8, 46);
+ _finalA->displayFrame(frame, 0, 8, 46, 0, 0, 0);
_screen->updateScreen();
timer2 = _system->getMillis() + 8 * _tickLength;
++frame;
@@ -1213,7 +1213,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
if (_system->getMillis() < timer1) {
if (_system->getMillis() >= timer2) {
frame = _rnd.getRandomNumberRng(14, 17);
- _finalA->displayFrame(frame, 0, 8, 46);
+ _finalA->displayFrame(frame, 0, 8, 46, 0, 0, 0);
_screen->updateScreen();
timer2 = _system->getMillis() + 8 * _tickLength;
}
@@ -1225,7 +1225,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
case 4:
if (_system->getMillis() >= timer2) {
- _finalA->displayFrame(frame, 0, 8, 46);
+ _finalA->displayFrame(frame, 0, 8, 46, 0, 0, 0);
_screen->updateScreen();
timer2 = _system->getMillis() + 8 * _tickLength;
++frame;
@@ -1239,7 +1239,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
case 5:
if (_system->getMillis() >= timer2) {
- _finalA->displayFrame(frame, 0, 8, 46);
+ _finalA->displayFrame(frame, 0, 8, 46, 0, 0, 0);
_screen->updateScreen();
timer2 = _system->getMillis() + 8 * _tickLength;
++frame;
@@ -1253,7 +1253,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
case 6:
if (_unkEndSeqVar4) {
if (frame <= 33 && _system->getMillis() >= timer2) {
- _finalA->displayFrame(frame, 0, 8, 46);
+ _finalA->displayFrame(frame, 0, 8, 46, 0, 0, 0);
_screen->updateScreen();
timer2 = _system->getMillis() + 8 * _tickLength;
++frame;
@@ -1278,7 +1278,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
case 8:
if (_system->getMillis() >= timer2) {
- _finalA->displayFrame(frame, 0, 8, 46);
+ _finalA->displayFrame(frame, 0, 8, 46, 0, 0, 0);
_screen->updateScreen();
timer2 = _system->getMillis() + 8 * _tickLength;
++frame;
@@ -1295,7 +1295,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
snd_playSoundEffect(12);
for (int i = 0; i < 18; ++i) {
timer2 = _system->getMillis() + 4 * _tickLength;
- _finalC->displayFrame(i, 0, 16, 50);
+ _finalC->displayFrame(i, 0, 16, 50, 0, 0, 0);
_screen->updateScreen();
delayUntil(timer2);
}
@@ -1500,14 +1500,14 @@ int KyraEngine_LoK::handleBeadState() {
uint32 nextRun = 0;
for (int i = 0; i < 8; ++i) {
nextRun = _system->getMillis() + _tickLength;
- _finalB->displayFrame(i, 0, 224, 8);
+ _finalB->displayFrame(i, 0, 224, 8, 0, 0, 0);
_screen->updateScreen();
delayUntil(nextRun);
}
snd_playSoundEffect(0x0D);
for (int i = 7; i >= 0; --i) {
nextRun = _system->getMillis() + _tickLength;
- _finalB->displayFrame(i, 0, 224, 8);
+ _finalB->displayFrame(i, 0, 224, 8, 0, 0, 0);
_screen->updateScreen();
delayUntil(nextRun);
}
diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp
index 849a325560..effc30d1d6 100644
--- a/engines/kyra/sequences_lol.cpp
+++ b/engines/kyra/sequences_lol.cpp
@@ -155,7 +155,7 @@ void LoLEngine::setupPrologueData(bool load) {
_screen->clearPage(3);
if (load) {
- _chargenWSA = new WSAMovie_v2(this, _screen);
+ _chargenWSA = new WSAMovie_v2(this);
assert(_chargenWSA);
//_charSelection = -1;
@@ -641,7 +641,7 @@ int LoLEngine::selectionCharAccept() {
}
void LoLEngine::showStarcraftLogo() {
- WSAMovie_v2 *ci = new WSAMovie_v2(this, _screen);
+ WSAMovie_v2 *ci = new WSAMovie_v2(this);
assert(ci);
_screen->clearPage(0);
@@ -653,7 +653,7 @@ void LoLEngine::showStarcraftLogo() {
return;
}
_screen->hideMouse();
- ci->displayFrame(0, 2, 32, 80, 0);
+ ci->displayFrame(0, 2, 32, 80, 0, 0, 0);
_screen->copyPage(2, 0);
_screen->fadeFromBlack();
int inputFlag = 0;
@@ -661,7 +661,7 @@ void LoLEngine::showStarcraftLogo() {
inputFlag = checkInput(0) & 0xff;
if (shouldQuit() || inputFlag)
break;
- ci->displayFrame(i, 2, 32, 80, 0);
+ ci->displayFrame(i, 2, 32, 80, 0, 0, 0);
_screen->copyPage(2, 0);
_screen->updateScreen();
delay(4 * _tickLength);
diff --git a/engines/kyra/text_mr.cpp b/engines/kyra/text_mr.cpp
index e28d97d154..40f651ab01 100644
--- a/engines/kyra/text_mr.cpp
+++ b/engines/kyra/text_mr.cpp
@@ -581,7 +581,7 @@ void KyraEngine_MR::albumChatWaitToFinish() {
frame = 13;
albumRestoreRect();
- _album.wsa->displayFrame(frame, 2, -100, 90, 0x4000);
+ _album.wsa->displayFrame(frame, 2, -100, 90, 0x4000, 0, 0);
albumUpdateRect();
nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(4, 8) * _tickLength;
diff --git a/engines/kyra/wsamovie.cpp b/engines/kyra/wsamovie.cpp
index 26638b8172..4e9d4742bb 100644
--- a/engines/kyra/wsamovie.cpp
+++ b/engines/kyra/wsamovie.cpp
@@ -137,19 +137,19 @@ void WSAMovie_v1::close() {
}
}
-void WSAMovie_v1::displayFrame(int frameNum, int pageNum, int x, int y, ...) {
- if (frameNum >= _numFrames || !_opened)
+void WSAMovie_v1::displayFrame(int frameNum, int pageNum, int x, int y, uint16 flags, const uint8 *table1, const uint8 *table2) {
+ if (frameNum >= _numFrames || frameNum < 0 || !_opened)
return;
_x = x;
_y = y;
_drawPage = pageNum;
- uint8 *dst;
+ uint8 *dst = 0;
if (_flags & WF_OFFSCREEN_DECODE)
dst = _offscreenBuffer;
else
- dst = _vm->screen()->getPageRect(_drawPage, _x, _y, _width, _height);
+ dst = _screen->getPageRect(_drawPage, _x, _y, _width, _height);
if (_currentFrame == _numFrames) {
if (!(_flags & WF_NO_FIRST_FRAME)) {
@@ -200,8 +200,16 @@ void WSAMovie_v1::displayFrame(int frameNum, int pageNum, int x, int y, ...) {
// display
_currentFrame = frameNum;
- if (_flags & WF_OFFSCREEN_DECODE)
- _vm->screen()->copyBlockToPage(_drawPage, _x, _y, _width, _height, _offscreenBuffer);
+ if (_flags & WF_OFFSCREEN_DECODE) {
+ int pageBackUp = _screen->setCurPage(_drawPage);
+
+ int plotFunc = (flags & 0xFF00) >> 12;
+ int unk1 = flags & 0xFF;
+
+ _screen->copyWsaRect(_x, _y, _width, _height, 0, plotFunc, _offscreenBuffer, unk1, table1, table2);
+
+ _screen->_curPage = pageBackUp;
+ }
}
void WSAMovie_v1::processFrame(int frameNum, uint8 *dst) {
@@ -239,7 +247,7 @@ void WSAMovieAmiga::close() {
WSAMovie_v1::close();
}
-void WSAMovieAmiga::displayFrame(int frameNum, int pageNum, int x, int y, ...) {
+void WSAMovieAmiga::displayFrame(int frameNum, int pageNum, int x, int y, uint16 flags, const uint8 *table1, const uint8 *table2) {
if (frameNum >= _numFrames || frameNum < 0 || !_opened)
return;
@@ -266,7 +274,7 @@ void WSAMovieAmiga::displayFrame(int frameNum, int pageNum, int x, int y, ...) {
dst = _buffer;
} else {
- _vm->screen()->copyBlockToPage(_drawPage, _x, _y, _width, _height, _buffer);
+ _screen->copyBlockToPage(_drawPage, _x, _y, _width, _height, _buffer);
}
}
_currentFrame = 0;
@@ -311,8 +319,16 @@ void WSAMovieAmiga::displayFrame(int frameNum, int pageNum, int x, int y, ...) {
// display
_currentFrame = frameNum;
- if (_flags & WF_OFFSCREEN_DECODE)
- _vm->screen()->copyBlockToPage(_drawPage, _x, _y, _width, _height, _offscreenBuffer);
+ if (_flags & WF_OFFSCREEN_DECODE) {
+ int pageBackUp = _screen->setCurPage(_drawPage);
+
+ int plotFunc = (flags & 0xFF00) >> 12;
+ int unk1 = flags & 0xFF;
+
+ _screen->copyWsaRect(_x, _y, _width, _height, 0, plotFunc, _offscreenBuffer, unk1, table1, table2);
+
+ _screen->_curPage = pageBackUp;
+ }
}
void WSAMovieAmiga::processFrame(int frameNum, uint8 *dst) {
@@ -334,7 +350,7 @@ void WSAMovieAmiga::processFrame(int frameNum, uint8 *dst) {
dst = _offscreenBuffer;
dstPitch = _width;
} else {
- dst = _vm->screen()->getPageRect(_drawPage, _x, _y, _width, _height);
+ dst = _screen->getPageRect(_drawPage, _x, _y, _width, _height);
dstPitch = Screen::SCREEN_W;
}
@@ -347,7 +363,7 @@ void WSAMovieAmiga::processFrame(int frameNum, uint8 *dst) {
#pragma mark -
-WSAMovie_v2::WSAMovie_v2(KyraEngine_v1 *vm, Screen_v2 *screen) : WSAMovie_v1(vm), _screen(screen), _xAdd(0), _yAdd(0) {}
+WSAMovie_v2::WSAMovie_v2(KyraEngine_v1 *vm) : WSAMovie_v1(vm), _xAdd(0), _yAdd(0) {}
int WSAMovie_v2::open(const char *filename, int unk1, uint8 *palBuf) {
close();
@@ -376,7 +392,7 @@ int WSAMovie_v2::open(const char *filename, int unk1, uint8 *palBuf) {
offsPal = 0x300;
_flags |= WF_HAS_PALETTE;
if (palBuf)
- _vm->screen()->loadPalette(wsaData + 8 + ((_numFrames << 2) & 0xFFFF), palBuf, 0x300);
+ _screen->loadPalette(wsaData + 8 + ((_numFrames << 2) & 0xFFFF), palBuf, 0x300);
}
if (flags & 2) {
@@ -384,7 +400,7 @@ int WSAMovie_v2::open(const char *filename, int unk1, uint8 *palBuf) {
offsPal = 0x30;
_flags |= WF_HAS_PALETTE;
if (palBuf)
- _vm->screen()->loadPalette(wsaData + 8 + ((_numFrames << 2) & 0xFFFF), palBuf, 0x30);
+ _screen->loadPalette(wsaData + 8 + ((_numFrames << 2) & 0xFFFF), palBuf, 0x30);
}
_flags |= WF_XOR;
@@ -448,90 +464,6 @@ int WSAMovie_v2::open(const char *filename, int unk1, uint8 *palBuf) {
return _numFrames;
}
-void WSAMovie_v2::displayFrame(int frameNum, int pageNum, int x, int y, ...) {
- if (frameNum >= _numFrames || frameNum < 0 || !_opened)
- return;
-
- _x = x + _xAdd;
- _y = y + _yAdd;
- _drawPage = pageNum;
-
- uint8 *dst = 0;
- if (_flags & WF_OFFSCREEN_DECODE)
- dst = _offscreenBuffer;
- else
- dst = _screen->getPageRect(_drawPage, _x, _y, _width, _height);
-
- if (_currentFrame == _numFrames) {
- if (!(_flags & WF_NO_FIRST_FRAME)) {
- if (_flags & WF_OFFSCREEN_DECODE)
- Screen::decodeFrameDelta(dst, _deltaBuffer);
- else
- Screen::decodeFrameDeltaPage(dst, _deltaBuffer, _width, (_flags & WF_XOR) == 0);
- }
- _currentFrame = 0;
- }
-
- // try to reduce the number of needed frame operations
- int diffCount = ABS(_currentFrame - frameNum);
- int frameStep = 1;
- int frameCount;
- if (_currentFrame < frameNum) {
- frameCount = _numFrames - frameNum + _currentFrame;
- if (diffCount > frameCount && !(_flags & WF_NO_LAST_FRAME))
- frameStep = -1;
- else
- frameCount = diffCount;
- } else {
- frameCount = _numFrames - _currentFrame + frameNum;
- if (frameCount >= diffCount || (_flags & WF_NO_LAST_FRAME)) {
- frameStep = -1;
- frameCount = diffCount;
- }
- }
-
- // process
- if (frameStep > 0) {
- uint16 cf = _currentFrame;
- while (frameCount--) {
- cf += frameStep;
- processFrame(cf, dst);
- if (cf == _numFrames)
- cf = 0;
- }
- } else {
- uint16 cf = _currentFrame;
- while (frameCount--) {
- if (cf == 0)
- cf = _numFrames;
- processFrame(cf, dst);
- cf += frameStep;
- }
- }
-
- // display
- _currentFrame = frameNum;
- if (_flags & WF_OFFSCREEN_DECODE) {
- int pageBackUp = _screen->_curPage;
- _screen->_curPage = _drawPage;
-
- va_list args;
- va_start(args, y);
-
- int copyParam = va_arg(args, int);
- int plotFunc = (copyParam & 0xFF00) >> 12;
- int unk1 = copyParam & 0xFF;
-
- const uint8 *unkPtr1 = va_arg(args, const uint8*);
- const uint8 *unkPtr2 = va_arg(args, const uint8*);
- va_end(args);
-
- _screen->copyWsaRect(_x, _y, _width, _height, 0, plotFunc, _offscreenBuffer, unk1, unkPtr1, unkPtr2);
-
- _screen->_curPage = pageBackUp;
- }
-}
-
} // end of namespace Kyra
diff --git a/engines/kyra/wsamovie.h b/engines/kyra/wsamovie.h
index fdceca1cd8..1bb06371c3 100644
--- a/engines/kyra/wsamovie.h
+++ b/engines/kyra/wsamovie.h
@@ -37,7 +37,7 @@ class Screen_v2;
class Movie {
public:
- Movie(KyraEngine_v1 *vm) : _vm(vm), _opened(false), _x(-1), _y(-1), _drawPage(-1) {}
+ Movie(KyraEngine_v1 *vm) : _vm(vm), _screen(vm->screen()), _opened(false), _x(-1), _y(-1), _drawPage(-1) {}
virtual ~Movie() {}
virtual bool opened() { return _opened; }
@@ -53,10 +53,11 @@ public:
virtual int frames() = 0;
- virtual void displayFrame(int frameNum, int pageNum, int x, int y, ...) = 0;
+ virtual void displayFrame(int frameNum, int pageNum, int x, int y, uint16 flags, const uint8 *table1, const uint8 *table2) = 0;
protected:
KyraEngine_v1 *_vm;
+ Screen *_screen;
bool _opened;
int _x, _y;
@@ -76,7 +77,7 @@ public:
virtual int frames() { return _opened ? _numFrames : -1; }
- virtual void displayFrame(int frameNum, int pageNum, int x, int y, ...);
+ virtual void displayFrame(int frameNum, int pageNum, int x, int y, uint16 flags, const uint8 *table1, const uint8 *table2);
enum WSAFlags {
WF_OFFSCREEN_DECODE = 0x10,
@@ -107,7 +108,7 @@ public:
int open(const char *filename, int offscreen, uint8 *palette);
void close();
- void displayFrame(int frameNum, int pageNum, int x, int y, ...);
+ void displayFrame(int frameNum, int pageNum, int x, int y, uint16 flags, const uint8 *table1, const uint8 *table2);
private:
void processFrame(int frameNum, uint8 *dst);
@@ -116,11 +117,12 @@ private:
class WSAMovie_v2 : public WSAMovie_v1 {
public:
- WSAMovie_v2(KyraEngine_v1 *vm, Screen_v2 *screen);
+ WSAMovie_v2(KyraEngine_v1 *vm);
int open(const char *filename, int unk1, uint8 *palette);
-
- virtual void displayFrame(int frameNum, int pageNum, int x, int y, ...);
+ virtual void displayFrame(int frameNum, int pageNum, int x, int y, uint16 flags, const uint8 *table1, const uint8 *table2) {
+ WSAMovie_v1::displayFrame(frameNum, pageNum, x + _xAdd, y + _yAdd, flags, table1, table2);
+ }
int xAdd() const { return _xAdd; }
int yAdd() const { return _yAdd; }
@@ -128,8 +130,6 @@ public:
void setWidth(int w) { _width = w; }
void setHeight(int h) { _height = h; }
protected:
- Screen_v2 *_screen;
-
int16 _xAdd;
int16 _yAdd;
};
--
cgit v1.2.3
From fcc0b69c073399d4af0443108eaa22cb630b276f Mon Sep 17 00:00:00 2001
From: Willem Jan Palenstijn
Date: Tue, 9 Jun 2009 15:26:09 +0000
Subject: Add (failing) hashmap test case for collision handling
svn-id: r41400
---
test/common/hashmap.h | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/test/common/hashmap.h b/test/common/hashmap.h
index c62f909f95..13f630430c 100644
--- a/test/common/hashmap.h
+++ b/test/common/hashmap.h
@@ -108,5 +108,48 @@ class HashMapTestSuite : public CxxTest::TestSuite
TS_ASSERT_EQUALS(container2[323], 32);
}
+ void test_collision() {
+ // NB: The usefulness of this example depends strongly on the
+ // specific hashmap implementation.
+ // It is constructed to insert multiple colliding elements.
+ Common::HashMap h;
+ h[5] = 1;
+ h[32+5] = 1;
+ h[64+5] = 1;
+ h[128+5] = 1;
+ TS_ASSERT(h.contains(5));
+ TS_ASSERT(h.contains(32+5));
+ TS_ASSERT(h.contains(64+5));
+ TS_ASSERT(h.contains(128+5));
+ h.erase(32+5);
+ TS_ASSERT(h.contains(5));
+ TS_ASSERT(h.contains(64+5));
+ TS_ASSERT(h.contains(128+5));
+ h.erase(5);
+ TS_ASSERT(h.contains(64+5));
+ TS_ASSERT(h.contains(128+5));
+ h[32+5] = 1;
+ TS_ASSERT(h.contains(32+5));
+ TS_ASSERT(h.contains(64+5));
+ TS_ASSERT(h.contains(128+5));
+ h[5] = 1;
+ TS_ASSERT(h.contains(5));
+ TS_ASSERT(h.contains(32+5));
+ TS_ASSERT(h.contains(64+5));
+ TS_ASSERT(h.contains(128+5));
+ h.erase(5);
+ TS_ASSERT(h.contains(32+5));
+ TS_ASSERT(h.contains(64+5));
+ TS_ASSERT(h.contains(128+5));
+ h.erase(64+5);
+ TS_ASSERT(h.contains(32+5));
+ TS_ASSERT(h.contains(128+5));
+ h.erase(128+5);
+ TS_ASSERT(h.contains(32+5));
+ h.erase(32+5);
+ TS_ASSERT(h.empty());
+ }
+
+
// TODO: Add test cases for iterators, find, ...
};
--
cgit v1.2.3
From 91d62c0a617cd2cefb69c2bb2339cfd08641d36d Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Tue, 9 Jun 2009 15:34:02 +0000
Subject: Changed some lines to tabs instead of whitespaces for identation.
svn-id: r41401
---
test/common/hashmap.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/test/common/hashmap.h b/test/common/hashmap.h
index 13f630430c..6476005eaf 100644
--- a/test/common/hashmap.h
+++ b/test/common/hashmap.h
@@ -112,20 +112,20 @@ class HashMapTestSuite : public CxxTest::TestSuite
// NB: The usefulness of this example depends strongly on the
// specific hashmap implementation.
// It is constructed to insert multiple colliding elements.
- Common::HashMap h;
- h[5] = 1;
- h[32+5] = 1;
- h[64+5] = 1;
- h[128+5] = 1;
+ Common::HashMap h;
+ h[5] = 1;
+ h[32+5] = 1;
+ h[64+5] = 1;
+ h[128+5] = 1;
TS_ASSERT(h.contains(5));
TS_ASSERT(h.contains(32+5));
TS_ASSERT(h.contains(64+5));
TS_ASSERT(h.contains(128+5));
- h.erase(32+5);
+ h.erase(32+5);
TS_ASSERT(h.contains(5));
TS_ASSERT(h.contains(64+5));
TS_ASSERT(h.contains(128+5));
- h.erase(5);
+ h.erase(5);
TS_ASSERT(h.contains(64+5));
TS_ASSERT(h.contains(128+5));
h[32+5] = 1;
--
cgit v1.2.3
From a077fa43482518b2885da14066339752cf5b1deb Mon Sep 17 00:00:00 2001
From: Sven Hesse
Date: Tue, 9 Jun 2009 18:14:49 +0000
Subject: Win Gob3 is multi-lingual (British, French, German)
svn-id: r41402
---
engines/gob/detection.cpp | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index af64a53b60..00824e702d 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -1788,6 +1788,42 @@ static const GOBGameDescription gameDescriptions[] = {
kFeaturesAdlib,
0, 0, 0
},
+ {
+ {
+ "gob3",
+ "",
+ {
+ {"intro.stk", 0, "16b014bf32dbd6ab4c5163c44f56fed1", 445104},
+ {"musmac1.mid", 0, "948c546cad3a9de5bff3fe4107c82bf1", 6404},
+ {0, 0, 0, 0}
+ },
+ FR_FRA,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeGob3,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
+ {
+ {
+ "gob3",
+ "",
+ {
+ {"intro.stk", 0, "16b014bf32dbd6ab4c5163c44f56fed1", 445104},
+ {"musmac1.mid", 0, "948c546cad3a9de5bff3fe4107c82bf1", 6404},
+ {0, 0, 0, 0}
+ },
+ EN_GRB,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeGob3,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
{ // Supplied by fac76 in bug report #1742716
{
"gob3",
--
cgit v1.2.3
From 5a1e1a167e477252ebbc051d94356c11030eb0be Mon Sep 17 00:00:00 2001
From: Sven Hesse
Date: Tue, 9 Jun 2009 18:18:11 +0000
Subject: Win Gob2 is multi-lingual (American, French, German)
svn-id: r41403
---
engines/gob/detection.cpp | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index 00824e702d..b377b8b6b3 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -835,6 +835,42 @@ static const GOBGameDescription gameDescriptions[] = {
kFeaturesAdlib,
0, 0, 0
},
+ {
+ {
+ "gob2",
+ "",
+ {
+ {"intro.stk", 0, "25a99827cd59751a80bed9620fb677a0", 893302},
+ {"musmac1.mid", 0, "834e55205b710d0af5f14a6f2320dd8e", 8661},
+ {0, 0, 0, 0}
+ },
+ EN_USA,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeGob2,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
+ {
+ {
+ "gob2",
+ "",
+ {
+ {"intro.stk", 0, "25a99827cd59751a80bed9620fb677a0", 893302},
+ {"musmac1.mid", 0, "834e55205b710d0af5f14a6f2320dd8e", 8661},
+ {0, 0, 0, 0}
+ },
+ FR_FRA,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeGob2,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
{
{
"gob2",
--
cgit v1.2.3
From 38c484abb2869f221af4a2c7fb12e76b9c112e3d Mon Sep 17 00:00:00 2001
From: Sven Hesse
Date: Tue, 9 Jun 2009 18:19:11 +0000
Subject: Win Gob1 is multi-lingual (British, French, German, Italian, Spanish)
svn-id: r41404
---
engines/gob/detection.cpp | 72 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index b377b8b6b3..b329c85438 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -441,6 +441,78 @@ static const GOBGameDescription gameDescriptions[] = {
kFeaturesAdlib,
0, 0, 0
},
+ {
+ {
+ "gob1",
+ "",
+ {
+ {"intro.stk", 0, "e157cb59c6d330ca70d12ab0ef1dd12b", 288972},
+ {"musmac1.mid", 0, "4f66903b33df8a20edd4c748809c0b56", 8161},
+ {0, 0, 0, 0}
+ },
+ EN_GRB,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeGob1,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
+ {
+ {
+ "gob1",
+ "",
+ {
+ {"intro.stk", 0, "e157cb59c6d330ca70d12ab0ef1dd12b", 288972},
+ {"musmac1.mid", 0, "4f66903b33df8a20edd4c748809c0b56", 8161},
+ {0, 0, 0, 0}
+ },
+ FR_FRA,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeGob1,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
+ {
+ {
+ "gob1",
+ "",
+ {
+ {"intro.stk", 0, "e157cb59c6d330ca70d12ab0ef1dd12b", 288972},
+ {"musmac1.mid", 0, "4f66903b33df8a20edd4c748809c0b56", 8161},
+ {0, 0, 0, 0}
+ },
+ ES_ESP,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeGob1,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
+ {
+ {
+ "gob1",
+ "",
+ {
+ {"intro.stk", 0, "e157cb59c6d330ca70d12ab0ef1dd12b", 288972},
+ {"musmac1.mid", 0, "4f66903b33df8a20edd4c748809c0b56", 8161},
+ {0, 0, 0, 0}
+ },
+ IT_ITA,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeGob1,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
{
{
"gob1",
--
cgit v1.2.3
From 412628aaa32d2694afe35c70c8b0afd2a6b5b81f Mon Sep 17 00:00:00 2001
From: Sven Hesse
Date: Tue, 9 Jun 2009 18:52:55 +0000
Subject: Multi-lingual Inca2 version (American, French, German, Italian,
Spanish)
svn-id: r41405
---
engines/gob/detection.cpp | 56 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index b329c85438..dadec7bf92 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -2360,6 +2360,62 @@ static const GOBGameDescription gameDescriptions[] = {
kFeaturesAdlib,
0, 0, 0
},
+ {
+ {
+ "inca2",
+ "",
+ AD_ENTRY1s("intro.stk", "d33011df8758ac64ca3dca77c7719001", 908612),
+ DE_DEU,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeInca2,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
+ {
+ {
+ "inca2",
+ "",
+ AD_ENTRY1s("intro.stk", "d33011df8758ac64ca3dca77c7719001", 908612),
+ IT_ITA,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeInca2,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
+ {
+ {
+ "inca2",
+ "",
+ AD_ENTRY1s("intro.stk", "d33011df8758ac64ca3dca77c7719001", 908612),
+ ES_ESP,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeInca2,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
+ {
+ {
+ "inca2",
+ "",
+ AD_ENTRY1s("intro.stk", "d33011df8758ac64ca3dca77c7719001", 908612),
+ FR_FRA,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeInca2,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
{
{
"inca2",
--
cgit v1.2.3
From 5728ff23cadf6b7695be42fc75a737afd17cf67f Mon Sep 17 00:00:00 2001
From: Sven Hesse
Date: Tue, 9 Jun 2009 18:53:17 +0000
Subject: Win Lost in Time is multi-lingual (British, French, Spanish)
svn-id: r41406
---
engines/gob/detection.cpp | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index dadec7bf92..3bbd79c30e 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -1644,7 +1644,35 @@ static const GOBGameDescription gameDescriptions[] = {
"lostintime",
"",
AD_ENTRY1s("intro.stk", "0ddf39cea1ec30ecc8bfe444ebd7b845", 4207330),
- UNK_LANG,
+ EN_GRB,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeLostInTime,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
+ {
+ {
+ "lostintime",
+ "",
+ AD_ENTRY1s("intro.stk", "0ddf39cea1ec30ecc8bfe444ebd7b845", 4207330),
+ FR_FRA,
+ kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSPEECH
+ },
+ kGameTypeLostInTime,
+ kFeaturesAdlib,
+ 0, 0, 0
+ },
+ {
+ {
+ "lostintime",
+ "",
+ AD_ENTRY1s("intro.stk", "0ddf39cea1ec30ecc8bfe444ebd7b845", 4207330),
+ ES_ESP,
kPlatformWindows,
ADGF_NO_FLAGS,
GUIO_NOSPEECH
--
cgit v1.2.3
From 6f49d1576b54e333f8da9b87ecc0e8ce03c473e9 Mon Sep 17 00:00:00 2001
From: Sven Hesse
Date: Tue, 9 Jun 2009 18:53:35 +0000
Subject: Added a workaround for Win Lost in Time. It's got VMD files which are
still referenced as IMD
svn-id: r41407
---
engines/gob/mult_v2.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/engines/gob/mult_v2.cpp b/engines/gob/mult_v2.cpp
index d9b5be0847..379ed90c23 100644
--- a/engines/gob/mult_v2.cpp
+++ b/engines/gob/mult_v2.cpp
@@ -269,6 +269,19 @@ void Mult_v2::loadImds(Common::SeekableReadStream &data) {
_multData->imdFiles = new char[size * 14];
memcpy(_multData->imdFiles, _vm->_global->_inter_execPtr, size * 14);
+
+ // WORKAROUND: The Windows version of Lost in Time has VMD not IMD files,
+ // but they are still referenced as IMD.
+ if ((_vm->getGameType() == kGameTypeLostInTime) &&
+ (_vm->getPlatform() == Common::kPlatformWindows)) {
+
+ for (int i = 0; i < size; i++) {
+ char *dot = strrchr(_multData->imdFiles + (i * 14), '.');
+ if (dot)
+ *dot = '\0';
+ }
+ }
+
_vm->_global->_inter_execPtr += size * 14;
data.seek(2, SEEK_CUR);
for (int i = 0; i < 4; i++) {
--
cgit v1.2.3
From 5e68fbfe875686c6ab1fda0a85d2a878486656c2 Mon Sep 17 00:00:00 2001
From: Walter van Niftrik
Date: Tue, 9 Jun 2009 19:18:48 +0000
Subject: SCI: Moved SCI1 audio map handling into the resource manager.
svn-id: r41408
---
engines/sci/engine/ksound.cpp | 2 +-
engines/sci/resource.cpp | 356 +++++++++++++++++++++---------------------
engines/sci/resource.h | 52 +++---
3 files changed, 209 insertions(+), 201 deletions(-)
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index b742c93a52..c912da020d 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -1027,7 +1027,7 @@ reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv) {
// In SCI1.1: tests for digital audio support
return make_reg(0, 1);
} else {
- s->_sound._audioResource->setAudioLang(argv[1].toSint16());
+ s->resmgr->setAudioLanguage(argv[1].toSint16());
}
break;
default:
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 5edf1b7145..ce08280812 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -217,7 +217,7 @@ bool ResourceManager::loadFromPatchFile(Resource *res) {
return loadPatch(res, file);
}
-bool ResourceManager::loadFromAudioVolume(Resource *res, Common::File &file) {
+bool ResourceManager::loadFromAudioVolumeSCI11(Resource *res, Common::File &file) {
ResourceType type = (ResourceType)(file.readByte() & 0x7f);
if (((res->id.type == kResourceTypeAudio || res->id.type == kResourceTypeAudio36) && (type != kResourceTypeAudio))
|| ((res->id.type == kResourceTypeSync || res->id.type == kResourceTypeSync36) && (type != kResourceTypeSync))) {
@@ -243,6 +243,21 @@ bool ResourceManager::loadFromAudioVolume(Resource *res, Common::File &file) {
return loadPatch(res, file);
}
+bool ResourceManager::loadFromAudioVolumeSCI1(Resource *res, Common::File &file) {
+ res->data = new byte[res->size];
+
+ if (res->data == NULL) {
+ error("Can't allocate %d bytes needed for loading %s", res->size, res->id.toString().c_str());
+ }
+
+ unsigned int really_read = file.read(res->data, res->size);
+ if (really_read != res->size)
+ warning("Read %d bytes from %s but expected %d", really_read, res->id.toString().c_str(), res->size);
+
+ res->status = kResStatusAllocated;
+ return true;
+}
+
Common::File *ResourceManager::getVolumeFile(const char *filename) {
Common::List::iterator it = _volumeFiles.begin();
Common::File *file;
@@ -292,7 +307,10 @@ void ResourceManager::loadResource(Resource *res) {
file->seek(res->file_offset, SEEK_SET);
if (res->source->source_type == kSourceAudioVolume) {
- loadFromAudioVolume(res, *file);
+ if (_sciVersion < SCI_VERSION_1_1)
+ loadFromAudioVolumeSCI1(res, *file);
+ else
+ loadFromAudioVolumeSCI11(res, *file);
} else {
int error = decompress(res, file);
if (error) {
@@ -436,8 +454,11 @@ void ResourceManager::scanNewSources() {
else
readResourceMapSCI1(source);
break;
+ case kSourceExtAudioMap:
+ readAudioMapSCI1(source);
+ break;
case kSourceIntMap:
- readMap(source);
+ readAudioMapSCI11(source);
break;
default:
break;
@@ -460,6 +481,7 @@ ResourceManager::ResourceManager(int version, int maxMemory) {
_LRU.clear();
_resMap.clear();
_sciVersion = version;
+ _audioMapSCI1 = NULL;
addAppropriateSources();
@@ -607,15 +629,10 @@ void ResourceManager::printLRU() {
debug("Total: %d entries, %d bytes (mgr says %d)", entries, mem, _memoryLRU);
}
-void ResourceManager::freeOldResources(int last_invulnerable) {
- while (_maxMemory < _memoryLRU && (!last_invulnerable || !_LRU.empty())) {
+void ResourceManager::freeOldResources() {
+ while (_maxMemory < _memoryLRU) {
+ assert(!_LRU.empty());
Resource *goner = *_LRU.reverse_begin();
- if (!goner) {
- debug("Internal error: mgr->lru_last is NULL!");
- debug("LRU-mem= %d", _memoryLRU);
- debug("lru_first = %p", (void *)*_LRU.begin());
- printLRU();
- }
removeFromLRU(goner);
goner->unalloc();
#ifdef SCI_VERBOSE_RESMGR
@@ -659,6 +676,8 @@ Resource *ResourceManager::findResource(ResourceId id, bool lock) {
// Unless an error occured, the resource is now either
// locked or allocated, but never queued or freed.
+ freeOldResources();
+
if (lock) {
if (retval->status == kResStatusAllocated) {
retval->status = kResStatusLocked;
@@ -671,8 +690,6 @@ Resource *ResourceManager::findResource(ResourceId id, bool lock) {
addToLRU(retval);
}
- freeOldResources(retval->status == kResStatusAllocated);
-
if (retval->data)
return retval;
else {
@@ -695,7 +712,7 @@ void ResourceManager::unlockResource(Resource *res) {
addToLRU(res);
}
- freeOldResources(0);
+ freeOldResources();
}
int ResourceManager::detectMapVersion() {
@@ -1077,6 +1094,22 @@ void ResourceManager::addResource(ResourceId resId, ResourceSource *src, uint32
}
}
+void ResourceManager::removeAudioResource(ResourceId resId) {
+ // Remove resource, unless it was loaded from a patch
+ if (_resMap.contains(resId)) {
+ Resource *res = _resMap.getVal(resId);
+
+ if (res->source->source_type == kSourceAudioVolume) {
+ if (res->lockers == 0) {
+ _resMap.erase(resId);
+ delete res;
+ } else {
+ warning("Failed to remove resource %s (still in use)", resId.toString().c_str());
+ }
+ }
+ }
+}
+
// Early SCI1.1 65535.MAP structure (uses RESOURCE.AUD):
// =========
// 6-byte entries:
@@ -1112,7 +1145,7 @@ void ResourceManager::addResource(ResourceId resId, ResourceSource *src, uint32
// w syncSize (iff seq has bit 7 set)
// w syncAscSize (iff seq has bit 6 set)
-int ResourceManager::readMap(ResourceSource *map) {
+int ResourceManager::readAudioMapSCI11(ResourceSource *map) {
bool isEarly = true;
uint32 offset = 0;
Resource *mapRes = findResource(ResourceId(kResourceTypeMap, map->volume_number), false);
@@ -1197,6 +1230,103 @@ int ResourceManager::readMap(ResourceSource *map) {
return 0;
}
+// AUDIOnnn.MAP contains 10-byte entries:
+// w nEntry
+// dw offset+volume (as in resource.map)
+// dw size
+// ending with 10 0xFFs
+
+int ResourceManager::readAudioMapSCI1(ResourceSource *map, bool unload) {
+ Common::File file;
+
+ if (!file.open(map->location_name))
+ return SCI_ERROR_RESMAP_NOT_FOUND;
+
+ while (1) {
+ uint16 n = file.readUint16LE();
+ uint32 offset = file.readUint32LE();
+ uint32 size = file.readUint32LE();
+
+ if (file.ioFailed()) {
+ warning("Error while reading %s", map->location_name.c_str());
+ return SCI_ERROR_RESMAP_NOT_FOUND;
+ }
+
+ if (n == 0xffff)
+ break;
+
+ byte volume_nr = offset >> 28; // most significant 4 bits
+ offset &= 0x0fffffff; // least significant 28 bits
+
+ ResourceSource *src = getVolume(map, volume_nr);
+
+ if (src) {
+ if (unload)
+ removeAudioResource(ResourceId(kResourceTypeAudio, n));
+ else
+ addResource(ResourceId(kResourceTypeAudio, n), src, offset, size);
+ } else {
+ warning("Failed to find audio volume %i", volume_nr);
+ }
+ }
+
+ return 0;
+}
+
+void ResourceManager::setAudioLanguage(int language) {
+ if (_audioMapSCI1) {
+ if (_audioMapSCI1->volume_number == language) {
+ // This language is already loaded
+ return;
+ }
+
+ // We already have a map loaded, so we unload it first
+ readAudioMapSCI1(_audioMapSCI1, true);
+
+ // Remove all volumes that use this map from the source list
+ Common::List::iterator it = _sources.begin();
+ while (it != _sources.end()) {
+ ResourceSource *src = *it;
+ if (src->associated_map == _audioMapSCI1) {
+ it = _sources.erase(it);
+ delete src;
+ } else {
+ ++it;
+ }
+ }
+
+ // Remove the map itself from the source list
+ _sources.remove(_audioMapSCI1);
+ delete _audioMapSCI1;
+
+ _audioMapSCI1 = NULL;
+ }
+
+ char filename[9];
+ snprintf(filename, 9, "AUDIO%03d", language);
+
+ Common::String fullname = Common::String(filename) + ".MAP";
+ if (!Common::File::exists(fullname)) {
+ warning("No audio map found for language %i", language);
+ return;
+ }
+
+ _audioMapSCI1 = addSource(NULL, kSourceExtAudioMap, fullname.c_str(), language);
+
+ // Search for audio volumes for this language and add them to the source list
+ Common::ArchiveMemberList files;
+ SearchMan.listMatchingMembers(files, Common::String(filename) + ".0??");
+ for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) {
+ const Common::String name = (*x)->getName();
+ const char *dot = strrchr(name.c_str(), '.');
+ int number = atoi(dot + 1);
+
+ addSource(_audioMapSCI1, kSourceAudioVolume, name.c_str(), number);
+ }
+
+ scanNewSources();
+}
+
int ResourceManager::readResourceInfo(Resource *res, Common::File *file,
uint32&szPacked, ResourceCompression &compression) {
// SCI0 volume format: {wResId wPacked+4 wUnpacked wCompression} = 8 bytes
@@ -1360,42 +1490,6 @@ AudioResource::AudioResource(ResourceManager *resMgr, int sciVersion) {
_resMgr = resMgr;
_sciVersion = sciVersion;
_audioRate = 11025;
- _lang = 0;
- _audioMapSCI1 = 0;
- _audioMapSCI11 = 0;
-}
-
-AudioResource::~AudioResource() {
- if (_sciVersion < SCI_VERSION_1_1) {
- if (_audioMapSCI1) {
- delete[] _audioMapSCI1;
- _audioMapSCI1 = 0;
- }
- } else {
- if (_audioMapSCI11)
- _resMgr->unlockResource(_audioMapSCI11);
- }
-}
-
-// Used in SCI1 games
-void AudioResource::setAudioLang(int16 lang) {
- if (lang != -1) {
- _lang = lang;
-
- char filename[40];
- sprintf(filename, "AUDIO%03d.MAP", _lang);
-
- Common::File* audioMapFile = new Common::File();
- if (audioMapFile->open(filename)) {
- // The audio map is freed in the destructor
- _audioMapSCI1 = new byte[audioMapFile->size()];
- audioMapFile->read(_audioMapSCI1, audioMapFile->size());
- audioMapFile->close();
- delete audioMapFile;
- } else {
- _audioMapSCI1 = 0;
- }
- }
}
int AudioResource::getAudioPosition() {
@@ -1406,33 +1500,6 @@ int AudioResource::getAudioPosition() {
}
}
-bool AudioResource::findAudEntrySCI1(uint16 audioNumber, byte &volume, uint32 &offset, uint32 &size) {
- // AUDIO00X.MAP contains 10-byte entries:
- // w nEntry
- // dw offset+volume (as in resource.map)
- // dw size
- // ending with 10 0xFFs
- uint16 n;
- uint32 off;
-
- if (_audioMapSCI1 == 0)
- return false;
-
- byte *ptr = _audioMapSCI1;
- while ((n = READ_LE_UINT16(ptr)) != 0xFFFF) {
- if (n == audioNumber) {
- off = READ_LE_UINT32(ptr + 2);
- size = READ_LE_UINT32(ptr + 6);
- volume = off >> 28;
- offset = off & 0x0FFFFFFF;
- return true;
- }
- ptr += 10;
- }
-
- return false;
-}
-
// FIXME: Move this to sound/adpcm.cpp?
// Note that the 16-bit version is also used in coktelvideo.cpp
static const uint16 tableDPCM16[128] = {
@@ -1535,115 +1602,56 @@ static byte* readSOLAudio(Common::SeekableReadStream *audioStream, uint32 &size,
Audio::AudioStream* AudioResource::getAudioStream(uint32 audioNumber, uint32 volume, int *sampleLen) {
Audio::AudioStream *audioStream = 0;
- uint32 offset;
uint32 size;
- bool found = false;
byte *data = 0;
- char filename[40];
byte flags = 0;
- Sci::Resource* audioRes = NULL;
+ Sci::Resource* audioRes;
- // Try to load from resource manager
- if (volume == 65535)
+ if (volume == 65535) {
audioRes = _resMgr->findResource(ResourceId(kResourceTypeAudio, audioNumber), false);
- else
- audioRes = _resMgr->findResource(ResourceId(kResourceTypeAudio36, volume, audioNumber), false);
-
- if (audioRes) {
- if (_sciVersion < SCI_VERSION_1_1) {
- size = audioRes->size;
- data = audioRes->data;
- } else {
- byte audioFlags;
-
- Common::MemoryReadStream *headerStream =
- new Common::MemoryReadStream(audioRes->header, audioRes->headerSize, false);
-
- if (readSOLHeader(headerStream, audioRes->headerSize, size, _audioRate, audioFlags)) {
- Common::MemoryReadStream *dataStream =
- new Common::MemoryReadStream(audioRes->data, audioRes->size, false);
- data = readSOLAudio(dataStream, size, audioFlags, flags);
- delete dataStream;
- }
- delete headerStream;
- }
-
- if (data) {
- audioStream = Audio::makeLinearInputStream(data, size, _audioRate,
- flags | Audio::Mixer::FLAG_AUTOFREE, 0, 0);
+ if (!audioRes) {
+ warning("Failed to find audio entry %i", audioNumber);
+ return NULL;
}
} else {
- // Load it from the audio file
- if (_sciVersion < SCI_VERSION_1_1) {
- byte sci1Volume;
- found = findAudEntrySCI1(audioNumber, sci1Volume, offset, size);
- sprintf(filename, "AUDIO%03d.%03d", _lang, sci1Volume);
- flags |= Audio::Mixer::FLAG_UNSIGNED;
+ audioRes = _resMgr->findResource(ResourceId(kResourceTypeAudio36, volume, audioNumber), false);
+ if (!audioRes) {
+ warning("Failed to find audio entry (%i, %i, %i, %i, %i)", volume, (audioNumber >> 24) & 0xff,
+ (audioNumber >> 16) & 0xff, (audioNumber >> 8) & 0xff, audioNumber & 0xff);
+ return NULL;
}
+ }
- if (found) {
- #if 0
- // TODO: This tries to load directly from the KQ5CD audio file with MP3/OGG/FLAC
- // compression. Once we got a tool to compress this file AND update the map file
- // at the same time, we can use this code to play compressed audio.
- if (_sciVersion < SCI_VERSION_1_1) {
- uint32 start = offset * 1000 / _audioRate;
- uint32 duration = size * 1000 / _audioRate;
-
- // Try to load compressed
- audioStream = Audio::AudioStream::openStreamFile(filename, start, duration);
- }
- #endif
-
- if (!audioStream) {
- // Compressed file load failed, try to load original raw data
- Common::File* audioFile = new Common::File();
- if (audioFile->open(filename)) {
- audioFile->seek(offset);
-
- if (_sciVersion < SCI_VERSION_1_1) {
- data = (byte *)malloc(size);
- audioFile->read(data, size);
- } else {
- byte type = audioFile->readByte() & 0x7f;
- byte audioFlags;
-
- if (type != kResourceTypeAudio) {
- warning("Resource type mismatch");
- delete audioFile;
- return NULL;
- }
-
- byte headerSize = audioFile->readByte();
-
- if (readSOLHeader(audioFile, headerSize, size, _audioRate, audioFlags))
- data = readSOLAudio(audioFile, size, audioFlags, flags);
-
- if (!data) {
- delete audioFile;
- return NULL;
- }
- }
-
- audioFile->close();
-
- if (data) {
- audioStream = Audio::makeLinearInputStream(data, size, _audioRate,
- flags | Audio::Mixer::FLAG_AUTOFREE, 0, 0);
- }
- }
+ byte audioFlags;
- delete audioFile;
- }
- } else {
- warning("Failed to find audio entry (%i, %i, %i, %i, %i)", volume, (audioNumber >> 24) & 0xff,
- (audioNumber >> 16) & 0xff, (audioNumber >> 8) & 0xff, audioNumber & 0xff);
+ if (audioRes->headerSize > 0) {
+ // SCI1.1
+ Common::MemoryReadStream *headerStream =
+ new Common::MemoryReadStream(audioRes->header, audioRes->headerSize, false);
+
+ if (readSOLHeader(headerStream, audioRes->headerSize, size, _audioRate, audioFlags)) {
+ Common::MemoryReadStream *dataStream =
+ new Common::MemoryReadStream(audioRes->data, audioRes->size, false);
+ data = readSOLAudio(dataStream, size, audioFlags, flags);
+ delete dataStream;
}
+ delete headerStream;
+ } else {
+ // SCI1
+ size = audioRes->size;
+ data = (byte *)malloc(size);
+ assert(data);
+ memcpy(data, audioRes->data, size);
+ flags = Audio::Mixer::FLAG_UNSIGNED;
}
- if (audioStream) {
- *sampleLen = (flags & Audio::Mixer::FLAG_16BITS ? size >> 1 : size) * 60 / _audioRate;
- return audioStream;
+ if (data) {
+ audioStream = Audio::makeLinearInputStream(data, size, _audioRate,
+ flags | Audio::Mixer::FLAG_AUTOFREE, 0, 0);
+ if (audioStream) {
+ *sampleLen = (flags & Audio::Mixer::FLAG_16BITS ? size >> 1 : size) * 60 / _audioRate;
+ return audioStream;
+ }
}
return NULL;
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index fc3f37f25c..e1a7dda921 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -72,19 +72,14 @@ enum {
enum ResSourceType {
kSourceDirectory = 0,
- kSourcePatch = 1,
- kSourceVolume = 2,
- kSourceExtMap = 3,
- kSourceIntMap = 4,
- kSourceAudioVolume = 5,
- kSourceMask = 127
+ kSourcePatch,
+ kSourceVolume,
+ kSourceExtMap,
+ kSourceIntMap,
+ kSourceAudioVolume,
+ kSourceExtAudioMap
};
-#define RESSOURCE_ADDRESSING_BASIC 0
-#define RESSOURCE_ADDRESSING_EXTENDED 128
-#define RESSOURCE_ADDRESSING_MASK 128
-
-#define RESOURCE_HASH(type, number) (uint32)((type<<16) | number)
#define SCI0_RESMAP_ENTRIES_SIZE 6
#define SCI1_RESMAP_ENTRIES_SIZE 6
#define SCI11_RESMAP_ENTRIES_SIZE 5
@@ -136,7 +131,6 @@ struct ResourceSource {
Common::String location_name; // FIXME: Replace by FSNode ?
int volume_number;
ResourceSource *associated_map;
- ResourceSource *next;
};
class ResourceManager;
@@ -270,6 +264,8 @@ public:
*/
Common::List *listResources(ResourceType type, int mapNumber = -1);
+ void setAudioLanguage(int language);
+
protected:
int _maxMemory; //!< Config option: Maximum total byte number allocated
Common::List _sources;
@@ -278,6 +274,7 @@ protected:
Common::List _LRU; //!< Last Resource Used list
ResourceMap _resMap;
Common::List _volumeFiles; //!< list of opened volume files
+ ResourceSource *_audioMapSCI1; //!< Currently loaded audio map for SCI1
/**
* Add a path to the resource manager's list of sources.
@@ -325,11 +322,13 @@ protected:
void loadResource(Resource *res);
bool loadPatch(Resource *res, Common::File &file);
bool loadFromPatchFile(Resource *res);
- bool loadFromAudioVolume(Resource *res, Common::File &file);
- void freeOldResources(int last_invulnerable);
+ bool loadFromAudioVolumeSCI1(Resource *res, Common::File &file);
+ bool loadFromAudioVolumeSCI11(Resource *res, Common::File &file);
+ void freeOldResources();
int decompress(Resource *res, Common::File *file);
int readResourceInfo(Resource *res, Common::File *file, uint32&szPacked, ResourceCompression &compression);
void addResource(ResourceId resId, ResourceSource *src, uint32 offset, uint32 size = 0);
+ void removeAudioResource(ResourceId resId);
/**--- Resource map decoding functions ---*/
int detectMapVersion();
@@ -337,21 +336,32 @@ protected:
/**
* Reads the SCI0 resource.map file from a local directory.
+ * @param map The map
* @return 0 on success, an SCI_ERROR_* code otherwise
*/
int readResourceMapSCI0(ResourceSource *map);
/**
* Reads the SCI1 resource.map file from a local directory.
+ * @param map The map
* @return 0 on success, an SCI_ERROR_* code otherwise
*/
int readResourceMapSCI1(ResourceSource *map);
/**
- * Reads SCI1.1 MAP resources
+ * Reads SCI1.1 audio map resources
+ * @param map The map
* @return 0 on success, an SCI_ERROR_* code otherwise
*/
- int readMap(ResourceSource *map);
+ int readAudioMapSCI11(ResourceSource *map);
+
+ /**
+ * Reads SCI1 audio map files
+ * @param map The map
+ * @param unload Unload the map instead of loading it
+ * @return 0 on success, an SCI_ERROR_* code otherwise
+ */
+ int readAudioMapSCI1(ResourceSource *map, bool unload = false);
/**--- Patch management functions ---*/
@@ -393,10 +403,8 @@ protected:
class AudioResource {
public:
AudioResource(ResourceManager *resMgr, int sciVersion);
- ~AudioResource();
void setAudioRate(uint16 audioRate) { _audioRate = audioRate; }
- void setAudioLang(int16 lang);
Audio::SoundHandle* getAudioHandle() { return &_audioHandle; }
int getAudioPosition();
@@ -410,16 +418,8 @@ public:
private:
Audio::SoundHandle _audioHandle;
uint16 _audioRate;
- int16 _lang;
- byte *_audioMapSCI1;
- Resource *_audioMapSCI11;
ResourceManager *_resMgr;
int _sciVersion;
-
- bool findAudEntrySCI1(uint16 audioNumber, byte &volume, uint32 &offset, uint32 &size);
- bool findAudEntrySCI11(uint32 audioNumber, uint32 volume, uint32 &offset, bool getSync = false, uint32 *size = NULL);
- bool findAudEntrySCI11Late(uint32 audioNumber, uint32 &offset, bool getSync, uint32 *size);
- bool findAudEntrySCI11Early(uint32 audioNumber, uint32 &offset, bool getSync, uint32 *size);
};
} // End of namespace Sci
--
cgit v1.2.3
From a19622994bc8c8411a64ad458335ee1989a78817 Mon Sep 17 00:00:00 2001
From: Sven Hesse
Date: Tue, 9 Jun 2009 19:37:24 +0000
Subject: Fixed CLEAR
svn-id: r41409
---
engines/gob/demos/demoplayer.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/engines/gob/demos/demoplayer.cpp b/engines/gob/demos/demoplayer.cpp
index ede90af333..0229bb7515 100644
--- a/engines/gob/demos/demoplayer.cpp
+++ b/engines/gob/demos/demoplayer.cpp
@@ -123,7 +123,9 @@ void DemoPlayer::init() {
void DemoPlayer::clearScreen() {
debugC(1, kDebugDemo, "Clearing the screen");
- _vm->_video->clearScreen();
+ _vm->_video->clearSurf(*_vm->_draw->_backSurface);
+ _vm->_draw->forceBlit();
+ _vm->_video->retrace();
}
void DemoPlayer::playVideo(const char *fileName) {
--
cgit v1.2.3
From ea0a2bcbbdc0406eec97e161572c69da4e80f61a Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Wed, 10 Jun 2009 08:18:44 +0000
Subject: Clarify that Cygwin is not supported as building platform anymore
svn-id: r41419
---
configure | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/configure b/configure
index c2641b31f0..65e516de1a 100755
--- a/configure
+++ b/configure
@@ -1115,6 +1115,10 @@ case $_host_os in
LIBS="$LIBS -lmingw32 -lwinmm"
OBJS="$OBJS scummvmico.o"
;;
+ cygwin*)
+ echo ERROR: Cygwin building is not supported by ScummVM anymore. Consider using MinGW.
+ exit 0
+ ;;
os2-emx*)
DEFINES="$DEFINES -DUNIX"
;;
--
cgit v1.2.3
From ff72f8531cea80be7606e338dbdbd6413b298661 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Wed, 10 Jun 2009 10:11:24 +0000
Subject: Added debugCN() call which does not add newline automatically
svn-id: r41421
---
common/debug.cpp | 26 ++++++++++++++++++++++++++
common/debug.h | 21 +++++++++++++++++++++
2 files changed, 47 insertions(+)
diff --git a/common/debug.cpp b/common/debug.cpp
index cc358596f7..ff17959cbf 100644
--- a/common/debug.cpp
+++ b/common/debug.cpp
@@ -227,6 +227,19 @@ void debugC(int level, uint32 debugChannels, const char *s, ...) {
va_end(va);
}
+void debugCN(int level, uint32 debugChannels, const char *s, ...) {
+ va_list va;
+
+ // Debug level 11 turns on all special debug level messages
+ if (gDebugLevel != 11)
+ if (level > gDebugLevel || !(Common::gDebugLevelsEnabled & debugChannels))
+ return;
+
+ va_start(va, s);
+ debugHelper(s, va, false);
+ va_end(va);
+}
+
void debugC(uint32 debugChannels, const char *s, ...) {
va_list va;
@@ -240,4 +253,17 @@ void debugC(uint32 debugChannels, const char *s, ...) {
va_end(va);
}
+void debugCN(uint32 debugChannels, const char *s, ...) {
+ va_list va;
+
+ // Debug level 11 turns on all special debug level messages
+ if (gDebugLevel != 11)
+ if (!(Common::gDebugLevelsEnabled & debugChannels))
+ return;
+
+ va_start(va, s);
+ debugHelper(s, va, false);
+ va_end(va);
+}
+
#endif
diff --git a/common/debug.h b/common/debug.h
index 43fe297859..888c71adbb 100644
--- a/common/debug.h
+++ b/common/debug.h
@@ -106,6 +106,8 @@ inline void debug(int level, const char *s, ...) {}
inline void debugN(int level, const char *s, ...) {}
inline void debugC(int level, uint32 engine_level, const char *s, ...) {}
inline void debugC(uint32 engine_level, const char *s, ...) {}
+inline void debugCN(int level, uint32 engine_level, const char *s, ...) {}
+inline void debugCN(uint32 engine_level, const char *s, ...) {}
#else
@@ -144,6 +146,17 @@ void debugN(int level, const char *s, ...) GCC_PRINTF(2, 3);
*/
void debugC(int level, uint32 debugChannels, const char *s, ...) GCC_PRINTF(3, 4);
+/**
+ * Print a debug message to the text console (stdout), but only if
+ * the specified level does not exceed the value of gDebugLevel OR
+ * if the specified special debug level is active.
+ * As a rule of thumb, the more important the message, the lower the level.
+ * Does not append a newline automatically.
+ *
+ * @see enableDebugChannel
+ */
+void debugCN(int level, uint32 debugChannels, const char *s, ...) GCC_PRINTF(3, 4);
+
/**
* Print a debug message to the text console (stdout), but only if
* the specified special debug level is active.
@@ -153,6 +166,14 @@ void debugC(int level, uint32 debugChannels, const char *s, ...) GCC_PRINTF(3, 4
*/
void debugC(uint32 debugChannels, const char *s, ...) GCC_PRINTF(2, 3);
+/**
+ * Print a debug message to the text console (stdout), but only if
+ * the specified special debug level is active.
+ * Does not append a newline automatically.
+ *
+ * @see enableDebugChannel
+ */
+void debugCN(uint32 debugChannels, const char *s, ...) GCC_PRINTF(2, 3);
#endif
--
cgit v1.2.3
From f2c1b182424f3e76ab72a770e8d3f059deb8e929 Mon Sep 17 00:00:00 2001
From: Paul Gilbert
Date: Wed, 10 Jun 2009 12:15:50 +0000
Subject: Added variable to savegame format so that savegames can be correctly
loaded from the ScummVM launcher
svn-id: r41423
---
engines/cruise/function.cpp | 2 --
engines/cruise/saveload.cpp | 2 ++
engines/cruise/vars.cpp | 2 ++
engines/cruise/vars.h | 2 ++
4 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index 7789cb6fb1..5194ad4269 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -774,8 +774,6 @@ int16 Op_UnfreezeParent(void) {
return 0;
}
-int16 protectionCode = 0;
-
int16 Op_ProtectionFlag(void) {
int16 temp = protectionCode;
int16 newVar;
diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp
index 0084b10cb9..1b929f6994 100644
--- a/engines/cruise/saveload.cpp
+++ b/engines/cruise/saveload.cpp
@@ -25,6 +25,7 @@
#include "cruise/cruise_main.h"
#include "cruise/cruise.h"
+#include "cruise/vars.h"
#include "common/serializer.h"
#include "common/savefile.h"
@@ -143,6 +144,7 @@ static void syncBasicInfo(Common::Serializer &s) {
s.syncAsSint16LE(flagCt);
s.syncAsSint16LE(var41);
s.syncAsSint16LE(playerMenuEnabled);
+ s.syncAsSint16LE(protectionCode);
}
static void syncBackgroundTable(Common::Serializer &s) {
diff --git a/engines/cruise/vars.cpp b/engines/cruise/vars.cpp
index 3ea591ed43..94fd00cbfd 100644
--- a/engines/cruise/vars.cpp
+++ b/engines/cruise/vars.cpp
@@ -79,6 +79,8 @@ int16 volumeNumberOfEntry;
int16 displayOn = 1;
+int16 protectionCode = 0;
+
int16 globalVars[2000];
dataFileEntry filesDatabase[NUM_FILE_ENTRIES];
diff --git a/engines/cruise/vars.h b/engines/cruise/vars.h
index 7208a8bea0..4bb94ff691 100644
--- a/engines/cruise/vars.h
+++ b/engines/cruise/vars.h
@@ -183,6 +183,8 @@ extern int16 volumeNumberOfEntry;
extern int16 displayOn;
+extern int16 protectionCode;
+
#define NUM_FILE_ENTRIES 257
extern int16 globalVars[2000];
--
cgit v1.2.3
From e487347921fc751a85b221fa7a8c9c455cc595d6 Mon Sep 17 00:00:00 2001
From: Paul Gilbert
Date: Wed, 10 Jun 2009 12:16:30 +0000
Subject: Added support for loading savegames from the launcher
svn-id: r41424
---
engines/cruise/cruise_main.cpp | 3 +++
engines/cruise/detection.cpp | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index 136aa92b81..ea120ba05e 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -1739,6 +1739,9 @@ void CruiseEngine::mainLoop(void) {
int quitValue2 = 1;
int quitValue = 0;
+ if (ConfMan.hasKey("save_slot"))
+ loadGameState(ConfMan.getInt("save_slot"));
+
do {
// Handle frame delay
uint32 currentTick = g_system->getMillis();
diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp
index a0a8cce970..879fad0210 100644
--- a/engines/cruise/detection.cpp
+++ b/engines/cruise/detection.cpp
@@ -209,7 +209,8 @@ bool CruiseMetaEngine::hasFeature(MetaEngineFeature f) const {
(f == kSupportsListSaves) ||
(f == kSupportsDeleteSave) ||
(f == kSavesSupportMetaInfo) ||
- (f == kSavesSupportThumbnail);
+ (f == kSavesSupportThumbnail) ||
+ (f == kSupportsLoadingDuringStartup);
}
SaveStateList CruiseMetaEngine::listSaves(const char *target) const {
--
cgit v1.2.3
From ad98719ba260caa602aa38522ce06f85bb621f1b Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 10 Jun 2009 12:47:19 +0000
Subject: Fix documentation for debugC and debugCN, relying on special debug
levels.
svn-id: r41425
---
common/debug.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/debug.h b/common/debug.h
index 888c71adbb..95779af617 100644
--- a/common/debug.h
+++ b/common/debug.h
@@ -137,7 +137,7 @@ void debugN(int level, const char *s, ...) GCC_PRINTF(2, 3);
/**
* Print a debug message to the text console (stdout), but only if
- * the specified level does not exceed the value of gDebugLevel OR
+ * the specified level does not exceed the value of gDebugLevel AND
* if the specified special debug level is active.
* As a rule of thumb, the more important the message, the lower the level.
* Automatically appends a newline.
@@ -148,7 +148,7 @@ void debugC(int level, uint32 debugChannels, const char *s, ...) GCC_PRINTF(3, 4
/**
* Print a debug message to the text console (stdout), but only if
- * the specified level does not exceed the value of gDebugLevel OR
+ * the specified level does not exceed the value of gDebugLevel AND
* if the specified special debug level is active.
* As a rule of thumb, the more important the message, the lower the level.
* Does not append a newline automatically.
--
cgit v1.2.3
From 3a32d7711b813e8de1d0a5a05fa48368a8a1206a Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 10 Jun 2009 15:01:20 +0000
Subject: Fix a bug in disableCursorPalette, where it never allowed the palette
to be enabled properly again.
svn-id: r41428
---
graphics/cursorman.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index fe5f653b94..462897ac57 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -139,7 +139,7 @@ void CursorManager::disableCursorPalette(bool disable) {
Palette *pal = _cursorPaletteStack.top();
pal->_disabled = disable;
- g_system->disableCursorPalette(true);
+ g_system->disableCursorPalette(disable);
}
void CursorManager::pushCursorPalette(const byte *colors, uint start, uint num) {
--
cgit v1.2.3
From b1b03a33ba1f338d2c8c26c55292c5e2e3b8cf90 Mon Sep 17 00:00:00 2001
From: Arnaud Boutonné
Date: Wed, 10 Jun 2009 15:04:21 +0000
Subject: Gob detection : - use GUIO_NOSPEECH and GUIO_NOSUBTITLES intensively,
as there is no control other them even when they are present - Replace
non-ASCII characters by hex values
svn-id: r41429
---
engines/gob/detection.cpp | 485 +++++++++++++++++++++++-----------------------
1 file changed, 243 insertions(+), 242 deletions(-)
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index 3bbd79c30e..a4f5d2d1be 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -84,6 +84,7 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = {
namespace Gob {
using Common::GUIO_NOSPEECH;
+using Common::GUIO_NOSUBTITLES;
using Common::GUIO_NONE;
static const GOBGameDescription gameDescriptions[] = {
@@ -95,7 +96,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesEGA,
@@ -109,7 +110,7 @@ static const GOBGameDescription gameDescriptions[] = {
RU_RUS,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesEGA,
@@ -123,7 +124,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesNone,
@@ -137,7 +138,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesAdlib,
@@ -151,7 +152,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesCD,
@@ -165,7 +166,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesCD,
@@ -179,7 +180,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesCD,
@@ -193,7 +194,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesCD,
@@ -207,7 +208,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesCD,
@@ -221,7 +222,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesCD,
@@ -235,7 +236,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesCD,
@@ -249,7 +250,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesCD,
@@ -263,7 +264,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesCD,
@@ -277,7 +278,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesCD,
@@ -291,7 +292,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformAmiga,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesNone,
@@ -305,7 +306,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesNone,
@@ -319,7 +320,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesNone,
@@ -333,7 +334,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesNone,
@@ -347,7 +348,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesNone,
@@ -361,7 +362,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesAdlib,
@@ -375,7 +376,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesAdlib,
@@ -389,7 +390,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesAdlib,
@@ -403,7 +404,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesAdlib,
@@ -417,7 +418,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesAdlib,
@@ -435,7 +436,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesAdlib,
@@ -453,7 +454,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesAdlib,
@@ -471,7 +472,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesAdlib,
@@ -489,7 +490,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesAdlib,
@@ -507,7 +508,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesAdlib,
@@ -525,7 +526,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesAdlib,
@@ -539,7 +540,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesNone,
@@ -553,7 +554,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesNone,
@@ -567,7 +568,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesNone,
@@ -581,7 +582,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformAtariST,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesNone,
@@ -599,7 +600,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -617,7 +618,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -631,7 +632,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -645,7 +646,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -659,7 +660,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -673,7 +674,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -687,7 +688,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -701,7 +702,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -715,7 +716,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -729,7 +730,7 @@ static const GOBGameDescription gameDescriptions[] = {
RU_RUS,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -743,7 +744,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -757,7 +758,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesCD,
@@ -771,7 +772,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesCD,
@@ -785,7 +786,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesCD,
@@ -799,7 +800,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesCD,
@@ -813,7 +814,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesCD,
@@ -827,7 +828,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesCD,
@@ -841,7 +842,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -855,7 +856,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -869,7 +870,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformAmiga,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesNone,
@@ -883,7 +884,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformAmiga,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesNone,
@@ -901,7 +902,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -919,7 +920,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -937,7 +938,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -955,7 +956,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -973,7 +974,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesNone,
@@ -987,7 +988,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesNone,
@@ -1001,7 +1002,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesNone,
@@ -1015,7 +1016,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesNone,
@@ -1033,7 +1034,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesNone,
@@ -1051,7 +1052,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformAtariST,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesNone,
@@ -1065,7 +1066,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformAtariST,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesNone,
@@ -1079,7 +1080,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesAdlib,
@@ -1093,7 +1094,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesAdlib,
@@ -1107,7 +1108,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesAdlib,
@@ -1121,7 +1122,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesAdlib,
@@ -1135,7 +1136,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesAdlib,
@@ -1149,7 +1150,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesAdlib,
@@ -1163,7 +1164,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesAdlib,
@@ -1177,7 +1178,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWeen,
kFeaturesAdlib,
@@ -1191,7 +1192,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeBargon,
kFeaturesNone,
@@ -1205,7 +1206,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformAtariST,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeBargon,
kFeaturesNone,
@@ -1219,7 +1220,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeBargon,
kFeaturesNone,
@@ -1233,7 +1234,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeBargon,
kFeaturesNone,
@@ -1247,7 +1248,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeBargon,
kFeaturesNone,
@@ -1261,7 +1262,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeBargon,
kFeaturesNone,
@@ -1275,7 +1276,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeBargon,
kFeaturesNone,
@@ -1289,7 +1290,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib | kFeaturesEGA,
@@ -1303,7 +1304,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib | kFeaturesEGA,
@@ -1317,7 +1318,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib | kFeaturesEGA,
@@ -1331,7 +1332,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib | kFeaturesEGA,
@@ -1345,7 +1346,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib | kFeaturesEGA,
@@ -1363,7 +1364,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesNone,
@@ -1377,7 +1378,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -1391,7 +1392,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesAdlib,
@@ -1405,7 +1406,7 @@ static const GOBGameDescription gameDescriptions[] = {
HB_ISR,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesAdlib,
@@ -1419,7 +1420,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesAdlib,
@@ -1433,7 +1434,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesAdlib,
@@ -1447,7 +1448,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesAdlib,
@@ -1465,7 +1466,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesAdlib,
@@ -1479,7 +1480,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesCD,
@@ -1493,7 +1494,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesCD,
@@ -1507,7 +1508,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesCD,
@@ -1521,7 +1522,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesCD,
@@ -1535,7 +1536,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesCD,
@@ -1549,7 +1550,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesCD,
@@ -1563,7 +1564,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesCD,
@@ -1577,7 +1578,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesCD,
@@ -1591,7 +1592,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesCD,
@@ -1605,7 +1606,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesCD,
@@ -1619,7 +1620,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesCD,
@@ -1633,7 +1634,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesCD,
@@ -1647,7 +1648,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesAdlib,
@@ -1661,7 +1662,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesAdlib,
@@ -1675,7 +1676,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesAdlib,
@@ -1689,7 +1690,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES
},
kGameTypeFascination,
kFeaturesCD,
@@ -1703,7 +1704,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeFascination,
kFeaturesAdlib,
@@ -1717,7 +1718,7 @@ static const GOBGameDescription gameDescriptions[] = {
HB_ISR,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeFascination,
kFeaturesAdlib,
@@ -1732,7 +1733,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeFascination,
kFeaturesAdlib,
@@ -1746,7 +1747,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeFascination,
kFeaturesAdlib,
@@ -1760,7 +1761,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeFascination,
kFeaturesNone,
@@ -1774,7 +1775,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeFascination,
kFeaturesNone,
@@ -1788,7 +1789,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeFascination,
kFeaturesNone,
@@ -1802,7 +1803,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeFascination,
kFeaturesNone,
@@ -1816,7 +1817,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGeisha,
kFeaturesNone,
@@ -1830,7 +1831,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGeisha,
kFeaturesNone,
@@ -1844,7 +1845,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesAdlib,
@@ -1858,7 +1859,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesAdlib,
@@ -1872,7 +1873,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -1886,7 +1887,7 @@ static const GOBGameDescription gameDescriptions[] = {
HB_ISR,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -1900,7 +1901,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -1918,7 +1919,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -1936,7 +1937,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -1954,7 +1955,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -1972,7 +1973,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -1986,7 +1987,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -2000,7 +2001,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -2014,7 +2015,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -2028,7 +2029,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -2042,7 +2043,7 @@ static const GOBGameDescription gameDescriptions[] = {
RU_RUS,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -2056,7 +2057,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -2070,7 +2071,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -2084,7 +2085,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesNone,
@@ -2098,7 +2099,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesNone,
@@ -2112,7 +2113,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesCD,
@@ -2126,7 +2127,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesCD,
@@ -2140,7 +2141,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesCD,
@@ -2154,7 +2155,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesCD,
@@ -2168,7 +2169,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesCD,
@@ -2182,7 +2183,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesCD,
@@ -2196,7 +2197,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -2210,7 +2211,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -2224,7 +2225,7 @@ static const GOBGameDescription gameDescriptions[] = {
UNK_LANG,
kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -2238,7 +2239,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -2256,7 +2257,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -2270,7 +2271,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesCD,
@@ -2284,7 +2285,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesCD,
@@ -2298,7 +2299,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesCD,
@@ -2312,7 +2313,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesCD,
@@ -2326,7 +2327,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesCD,
@@ -2340,7 +2341,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesAdlib,
@@ -2354,7 +2355,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesAdlib,
@@ -2368,7 +2369,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesAdlib,
@@ -2382,7 +2383,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesAdlib,
@@ -2396,7 +2397,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesAdlib,
@@ -2410,7 +2411,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesAdlib,
@@ -2424,7 +2425,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesAdlib,
@@ -2438,7 +2439,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesAdlib,
@@ -2465,7 +2466,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeInca2,
kFeaturesAdlib | kFeaturesBATDemo,
@@ -2479,7 +2480,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2493,7 +2494,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2507,7 +2508,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2521,7 +2522,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2535,7 +2536,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2549,7 +2550,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2563,7 +2564,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2577,7 +2578,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2591,7 +2592,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2605,7 +2606,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2619,7 +2620,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2633,7 +2634,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2647,7 +2648,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2661,7 +2662,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2675,7 +2676,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2689,7 +2690,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2703,7 +2704,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2717,7 +2718,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2731,7 +2732,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2745,7 +2746,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2759,7 +2760,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2773,7 +2774,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2787,7 +2788,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2801,7 +2802,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2815,7 +2816,7 @@ static const GOBGameDescription gameDescriptions[] = {
PL_POL,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2833,7 +2834,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640 | kFeaturesSCNDemo,
@@ -2847,7 +2848,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeDynasty,
kFeatures640,
@@ -2861,7 +2862,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeDynasty,
kFeatures640,
@@ -2875,7 +2876,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeDynasty,
kFeatures640,
@@ -2889,7 +2890,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeDynasty,
kFeatures640,
@@ -2945,7 +2946,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_USA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeUrban,
kFeatures640,
@@ -2959,7 +2960,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeUrban,
kFeatures640,
@@ -2973,7 +2974,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeUrban,
kFeatures640,
@@ -2987,7 +2988,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeUrban,
kFeatures640,
@@ -3024,7 +3025,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3033,7 +3034,7 @@ static const GOBGameDescription gameDescriptions[] = {
{
{
"archi",
- "Pack mes histoires animées",
+ "Pack mes histoires anim\xE9""es",
{
{"playtoon.stk", 0, "55f0293202963854192e39474e214f5f", 30448474},
{"archi.stk", 0, "8d44b2a0d4e3139471213f9f0ed21e81", 5524674},
@@ -3042,7 +3043,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3060,7 +3061,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3083,7 +3084,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640 | kFeaturesSCNDemo,
@@ -3101,7 +3102,7 @@ static const GOBGameDescription gameDescriptions[] = {
EN_ANY,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640 | kFeaturesSCNDemo,
@@ -3123,7 +3124,7 @@ static const GOBGameDescription gameDescriptions[] = {
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640 | kFeaturesSCNDemo,
@@ -3144,7 +3145,7 @@ static const GOBGameDescription gameDescriptions[] = {
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640 | kFeaturesSCNDemo,
@@ -3162,7 +3163,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3180,7 +3181,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3198,7 +3199,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3207,7 +3208,7 @@ static const GOBGameDescription gameDescriptions[] = {
{
{
"chato",
- "Pack mes histoires animées",
+ "Pack mes histoires anim\xE9""es",
{
{"playtoon.stk", 0, "55f0293202963854192e39474e214f5f", 30448474},
{"chato.stk", 0, "4fa4ed96a427c344e9f916f9f236598d", 6033793},
@@ -3216,7 +3217,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3234,7 +3235,7 @@ static const GOBGameDescription gameDescriptions[] = {
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3252,7 +3253,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3270,11 +3271,11 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeBambou,
kFeatures640,
- 0, 0, 0
+ "intro.stk", "intro.tot", 0
},
{
{
@@ -3287,7 +3288,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytnCk,
kFeatures640,
@@ -3301,7 +3302,7 @@ static const GOBGameDescription gameDescriptions[] = {
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NONE
},
kGameTypeAdibou4,
kFeatures640,
@@ -3435,7 +3436,7 @@ static const GOBGameDescription gameDescriptions[] = {
{
{
"adibouunknown",
- "ADIBÙ 2 Ambiente",
+ "ADIB\xD9 2 Ambiente",
AD_ENTRY1s("intro.stk", "092707829555f27706920e4cacf1fada", 8737958),
IT_ITA,
kPlatformPC,
@@ -3449,7 +3450,7 @@ static const GOBGameDescription gameDescriptions[] = {
{
{
"adibouunknown",
- "ADIBÙ prima elementare : Imparo a leggere e a contare",
+ "ADIB\xD9 prima elementare : Imparo a leggere e a contare",
{
{"intro.stk", 0, "092707829555f27706920e4cacf1fada", 8737958},
{"appbou2.itk", 0, "f7bf045f6bdce5a7607c720e36704f33", 200005632},
@@ -3467,7 +3468,7 @@ static const GOBGameDescription gameDescriptions[] = {
{
{
"adibouunknown",
- "ADIBOU présente La Magie (STK2.1/OBC)",
+ "ADIBOU pr\xE9sente La Magie (STK2.1/OBC)",
{
{"adibou.stk", 0, "977d2449d398f3df23238d718fca35b5", 61097},
{"magic.stk", 0, "9776765dead3e338a32c43bf344b5819", 302664},
@@ -3548,7 +3549,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesNone,
@@ -3562,7 +3563,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob1,
kFeaturesCD,
@@ -3576,7 +3577,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -3590,7 +3591,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesAdlib,
@@ -3604,7 +3605,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob2,
kFeaturesCD,
@@ -3618,7 +3619,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeBargon,
kFeaturesNone,
@@ -3632,7 +3633,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesAdlib,
@@ -3646,7 +3647,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGob3,
kFeaturesCD,
@@ -3660,7 +3661,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -3674,7 +3675,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesAdlib,
@@ -3688,7 +3689,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesAdlib,
@@ -3702,7 +3703,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeLostInTime,
kFeaturesCD,
@@ -3716,7 +3717,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeUrban,
kFeaturesCD,
@@ -3730,7 +3731,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3744,7 +3745,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3758,7 +3759,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3772,7 +3773,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3786,7 +3787,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytoon,
kFeatures640,
@@ -3800,7 +3801,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypePlaytnCk,
kFeatures640,
@@ -3814,7 +3815,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeBambou,
kFeatures640,
@@ -3828,7 +3829,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeFascination,
kFeaturesNone,
@@ -3842,7 +3843,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeGeisha,
kFeaturesNone,
@@ -3856,7 +3857,7 @@ static const GOBGameDescription fallbackDescs[] = {
UNK_LANG,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSUBTITLES || GUIO_NOSPEECH
},
kGameTypeAdibou4,
kFeatures640,
--
cgit v1.2.3
From be42f800a448798819b5ccedbb0a2aca3133730f Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 10 Jun 2009 15:11:17 +0000
Subject: Extend documentation for "kFeatureCursorHasPalette".
svn-id: r41430
---
common/system.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/common/system.h b/common/system.h
index 5b72dab7c1..9cfb7dd511 100644
--- a/common/system.h
+++ b/common/system.h
@@ -148,6 +148,10 @@ public:
* It is currently used only by some Macintosh versions of Humongous
* Entertainment games. If the backend doesn't implement this feature then
* the engine switches to b/w versions of cursors.
+ * The GUI also relies on this feature for mouse cursors.
+ *
+ * To enable the cursor palette call "disableCursorPalette" with false.
+ * @see disableCursorPalette
*/
kFeatureCursorHasPalette,
--
cgit v1.2.3
From c0ba9d11589edd9183e068ae94ad016a365c4f34 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 10 Jun 2009 15:20:52 +0000
Subject: Add a convenience wrapper to CursorMan for checking whether cursor
palettes are supported.
svn-id: r41432
---
graphics/cursorman.cpp | 4 ++++
graphics/cursorman.h | 11 +++++++++++
2 files changed, 15 insertions(+)
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 462897ac57..2e71b548bc 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -129,6 +129,10 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale);
}
+bool CursorManager::supportsCursorPalettes() {
+ return g_system->hasFeature(OSystem::kFeatureCursorHasPalette);
+}
+
void CursorManager::disableCursorPalette(bool disable) {
if (!g_system->hasFeature(OSystem::kFeatureCursorHasPalette))
return;
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index bc38466eda..4cbd5bea12 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -87,6 +87,17 @@ public:
*/
void popAllCursors();
+ /**
+ * Test whether cursor palettes are supported.
+ *
+ * This is just an convenience wrapper for checking for
+ * OSystem::kFeatureCursorHasPalette to be supported by OSystem.
+ *
+ * @see OSystem::kFeatureCursorHasPalette
+ * @see OSystem::hasFeature
+ */
+ bool supportsCursorPalettes();
+
/**
* Enable/Disable the current cursor palette.
*
--
cgit v1.2.3
From ccbc5f3abbc85d5c5d165fefc60af2eeb9056bee Mon Sep 17 00:00:00 2001
From: Jordi Vilalta Prat
Date: Wed, 10 Jun 2009 15:33:37 +0000
Subject: Point to the Cursor and AudioCD Managers to help engine authors
following the right path.
svn-id: r41433
---
common/system.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/common/system.h b/common/system.h
index 9cfb7dd511..bfec20e319 100644
--- a/common/system.h
+++ b/common/system.h
@@ -666,7 +666,11 @@ public:
- /** @name Mouse */
+ /** @name Mouse
+ * This is the lower level implementation as provided by the
+ * backends. The engines should use the Graphics::CursorManager
+ * class instead of using it directly.
+ */
//@{
/** Show or hide the mouse cursor. */
@@ -834,6 +838,9 @@ public:
* @name Audio CD
* The methods in this group deal with Audio CD playback.
* The default implementation simply does nothing.
+ * This is the lower level implementation as provided by the
+ * backends. The engines should use the Audio::AudioCDManager
+ * class instead of using it directly.
*/
//@{
--
cgit v1.2.3
From 2ffe5ed25edfaed7bd53a6618286b003c78cde85 Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Thu, 11 Jun 2009 15:45:52 +0000
Subject: Added set of CoCo3 AGI games
svn-id: r41452
---
engines/agi/detection.cpp | 94 +++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 87 insertions(+), 7 deletions(-)
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 302951b69b..910f6e0e55 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -168,6 +168,9 @@ using Common::GUIO_NONE;
#define FANMADE_ILVF(id,name,md5,lang,ver,features) GAME_LVFPN(id,name,"logdir",md5,-1,lang,ver,(GF_FANMADE|features),GID_FANMADE,Common::kPlatformPC,GType_V2)
+#define FANMADE_ISVP(id,name,md5,size,ver,platform) GAME_LVFPN(id,name,"logdir",md5,size,Common::EN_ANY,ver,GF_FANMADE,GID_FANMADE,platform,GType_V2)
+#define FANMADE_SVP(name,md5,size,ver,platform) FANMADE_ISVP("agi-fanmade",name,md5,size,ver,platform)
+
#define FANMADE_LVF(name,md5,lang,ver,features) FANMADE_ILVF("agi-fanmade",name,md5,lang,ver,features)
#define FANMADE_LF(name,md5,lang,features) FANMADE_LVF(name,md5,lang,0x2917,features)
@@ -222,6 +225,12 @@ static const AGIGameDescription gameDescriptions[] = {
// Black Cauldron (PC) 2.10 [AGI 3.002.097]
GAME3("bc", "2.10", "bcdir", "0de3953c9225009dc91e5b0d1692967b", 0x3149, GID_BC),
+ // Black Cauldron (CoCo3 360k) [AGI 2.023]
+ GAME_PS("bc", "", "51212c54808ade96176f201ae0ac7a6f", 357, 0x2440, GID_BC, Common::kPlatformCoCo3),
+
+ // Black Cauldron (CoCo3 360k) [AGI 2.072]
+ GAME_PS("bc", "updated", "c4e1937f74e8100cd0152b904434d8b4", 357, 0x2440, GID_BC, Common::kPlatformCoCo3),
+
// TODO
// These aren't supposed to work now as they require unsupported agi engine 2.01
#if 0
@@ -279,6 +288,12 @@ static const AGIGameDescription gameDescriptions[] = {
},
+ // Gold Rush! (CoCo3 720k) [AGI 2.023]
+ GAME_PS("goldrush", "", "0a41b65efc0cd6c4271e957e6ffbbd8e", 744, 0x2440, GID_GOLDRUSH, Common::kPlatformCoCo3),
+
+ // Gold Rush! (CoCo3 360k/720k) [AGI 2.072]
+ GAME_PS("goldrush", "updated", "c49bf56bf91e31a4601a604e51ef8bfb", 744, 0x2440, GID_GOLDRUSH, Common::kPlatformCoCo3),
+
// King's Quest 1 (Amiga) 1.0U # 2.082
// The original game did not have menus, they are enabled under ScummVM
GAME_FP("kq1", "1.0U 1986", "246c695324f1c514aee2b904fa352fad", 0x2440, GF_MENUS, GID_KQ1, Common::kPlatformAmiga),
@@ -297,6 +312,15 @@ static const AGIGameDescription gameDescriptions[] = {
// King's Quest 1 (PC 5.25"/3.5") 2.0F [AGI 2.917]
GAME("kq1", "2.0F 1987-05-05 5.25\"/3.5\"", "10ad66e2ecbd66951534a50aedcd0128", 0x2917, GID_KQ1),
+ // King's Quest 1 (CoCo3 360k) [AGI 2.023]
+ GAME_PS("kq1", "", "10ad66e2ecbd66951534a50aedcd0128", 315, 0x2440, GID_KQ1, Common::kPlatformCoCo3),
+
+ // King's Quest 1 (CoCo3 360k) [AGI 2.023]
+ GAME_PS("kq1", "fixed", "4c8ef8b5d2f1b6c1a93e456d1f1ffc74", 768, 0x2440, GID_KQ1, Common::kPlatformCoCo3),
+
+ // King's Quest 1 (CoCo3 360k) [AGI 2.072]
+ GAME_PS("kq1", "updated", "94087178c78933a4af3cd24d1c8dd7b2", 315, 0x2440, GID_KQ1, Common::kPlatformCoCo3),
+
// King's Quest 2 (IIgs) 2.0A 6/16/88 (CE)
GAME_P("kq2", "2.0A 1988-06-16 (CE)", "5203c8b95250a2ecfee93ddb99414753", 0x2917, GID_KQ2, Common::kPlatformApple2GS),
@@ -316,6 +340,15 @@ static const AGIGameDescription gameDescriptions[] = {
// King's Quest 2 (Russian)
GAME_LPS("kq2", "", "35211c574ececebdc723b23e35f99275", 543, Common::RU_RUS, 0x2917, GID_KQ2, Common::kPlatformPC),
+ // King's Quest 2 (CoCo3 360k) [AGI 2.023]
+ GAME_PS("kq2", "", "b944c4ff18fb8867362dc21cc688a283", 543, 0x2440, GID_KQ2, Common::kPlatformCoCo3),
+
+ // King's Quest 2 (CoCo3 360k) [AGI 2.072]
+ GAME_PS("kq2", "updated", "f64a606de740a5348f3d125c03e989fe", 543, 0x2440, GID_KQ2, Common::kPlatformCoCo3),
+
+ // King's Quest 2 (CoCo3 360k) [AGI 2.023]
+ GAME_PS("kq2", "fixed", "fb33ac2768a94a89117a270771db465c", 768, 0x2440, GID_KQ2, Common::kPlatformCoCo3),
+
// King's Quest 3 (Amiga) 1.01 11/8/86
// The original game did not have menus, they are enabled under ScummVM
GAME_FP("kq3", "1.01 1986-11-08", "8ab343306df0e2d98f136be4e8cfd0ef", 0x2440, GF_MENUS, GID_KQ3, Common::kPlatformAmiga),
@@ -350,6 +383,9 @@ static const AGIGameDescription gameDescriptions[] = {
// King's Quest 3 (PC 3.5") 2.14 3/15/88 [AGI 2.936]
GAME("kq3", "2.14 1988-03-15 3.5\"", "d3d17b77b3b3cd13246749231d9473cd", 0x2936, GID_KQ3),
+ // King's Quest 3 (CoCo3 158k/360k) [AGI 2.023]
+ GAME_PS("kq3", "", "5a6be7d16b1c742c369ef5cc64fefdd2", 429, 0x2440, GID_KQ3, Common::kPlatformCoCo3),
+
// King's Quest 4 (PC 5.25") 2.3 9/27/88 [AGI 3.002.086]
GAME3("kq4", "2.3 1988-09-27", "kq4dir", "6d7714b8b61466a5f5981242b993498f", 0x3086, GID_KQ4),
@@ -371,6 +407,12 @@ static const AGIGameDescription gameDescriptions[] = {
// Menus not tested
GAME3("kq4", "Demo 1988-12-20", "dmdir", "a3332d70170a878469d870b14863d0bf", 0x3149, GID_KQ4),
+ // King's Quest 4 (CoCo3 720k) [AGI 2.023]
+ GAME_PS("kq4", "", "9e7729a28e749ca241d2bf71b9b2dbde", 741, 0x2440, GID_KQ4, Common::kPlatformCoCo3),
+
+ // King's Quest 4 (CoCo3 360k/720k) [AGI 2.072]
+ GAME_PS("kq4", "updated", "1959ca10739edb34069bb504dbd74805", 741, 0x2440, GID_KQ4, Common::kPlatformCoCo3),
+
// Leisure Suit Larry 1 (PC 5.25"/3.5") 1.00 6/1/87 [AGI 2.440]
GAME("lsl1", "1.00 1987-06-01 5.25\"/3.5\"", "1fe764e66857e7f305a5f03ca3f4971d", 0x2440, GID_LSL1),
@@ -392,6 +434,9 @@ static const AGIGameDescription gameDescriptions[] = {
// Leisure Suit Larry 1 (Mac) 1.05 6/26/87
GAME_P("lsl1", "1.05 1987-06-26", "8a0076429890531832f0dc113285e31e", 0x2440, GID_LSL1, Common::kPlatformMacintosh),
+ // Leisure Suit Larry 1 (CoCo3 158k/360k) [AGI 2.072]
+ GAME_PS("lsl1", "", "a2de1fe76565c3e8b40c9d036b5e5612", 198, 0x2440, GID_LSL1, Common::kPlatformCoCo3),
+
// Manhunter NY (ST) 1.03 10/20/88
GAME3_P("mh1", "1.03 1988-10-20", "mhdir", "f2d58056ad802452d60776ee920a52a6", 0x3149, 0, GID_MH1, Common::kPlatformAtariST),
@@ -408,6 +453,12 @@ static const AGIGameDescription gameDescriptions[] = {
// Manhunter NY (PC 3.5") 1.22 8/31/88 [AGI 3.002.102]
GAME3_PS("mh1", "1.22 1988-08-31", "mhdir", "5b625329021ad49fd0c1d6f2d6f54bba", 2141, 0x3149, 0, GID_MH1, Common::kPlatformPC),
+ // Manhunter NY (CoCo3 720k) [AGI 2.023]
+ GAME_PS("mh1", "", "b968285caf2f591c78dd9c9e26ab8974", 495, 0x2440, GID_MH1, Common::kPlatformCoCo3),
+
+ // Manhunter NY (CoCo3 360k/720k) [AGI 2.072]
+ GAME_PS("mh1", "updated", "d47da950c62289f8d4ccf36af73365f2", 495, 0x2440, GID_MH1, Common::kPlatformCoCo3),
+
// Manhunter SF (ST) 1.0 7/29/89
GAME3_P("mh2", "1.0 1989-07-29", "mh2dir", "5e3581495708b952fea24438a6c7e040", 0x3149, 0, GID_MH1, Common::kPlatformAtariST),
@@ -420,6 +471,12 @@ static const AGIGameDescription gameDescriptions[] = {
// Manhunter SF (PC 3.5") 3.02 7/26/89 [AGI 3.002.149]
GAME3("mh2", "3.02 1989-07-26 3.5\"", "mh2dir", "6fb6f0ee2437704c409cf17e081ba152", 0x3149, GID_MH2),
+ // Manhunter SF (CoCo3 720k) [AGI 2.023]
+ GAME_PS("mh2", "", "acaaa577e10d1753c5a74f6ae1d858d4", 591, 0x2440, GID_MH2, Common::kPlatformCoCo3),
+
+ // Manhunter SF (CoCo3 720k) [AGI 2.072]
+ GAME_PS("mh2", "updated", "c64875766700196e72a92359f70f45a9", 591, 0x2440, GID_MH2, Common::kPlatformCoCo3),
+
// Mickey's Space Adventure
// Preagi game
GAMEpre_P("mickey", "", "1.pic", "b6ec04c91a05df374792872c4d4ce66d", 0x0000, GID_MICKEY, Common::kPlatformPC),
@@ -437,11 +494,8 @@ static const AGIGameDescription gameDescriptions[] = {
// Mixed-Up Mother Goose (PC) [AGI 2.915]
GAME("mixedup", "1987-11-10", "e524655abf9b96a3b179ffcd1d0f79af", 0x2917, GID_MIXEDUP),
-#if 0
- // Mixed Up Mother Goose (PC) [AGI 2.915] (Broken)
- // Menus not tested
- GAME("mixedup", "[corrupt/OBJECT from disk 1]", "e524655abf9b96a3b179ffcd1d0f79af", 0x2917, GID_MIXEDUP),
-#endif
+ // Mixed-Up Mother Goose (CoCo3 360k) [AGI 2.072]
+ GAME_PS("mixedup", "", "44e63e9b4d4822a31edea0e8a7e7eac4", 606, 0x2440, GID_MIXEDUP, Common::kPlatformCoCo3),
// Police Quest 1 (PC) 2.0E 11/17/87 [AGI 2.915]
GAME("pq1", "2.0E 1987-11-17", "2fd992a92df6ab0461d5a2cd83c72139", 0x2917, GID_PQ1),
@@ -471,6 +525,12 @@ static const AGIGameDescription gameDescriptions[] = {
// not sure about disk format -- dsymonds
GAME("pq1", "2.0G 1987-12-03", "d194e5d88363095f55d5096b8e32fbbb", 0x2917, GID_PQ1),
+ // Police Quest 1 (CoCo3 360k) [AGI 2.023]
+ GAME_PS("pq1", "", "28a077041f75aab78f66804800940085", 375, 0x2440, GID_PQ1, Common::kPlatformCoCo3),
+
+ // Police Quest 1 (CoCo3 360k) [AGI 2.072]
+ GAME_PS("pq1", "updated", "63b9a9c6eec154751dd446cd3693e0e2", 768, 0x2440, GID_PQ1, Common::kPlatformCoCo3),
+
// Space Quest 1 (ST) 1.1A
// The original game did not have menus, they are enabled under ScummVM
GAME_FP("sq1", "1.1A 1986-02-06", "6421fb64b0e6604c9dd065975d9279e9", 0x2440, GF_MENUS, GID_SQ1, Common::kPlatformAtariST),
@@ -499,8 +559,14 @@ static const AGIGameDescription gameDescriptions[] = {
// Space Quest 1 (PC 5.25"/3.5") 2.2 [AGI 2.426/2.917]
GAME("sq1", "2.2 1987-05-07 5.25\"/3.5\"", "5d67630aba008ec5f7f9a6d0a00582f4", 0x2440, GID_SQ1),
- // Space Quest 1 (CoCo3)
- GAME_P("sq1", "", "5d67630aba008ec5f7f9a6d0a00582f4", 0x2440, GID_SQ1, Common::kPlatformCoCo3),
+ // Space Quest 1 (CoCo3 360k) [AGI 2.072]
+ GAME_PS("sq1", "", "5d67630aba008ec5f7f9a6d0a00582f4", 372, 0x2440, GID_SQ1, Common::kPlatformCoCo3),
+
+ // Space Quest 1 (CoCo3 360k) [AGI 2.023]
+ GAME_PS("sq1", "fixed", "ca822b768b6462e410423ea7f498daee", 768, 0x2440, GID_SQ1, Common::kPlatformCoCo3),
+
+ // Space Quest 1 (CoCo3 360k) [AGI 2.072]
+ GAME_PS("sq1", "updated", "7fa54e6bb7ffeb4cf20eca39d86f5fb2", 387, 0x2440, GID_SQ1, Common::kPlatformCoCo3),
// Space Quest 2 (PC 3.5") 2.0D [AGI 2.936]
GAME("sq2", "2.0D 1988-03-14 3.5\"", "85390bde8958c39830e1adbe9fff87f3", 0x2936, GID_SQ2),
@@ -550,6 +616,12 @@ static const AGIGameDescription gameDescriptions[] = {
// Space Quest 2 (PC 3.5") 2.0F [AGI 2.936]
GAME("sq2", "2.0F 1989-01-05 3.5\"", "28add5125484302d213911df60d2aded", 0x2936, GID_SQ2),
+ // Space Quest 2 (CoCo3 360k) [AGI 2.023]
+ GAME_PS("sq2", "", "12973d39b892dc9d280257fd271e9597", 768, 0x2440, GID_SQ2, Common::kPlatformCoCo3),
+
+ // Space Quest 2 (CoCo3 360k) [AGI 2.072]
+ GAME_PS("sq2", "updated", "d24f19b047e65e1763eff4b46f3d50df", 768, 0x2440, GID_SQ2, Common::kPlatformCoCo3),
+
// Troll's Tale
GAMEpre_PS("troll", "", "troll.img", "62903f264b3d849be4214b3a5c42a2fa", 184320, 0x0000, GID_TROLL, Common::kPlatformPC),
@@ -568,6 +640,9 @@ static const AGIGameDescription gameDescriptions[] = {
// Xmas Card 1986 (PC) [AGI 2.272]
GAME("xmascard", "1986-11-13 [version 1]", "3067b8d5957e2861e069c3c0011bd43d", 0x2272, GID_XMASCARD),
+ // Xmas Card 1986 (CoCo3 360k) [AGI 2.072]
+ GAME_PS("xmascard", "", "25ad35e9628fc77e5e0dd35852a272b6", 768, 0x2440, GID_XMASCARD, Common::kPlatformCoCo3),
+
FANMADE_F("2 Player Demo", "4279f46b3cebd855132496476b1d2cca", GF_AGIMOUSE),
FANMADE("AGI Contest 1 Template", "d879aed25da6fc655564b29567358ae2"),
FANMADE("AGI Contest 2 Template", "5a2fb2894207eff36c72f5c1b08bcc07"),
@@ -630,6 +705,7 @@ static const AGIGameDescription gameDescriptions[] = {
FANMADE("Elfintard", "c3b847e9e9e978af9708df76a0751dc2"),
FANMADE("Enclosure (v1.01)", "f08e66fee9ecdde77db7ee9a10c96ba2"),
FANMADE("Enclosure (v1.03)", "e4a0613ed02401502e506ba3565a8c40"),
+ FANMADE_SVP("Enclosure", "fe98e6126db74c6cc6fd8fe395cc6e8c", 345, 0x2440, Common::kPlatformCoCo3),
FANMADE("Epic Fighting (v0.1)", "aff24a1b3bdd676187685c4d95ba4294"),
FANMADE("Escape Quest (v0.0.3)", "2346b65619b1da0298b715b06d1a45a1"),
FANMADE("Escape from the Desert (beta 1)", "dfdc634d340854bd6ece28024010758d"),
@@ -777,8 +853,10 @@ static const AGIGameDescription gameDescriptions[] = {
FANMADE("Sorceror's Appraisal", "fe62615557b3cb7b08dd60c9d35efef1"),
FANMADE_I("sq0", "v1.03", "d2fd6f7404e86182458494e64375e590"),
FANMADE_I("sq0", "v1.04", "2ad9d1a4624a98571ee77dcc83f231b6"),
+ FANMADE_ISVP("sq0", "", "e1a8e4efcce86e1efcaa14633b9eb986", 762, 0x2440, Common::kPlatformCoCo3),
FANMADE_I("sqx", "v10.0 Feb 05", "c992ae2f8ab18360404efdf16fa9edd1"),
FANMADE_I("sqx", "v10.0 Jul 18", "812edec45cefad559d190ffde2f9c910"),
+ FANMADE_ISVP("sqx", "", "f0a59044475a5fa37c055d8c3eb4d1a7", 768, 0x2440, Common::kPlatformCoCo3),
FANMADE_F("Space Quest 3.5", "c077bc28d7b36213dd99dc9ecb0147fc", GF_AGIMOUSE|GF_AGIPAL),
FANMADE_F("Space Trek (v1.0)", "807a1aeadb2ace6968831d36ab5ea37a", GF_CLIPCOORDS),
FANMADE("Special Delivery", "88764dfe61126b8e73612c851b510a33"),
@@ -805,6 +883,7 @@ static const AGIGameDescription gameDescriptions[] = {
FANMADE("The Shadow Plan", "c02cd10267e721f4e836b1431f504a0a"),
FANMADE("Time Quest (Demo v0.1)", "12e1a6f03ea4b8c5531acd0400b4ed8d"),
FANMADE("Time Quest (Demo v0.2)", "7b710608abc99e0861ac59b967bf3f6d"),
+ FANMADE_SVP("Time Quest", "90314f473d8317be5cd1f0306f139aea", 300, 0x2440, Common::kPlatformCoCo3),
FANMADE("Tonight The Shrieking Corpses Bleed (Demo v0.11)", "bcc57a7c8d563fa0c333107ae1c0a6e6"),
FANMADE("Tonight The Shrieking Corpses Bleed (v1.01)", "36b38f621b38e8d104aa0807302dc8c9"),
FANMADE("Turks' Quest - Heir to the Planet", "3d19254b737c8b218e5bc4580542b79a"),
@@ -826,6 +905,7 @@ static const AGIGameDescription gameDescriptions[] = {
GF_FANMADE,
0x3149,
},
+ FANMADE_SVP("V - The Graphical Adventure", "1646eaade74f137a9041eb427a389969", 768, 0x2440, Common::kPlatformCoCo3),
FANMADE("Voodoo Girl - Queen of the Darned (v1.2 2002 Jan 1)", "ae95f0c77d9a97b61420fd192348b937"),
FANMADE("Voodoo Girl - Queen of the Darned (v1.2 2002 Mar 29)", "11d0417b7b886f963d0b36789dac4c8f"),
--
cgit v1.2.3
From f5b2e69522153c47438895ea80129ad5e3c9b952 Mon Sep 17 00:00:00 2001
From: Kari Salminen
Date: Thu, 11 Jun 2009 18:32:35 +0000
Subject: Fix Operation Stealth's 2nd arcade sequence's revolving doors. - Now
the doors actually do revolve when before they didn't. - The fix was to alias
the 9th background with the collision page directly when loading collision
page data. This way changes written to the 9th background go to the
collision page and vice versa (And there were changes in the labyrinth). -
Also converted _bgTable from a pure array to a Common::Array
svn-id: r41453
---
engines/cine/bg.cpp | 1 -
engines/cine/gfx.cpp | 37 +++++++++++++++----------------------
engines/cine/gfx.h | 26 +++++++++++++++++++++++---
3 files changed, 38 insertions(+), 26 deletions(-)
diff --git a/engines/cine/bg.cpp b/engines/cine/bg.cpp
index cc7e843c2b..08722c42e5 100644
--- a/engines/cine/bg.cpp
+++ b/engines/cine/bg.cpp
@@ -82,7 +82,6 @@ byte loadCtOS(const char *ctName) {
ptr += 2;
if (bpp == 8) {
- memcpy(collisionPage, ptr + 256 * 3, 320 * 200);
renderer->loadCt256(ptr, ctName);
} else {
gfxConvertSpriteToRaw(collisionPage, ptr + 32, 160, 200);
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 87e0e0aa5b..ddc2d48152 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -874,35 +874,25 @@ void FWRenderer::fadeToBlack() {
/*! \brief Initialize Operation Stealth renderer
*/
-OSRenderer::OSRenderer() : FWRenderer(), _currentBg(0), _scrollBg(0),
+OSRenderer::OSRenderer() : FWRenderer(), _bgTable(), _currentBg(0), _scrollBg(0),
_bgShift(0) {
- int i;
- for (i = 0; i < 9; i++) {
- _bgTable[i].bg = NULL;
- _bgTable[i].pal.clear();
- memset(_bgTable[i].name, 0, sizeof (_bgTable[i].name));
- }
+ _bgTable.resize(9); // Resize the background table to its required size
}
/*! \brief Destroy Operation Stealth renderer
*/
OSRenderer::~OSRenderer() {
- for (int i = 0; i < 9; i++) {
- delete[] _bgTable[i].bg;
- _bgTable[i].pal.clear();
+ for (uint i = 0; i < _bgTable.size(); i++) {
+ _bgTable[i].clear();
}
}
/*! \brief Reset Operation Stealth renderer state
*/
void OSRenderer::clear() {
- for (int i = 0; i < 9; i++) {
- delete[] _bgTable[i].bg;
-
- _bgTable[i].bg = NULL;
- _bgTable[i].pal.clear();
- memset(_bgTable[i].name, 0, sizeof (_bgTable[i].name));
+ for (uint i = 0; i < _bgTable.size(); i++) {
+ _bgTable[i].clear();
}
_currentBg = 0;
@@ -1172,7 +1162,10 @@ void OSRenderer::loadBg16(const byte *bg, const char *name, unsigned int idx) {
* \param name Background filename
*/
void OSRenderer::loadCt16(const byte *ct, const char *name) {
- loadBg16(ct, name, 8);
+ // Make the 9th background point directly to the collision page
+ // and load the picture into it.
+ _bgTable[kCollisionPageBgIdxAlias].bg = collisionPage;
+ loadBg16(ct, name, kCollisionPageBgIdxAlias);
}
/*! \brief Load 256 color background into renderer
@@ -1199,7 +1192,10 @@ void OSRenderer::loadBg256(const byte *bg, const char *name, unsigned int idx) {
* \param name Background filename
*/
void OSRenderer::loadCt256(const byte *ct, const char *name) {
- loadBg256(ct, name, 8);
+ // Make the 9th background point directly to the collision page
+ // and load the picture into it.
+ _bgTable[kCollisionPageBgIdxAlias].bg = collisionPage;
+ loadBg256(ct, name, kCollisionPageBgIdxAlias);
}
/*! \brief Select active background and load its palette
@@ -1255,10 +1251,7 @@ void OSRenderer::removeBg(unsigned int idx) {
_scrollBg = 0;
}
- delete[] _bgTable[idx].bg;
- _bgTable[idx].bg = NULL;
- _bgTable[idx].pal.clear();
- memset(_bgTable[idx].name, 0, sizeof (_bgTable[idx].name));
+ _bgTable[idx].clear();
}
void OSRenderer::saveBgNames(Common::OutSaveFile &fHandle) {
diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h
index 839f37a0b1..f1503a4c46 100644
--- a/engines/cine/gfx.h
+++ b/engines/cine/gfx.h
@@ -31,12 +31,34 @@
namespace Cine {
+extern byte *collisionPage;
+static const int kCollisionPageBgIdxAlias = 8;
+
/*! \brief Background with palette
*/
struct palBg {
byte *bg; ///< Background data
Cine::Palette pal; ///< Background color palette
char name[15]; ///< Background filename
+
+ /** @brief Default constructor. */
+ palBg() : bg(NULL), pal(), name() {
+ // Make sure the name is empty (Maybe this is not needed?)
+ memset(this->name, 0, sizeof(this->name));
+ }
+
+ /** @brief Clears the struct (Releases allocated memory etc). */
+ void clear() {
+ // In Operation Stealth the 9th background is sometimes aliased to
+ // the collision page so we should take care not to double delete it
+ // (The collision page is deleted elsewhere).
+ if (this->bg != collisionPage) {
+ delete[] this->bg;
+ }
+ this->bg = NULL;
+ this->pal.clear();
+ memset(this->name, 0, sizeof(this->name));
+ }
};
/*! \brief Future Wars renderer
@@ -129,8 +151,7 @@ public:
*/
class OSRenderer : public FWRenderer {
private:
- // FIXME: Background table's size is probably 8 instead of 9. Check to make sure and correct if necessary.
- palBg _bgTable[9]; ///< Table of backgrounds loaded into renderer
+ Common::Array _bgTable; ///< Table of backgrounds loaded into renderer (Maximum is 9)
unsigned int _currentBg; ///< Current background
unsigned int _scrollBg; ///< Current scroll background
unsigned int _bgShift; ///< Background shift
@@ -175,7 +196,6 @@ public:
void gfxDrawSprite(byte *src4, uint16 sw, uint16 sh, byte *dst4, int16 sx, int16 sy);
-extern byte *collisionPage;
extern FWRenderer *renderer;
void setMouseCursor(int cursor);
--
cgit v1.2.3
From 5fccc0f98dda5cbcec208b17c2e6d36a36fadf1e Mon Sep 17 00:00:00 2001
From: Nicola Mettifogo
Date: Fri, 12 Jun 2009 05:03:18 +0000
Subject: * Final version of the IFF parsing code. * Refactored ILBMDecoder
usage from disk code.
svn-id: r41458
---
engines/parallaction/disk.cpp | 121 +++++++++++++++++++++++
engines/parallaction/disk.h | 40 +++++++-
engines/parallaction/disk_br.cpp | 113 +++++++++------------
engines/parallaction/disk_ns.cpp | 72 +++-----------
engines/parallaction/gfxbase.cpp | 8 +-
engines/parallaction/iff.cpp | 209 +++++++++++----------------------------
engines/parallaction/iff.h | 191 ++++++++++++++++++++++++++---------
engines/parallaction/module.mk | 1 +
8 files changed, 422 insertions(+), 333 deletions(-)
create mode 100644 engines/parallaction/disk.cpp
diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp
new file mode 100644
index 0000000000..a58fa35655
--- /dev/null
+++ b/engines/parallaction/disk.cpp
@@ -0,0 +1,121 @@
+#include "parallaction/disk.h"
+#include "parallaction/graphics.h"
+#include "parallaction/iff.h"
+
+namespace Parallaction {
+
+void ILBMLoader::setupBuffer(uint32 w, uint32 h) {
+ _intBuffer = 0;
+ switch (_bodyMode) {
+ case BODYMODE_SURFACE:
+ if (!_surf) {
+ _surf = new Graphics::Surface;
+ assert(_surf);
+ }
+ _surf->create(w, h, 1);
+ _mode = ILBMDecoder::ILBM_UNPACK_PLANES;
+ _intBuffer = (byte*)_surf->pixels;
+ break;
+
+ case BODYMODE_MASKBUFFER:
+ if (!_maskBuffer) {
+ _maskBuffer = new MaskBuffer;
+ assert(_maskBuffer);
+ }
+ _maskBuffer->create(w, h);
+ _mode = ILBMDecoder::ILBM_2_PACK_PLANES;
+ _intBuffer = _maskBuffer->data;
+ break;
+
+ case BODYMODE_PATHBUFFER:
+ if (!_pathBuffer) {
+ _pathBuffer = new PathBuffer;
+ assert(_pathBuffer);
+ }
+ _pathBuffer->create(w, h);
+ _mode = ILBMDecoder::ILBM_1_PACK_PLANES;
+ _intBuffer = _pathBuffer->data;
+ break;
+
+ default:
+ error("Invalid bodyMode '%i' for ILBMLoader", _bodyMode);
+ break;
+ }
+}
+
+bool ILBMLoader::callback(IFFChunk &chunk) {
+ switch (chunk._type) {
+ case ID_BMHD:
+ _decoder.loadHeader(chunk._stream);
+ break;
+
+ case ID_CMAP:
+ if (_palette) {
+ chunk._stream->read(_palette, chunk._size);
+ }
+ break;
+
+ case ID_CRNG:
+ if (_crng) {
+ PaletteFxRange *ptr = &_crng[_numCRNG];
+ chunk._stream->read((byte*)ptr, chunk._size);
+ ptr->_timer = FROM_BE_16(ptr->_timer);
+ ptr->_step = FROM_BE_16(ptr->_step);
+ ptr->_flags = FROM_BE_16(ptr->_flags);
+ ++_numCRNG;
+ }
+ break;
+
+ case ID_BODY:
+ setupBuffer(_decoder._header.width, _decoder._header.height);
+ assert(_intBuffer);
+ _decoder.loadBitmap(_mode, _intBuffer, chunk._stream);
+ return true; // stop the parser
+ }
+
+ return false;
+}
+
+void ILBMLoader::load(Common::ReadStream *in, bool disposeStream) {
+ IFFParser parser(in, disposeStream);
+ Common::Functor1Mem< IFFChunk&, bool, ILBMLoader > c(this, &ILBMLoader::callback);
+ parser.parse(c);
+}
+
+ILBMLoader::ILBMLoader(uint32 bodyMode, byte *palette, PaletteFxRange *crng) {
+ _bodyMode = bodyMode;
+ _surf = 0;
+ _maskBuffer = 0;
+ _pathBuffer = 0;
+ _palette = palette;
+ _crng = crng;
+ _numCRNG = 0;
+}
+
+ILBMLoader::ILBMLoader(Graphics::Surface *surf, byte *palette, PaletteFxRange *crng) {
+ _bodyMode = ILBMLoader::BODYMODE_SURFACE;
+ _surf = surf;
+ _palette = palette;
+ _crng = crng;
+ _numCRNG = 0;
+}
+
+ILBMLoader::ILBMLoader(MaskBuffer *buffer) {
+ _bodyMode = ILBMLoader::BODYMODE_MASKBUFFER;
+ _maskBuffer = buffer;
+ _palette = 0;
+ _crng = 0;
+ _numCRNG = 0;
+}
+
+ILBMLoader::ILBMLoader(PathBuffer *buffer) {
+ _bodyMode = ILBMLoader::BODYMODE_PATHBUFFER;
+ _pathBuffer = buffer;
+ _palette = 0;
+ _crng = 0;
+ _numCRNG = 0;
+}
+
+
+
+}
diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h
index 4cc2711e96..936be1e140 100644
--- a/engines/parallaction/disk.h
+++ b/engines/parallaction/disk.h
@@ -33,6 +33,7 @@
#include "common/file.h"
#include "graphics/surface.h"
+#include "parallaction/iff.h"
@@ -77,8 +78,37 @@ public:
virtual Table* loadTable(const char* name) = 0;
virtual Common::SeekableReadStream* loadMusic(const char* name) = 0;
virtual Common::SeekableReadStream* loadSound(const char* name) = 0;
- virtual void loadMask(const char *name, MaskBuffer &buffer) { }
- virtual void loadPath(const char *name, PathBuffer &buffer) { }
+ virtual MaskBuffer *loadMask(const char *name, uint32 w, uint32 h) { return 0; }
+ virtual PathBuffer *loadPath(const char *name, uint32 w, uint32 h) { return 0; }
+};
+
+struct PaletteFxRange;
+
+struct ILBMLoader {
+ enum {
+ BODYMODE_SURFACE,
+ BODYMODE_MASKBUFFER,
+ BODYMODE_PATHBUFFER
+ };
+ uint32 _bodyMode;
+ Graphics::Surface *_surf;
+ MaskBuffer *_maskBuffer;
+ PathBuffer *_pathBuffer;
+ byte *_palette;
+ PaletteFxRange *_crng;
+ uint32 _mode;
+ byte* _intBuffer;
+ uint32 _numCRNG;
+ ILBMDecoder _decoder;
+
+ ILBMLoader(uint32 bodyMode, byte *palette = 0, PaletteFxRange *crng = 0);
+ ILBMLoader(Graphics::Surface *surf, byte *palette = 0, PaletteFxRange *crng = 0);
+ ILBMLoader(MaskBuffer *buffer);
+ ILBMLoader(PathBuffer *buffer);
+
+ bool callback(IFFChunk &chunk);
+ void setupBuffer(uint32 w, uint32 h);
+ void load(Common::ReadStream *in, bool disposeStream = false);
};
@@ -235,8 +265,8 @@ public:
Table* loadTable(const char* name);
Common::SeekableReadStream* loadMusic(const char* name);
Common::SeekableReadStream* loadSound(const char* name);
- void loadMask(const char *name, MaskBuffer &buffer);
- void loadPath(const char *name, PathBuffer &buffer);
+ MaskBuffer *loadMask(const char *name, uint32 w, uint32 h);
+ PathBuffer *loadPath(const char *name, uint32 w, uint32 h);
};
class DosDemoDisk_br : public DosDisk_br {
@@ -272,7 +302,7 @@ public:
GfxObj* loadObjects(const char *name, uint8 part = 0);
Common::SeekableReadStream* loadMusic(const char* name);
Common::SeekableReadStream* loadSound(const char* name);
- void loadMask(const char *name, MaskBuffer &buffer);
+ MaskBuffer *loadMask(const char *name, uint32 w, uint32 h);
};
} // namespace Parallaction
diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp
index ec4fc32cc1..3572129dc0 100644
--- a/engines/parallaction/disk_br.cpp
+++ b/engines/parallaction/disk_br.cpp
@@ -331,32 +331,40 @@ void DosDisk_br::loadSlide(BackgroundInfo& info, const char *name) {
}
}
-void DosDisk_br::loadMask(const char *name, MaskBuffer &buffer) {
+MaskBuffer *DosDisk_br::loadMask(const char *name, uint32 w, uint32 h) {
if (!name) {
- return;
+ return 0;
}
Common::SeekableReadStream *stream = openFile("msk/" + Common::String(name), ".msk");
- // NOTE: info.width and info.height are only valid if the background graphics
- // have already been loaded
- buffer.bigEndian = false;
- stream->read(buffer.data, buffer.size);
+ MaskBuffer *buffer = new MaskBuffer;
+ assert(buffer);
+ buffer->create(w, h);
+ buffer->bigEndian = false;
+
+ stream->read(buffer->data, buffer->size);
delete stream;
+
+ return buffer;
}
-void DosDisk_br::loadPath(const char *name, PathBuffer &buffer) {
+PathBuffer *DosDisk_br::loadPath(const char *name, uint32 w, uint32 h) {
if (!name) {
- return;
+ return 0;
}
Common::SeekableReadStream *stream = openFile("pth/" + Common::String(name), ".pth");
- // NOTE: info.width and info.height are only valid if the background graphics
- // have already been loaded
- buffer.bigEndian = false;
- stream->read(buffer.data, buffer.size);
+ PathBuffer *buffer = new PathBuffer;
+ assert(buffer);
+ buffer->create(w, h);
+ buffer->bigEndian = false;
+
+ stream->read(buffer->data, buffer->size);
delete stream;
+
+ return buffer;
}
void DosDisk_br::loadScenery(BackgroundInfo& info, const char *name, const char *mask, const char* path) {
@@ -380,18 +388,12 @@ void DosDisk_br::loadScenery(BackgroundInfo& info, const char *name, const char
}
if (mask) {
- info._mask = new MaskBuffer;
- info._mask->create(info.width, info.height);
- loadMask(mask, *info._mask);
+ info._mask = loadMask(mask, info.width, info.height);
}
if (path) {
- info._path = new PathBuffer;
- info._path->create(info.width, info.height);
- loadPath(path, *info._path);
+ info._path = loadPath(path, info.width, info.height);
}
-
- return;
}
Table* DosDisk_br::loadTable(const char* name) {
@@ -459,7 +461,7 @@ void AmigaDisk_br::adjustForPalette(Graphics::Surface &surf, int transparentColo
void AmigaDisk_br::loadBackground(BackgroundInfo& info, const char *filename) {
byte r,g,b;
- byte *pal, *p;
+ byte *p;
Common::SeekableReadStream *stream;
uint i;
@@ -488,20 +490,14 @@ void AmigaDisk_br::loadBackground(BackgroundInfo& info, const char *filename) {
}
stream = openFile("backs/" + Common::String(filename), ".bkg");
- ILBMDecoder decoder(stream, true);
- // TODO: encapsulate surface creation
- info.bg.w = decoder.getWidth();
- info.bg.h = decoder.getHeight();
- info.bg.pitch = info.bg.w;
- info.bg.bytesPerPixel = 1;
- info.bg.pixels = decoder.getBitmap();
- assert(info.bg.pixels);
+ byte pal[768];
+ ILBMLoader loader(&info.bg, pal);
+ loader.load(stream, true);
info.width = info.bg.w;
info.height = info.bg.h;
- pal = decoder.getPalette();
p = pal;
for (i = 16; i < 32; i++) {
r = *p >> 2;
@@ -516,8 +512,6 @@ void AmigaDisk_br::loadBackground(BackgroundInfo& info, const char *filename) {
// Overwrite the first color (transparent key) in the palette
info.palette.setEntry(0, pal[0] >> 2, pal[1] >> 2, pal[2] >> 0);
- delete []pal;
-
// background data is drawn used the upper portion of the palette
adjustForPalette(info.bg);
}
@@ -543,27 +537,24 @@ void finalpass(byte *buffer, uint32 size) {
}
}
-void AmigaDisk_br::loadMask(const char *name, MaskBuffer &buffer) {
+MaskBuffer *AmigaDisk_br::loadMask(const char *name, uint32 w, uint32 h) {
if (!name) {
- return;
+ return 0;
}
debugC(1, kDebugDisk, "AmigaDisk_br::loadMask '%s'", name);
Common::SeekableReadStream *stream = tryOpenFile("msk/" + Common::String(name), ".msk");
if (!stream) {
- return;
+ return 0;
}
- ILBMDecoder decoder(stream, true);
+ ILBMLoader loader(ILBMLoader::BODYMODE_MASKBUFFER);
+ loader.load(stream, true);
- // TODO: the buffer is allocated by the caller, so a copy here is
- // unavoidable... a better solution would be inform the function
- // of the size of the mask (the size in the mask file is not valid!)
- byte *bitmap = decoder.getBitmap(2, true);
- memcpy(buffer.data, bitmap, buffer.size);
- finalpass(buffer.data, buffer.size);
-
- buffer.bigEndian = true;
+ MaskBuffer *buffer = loader._maskBuffer;
+ buffer->bigEndian = true;
+ finalpass(buffer->data, buffer->size);
+ return buffer;
}
void AmigaDisk_br::loadScenery(BackgroundInfo& info, const char* name, const char* mask, const char* path) {
@@ -573,18 +564,12 @@ void AmigaDisk_br::loadScenery(BackgroundInfo& info, const char* name, const cha
loadBackground(info, name);
}
if (mask) {
- info._mask = new MaskBuffer;
- info._mask->create(info.width, info.height);
- loadMask(mask, *info._mask);
+ info._mask = loadMask(mask, info.width, info.height);
}
if (path) {
- info._path = new PathBuffer;
- info._path->create(info.width, info.height);
- loadPath(path, *info._path);
+ info._path = loadPath(path, info.width, info.height);
}
-
- return;
}
void AmigaDisk_br::loadSlide(BackgroundInfo& info, const char *name) {
@@ -596,20 +581,13 @@ GfxObj* AmigaDisk_br::loadStatic(const char* name) {
debugC(1, kDebugDisk, "AmigaDisk_br::loadStatic '%s'", name);
Common::String sName = name;
-
Common::SeekableReadStream *stream = openFile("ras/" + sName, ".ras");
- ILBMDecoder decoder(stream, true);
- Graphics::Surface* surf = new Graphics::Surface;
- assert(surf);
+ ILBMLoader loader(ILBMLoader::BODYMODE_SURFACE);
+ loader.load(stream, true);
- // TODO: encapsulate surface creation
- surf->w = decoder.getWidth();
- surf->h = decoder.getHeight();
- surf->pitch = surf->w;
- surf->bytesPerPixel = 1;
- surf->pixels = decoder.getBitmap();
- assert(surf->pixels);
+ Graphics::Surface* surf = loader._surf;
+ assert(surf);
// Static pictures are drawn used the upper half of the palette: this must be
// done before shadow mask is applied. This way, only really transparent pixels
@@ -741,15 +719,16 @@ GfxObj* AmigaDisk_br::loadObjects(const char *name, uint8 part) {
debugC(5, kDebugDisk, "AmigaDisk_br::loadObjects");
Common::SeekableReadStream *stream = openFile(name);
- ILBMDecoder decoder(stream, true);
+ ILBMLoader loader(ILBMLoader::BODYMODE_SURFACE);
+ loader.load(stream, true);
uint16 max = objectsMax[part];
if (_vm->getFeatures() & GF_DEMO)
max = 72;
byte *data = new byte[max * 2601];
- byte *srcPtr = decoder.getBitmap();
- int w = decoder.getWidth();
+ byte *srcPtr = (byte*)loader._surf->getBasePtr(0,0);
+ int w = loader._surf->w;
// Convert to the expected display format
for (int i = 0; i < max; i++) {
@@ -764,7 +743,7 @@ GfxObj* AmigaDisk_br::loadObjects(const char *name, uint8 part) {
dst += 51;
}
}
- free(srcPtr);
+ delete loader._surf;
return new GfxObj(0, new Cnv(max, 51, 51, data, true));
}
diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp
index 8aa2a9f543..a75decdf88 100644
--- a/engines/parallaction/disk_ns.cpp
+++ b/engines/parallaction/disk_ns.cpp
@@ -900,56 +900,18 @@ void AmigaDisk_ns::buildMask(byte* buf) {
}
}
-// TODO: extend the ILBMDecoder to return CRNG chunks and get rid of this BackgroundDecoder crap
-class BackgroundDecoder : public ILBMDecoder {
-
-public:
- BackgroundDecoder(Common::SeekableReadStream *input, bool disposeStream = false) : ILBMDecoder(input, disposeStream) {
- }
-
- uint32 getCRNG(PaletteFxRange *ranges, uint32 num) {
- assert(ranges);
-
- uint32 size = _parser.getIFFBlockSize(ID_CRNG);
- if (size == (uint32)-1) {
- return 0;
- }
-
- uint32 count = MIN((uint32)(size / sizeof(PaletteFxRange)), num);
- _parser.loadIFFBlock(ID_CRNG, ranges, count * sizeof(PaletteFxRange));
-
- for (uint32 i = 0; i < count; ++i) {
- ranges[i]._timer = FROM_BE_16(ranges[i]._timer);
- ranges[i]._step = FROM_BE_16(ranges[i]._step);
- ranges[i]._flags = FROM_BE_16(ranges[i]._flags);
- }
-
- return count;
- }
-};
-
void AmigaDisk_ns::loadBackground(BackgroundInfo& info, const char *name) {
-
- Common::SeekableReadStream *s = openFile(name);
- BackgroundDecoder decoder(s, true);
-
PaletteFxRange ranges[6];
- memset(ranges, 0, 6*sizeof(PaletteFxRange));
- decoder.getCRNG(ranges, 6);
+ byte pal[768];
- // TODO: encapsulate surface creation
- info.bg.w = decoder.getWidth();
- info.bg.h = decoder.getHeight();
- info.bg.pitch = info.bg.w;
- info.bg.bytesPerPixel = 1;
- info.bg.pixels = decoder.getBitmap();
+ Common::SeekableReadStream *s = openFile(name);
+ ILBMLoader loader(&info.bg, pal, ranges);
+ loader.load(s, true);
info.width = info.bg.w;
info.height = info.bg.h;
- byte *pal = decoder.getPalette();
- assert(pal);
byte *p = pal;
for (uint i = 0; i < 32; i++) {
byte r = *p >> 2;
@@ -960,7 +922,6 @@ void AmigaDisk_ns::loadBackground(BackgroundInfo& info, const char *name) {
p++;
info.palette.setEntry(i, r, g, b);
}
- delete []pal;
for (uint j = 0; j < 6; j++) {
info.setPaletteRange(j, ranges[j]);
@@ -979,9 +940,9 @@ void AmigaDisk_ns::loadMask(BackgroundInfo& info, const char *name) {
return; // no errors if missing mask files: not every location has one
}
- ILBMDecoder decoder(s, true);
- byte *pal = decoder.getPalette();
- assert(pal);
+ byte pal[768];
+ ILBMLoader loader(ILBMLoader::BODYMODE_MASKBUFFER, pal);
+ loader.load(s, true);
byte r, g, b;
for (uint i = 0; i < 4; i++) {
@@ -990,14 +951,8 @@ void AmigaDisk_ns::loadMask(BackgroundInfo& info, const char *name) {
b = pal[i*3+2];
info.layers[i] = (((r << 4) & 0xF00) | (g & 0xF0) | (b >> 4)) & 0xFF;
}
- delete []pal;
- info._mask = new MaskBuffer;
- info._mask->w = info.width;
- info._mask->h = info.height;
- info._mask->internalWidth = info.width >> 2;
- info._mask->size = info._mask->internalWidth * info._mask->h;
- info._mask->data = decoder.getBitmap(2, true);
+ info._mask = loader._maskBuffer;
}
void AmigaDisk_ns::loadPath(BackgroundInfo& info, const char *name) {
@@ -1010,15 +965,10 @@ void AmigaDisk_ns::loadPath(BackgroundInfo& info, const char *name) {
return; // no errors if missing path files: not every location has one
}
- ILBMDecoder decoder(s, true);
- info._path = new PathBuffer;
- info._path->create(info.width, info.height);
+ ILBMLoader loader(ILBMLoader::BODYMODE_PATHBUFFER);
+ loader.load(s, true);
+ info._path = loader._pathBuffer;
info._path->bigEndian = true;
-
- byte *bitmap = decoder.getBitmap(1, true);
- assert(bitmap);
- memcpy(info._path->data, bitmap, info._path->size);
- delete bitmap;
}
void AmigaDisk_ns::loadScenery(BackgroundInfo& info, const char* background, const char* mask, const char* path) {
diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp
index ec72b14c15..fc6cb28d9e 100644
--- a/engines/parallaction/gfxbase.cpp
+++ b/engines/parallaction/gfxbase.cpp
@@ -162,9 +162,7 @@ void BackgroundInfo::loadGfxObjMask(const char *name, GfxObj *obj) {
Common::Rect rect;
obj->getRect(0, rect);
- MaskBuffer *buf = new MaskBuffer;
- buf->create(rect.width(), rect.height());
- _vm->_disk->loadMask(name, *buf);
+ MaskBuffer *buf = _vm->_disk->loadMask(name, rect.width(), rect.height());
obj->_maskId = addMaskPatch(buf);
obj->_hasMask = true;
@@ -174,9 +172,7 @@ void BackgroundInfo::loadGfxObjPath(const char *name, GfxObj *obj) {
Common::Rect rect;
obj->getRect(0, rect);
- PathBuffer *buf = new PathBuffer;
- buf->create(rect.width(), rect.height());
- _vm->_disk->loadPath(name, *buf);
+ PathBuffer *buf = _vm->_disk->loadPath(name, rect.width(), rect.height());
obj->_pathId = addPathPatch(buf);
obj->_hasPath = true;
diff --git a/engines/parallaction/iff.cpp b/engines/parallaction/iff.cpp
index 43dcac3697..51e1e1d186 100644
--- a/engines/parallaction/iff.cpp
+++ b/engines/parallaction/iff.cpp
@@ -32,34 +32,17 @@
namespace Parallaction {
-void IFFParser::setInputStream(Common::SeekableReadStream *stream) {
- destroy();
-
+void IFFParser::setInputStream(Common::ReadStream *stream) {
assert(stream);
- _stream = stream;
- _startOffset = 0;
- _endOffset = _stream->size();
-
- _formType = 0;
- _formSize = (uint32)-1;
-
- if (_stream->size() < 12) {
- // this file is too small to be a valid IFF container
- return;
- }
+ _formChunk.setInputStream(stream);
+ _chunk.setInputStream(stream);
- if (_stream->readUint32BE() != ID_FORM) {
- // no FORM header was found
- return;
+ _formChunk.readHeader();
+ if (_formChunk.id != ID_FORM) {
+ error("IFFParser input is not a FORM type IFF file");
}
-
- _formSize = _stream->readUint32BE();
- _formType = _stream->readUint32BE();
-}
-
-void IFFParser::destroy() {
- _stream = 0;
- _startOffset = _endOffset = 0;
+ _formSize = _formChunk.size;
+ _formType = _formChunk.readUint32BE();
}
uint32 IFFParser::getFORMSize() const {
@@ -70,171 +53,99 @@ Common::IFF_ID IFFParser::getFORMType() const {
return _formType;
}
-uint32 IFFParser::moveToIFFBlock(Common::IFF_ID chunkName) {
- uint32 size = (uint32)-1;
-
- _stream->seek(_startOffset + 0x0C);
-
- while ((uint)_stream->pos() < _endOffset) {
- uint32 chunk = _stream->readUint32BE();
- uint32 size_temp = _stream->readUint32BE();
+void IFFParser::parse(IFFCallback &callback) {
+ bool stop;
+ do {
+ _chunk.feed();
+ _formChunk.incBytesRead(_chunk.size);
- if (chunk != chunkName) {
- _stream->seek((size_temp + 1) & (~1), SEEK_CUR);
- assert((uint)_stream->pos() <= _endOffset);
- } else {
- size = size_temp;
+ if (_formChunk.hasReadAll()) {
break;
}
- }
-
- return size;
-}
-
-uint32 IFFParser::getIFFBlockSize(Common::IFF_ID chunkName) {
- uint32 size = moveToIFFBlock(chunkName);
- return size;
-}
-
-bool IFFParser::loadIFFBlock(Common::IFF_ID chunkName, void *loadTo, uint32 ptrSize) {
- uint32 chunkSize = moveToIFFBlock(chunkName);
-
- if (chunkSize == (uint32)-1) {
- return false;
- }
-
- uint32 loadSize = 0;
- loadSize = MIN(ptrSize, chunkSize);
- _stream->read(loadTo, loadSize);
- return true;
-}
-
-Common::SeekableReadStream *IFFParser::getIFFBlockStream(Common::IFF_ID chunkName) {
- uint32 chunkSize = moveToIFFBlock(chunkName);
-
- if (chunkSize == (uint32)-1) {
- return 0;
- }
-
- uint32 pos = _stream->pos();
- return new Common::SeekableSubReadStream(_stream, pos, pos + chunkSize, false);
-}
+ _formChunk.incBytesRead(8);
+ _chunk.readHeader();
-// ILBM decoder implementation
+ // invoke the callback
+ Common::SubReadStream stream(&_chunk, _chunk.size);
+ IFFChunk chunk(_chunk.id, _chunk.size, &stream);
+ stop = callback(chunk);
-ILBMDecoder::ILBMDecoder(Common::SeekableReadStream *in, bool disposeStream) : _in(in), _disposeStream(disposeStream), _hasHeader(false), _bodySize((uint32)-1), _paletteSize((uint32)-1) {
- assert(in);
- _parser.setInputStream(in);
-
- if (_parser.getFORMType() != ID_ILBM) {
- return;
- }
-
- _hasHeader = _parser.loadIFFBlock(ID_BMHD, &_header, sizeof(_header));
- if (!_hasHeader) {
- return;
- }
-
- _header.width = TO_BE_16(_header.width);
- _header.height = TO_BE_16(_header.height);
-
- _paletteSize = _parser.getIFFBlockSize(ID_CMAP);
- _bodySize = _parser.getIFFBlockSize(ID_BODY);
-}
+ // eats up all the remaining data in the chunk
+ while (!stream.eos()) {
+ printf("attemping to eat data in chunk\n");
+ stream.readByte();
+ }
-ILBMDecoder::~ILBMDecoder() {
- if (_disposeStream) {
- delete _in;
- }
+ } while (!stop);
}
-uint32 ILBMDecoder::getWidth() {
- assert(_hasHeader);
- return _header.width;
-}
-uint32 ILBMDecoder::getHeight() {
- assert(_hasHeader);
- return _header.height;
-}
-uint32 ILBMDecoder::getNumColors() {
- assert(_hasHeader);
- return (1 << _header.depth);
-}
-
-byte *ILBMDecoder::getPalette() {
- assert(_paletteSize != (uint32)-1);
- byte *palette = new byte[_paletteSize];
- assert(palette);
- _parser.loadIFFBlock(ID_CMAP, palette, _paletteSize);
- return palette;
+void ILBMDecoder::loadHeader(Common::ReadStream *stream) {
+ assert(stream);
+ stream->read(&_header, sizeof(_header));
+ _header.width = FROM_BE_16(_header.width);
+ _header.height = FROM_BE_16(_header.height);
+ _header.x = FROM_BE_16(_header.x);
+ _header.y = FROM_BE_16(_header.y);
+ _header.transparentColor = FROM_BE_16(_header.transparentColor);
+ _header.pageWidth = FROM_BE_16(_header.pageWidth);
+ _header.pageHeight = FROM_BE_16(_header.pageHeight);
}
-byte *ILBMDecoder::getBitmap(uint32 numPlanes, bool packPlanes) {
- assert(_bodySize != (uint32)-1);
+void ILBMDecoder::loadBitmap(uint32 mode, byte *buffer, Common::ReadStream *stream) {
+ assert(stream);
+ uint32 numPlanes = MIN(mode & ILBM_UNPACK_PLANES, (uint32)_header.depth);
assert(numPlanes == 1 || numPlanes == 2 || numPlanes == 3 || numPlanes == 4 || numPlanes == 5 || numPlanes == 8);
- numPlanes = MIN(numPlanes, (uint32)_header.depth);
- if (numPlanes > 4) {
- packPlanes = false;
+ bool packPixels = (mode & ILBM_PACK_PLANES) != 0;
+ if (numPlanes != 1 && numPlanes != 2 && numPlanes != 4) {
+ packPixels = false;
}
- uint32 bitmapSize = _header.width * _header.height;
- uint32 bitmapWidth = _header.width;
- if (packPlanes) {
- bitmapSize /= (8 / numPlanes);
- bitmapWidth /= (8 / numPlanes);
+ uint32 outPitch = _header.width;
+ if (packPixels) {
+ outPitch /= (8 / numPlanes);
}
-
- Common::SeekableReadStream *bodyStream = _parser.getIFFBlockStream(ID_BODY);
- assert(bodyStream);
-
- byte *bitmap = (byte*)calloc(bitmapSize, 1);
- assert(bitmap);
+ byte *out = buffer;
switch (_header.pack) {
case 1: { // PackBits compressed bitmap
- Graphics::PackBitsReadStream stream(*bodyStream);
-
- byte *out = bitmap;
+ Graphics::PackBitsReadStream packStream(*stream);
// setup a buffer to hold enough data to build a line in the output
- uint32 scanWidth = ((_header.width + 15)/16) << 1;
- byte *scanBuffer = (byte*)malloc(scanWidth * _header.depth);
+ uint32 scanlineWidth = ((_header.width + 15)/16) << 1;
+ byte *scanline = new byte[scanlineWidth * _header.depth];
for (uint i = 0; i < _header.height; ++i) {
- byte *s = scanBuffer;
+ byte *s = scanline;
for (uint32 j = 0; j < _header.depth; ++j) {
- stream.read(s, scanWidth);
- s += scanWidth;
+ packStream.read(s, scanlineWidth);
+ s += scanlineWidth;
}
- planarToChunky(out, bitmapWidth, scanBuffer, scanWidth, numPlanes, packPlanes);
- out += bitmapWidth;
+ planarToChunky(out, outPitch, scanline, scanlineWidth, numPlanes, packPixels);
+ out += outPitch;
}
- free(scanBuffer);
+ delete []scanline;
break;
}
+
default:
+ // implement other compression types here!
error("only RLE compressed ILBM files are supported");
break;
}
-
- delete bodyStream;
-
- return bitmap;
}
-
-void ILBMDecoder::planarToChunky(byte *out, uint32 width, byte *in, uint32 planeWidth, uint32 nPlanes, bool packPlanes) {
+void ILBMDecoder::planarToChunky(byte *out, uint32 outPitch, byte *in, uint32 inWidth, uint32 nPlanes, bool packPlanes) {
byte pix, ofs, bit;
byte *s;
- uint32 pixels = width;
+ uint32 pixels = outPitch;
if (packPlanes) {
pixels *= (8 / nPlanes);
}
@@ -251,7 +162,7 @@ void ILBMDecoder::planarToChunky(byte *out, uint32 width, byte *in, uint32 plane
if (s[ofs] & bit) {
pix |= (1 << plane);
}
- s += planeWidth;
+ s += inWidth;
}
diff --git a/engines/parallaction/iff.h b/engines/parallaction/iff.h
index 43f78bf001..98e36e1b00 100644
--- a/engines/parallaction/iff.h
+++ b/engines/parallaction/iff.h
@@ -27,39 +27,126 @@
#define PARALLACTION_IFF_H
#include "common/stream.h"
+#include "common/func.h"
#include "common/iff_container.h" // for IFF chunk names
#include "graphics/iff.h" // for BMHD
-// this IFF parser code is courtesy of the Kyra engine team ;)
namespace Parallaction {
+/**
+ * Represents a IFF chunk available to client code.
+ *
+ * Client code must *not* deallocate _stream when done.
+ */
+struct IFFChunk {
+ Common::IFF_ID _type;
+ uint32 _size;
+ Common::ReadStream *_stream;
+
+ IFFChunk(Common::IFF_ID type, uint32 size, Common::ReadStream *stream) : _type(type), _size(size), _stream(stream) {
+ assert(_stream);
+ }
+};
+
+/**
+ * Parser for IFF containers.
+ */
class IFFParser {
+
+ /**
+ * This private class implements IFF chunk navigation.
+ */
+ class IFFChunkNav : public Common::ReadStream {
+ protected:
+ Common::ReadStream *_input;
+ uint32 _bytesRead;
+ public:
+ Common::IFF_ID id;
+ uint32 size;
+
+ IFFChunkNav() : _input(0) {
+ }
+ void setInputStream(Common::ReadStream *input) {
+ _input = input;
+ size = _bytesRead = 0;
+ }
+ void incBytesRead(uint32 inc) {
+ _bytesRead += inc;
+ if (_bytesRead > size) {
+ error("Chunk overread");
+ }
+ }
+ void readHeader() {
+ id = _input->readUint32BE();
+ size = _input->readUint32BE();
+ _bytesRead = 0;
+ }
+ bool hasReadAll() const {
+ return (size - _bytesRead) == 0;
+ }
+ void feed() {
+ if (size % 2) {
+ size++;
+ }
+ while (!hasReadAll()) {
+ readByte();
+ }
+ }
+ // Common::ReadStream implementation
+ bool eos() const { return _input->eos(); }
+ bool err() const { return _input->err(); }
+ void clearErr() { _input->clearErr(); }
+
+ uint32 read(void *dataPtr, uint32 dataSize) {
+ incBytesRead(dataSize);
+ return _input->read(dataPtr, dataSize);
+ }
+ };
+
+ IFFChunkNav _formChunk; //!< The root chunk of the file.
+ IFFChunkNav _chunk; //!< The current chunk.
+
+ Common::ReadStream *_stream;
+ bool _disposeStream;
+
+ void setInputStream(Common::ReadStream *stream);
+
public:
- IFFParser() : _stream(0), _startOffset(0), _endOffset(0) {}
- IFFParser(Common::SeekableReadStream *stream) : _stream(0), _startOffset(0), _endOffset(0) {
+ IFFParser(Common::ReadStream *stream, bool disposeStream = false) : _stream(stream), _disposeStream(stream) {
setInputStream(stream);
}
- ~IFFParser() { destroy(); }
-
- void setInputStream(Common::SeekableReadStream *stream);
+ ~IFFParser() {
+ if (_disposeStream) {
+ delete _stream;
+ }
+ _stream = 0;
+ }
- operator bool() const { return (_startOffset != _endOffset) && _stream; }
+ /**
+ * Returns the IFF FORM type.
+ * @return the IFF FORM type of the stream, or 0 if FORM header is not found.
+ */
+ Common::IFF_ID getFORMType() const;
+ /**
+ * Returns the size of the data.
+ * @return the size of the data in file, or -1 if FORM header is not found.
+ */
uint32 getFORMSize() const;
- Common::IFF_ID getFORMType() const;
- uint32 getIFFBlockSize(Common::IFF_ID chunk);
- bool loadIFFBlock(Common::IFF_ID chunk, void *loadTo, uint32 ptrSize);
- Common::SeekableReadStream *getIFFBlockStream(Common::IFF_ID chunkName);
-private:
- void destroy();
- uint32 moveToIFFBlock(Common::IFF_ID chunkName);
+ /**
+ * Callback type for the parser.
+ */
+ typedef Common::Functor1< IFFChunk&, bool > IFFCallback;
- Common::SeekableReadStream *_stream;
- uint32 _startOffset;
- uint32 _endOffset;
+ /**
+ * Parse the IFF container, invoking the callback on each chunk encountered.
+ * The callback can interrupt the parsing by returning 'true'.
+ */
+ void parse(IFFCallback &callback);
+private:
uint32 _formSize;
Common::IFF_ID _formType;
};
@@ -67,35 +154,49 @@ private:
-class ILBMDecoder {
- Common::SeekableReadStream *_in;
- bool _disposeStream;
-
+struct ILBMDecoder {
+ /**
+ * ILBM header data, necessary for loadBitmap()
+ */
+ Graphics::BMHD _header;
+
+ /**
+ * Available decoding modes for loadBitmap().
+ */
+ enum {
+ ILBM_UNPACK_PLANES = 0xFF, //!< Decode all bitplanes, and map 1 pixel to 1 byte.
+ ILBM_PACK_PLANES = 0x100, //!< Request unpacking, used as a mask with below options.
+
+ ILBM_1_PLANES = 1, //!< Decode only the first bitplane, don't pack.
+ ILBM_1_PACK_PLANES = ILBM_1_PLANES | ILBM_PACK_PLANES, //!< Decode only the first bitplane, pack 8 pixels in 1 byte.
+ ILBM_2_PLANES = 2, //!< Decode first 2 bitplanes, don't pack.
+ ILBM_2_PACK_PLANES = ILBM_2_PLANES | ILBM_PACK_PLANES, //!< Decode first 2 bitplanes, pack 4 pixels in 1 byte.
+ ILBM_3_PLANES = 3, //!< Decode first 3 bitplanes, don't pack.
+ ILBM_4_PLANES = 4, //!< Decode first 4 bitplanes, don't pack.
+ ILBM_4_PACK_PLANES = ILBM_4_PLANES | ILBM_PACK_PLANES, //!< Decode first 4 bitplanes, pack 2 pixels in 1 byte.
+ ILBM_5_PLANES = 5, //!< Decode first 5 bitplanes, don't pack.
+ ILBM_8_PLANES = 8 //!< Decode all 8 bitplanes.
+ };
+
+ /**
+ * Fills the _header member from the given stream.
+ */
+ void loadHeader(Common::ReadStream *stream);
+
+ /**
+ * Loads and unpacks the ILBM bitmap data from the stream into the buffer.
+ * The functions assumes the buffer is large enough to contain all data.
+ * The caller controls how data should be packed by choosing mode from
+ * the enum above.
+ */
+ void loadBitmap(uint32 mode, byte *buffer, Common::ReadStream *stream);
+
+ /**
+ * Converts from bitplanar to chunky representation. Intended for internal
+ * usage, but you can be (ab)use it from client code if you know what you
+ * are doing.
+ */
void planarToChunky(byte *out, uint32 width, byte *in, uint32 planeWidth, uint32 nPlanes, bool packPlanes);
-
-protected:
- IFFParser _parser;
- Graphics::BMHD _header;
- bool _hasHeader;
- uint32 _bodySize;
- uint32 _paletteSize;
-
-
-public:
- ILBMDecoder(Common::SeekableReadStream *input, bool disposeStream = false);
-
- virtual ~ILBMDecoder();
-
- uint32 getWidth();
- uint32 getHeight();
- uint32 getNumColors();
- byte *getPalette();
-
- byte *getBitmap(uint32 numPlanes, bool packPlanes);
- byte *getBitmap() {
- assert(_hasHeader);
- return getBitmap(_header.depth, false);
- }
};
diff --git a/engines/parallaction/module.mk b/engines/parallaction/module.mk
index 16b79c3d5a..bd45598d17 100644
--- a/engines/parallaction/module.mk
+++ b/engines/parallaction/module.mk
@@ -7,6 +7,7 @@ MODULE_OBJS := \
debug.o \
detection.o \
dialogue.o \
+ disk.o \
disk_br.o \
disk_ns.o \
exec.o \
--
cgit v1.2.3
From 5915e60452feefc676d8be283af3a930015561da Mon Sep 17 00:00:00 2001
From: Nicola Mettifogo
Date: Fri, 12 Jun 2009 06:20:11 +0000
Subject: Removed a leftover printf().
svn-id: r41459
---
engines/parallaction/iff.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/engines/parallaction/iff.cpp b/engines/parallaction/iff.cpp
index 51e1e1d186..024af5b6a7 100644
--- a/engines/parallaction/iff.cpp
+++ b/engines/parallaction/iff.cpp
@@ -73,7 +73,6 @@ void IFFParser::parse(IFFCallback &callback) {
// eats up all the remaining data in the chunk
while (!stream.eos()) {
- printf("attemping to eat data in chunk\n");
stream.readByte();
}
--
cgit v1.2.3
From df1534ffd058c4c75cbe549cd901bae4be1dad4b Mon Sep 17 00:00:00 2001
From: Nicola Mettifogo
Date: Fri, 12 Jun 2009 07:18:01 +0000
Subject: * Replaced the A8SVXDecoder class with a function to return an
AudioStream in trunk/sound/. * Refactored sound code in Parallaction to use
the new Audio::make8SVXStream.
svn-id: r41460
---
engines/parallaction/sound.h | 10 ++---
engines/parallaction/sound_br.cpp | 58 ++++++++++++------------
engines/parallaction/sound_ns.cpp | 41 ++++++++---------
sound/iff.cpp | 95 ++++++++++++++++++++++++---------------
sound/iff.h | 27 ++---------
5 files changed, 113 insertions(+), 118 deletions(-)
diff --git a/engines/parallaction/sound.h b/engines/parallaction/sound.h
index f0ecea67bb..8a5582b378 100644
--- a/engines/parallaction/sound.h
+++ b/engines/parallaction/sound.h
@@ -154,10 +154,9 @@ class AmigaSoundMan_ns : public SoundMan_ns {
uint32 dataSize;
bool dispose;
Audio::SoundHandle handle;
- uint32 flags;
} _channels[NUM_SFX_CHANNELS];
- void loadChannelData(const char *filename, Channel *ch);
+ Audio::AudioStream *loadChannelData(const char *filename, Channel *ch, bool looping);
public:
AmigaSoundMan_ns(Parallaction_ns *vm);
@@ -202,11 +201,8 @@ protected:
uint32 dataSize;
bool dispose;
Audio::SoundHandle handle;
- uint32 flags;
} _channels[NUM_SFX_CHANNELS];
- virtual void loadChannelData(const char *filename, Channel *ch) = 0;
-
public:
SoundMan_br(Parallaction_br *vm);
~SoundMan_br();
@@ -228,7 +224,7 @@ class DosSoundMan_br : public SoundMan_br {
MidiPlayer_MSC *_midiPlayer;
- void loadChannelData(const char *filename, Channel *ch);
+ Audio::AudioStream *loadChannelData(const char *filename, Channel *ch, bool looping);
public:
DosSoundMan_br(Parallaction_br *vm, MidiDriver *midiDriver);
@@ -246,7 +242,7 @@ class AmigaSoundMan_br : public SoundMan_br {
Audio::AudioStream *_musicStream;
Audio::SoundHandle _musicHandle;
- void loadChannelData(const char *filename, Channel *ch);
+ Audio::AudioStream *loadChannelData(const char *filename, Channel *ch, bool looping);
public:
AmigaSoundMan_br(Parallaction_br *vm);
diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp
index 4915eb41e2..464201b2d6 100644
--- a/engines/parallaction/sound_br.cpp
+++ b/engines/parallaction/sound_br.cpp
@@ -401,7 +401,7 @@ DosSoundMan_br::~DosSoundMan_br() {
delete _midiPlayer;
}
-void DosSoundMan_br::loadChannelData(const char *filename, Channel *ch) {
+Audio::AudioStream *DosSoundMan_br::loadChannelData(const char *filename, Channel *ch, bool looping) {
Common::SeekableReadStream *stream = _vm->_disk->loadSound(filename);
ch->dataSize = stream->size();
@@ -414,6 +414,15 @@ void DosSoundMan_br::loadChannelData(const char *filename, Channel *ch) {
// TODO: Confirm sound rate
ch->header.samplesPerSec = 11025;
+
+ uint32 loopStart = 0, loopEnd = 0, flags = Audio::Mixer::FLAG_UNSIGNED;
+ if (looping) {
+ loopEnd = ch->dataSize;
+ flags |= Audio::Mixer::FLAG_LOOP;
+ }
+
+ // Create the input stream
+ return Audio::makeLinearInputStream((byte *)ch->data, ch->dataSize, ch->header.samplesPerSec, flags, loopStart, loopEnd);
}
void DosSoundMan_br::playSfx(const char *filename, uint channel, bool looping, int volume) {
@@ -426,16 +435,8 @@ void DosSoundMan_br::playSfx(const char *filename, uint channel, bool looping, i
debugC(1, kDebugAudio, "DosSoundMan_br::playSfx(%s, %u, %i, %i)", filename, channel, looping, volume);
Channel *ch = &_channels[channel];
- loadChannelData(filename, ch);
-
- uint32 loopStart = 0, loopEnd = 0, flags = Audio::Mixer::FLAG_UNSIGNED;
- if (looping) {
- loopEnd = ch->dataSize;
- flags |= Audio::Mixer::FLAG_LOOP;
- }
-
- _mixer->playRaw(Audio::Mixer::kSFXSoundType, &ch->handle, ch->data, ch->dataSize,
- ch->header.samplesPerSec, flags, -1, volume, 0, loopStart, loopEnd);
+ Audio::AudioStream *input = loadChannelData(filename, ch, looping);
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &ch->handle, input, -1, volume);
}
void DosSoundMan_br::playMusic() {
@@ -468,8 +469,10 @@ AmigaSoundMan_br::~AmigaSoundMan_br() {
stopMusic();
}
-void AmigaSoundMan_br::loadChannelData(const char *filename, Channel *ch) {
+Audio::AudioStream *AmigaSoundMan_br::loadChannelData(const char *filename, Channel *ch, bool looping) {
Common::SeekableReadStream *stream = _vm->_disk->loadSound(filename);
+ Audio::AudioStream *input = 0;
+
if (_vm->getFeatures() & GF_DEMO) {
ch->dataSize = stream->size();
ch->data = (int8*)malloc(ch->dataSize);
@@ -478,12 +481,20 @@ void AmigaSoundMan_br::loadChannelData(const char *filename, Channel *ch) {
// TODO: Confirm sound rate
ch->header.samplesPerSec = 11025;
+
+ uint32 loopStart = 0, loopEnd = 0, flags = 0;
+ if (looping) {
+ loopEnd = ch->header.oneShotHiSamples + ch->header.repeatHiSamples;
+ flags = Audio::Mixer::FLAG_LOOP;
+ }
+
+ input = Audio::makeLinearInputStream((byte *)ch->data, ch->dataSize, ch->header.samplesPerSec, flags, loopStart, loopEnd);
} else {
- Audio::A8SVXDecoder decoder(*stream, ch->header, ch->data, ch->dataSize);
- decoder.decode();
+ input = Audio::make8SVXStream(*stream, looping);
+ delete stream;
}
- ch->dispose = true;
- delete stream;
+
+ return input;
}
void AmigaSoundMan_br::playSfx(const char *filename, uint channel, bool looping, int volume) {
@@ -501,24 +512,13 @@ void AmigaSoundMan_br::playSfx(const char *filename, uint channel, bool looping,
debugC(1, kDebugAudio, "AmigaSoundMan_ns::playSfx(%s, %i)", filename, channel);
Channel *ch = &_channels[channel];
- loadChannelData(filename, ch);
-
- uint32 loopStart = 0, loopEnd = 0, flags = 0;
- if (looping) {
- // the standard way to loop 8SVX audio implies use of the oneShotHiSamples and
- // repeatHiSamples fields, but Nippon Safes handles loops according to flags
- // set in its location scripts and always operates on the whole data.
- loopStart = 0;
- loopEnd = ch->header.oneShotHiSamples + ch->header.repeatHiSamples;
- flags = Audio::Mixer::FLAG_LOOP;
- }
+ Audio::AudioStream *input = loadChannelData(filename, ch, looping);
if (volume == -1) {
volume = ch->header.volume;
}
- _mixer->playRaw(Audio::Mixer::kSFXSoundType, &ch->handle, ch->data, ch->dataSize,
- ch->header.samplesPerSec, flags, -1, volume, 0, loopStart, loopEnd);
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &ch->handle, input, -1, volume);
}
void AmigaSoundMan_br::playMusic() {
diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp
index d0688c7264..b5ce54c78d 100644
--- a/engines/parallaction/sound_ns.cpp
+++ b/engines/parallaction/sound_ns.cpp
@@ -360,8 +360,9 @@ static int8 res_amigaBeep[AMIGABEEP_SIZE] = {
0, 20, 40, 60, 80, 60, 40, 20, 0, -20, -40, -60, -80, -60, -40, -20
};
+Audio::AudioStream *AmigaSoundMan_ns::loadChannelData(const char *filename, Channel *ch, bool looping) {
+ Audio::AudioStream *input = 0;
-void AmigaSoundMan_ns::loadChannelData(const char *filename, Channel *ch) {
if (!scumm_stricmp("beep", filename)) {
ch->header.oneShotHiSamples = 0;
ch->header.repeatHiSamples = 0;
@@ -376,14 +377,22 @@ void AmigaSoundMan_ns::loadChannelData(const char *filename, Channel *ch) {
}
ch->dataSize = AMIGABEEP_SIZE * NUM_REPEATS;
ch->dispose = true;
- return;
+
+ uint32 loopStart = 0, loopEnd = 0, flags = 0;
+ if (looping) {
+ loopEnd = ch->header.oneShotHiSamples + ch->header.repeatHiSamples;
+ flags = Audio::Mixer::FLAG_LOOP;
+ }
+
+ input = Audio::makeLinearInputStream((byte *)ch->data, ch->dataSize, ch->header.samplesPerSec, flags, loopStart, loopEnd);
+ } else {
+ Common::SeekableReadStream *stream = _vm->_disk->loadSound(filename);
+ input = Audio::make8SVXStream(*stream, looping);
+ ch->dispose = true;
+ delete stream;
}
- Common::SeekableReadStream *stream = _vm->_disk->loadSound(filename);
- Audio::A8SVXDecoder decoder(*stream, ch->header, ch->data, ch->dataSize);
- decoder.decode();
- ch->dispose = true;
- delete stream;
+ return input;
}
void AmigaSoundMan_ns::playSfx(const char *filename, uint channel, bool looping, int volume) {
@@ -397,27 +406,13 @@ void AmigaSoundMan_ns::playSfx(const char *filename, uint channel, bool looping,
debugC(1, kDebugAudio, "AmigaSoundMan_ns::playSfx(%s, %i)", filename, channel);
Channel *ch = &_channels[channel];
- loadChannelData(filename, ch);
-
- uint32 loopStart, loopEnd, flags;
- if (looping) {
- // the standard way to loop 8SVX audio implies use of the oneShotHiSamples and
- // repeatHiSamples fields, but Nippon Safes handles loops according to flags
- // set in its location scripts and always operates on the whole data.
- loopStart = 0;
- loopEnd = ch->header.oneShotHiSamples + ch->header.repeatHiSamples;
- flags = Audio::Mixer::FLAG_LOOP;
- } else {
- loopStart = loopEnd = 0;
- flags = 0;
- }
+ Audio::AudioStream *input = loadChannelData(filename, ch, looping);
if (volume == -1) {
volume = ch->header.volume;
}
- _mixer->playRaw(Audio::Mixer::kSFXSoundType, &ch->handle, ch->data, ch->dataSize,
- ch->header.samplesPerSec, flags, -1, volume, 0, loopStart, loopEnd);
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &ch->handle, input, -1, volume);
}
void AmigaSoundMan_ns::stopSfx(uint channel) {
diff --git a/sound/iff.cpp b/sound/iff.cpp
index de380276bb..bf3318d80e 100644
--- a/sound/iff.cpp
+++ b/sound/iff.cpp
@@ -26,58 +26,83 @@
#include "sound/iff.h"
#include "sound/audiostream.h"
#include "sound/mixer.h"
+#include "common/func.h"
namespace Audio {
-
-void A8SVXDecoder::readVHDR(Common::IFFChunk &chunk) {
- _header.oneShotHiSamples = chunk.readUint32BE();
- _header.repeatHiSamples = chunk.readUint32BE();
- _header.samplesPerHiCycle = chunk.readUint32BE();
- _header.samplesPerSec = chunk.readUint16BE();
- _header.octaves = chunk.readByte();
- _header.compression = chunk.readByte();
- _header.volume = chunk.readUint32BE();
+void Voice8Header::load(Common::ReadStream &stream) {
+ stream.read(this, sizeof(Voice8Header));
+ oneShotHiSamples = FROM_BE_32(oneShotHiSamples);
+ repeatHiSamples = FROM_BE_32(repeatHiSamples);
+ samplesPerHiCycle = FROM_BE_32(samplesPerHiCycle);
+ samplesPerSec = FROM_BE_16(samplesPerSec);
+ volume = FROM_BE_32(volume);
}
-void A8SVXDecoder::readBODY(Common::IFFChunk &chunk) {
-
- switch (_header.compression) {
- case 0:
- _dataSize = chunk.size;
- _data = (int8*)malloc(_dataSize);
- chunk.read(_data, _dataSize);
- break;
- case 1:
- warning("compressed IFF audio is not supported");
- break;
- }
-}
+struct A8SVXLoader {
+ Voice8Header _header;
+ int8 *_data;
+ uint32 _dataSize;
+ void load(Common::ReadStream &input) {
+ Common::IFFParser parser(input);
+ Common::IFFChunk *chunk;
+ while (chunk = parser.nextChunk()) {
+ callback(*chunk);
+ }
+ }
-A8SVXDecoder::A8SVXDecoder(Common::ReadStream &input, Voice8Header &header, int8 *&data, uint32 &dataSize) :
- IFFParser(input), _header(header), _data(data), _dataSize(dataSize) {
- if (_typeId != ID_8SVX)
- error("unknown audio format");
-}
+ bool callback(Common::IFFChunk &chunk) {
+ switch (chunk.id) {
+ case ID_VHDR:
+ _header.load(chunk);
+ break;
-void A8SVXDecoder::decode() {
+ case ID_BODY:
+ _dataSize = chunk.size;
+ _data = (int8*)malloc(_dataSize);
+ assert(_data);
+ loadData(&chunk);
+ return true;
+ }
- Common::IFFChunk *chunk;
+ return false;
+ }
- while ((chunk = nextChunk()) != 0) {
- switch (chunk->id) {
- case ID_VHDR:
- readVHDR(*chunk);
+ void loadData(Common::ReadStream *stream) {
+ switch (_header.compression) {
+ case 0:
+ stream->read(_data, _dataSize);
break;
- case ID_BODY:
- readBODY(*chunk);
+ case 1:
+ // implement other formats here
+ error("compressed IFF audio is not supported");
break;
}
+
+ }
+};
+
+
+AudioStream *make8SVXStream(Common::ReadStream &input, bool loop) {
+ A8SVXLoader loader;
+ loader.load(input);
+
+ uint32 loopStart = 0, loopEnd = 0, flags = 0;
+ if (loop) {
+ // the standard way to loop 8SVX audio implies use of the oneShotHiSamples and
+ // repeatHiSamples fields
+ loopStart = 0;
+ loopEnd = loader._header.oneShotHiSamples + loader._header.repeatHiSamples;
+ flags |= Audio::Mixer::FLAG_LOOP;
}
+
+ flags |= Audio::Mixer::FLAG_AUTOFREE;
+
+ return Audio::makeLinearInputStream((byte *)loader._data, loader._dataSize, loader._header.samplesPerSec, flags, loopStart, loopEnd);
}
}
diff --git a/sound/iff.h b/sound/iff.h
index 2bc8b51b82..82106cb75e 100644
--- a/sound/iff.h
+++ b/sound/iff.h
@@ -32,6 +32,7 @@
#define SOUND_IFF_H
#include "common/iff_container.h"
+#include "sound/audiostream.h"
namespace Audio {
@@ -47,34 +48,12 @@ struct Voice8Header {
Voice8Header() {
memset(this, 0, sizeof(Voice8Header));
}
-};
-
-
-/*
- A8SVX decoder reads 8SVX subtype of IFF files.
-
- TODO: make a factory function for this kind of stream?
- */
-class A8SVXDecoder : public Common::IFFParser {
-
-protected:
- Voice8Header &_header;
- int8* &_data;
- uint32 &_dataSize;
-protected:
- void readVHDR(Common::IFFChunk &chunk);
- void readBODY(Common::IFFChunk &chunk);
-
-public:
- A8SVXDecoder(Common::ReadStream &input, Voice8Header &header, int8 *&data, uint32 &dataSize);
- void decode();
+ void load(Common::ReadStream &stream);
};
+AudioStream *make8SVXStream(Common::ReadStream &stream, bool loop);
-/*
- TODO: Implement a parser for AIFF subtype.
- */
}
--
cgit v1.2.3
From 657e37985e79967b6fc3c51badb6fb669c6680dc Mon Sep 17 00:00:00 2001
From: Nicola Mettifogo
Date: Fri, 12 Jun 2009 07:55:44 +0000
Subject: Cleanup of sound code.
svn-id: r41461
---
engines/parallaction/disk_ns.cpp | 6 ----
engines/parallaction/sound.h | 26 +++++++----------
engines/parallaction/sound_br.cpp | 60 ++++++++++++++-------------------------
engines/parallaction/sound_ns.cpp | 46 +++++++++---------------------
4 files changed, 46 insertions(+), 92 deletions(-)
diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp
index a75decdf88..b002d1e1f5 100644
--- a/engines/parallaction/disk_ns.cpp
+++ b/engines/parallaction/disk_ns.cpp
@@ -29,12 +29,6 @@
#include "parallaction/parallaction.h"
-namespace Audio {
- class AudioStream;
-
- AudioStream *make8SVXStream(Common::ReadStream &input);
-}
-
namespace Parallaction {
diff --git a/engines/parallaction/sound.h b/engines/parallaction/sound.h
index 8a5582b378..8fcfb94a9a 100644
--- a/engines/parallaction/sound.h
+++ b/engines/parallaction/sound.h
@@ -84,6 +84,14 @@ enum {
SC_PAUSE
};
+struct Channel {
+ Audio::AudioStream *stream;
+ Audio::SoundHandle handle;
+ uint32 volume;
+};
+
+
+
class SoundMan_ns : public SoundManImpl {
public:
enum {
@@ -148,13 +156,7 @@ class AmigaSoundMan_ns : public SoundMan_ns {
Audio::AudioStream *_musicStream;
Audio::SoundHandle _musicHandle;
- struct Channel {
- Audio::Voice8Header header;
- int8 *data;
- uint32 dataSize;
- bool dispose;
- Audio::SoundHandle handle;
- } _channels[NUM_SFX_CHANNELS];
+ Channel _channels[NUM_SFX_CHANNELS];
Audio::AudioStream *loadChannelData(const char *filename, Channel *ch, bool looping);
@@ -191,18 +193,12 @@ protected:
bool _musicEnabled;
bool _sfxEnabled;
+ Channel _channels[NUM_SFX_CHANNELS];
+
virtual void playMusic() = 0;
virtual void stopMusic() = 0;
virtual void pause(bool p) = 0;
- struct Channel {
- Audio::Voice8Header header;
- int8 *data;
- uint32 dataSize;
- bool dispose;
- Audio::SoundHandle handle;
- } _channels[NUM_SFX_CHANNELS];
-
public:
SoundMan_br(Parallaction_br *vm);
~SoundMan_br();
diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp
index 464201b2d6..c0e3f3b24a 100644
--- a/engines/parallaction/sound_br.cpp
+++ b/engines/parallaction/sound_br.cpp
@@ -404,25 +404,26 @@ DosSoundMan_br::~DosSoundMan_br() {
Audio::AudioStream *DosSoundMan_br::loadChannelData(const char *filename, Channel *ch, bool looping) {
Common::SeekableReadStream *stream = _vm->_disk->loadSound(filename);
- ch->dataSize = stream->size();
- ch->data = (int8*)malloc(ch->dataSize);
- if (stream->read(ch->data, ch->dataSize) != ch->dataSize)
+ uint32 dataSize = stream->size();
+ int8 *data = (int8*)malloc(dataSize);
+ if (stream->read(data, dataSize) != dataSize)
error("DosSoundMan_br::loadChannelData: Read failed");
- ch->dispose = true;
delete stream;
// TODO: Confirm sound rate
- ch->header.samplesPerSec = 11025;
+ int rate = 11025;
+
+ uint32 loopStart = 0, loopEnd = 0;
+ uint32 flags = Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE;
- uint32 loopStart = 0, loopEnd = 0, flags = Audio::Mixer::FLAG_UNSIGNED;
if (looping) {
- loopEnd = ch->dataSize;
+ loopEnd = dataSize;
flags |= Audio::Mixer::FLAG_LOOP;
}
- // Create the input stream
- return Audio::makeLinearInputStream((byte *)ch->data, ch->dataSize, ch->header.samplesPerSec, flags, loopStart, loopEnd);
+ ch->stream = Audio::makeLinearInputStream((byte *)data, dataSize, rate, flags, loopStart, loopEnd);
+ return ch->stream;
}
void DosSoundMan_br::playSfx(const char *filename, uint channel, bool looping, int volume) {
@@ -474,26 +475,21 @@ Audio::AudioStream *AmigaSoundMan_br::loadChannelData(const char *filename, Chan
Audio::AudioStream *input = 0;
if (_vm->getFeatures() & GF_DEMO) {
- ch->dataSize = stream->size();
- ch->data = (int8*)malloc(ch->dataSize);
- if (stream->read(ch->data, ch->dataSize) != ch->dataSize)
+ uint32 dataSize = stream->size();
+ int8 *data = (int8*)malloc(dataSize);
+ if (stream->read(data, dataSize) != dataSize)
error("DosSoundMan_br::loadChannelData: Read failed");
// TODO: Confirm sound rate
- ch->header.samplesPerSec = 11025;
-
- uint32 loopStart = 0, loopEnd = 0, flags = 0;
- if (looping) {
- loopEnd = ch->header.oneShotHiSamples + ch->header.repeatHiSamples;
- flags = Audio::Mixer::FLAG_LOOP;
- }
-
- input = Audio::makeLinearInputStream((byte *)ch->data, ch->dataSize, ch->header.samplesPerSec, flags, loopStart, loopEnd);
+ int rate = 11025;
+ input = Audio::makeLinearInputStream((byte *)data, dataSize, rate, Audio::Mixer::FLAG_AUTOFREE, 0, 0);
} else {
input = Audio::make8SVXStream(*stream, looping);
- delete stream;
}
+ delete stream;
+
+ ch->stream = input;
return input;
}
@@ -515,7 +511,7 @@ void AmigaSoundMan_br::playSfx(const char *filename, uint channel, bool looping,
Audio::AudioStream *input = loadChannelData(filename, ch, looping);
if (volume == -1) {
- volume = ch->header.volume;
+ volume = ch->volume;
}
_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &ch->handle, input, -1, volume);
@@ -560,15 +556,6 @@ void AmigaSoundMan_br::pause(bool p) {
SoundMan_br::SoundMan_br(Parallaction_br *vm) : _vm(vm) {
_mixer = _vm->_mixer;
- _channels[0].data = 0;
- _channels[0].dispose = false;
- _channels[1].data = 0;
- _channels[1].dispose = false;
- _channels[2].data = 0;
- _channels[2].dispose = false;
- _channels[3].data = 0;
- _channels[3].dispose = false;
-
_musicEnabled = true;
_sfxEnabled = true;
}
@@ -595,12 +582,9 @@ void SoundMan_br::stopSfx(uint channel) {
return;
}
- if (_channels[channel].dispose) {
- debugC(1, kDebugAudio, "SoundMan_br::stopSfx(%i)", channel);
- _mixer->stopHandle(_channels[channel].handle);
- free(_channels[channel].data);
- _channels[channel].data = 0;
- }
+ debugC(1, kDebugAudio, "SoundMan_br::stopSfx(%i)", channel);
+ _mixer->stopHandle(_channels[channel].handle);
+ _channels[channel].stream = 0;
}
void SoundMan_br::execute(int command, const char *parm) {
diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp
index b5ce54c78d..65ee75ed98 100644
--- a/engines/parallaction/sound_ns.cpp
+++ b/engines/parallaction/sound_ns.cpp
@@ -335,14 +335,6 @@ void DosSoundMan_ns::playLocationMusic(const char *location) {
AmigaSoundMan_ns::AmigaSoundMan_ns(Parallaction_ns *vm) : SoundMan_ns(vm) {
_musicStream = 0;
- _channels[0].data = 0;
- _channels[0].dispose = false;
- _channels[1].data = 0;
- _channels[1].dispose = false;
- _channels[2].data = 0;
- _channels[2].dispose = false;
- _channels[3].data = 0;
- _channels[3].dispose = false;
}
AmigaSoundMan_ns::~AmigaSoundMan_ns() {
@@ -364,34 +356,25 @@ Audio::AudioStream *AmigaSoundMan_ns::loadChannelData(const char *filename, Chan
Audio::AudioStream *input = 0;
if (!scumm_stricmp("beep", filename)) {
- ch->header.oneShotHiSamples = 0;
- ch->header.repeatHiSamples = 0;
- ch->header.samplesPerHiCycle = 0;
- ch->header.samplesPerSec = 11934;
- ch->header.volume = 160;
- ch->data = (int8*)malloc(AMIGABEEP_SIZE * NUM_REPEATS);
- int8* odata = ch->data;
+ // TODO: make a permanent stream out of this
+ uint32 dataSize = AMIGABEEP_SIZE * NUM_REPEATS;
+ int8 *data = (int8*)malloc(dataSize);
+ int8 *odata = data;
for (uint i = 0; i < NUM_REPEATS; i++) {
memcpy(odata, res_amigaBeep, AMIGABEEP_SIZE);
odata += AMIGABEEP_SIZE;
}
- ch->dataSize = AMIGABEEP_SIZE * NUM_REPEATS;
- ch->dispose = true;
-
- uint32 loopStart = 0, loopEnd = 0, flags = 0;
- if (looping) {
- loopEnd = ch->header.oneShotHiSamples + ch->header.repeatHiSamples;
- flags = Audio::Mixer::FLAG_LOOP;
- }
-
- input = Audio::makeLinearInputStream((byte *)ch->data, ch->dataSize, ch->header.samplesPerSec, flags, loopStart, loopEnd);
+ int rate = 11934;
+ ch->volume = 160;
+ input = Audio::makeLinearInputStream((byte *)data, dataSize, rate, Audio::Mixer::FLAG_AUTOFREE, 0, 0);
} else {
Common::SeekableReadStream *stream = _vm->_disk->loadSound(filename);
input = Audio::make8SVXStream(*stream, looping);
- ch->dispose = true;
delete stream;
}
+ ch->stream = input;
+
return input;
}
@@ -409,7 +392,7 @@ void AmigaSoundMan_ns::playSfx(const char *filename, uint channel, bool looping,
Audio::AudioStream *input = loadChannelData(filename, ch, looping);
if (volume == -1) {
- volume = ch->header.volume;
+ volume = ch->volume;
}
_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &ch->handle, input, -1, volume);
@@ -421,12 +404,9 @@ void AmigaSoundMan_ns::stopSfx(uint channel) {
return;
}
- if (_channels[channel].dispose) {
- debugC(1, kDebugAudio, "AmigaSoundMan_ns::stopSfx(%i)", channel);
- _mixer->stopHandle(_channels[channel].handle);
- free(_channels[channel].data);
- _channels[channel].data = 0;
- }
+ debugC(1, kDebugAudio, "AmigaSoundMan_ns::stopSfx(%i)", channel);
+ _mixer->stopHandle(_channels[channel].handle);
+ _channels[channel].stream = 0;
}
void AmigaSoundMan_ns::playMusic() {
--
cgit v1.2.3
From b9017519fa1408311199bd0b41c271e35afee02c Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Fri, 12 Jun 2009 08:00:26 +0000
Subject: Rename KeyRemapper dialog to KeyMapper
svn-id: r41462
---
backends/keymapper/remap-dialog.cpp | 16 ++++++++--------
gui/themes/default.inc | 16 ++++++++--------
gui/themes/scummclassic.zip | Bin 53162 -> 53146 bytes
gui/themes/scummclassic/classic_layout.stx | 8 ++++----
gui/themes/scummclassic/classic_layout_lowres.stx | 8 ++++----
gui/themes/scummmodern.zip | Bin 157839 -> 157823 bytes
gui/themes/scummmodern/scummmodern_layout.stx | 8 ++++----
.../scummmodern/scummmodern_layout_lowres.stx | 8 ++++----
8 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp
index 8b0a5c2e36..0440acdd0a 100644
--- a/backends/keymapper/remap-dialog.cpp
+++ b/backends/keymapper/remap-dialog.cpp
@@ -39,17 +39,17 @@ enum {
};
RemapDialog::RemapDialog()
- : Dialog("KeyRemapper"), _keymapTable(0), _activeRemapAction(0), _topAction(0), _remapTimeout(0) {
+ : Dialog("KeyMapper"), _keymapTable(0), _activeRemapAction(0), _topAction(0), _remapTimeout(0) {
_keymapper = g_system->getEventManager()->getKeymapper();
assert(_keymapper);
- _kmPopUpDesc = new GUI::StaticTextWidget(this, "KeyRemapper.PopupDesc", "Keymap:");
- _kmPopUp = new GUI::PopUpWidget(this, "KeyRemapper.Popup");
+ _kmPopUpDesc = new GUI::StaticTextWidget(this, "KeyMapper.PopupDesc", "Keymap:");
+ _kmPopUp = new GUI::PopUpWidget(this, "KeyMapper.Popup");
_scrollBar = new GUI::ScrollBarWidget(this, 0, 0, 0, 0);
- new GUI::ButtonWidget(this, "KeyRemapper.Close", "Close", kCloseCmd);
+ new GUI::ButtonWidget(this, "KeyMapper.Close", "Close", kCloseCmd);
}
RemapDialog::~RemapDialog() {
@@ -138,12 +138,12 @@ void RemapDialog::reflowLayout() {
int16 areaX, areaY;
uint16 areaW, areaH;
- int spacing = g_gui.xmlEval()->getVar("Globals.KeyRemapper.Spacing");
- int labelWidth = g_gui.xmlEval()->getVar("Globals.KeyRemapper.LabelWidth");
- int buttonWidth = g_gui.xmlEval()->getVar("Globals.KeyRemapper.ButtonWidth");
+ int spacing = g_gui.xmlEval()->getVar("Globals.KeyMapper.Spacing");
+ int labelWidth = g_gui.xmlEval()->getVar("Globals.KeyMapper.LabelWidth");
+ int buttonWidth = g_gui.xmlEval()->getVar("Globals.KeyMapper.ButtonWidth");
int colWidth = labelWidth + buttonWidth + spacing;
- g_gui.xmlEval()->getWidgetData((const String&)String("KeyRemapper.KeymapArea"), areaX, areaY, areaW, areaH);
+ g_gui.xmlEval()->getWidgetData((const String&)String("KeyMapper.KeymapArea"), areaX, areaY, areaW, areaH);
_colCount = (areaW - scrollbarWidth) / colWidth;
_rowCount = (areaH + spacing) / (buttonHeight + spacing);
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index d23c7ff060..d2fe7dade5 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -334,9 +334,9 @@
" "
" "
" "
-" "
-" "
-" "
+" "
+" "
+" "
" "
" "
" "
-"