aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2006-05-28 12:19:45 +0000
committerJohannes Schickel2006-05-28 12:19:45 +0000
commit1750be5b5a1dc8f89d786db143575e661bc3c11c (patch)
tree5c0bf705794b7fb9a0f68e5de63ca25852b1e2cf /engines
parentd5c74ee633fcedf706f72e3398256d4a19efd834 (diff)
downloadscummvm-rg350-1750be5b5a1dc8f89d786db143575e661bc3c11c.tar.gz
scummvm-rg350-1750be5b5a1dc8f89d786db143575e661bc3c11c.tar.bz2
scummvm-rg350-1750be5b5a1dc8f89d786db143575e661bc3c11c.zip
- makes Screen::getPagePtr private
- introduces Screen::getCPagePtr and Screen::getPageRect (which should ease the introduction of dirty rect handling) - moves KyraEngine::loadBitmap to Screen svn-id: r22716
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/kyra.cpp6
-rw-r--r--engines/kyra/kyra.h1
-rw-r--r--engines/kyra/kyra3.cpp12
-rw-r--r--engines/kyra/resource.cpp40
-rw-r--r--engines/kyra/saveload.cpp2
-rw-r--r--engines/kyra/scene.cpp4
-rw-r--r--engines/kyra/screen.cpp55
-rw-r--r--engines/kyra/screen.h8
-rw-r--r--engines/kyra/script_v1.cpp8
-rw-r--r--engines/kyra/seqplayer.cpp6
-rw-r--r--engines/kyra/sequences_v1.cpp38
-rw-r--r--engines/kyra/sound_adlib.cpp2
-rw-r--r--engines/kyra/staticres.cpp24
-rw-r--r--engines/kyra/wsamovie.cpp2
14 files changed, 116 insertions, 92 deletions
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp
index 0c121bdffd..827d3f5d63 100644
--- a/engines/kyra/kyra.cpp
+++ b/engines/kyra/kyra.cpp
@@ -430,7 +430,7 @@ int KyraEngine_v2::go() {
// Kyra2 goes here :)
loadPalette("palette.col", _screen->_currentPalette);
_screen->setScreenPalette(_screen->_currentPalette);
- loadBitmap("_playfld.cps", 0, 0, 0);
+ _screen->loadBitmap("_playfld.cps", 0, 0, 0);
_screen->updateScreen();
waitForEvent();
return 0;
@@ -451,7 +451,7 @@ void KyraEngine::startup() {
setCharactersPositions(i);
_animator->setCharactersHeight();
resetBrandonPoisonFlags();
- _maskBuffer = _screen->getPagePtr(5);
+ _maskBuffer = _screen->getMaskBuffer();
_screen->_curPage = 0;
// XXX
for (int i = 0; i < 0x0C; ++i) {
@@ -736,7 +736,7 @@ void KyraEngine::setupShapes123(const Shape *shapeTable, int endShape, int flags
uint8 newImage = shapeTable[i-123].imageIndex;
if (newImage != curImage && newImage != 0xFF) {
assert(_characterImageTable);
- loadBitmap(_characterImageTable[newImage], 8, 8, 0);
+ _screen->loadBitmap(_characterImageTable[newImage], 8, 8, 0);
curImage = newImage;
}
_shapes[4+i] = _screen->encodeShape(shapeTable[i-123].x<<3, shapeTable[i-123].y, shapeTable[i-123].w<<3, shapeTable[i-123].h, shapeFlags);
diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h
index f667c0615d..e3430a3031 100644
--- a/engines/kyra/kyra.h
+++ b/engines/kyra/kyra.h
@@ -296,7 +296,6 @@ public:
void delayUntil(uint32 timestamp, bool updateGameTimers = false, bool update = false, bool isMainLoop = false);
void delay(uint32 millis, bool update = false, bool isMainLoop = false);
void quitGame();
- void loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData);
void registerDefaultSettings();
void readSettings();
diff --git a/engines/kyra/kyra3.cpp b/engines/kyra/kyra3.cpp
index b44086ff3e..f303b1a5ca 100644
--- a/engines/kyra/kyra3.cpp
+++ b/engines/kyra/kyra3.cpp
@@ -161,7 +161,7 @@ void KyraEngine_v3::playVQA(const char *name) {
uint8 pal[768];
memcpy(pal, _screen->getPalette(0), sizeof(pal));
if (_screen->_curPage == 0)
- _screen->copyCurPageBlock(0, 0, 320, 200, _screen->getPagePtr(3));
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 0, 3);
_screen->hideMouse();
_soundDigital->beginFadeOut(_musicSoundChannel);
@@ -173,7 +173,7 @@ void KyraEngine_v3::playVQA(const char *name) {
_screen->showMouse();
if (_screen->_curPage == 0)
- _screen->copyBlockToPage(0, 0, 0, 320, 200, _screen->getPagePtr(3));
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 3, 0);
_screen->setScreenPalette(pal);
}
}
@@ -205,7 +205,11 @@ int KyraEngine_v3::handleMainMenu(WSAMovieV3 *logo) {
_screen->_charWidth = -2;
_screen->setScreenDim(3);
- _screen->copyCurPageBlock(_screen->_curDim->sx, _screen->_curDim->sy, _screen->_curDim->w, _screen->_curDim->h, _screen->getPagePtr(3));
+ int backUpX = _screen->_curDim->sx;
+ int backUpY = _screen->_curDim->sy;
+ int backUpWidth = _screen->_curDim->w;
+ int backUpHeight = _screen->_curDim->h;
+ _screen->copyRegion(backUpX, backUpY, backUpX, backUpY, backUpWidth, backUpHeight, 0, 3);
int x = _screen->_curDim->sx << 3;
int y = _screen->_curDim->sy;
@@ -250,7 +254,7 @@ int KyraEngine_v3::handleMainMenu(WSAMovieV3 *logo) {
if (_quitFlag)
command = -1;
- _screen->copyBlockToPage(_screen->_curPage, _screen->_curDim->sx, _screen->_curDim->sy, _screen->_curDim->w, _screen->_curDim->h, _screen->getPagePtr(3));
+ _screen->copyRegion(backUpX, backUpY, backUpX, backUpY, backUpWidth, backUpHeight, 3, 0);
_screen->_charWidth = charWidthBackUp;
_screen->setFont(oldFont);
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index c235f309d4..5cbf78c9b6 100644
--- a/engines/kyra/resource.cpp
+++ b/engines/kyra/resource.cpp
@@ -404,44 +404,4 @@ void KyraEngine::loadPalette(const char *filename, uint8 *palData) {
delete [] srcData;
}
-void KyraEngine::loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData) {
- debugC(9, kDebugLevelMain, "KyraEngine::loadBitmap('%s', %d, %d, %p)", filename, tempPage, dstPage, (void *)palData);
- uint32 fileSize;
- uint8 *srcData = _res->fileData(filename, &fileSize);
-
- if (!srcData) {
- warning("coudln't load bitmap: '%s'", filename);
- return;
- }
-
- uint8 compType = srcData[2];
- uint32 imgSize = READ_LE_UINT32(srcData + 4);
- uint16 palSize = READ_LE_UINT16(srcData + 8);
-
- if (palData && palSize) {
- debugC(9, kDebugLevelMain,"Loading a palette of size %i from %s", palSize, filename);
- memcpy(palData, srcData + 10, palSize);
- }
-
- uint8 *srcPtr = srcData + 10 + palSize;
- uint8 *dstData = _screen->getPagePtr(dstPage);
-
- switch (compType) {
- case 0:
- memcpy(dstData, srcPtr, imgSize);
- break;
- case 3:
- Screen::decodeFrame3(srcPtr, dstData, imgSize);
- break;
- case 4:
- Screen::decodeFrame4(srcPtr, dstData, imgSize);
- break;
- default:
- error("Unhandled bitmap compression %d", compType);
- break;
- }
-
- delete [] srcData;
-}
-
} // end of namespace Kyra
diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp
index d7deab6e77..b718b8826b 100644
--- a/engines/kyra/saveload.cpp
+++ b/engines/kyra/saveload.cpp
@@ -194,7 +194,7 @@ void KyraEngine::loadGame(const char *fileName) {
loadMainScreen(8);
if (queryGameFlag(0x2D)) {
- loadBitmap("AMULET3.CPS", 10, 10, 0);
+ _screen->loadBitmap("AMULET3.CPS", 10, 10, 0);
if (!queryGameFlag(0xF1)) {
for (int i = 0x55; i <= 0x5A; ++i) {
if (queryGameFlag(i)) {
diff --git a/engines/kyra/scene.cpp b/engines/kyra/scene.cpp
index 2d66874de5..a66de78789 100644
--- a/engines/kyra/scene.cpp
+++ b/engines/kyra/scene.cpp
@@ -446,7 +446,7 @@ void KyraEngine::loadSceneMSC() {
strcpy(fileNameBuffer, _roomFilenameTable[tableId]);
strcat(fileNameBuffer, ".MSC");
_screen->fillRect(0, 0, 319, 199, 0, 5);
- loadBitmap(fileNameBuffer, 3, 5, 0);
+ _screen->loadBitmap(fileNameBuffer, 3, 5, 0);
}
void KyraEngine::startSceneScript(int brandonAlive) {
@@ -457,7 +457,7 @@ void KyraEngine::startSceneScript(int brandonAlive) {
char fileNameBuffer[32];
strcpy(fileNameBuffer, _roomFilenameTable[tableId]);
strcat(fileNameBuffer, ".CPS");
- loadBitmap(fileNameBuffer, 3, 3, 0);
+ _screen->loadBitmap(fileNameBuffer, 3, 3, 0);
_sprites->loadSceneShapes();
_exitListPtr = 0;
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index f18efa6a4c..3484a05cf8 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -26,6 +26,7 @@
#include "graphics/cursorman.h"
#include "kyra/screen.h"
#include "kyra/kyra.h"
+#include "kyra/resource.h"
namespace Kyra {
@@ -135,9 +136,23 @@ void Screen::updateScreen() {
uint8 *Screen::getPagePtr(int pageNum) {
debugC(9, kDebugLevelScreen, "Screen::getPagePtr(%d)", pageNum);
assert(pageNum < SCREEN_PAGE_NUM);
+ // if pageNum == 0 wholeScreenDirty
return _pagePtrs[pageNum];
}
+const uint8 *Screen::getCPagePtr(int pageNum) const {
+ debugC(9, kDebugLevelScreen, "Screen::getCPagePtr(%d)", pageNum);
+ assert(pageNum < SCREEN_PAGE_NUM);
+ return _pagePtrs[pageNum];
+}
+
+uint8 *Screen::getPageRect(int pageNum, int x, int y, int w, int h) {
+ debugC(9, kDebugLevelScreen, "Screen::getPageRect(%d, %d, %d, %d, %d)", pageNum, x, y, w, h);
+ assert(pageNum < SCREEN_PAGE_NUM);
+ // if pageNum == 0 rectDirty(x, y, w, h)
+ return _pagePtrs[pageNum] + y * SCREEN_W + x;
+}
+
void Screen::clearPage(int pageNum) {
debugC(9, kDebugLevelScreen, "Screen::clearPage(%d)", pageNum);
assert(pageNum < SCREEN_PAGE_NUM);
@@ -2161,4 +2176,44 @@ void Screen::shakeScreen(int times) {
}
}
+void Screen::loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData) {
+ debugC(9, kDebugLevelScreen, "KyraEngine::loadBitmap('%s', %d, %d, %p)", filename, tempPage, dstPage, (void *)palData);
+ uint32 fileSize;
+ uint8 *srcData = _vm->resource()->fileData(filename, &fileSize);
+
+ if (!srcData) {
+ warning("coudln't load bitmap: '%s'", filename);
+ return;
+ }
+
+ uint8 compType = srcData[2];
+ uint32 imgSize = READ_LE_UINT32(srcData + 4);
+ uint16 palSize = READ_LE_UINT16(srcData + 8);
+
+ if (palData && palSize) {
+ debugC(9, kDebugLevelMain,"Loading a palette of size %i from %s", palSize, filename);
+ memcpy(palData, srcData + 10, palSize);
+ }
+
+ uint8 *srcPtr = srcData + 10 + palSize;
+ uint8 *dstData = getPagePtr(dstPage);
+
+ switch (compType) {
+ case 0:
+ memcpy(dstData, srcPtr, imgSize);
+ break;
+ case 3:
+ Screen::decodeFrame3(srcPtr, dstData, imgSize);
+ break;
+ case 4:
+ Screen::decodeFrame4(srcPtr, dstData, imgSize);
+ break;
+ default:
+ error("Unhandled bitmap compression %d", compType);
+ break;
+ }
+
+ delete [] srcData;
+}
+
} // End of namespace Kyra
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index 0b6426847c..2c7140a0e1 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -92,7 +92,8 @@ public:
bool init();
void updateScreen();
- uint8 *getPagePtr(int pageNum);
+ const uint8 *getCPagePtr(int pageNum) const;
+ uint8 *getPageRect(int pageNum, int x, int y, int w, int h);
void clearPage(int pageNum);
int setCurPage(int pageNum);
void clearCurPage();
@@ -135,6 +136,9 @@ public:
static void decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch, int noXor);
uint8 *encodeShape(int x, int y, int w, int h, int flags);
void copyRegionToBuffer(int pageNum, int x, int y, int w, int h, uint8 *dest);
+ void loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData);
+
+ uint8 *getMaskBuffer() { return getPagePtr(5); }
void shakeScreen(int times);
@@ -186,6 +190,8 @@ public:
static const ScreenDim _screenDimTableK3[];
static const int _screenDimTableCountK3;
private:
+ uint8 *getPagePtr(int pageNum);
+
int16 encodeShapeAndCalculateSize(uint8 *from, uint8 *to, int size);
void restoreMouseRect();
void copyMouseToScreen();
diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp
index 9ab89c28ea..72d02df7e7 100644
--- a/engines/kyra/script_v1.cpp
+++ b/engines/kyra/script_v1.cpp
@@ -1061,14 +1061,14 @@ int KyraEngine::cmd_specialEventDisplayBrynnsNote(ScriptState *script) {
_screen->savePageToDisk("SEENPAGE.TMP", 0);
if (_features & GF_TALKIE) {
if (_features & GF_ENGLISH) {
- loadBitmap("NOTEENG.CPS", 3, 3, 0);
+ _screen->loadBitmap("NOTEENG.CPS", 3, 3, 0);
} else if (_features & GF_FRENCH) {
- loadBitmap("NOTEFRE.CPS", 3, 3, 0);
+ _screen->loadBitmap("NOTEFRE.CPS", 3, 3, 0);
} else if (_features & GF_GERMAN) {
- loadBitmap("NOTEGER.CPS", 3, 3, 0);
+ _screen->loadBitmap("NOTEGER.CPS", 3, 3, 0);
}
} else {
- loadBitmap("NOTE.CPS", 3, 3, 0);
+ _screen->loadBitmap("NOTE.CPS", 3, 3, 0);
}
_screen->copyRegion(63, 8, 63, 8, 194, 128, 2, 0);
_screen->updateScreen();
diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp
index c9416bf3e7..15cec11477 100644
--- a/engines/kyra/seqplayer.cpp
+++ b/engines/kyra/seqplayer.cpp
@@ -70,7 +70,7 @@ SeqPlayer::~SeqPlayer() {
uint8 *SeqPlayer::setPanPages(int pageNum, int shape) {
debugC( 9, kDebugLevelSequence, "SeqPlayer::setPanPages(%d, %d)", pageNum, shape);
uint8 *panPage = 0;
- const uint8 *data = _screen->getPagePtr(pageNum);
+ const uint8 *data = _screen->getCPagePtr(pageNum);
uint16 numShapes = READ_LE_UINT16(data);
if (shape < numShapes) {
uint32 offs = 0;
@@ -93,7 +93,7 @@ uint8 *SeqPlayer::setPanPages(int pageNum, int shape) {
void SeqPlayer::makeHandShapes() {
debugC( 9, kDebugLevelSequence, "SeqPlayer::makeHandShapes()");
- _vm->loadBitmap("WRITING.CPS", 3, 3, 0);
+ _screen->loadBitmap("WRITING.CPS", 3, 3, 0);
for (int i = 0; i < ARRAYSIZE(_handShapes); ++i) {
if (_handShapes[i])
free(_handShapes[i]);
@@ -243,7 +243,7 @@ void SeqPlayer::s1_loadPalette() {
void SeqPlayer::s1_loadBitmap() {
uint8 cpsNum = *_seqData++;
- _vm->loadBitmap(_vm->seqCPSTable()[cpsNum], 3, 3, 0);
+ _screen->loadBitmap(_vm->seqCPSTable()[cpsNum], 3, 3, 0);
}
void SeqPlayer::s1_fadeToBlack() {
diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_v1.cpp
index f0d71884dd..17e85942a1 100644
--- a/engines/kyra/sequences_v1.cpp
+++ b/engines/kyra/sequences_v1.cpp
@@ -40,19 +40,19 @@ void KyraEngine::seq_demo() {
snd_playTheme(MUSIC_INTRO, 2);
- loadBitmap("START.CPS", 7, 7, _screen->_currentPalette);
+ _screen->loadBitmap("START.CPS", 7, 7, _screen->_currentPalette);
_screen->copyRegion(0, 0, 0, 0, 320, 200, 6, 0);
- _system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200);
+ _screen->updateScreen();
_screen->fadeFromBlack();
delay(60 * _tickLength);
_screen->fadeToBlack();
_screen->clearPage(0);
- loadBitmap("TOP.CPS", 7, 7, NULL);
- loadBitmap("BOTTOM.CPS", 5, 5, _screen->_currentPalette);
+ _screen->loadBitmap("TOP.CPS", 7, 7, NULL);
+ _screen->loadBitmap("BOTTOM.CPS", 5, 5, _screen->_currentPalette);
_screen->copyRegion(0, 91, 0, 8, 320, 103, 6, 0);
_screen->copyRegion(0, 0, 0, 111, 320, 64, 6, 0);
- _system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200);
+ _screen->updateScreen();
_screen->fadeFromBlack();
_seq->playSequence(_seq_WestwoodLogo, true);
@@ -75,10 +75,10 @@ void KyraEngine::seq_demo() {
_seq->playSequence(_seq_Demo4, true);
_screen->clearPage(0);
- loadBitmap("FINAL.CPS", 7, 7, _screen->_currentPalette);
+ _screen->loadBitmap("FINAL.CPS", 7, 7, _screen->_currentPalette);
_screen->_curPage = 0;
_screen->copyRegion(0, 0, 0, 0, 320, 200, 6, 0);
- _system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200);
+ _screen->updateScreen();
_screen->fadeFromBlack();
delay(60 * _tickLength);
_screen->fadeToBlack();
@@ -127,12 +127,12 @@ void KyraEngine::seq_intro() {
void KyraEngine::seq_introLogos() {
debugC(9, kDebugLevelMain, "KyraEngine::seq_introLogos()");
_screen->clearPage(0);
- loadBitmap("TOP.CPS", 7, 7, NULL);
- loadBitmap("BOTTOM.CPS", 5, 5, _screen->_currentPalette);
+ _screen->loadBitmap("TOP.CPS", 7, 7, NULL);
+ _screen->loadBitmap("BOTTOM.CPS", 5, 5, _screen->_currentPalette);
_screen->_curPage = 0;
_screen->copyRegion(0, 91, 0, 8, 320, 103, 6, 0);
_screen->copyRegion(0, 0, 0, 111, 320, 64, 6, 0);
- _system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200);
+ _screen->updateScreen();
_screen->fadeFromBlack();
if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag)) {
@@ -186,15 +186,15 @@ void KyraEngine::seq_introStory() {
if (_features & GF_TALKIE) {
return;
} else if (_features & GF_ENGLISH) {
- loadBitmap("TEXT.CPS", 3, 3, 0);
+ _screen->loadBitmap("TEXT.CPS", 3, 3, 0);
} else if (_features & GF_GERMAN) {
- loadBitmap("TEXT_GER.CPS", 3, 3, 0);
+ _screen->loadBitmap("TEXT_GER.CPS", 3, 3, 0);
} else if (_features & GF_FRENCH) {
- loadBitmap("TEXT_FRE.CPS", 3, 3, 0);
+ _screen->loadBitmap("TEXT_FRE.CPS", 3, 3, 0);
} else if (_features & GF_SPANISH) {
- loadBitmap("TEXT_SPA.CPS", 3, 3, 0);
+ _screen->loadBitmap("TEXT_SPA.CPS", 3, 3, 0);
} else if (_features & GF_ITALIAN) {
- loadBitmap("TEXT_ITA.CPS", 3, 3, 0);
+ _screen->loadBitmap("TEXT_ITA.CPS", 3, 3, 0);
} else {
warning("no story graphics file found");
}
@@ -950,7 +950,7 @@ int KyraEngine::seq_playEnd() {
_screen->hideMouse();
_screen->fadeSpecialPalette(32, 228, 20, 60);
delay(60 * _tickLength);
- loadBitmap("GEMHEAL.CPS", 3, 3, _screen->_currentPalette);
+ _screen->loadBitmap("GEMHEAL.CPS", 3, 3, _screen->_currentPalette);
_screen->setScreenPalette(_screen->_currentPalette);
_screen->shuffleScreen(8, 8, 304, 128, 2, 0, 1, 0);
uint32 nextTime = _system->getMillis() + 120 * _tickLength;
@@ -1009,7 +1009,7 @@ void KyraEngine::seq_playEnding() {
_screen->hideMouse();
_screen->_curPage = 0;
_screen->fadeToBlack();
- loadBitmap("REUNION.CPS", 3, 3, _screen->_currentPalette);
+ _screen->loadBitmap("REUNION.CPS", 3, 3, _screen->_currentPalette);
_screen->copyRegion(8, 8, 8, 8, 304, 128, 2, 0);
_screen->_curPage = 0;
// XXX
@@ -1047,7 +1047,7 @@ void KyraEngine::seq_playCredits() {
} else
_screen->setFont(Screen::FID_8_FNT);
- loadBitmap("CHALET.CPS", 4, 4, _screen->_currentPalette);
+ _screen->loadBitmap("CHALET.CPS", 4, 4, _screen->_currentPalette);
_screen->setScreenPalette(_screen->_currentPalette);
_screen->setCurPage(0);
@@ -1632,7 +1632,7 @@ int KyraEngine::processBead(int x, int y, int &x2, int &y2, BeadState *ptr) {
void KyraEngine::setupPanPages() {
debugC(9, kDebugLevelMain, "KyraEngine::setupPanPages()");
- loadBitmap("bead.cps", 3, 3, 0);
+ _screen->loadBitmap("BEAD.CPS", 3, 3, 0);
for (int i = 0; i <= 19; ++i) {
_panPagesTable[i] = _seq->setPanPages(3, i);
}
diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp
index e4406d5453..79eb187dc5 100644
--- a/engines/kyra/sound_adlib.cpp
+++ b/engines/kyra/sound_adlib.cpp
@@ -1962,7 +1962,7 @@ void AdlibDriver::setupParserOpcodeTable() {
_parserOpcodeTable = parserOpcodeTable;
_parserOpcodeTableSize = ARRAYSIZE(parserOpcodeTable);
-};
+}
#undef COMMAND
// This table holds the register offset for operator 1 for each of the nine
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 39baa7e088..1a61174e4a 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -631,7 +631,7 @@ void KyraEngine::initStaticResource() {
}
void KyraEngine::loadMouseShapes() {
- loadBitmap("MOUSE.CPS", 3, 3, 0);
+ _screen->loadBitmap("MOUSE.CPS", 3, 3, 0);
_screen->_curPage = 2;
_shapes[4] = _screen->encodeShape(0, 0, 8, 10, 0);
_shapes[5] = _screen->encodeShape(0, 0x17, 0x20, 7, 0);
@@ -659,7 +659,7 @@ void KyraEngine::loadCharacterShapes() {
}
if (shape->imageIndex != curImage) {
assert(shape->imageIndex < _characterImageTableSize);
- loadBitmap(_characterImageTable[shape->imageIndex], 3, 3, 0);
+ _screen->loadBitmap(_characterImageTable[shape->imageIndex], 3, 3, 0);
curImage = shape->imageIndex;
}
_shapes[i+7+4] = _screen->encodeShape(shape->x<<3, shape->y, shape->w<<3, shape->h, 1);
@@ -668,7 +668,7 @@ void KyraEngine::loadCharacterShapes() {
}
void KyraEngine::loadSpecialEffectShapes() {
- loadBitmap("EFFECTS.CPS", 3, 3, 0);
+ _screen->loadBitmap("EFFECTS.CPS", 3, 3, 0);
_screen->_curPage = 2;
int currShape;
@@ -688,7 +688,7 @@ void KyraEngine::loadSpecialEffectShapes() {
void KyraEngine::loadItems() {
int shape;
- loadBitmap("JEWELS3.CPS", 3, 3, 0);
+ _screen->loadBitmap("JEWELS3.CPS", 3, 3, 0);
_screen->_curPage = 2;
_shapes[327] = 0;
@@ -715,7 +715,7 @@ void KyraEngine::loadItems() {
_shapes[4 + shape] = _screen->encodeShape((shape-355) * 32, 85, 32, 17, 0);
- loadBitmap("ITEMS.CPS", 3, 3, 0);
+ _screen->loadBitmap("ITEMS.CPS", 3, 3, 0);
_screen->_curPage = 2;
for (int i = 0; i < 107; i++) {
@@ -740,7 +740,7 @@ void KyraEngine::loadItems() {
}
void KyraEngine::loadButtonShapes() {
- loadBitmap("BUTTONS2.CPS", 3, 3, 0);
+ _screen->loadBitmap("BUTTONS2.CPS", 3, 3, 0);
_screen->_curPage = 2;
_scrollUpButton.process0PtrShape = _screen->encodeShape(0, 0, 24, 14, 1);
_scrollUpButton.process1PtrShape = _screen->encodeShape(24, 0, 24, 14, 1);
@@ -755,17 +755,17 @@ void KyraEngine::loadMainScreen(int page) {
_screen->clearPage(page);
if ((_features & GF_ENGLISH) && (_features & GF_FLOPPY))
- loadBitmap("MAIN15.CPS", page, page, 0);
+ _screen->loadBitmap("MAIN15.CPS", page, page, 0);
else if ((_features & GF_ENGLISH) && (_features & GF_TALKIE))
- loadBitmap("MAIN_ENG.CPS", page, page, 0);
+ _screen->loadBitmap("MAIN_ENG.CPS", page, page, 0);
else if(_features & GF_FRENCH)
- loadBitmap("MAIN_FRE.CPS", page, page, 0);
+ _screen->loadBitmap("MAIN_FRE.CPS", page, page, 0);
else if(_features & GF_GERMAN)
- loadBitmap("MAIN_GER.CPS", page, page, 0);
+ _screen->loadBitmap("MAIN_GER.CPS", page, page, 0);
else if (_features & GF_SPANISH)
- loadBitmap("MAIN_SPA.CPS", page, page, 0);
+ _screen->loadBitmap("MAIN_SPA.CPS", page, page, 0);
else if (_features & GF_ITALIAN)
- loadBitmap("MAIN_ITA.CPS", page, page, 0);
+ _screen->loadBitmap("MAIN_ITA.CPS", page, page, 0);
else
warning("no main graphics file found");
diff --git a/engines/kyra/wsamovie.cpp b/engines/kyra/wsamovie.cpp
index 165da86a6d..6e2a2888c9 100644
--- a/engines/kyra/wsamovie.cpp
+++ b/engines/kyra/wsamovie.cpp
@@ -130,7 +130,7 @@ void WSAMovieV1::displayFrame(int frameNum) {
if (_flags & WF_OFFSCREEN_DECODE) {
dst = _offscreenBuffer;
} else {
- dst = _vm->screen()->getPagePtr(_drawPage) + _y * Screen::SCREEN_W + _x;
+ dst = _vm->screen()->getPageRect(_drawPage, _x, _y, _width, _height);
}
if (_currentFrame == _numFrames) {