diff options
author | Paul Gilbert | 2012-05-11 08:44:50 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-05-11 08:44:50 +1000 |
commit | 724deb6b84b8a5f5a3aa96adc2a512c962f7081a (patch) | |
tree | dbae3811dfe14c39e75c782ada6f89b27ea52d42 | |
parent | 82361a3ea3efb9b6454eb4805e777cd4bfc3a0e3 (diff) | |
download | scummvm-rg350-724deb6b84b8a5f5a3aa96adc2a512c962f7081a.tar.gz scummvm-rg350-724deb6b84b8a5f5a3aa96adc2a512c962f7081a.tar.bz2 scummvm-rg350-724deb6b84b8a5f5a3aa96adc2a512c962f7081a.zip |
TONY: Bugfixes for showing the credits screen.
-rw-r--r-- | engines/tony/custom.cpp | 4 | ||||
-rw-r--r-- | engines/tony/mpal/mpal.cpp | 4 | ||||
-rw-r--r-- | engines/tony/mpal/mpal.h | 2 | ||||
-rw-r--r-- | engines/tony/window.cpp | 28 | ||||
-rw-r--r-- | engines/tony/window.h | 1 |
5 files changed, 30 insertions, 9 deletions
diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index c82d0fcd2b..5089914d88 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2615,10 +2615,10 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods(); _ctx->i++) { _ctx->text[_ctx->i].SetInput(Input); - // Allineamento + // Alignment if ((*_ctx->msg)[_ctx->i][0] == '@') { _ctx->text[_ctx->i].SetAlignType(RMText::HCENTER, RMText::VTOP); - _ctx->text[_ctx->i].WriteText(_ctx->msg[_ctx->i][1], 3); + _ctx->text[_ctx->i].WriteText(&(*_ctx->msg)[_ctx->i][1], 3); _ctx->text[_ctx->i].SetPosition(RMPoint(414, 70 + _ctx->i * 26)); // 70 } else { _ctx->text[_ctx->i].SetAlignType(RMText::HLEFT,RMText::VTOP); diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp index da736a138f..e82df11328 100644 --- a/engines/tony/mpal/mpal.cpp +++ b/engines/tony/mpal/mpal.cpp @@ -422,7 +422,7 @@ static int locGetOrderFromNum(uint32 nLoc) { static int msgGetOrderFromNum(uint32 nMsg) { int i; - LPMPALMSG msg=lpmmMsgs; + LPMPALMSG msg = lpmmMsgs; for (i = 0; i < nMsgs; i++, msg++) if (msg->wNum == nMsg) @@ -542,7 +542,7 @@ static char *DuplicateMessage(uint32 nMsgOrd) { origmsg = (const char *)GlobalLock(lpmmMsgs[nMsgOrd].hText); j = 0; - while (origmsg[j] != '\0' || origmsg[j+1] != '\0') + while (origmsg[j] != '\0' || origmsg[j + 1] != '\0') j++; j += 2; diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 9a85f2df17..cd46219b57 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -566,7 +566,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryDoDialog(nDialog,nGroup) \ - mpalQueryHANDLE(MPQ_DO_DIALOG, (uint32)(nDialog),(uint32)(nGroup)) + mpalQueryDWORD(MPQ_DO_DIALOG, (uint32)(nDialog),(uint32)(nGroup)) /****************************************************************************\ diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp index f68c612911..18dcfb7cb6 100644 --- a/engines/tony/window.cpp +++ b/engines/tony/window.cpp @@ -128,12 +128,32 @@ void RMWindow::WipeEffect(Common::Rect &rcBoundEllipse) { } void RMWindow::GetNewFrame(byte *lpBuf, Common::Rect *rcBoundEllipse) { - Common::Rect bounds = (rcBoundEllipse) ? *rcBoundEllipse : Common::Rect(0, 0, RM_SX, RM_SY); - - // Update a screen section - g_system->copyRectToScreen(lpBuf, RM_SX * 2, bounds.left, bounds.top, bounds.width(), bounds.height()); + if (rcBoundEllipse != NULL) { + // Circular wipe effect + GetNewFrameWipe(lpBuf, *rcBoundEllipse); + } else { + // Standard screen copy + g_system->copyRectToScreen(lpBuf, RM_SX * 2, 0, 0, RM_SX, RM_SY); + } } +/** + * Copies a section of the game frame in a circle bounded by the specified rectangle + */ +void RMWindow::GetNewFrameWipe(byte *lpBuf, Common::Rect &rcBoundEllipse) { + // Clear the screen + g_system->fillScreen(0); + + if (!rcBoundEllipse.isValidRect()) + return; + + // TODO: Do a proper circular wipe + for (int yp = rcBoundEllipse.top; yp < rcBoundEllipse.bottom; ++yp) { + const byte *pSrc = lpBuf + (yp * RM_SX * 2) + rcBoundEllipse.left * 2; + + g_system->copyRectToScreen(pSrc, RM_SX * 2, rcBoundEllipse.left, yp, rcBoundEllipse.width(), 1); + } +} /****************************************************************************\ * RMSnapshot Methods diff --git a/engines/tony/window.h b/engines/tony/window.h index 5190fc4d16..06f684a15b 100644 --- a/engines/tony/window.h +++ b/engines/tony/window.h @@ -97,6 +97,7 @@ protected: void CreateBWPrecalcTable(void); void WipeEffect(Common::Rect &rcBoundEllipse); + void GetNewFrameWipe(byte *lpBuf, Common::Rect &rcBoundEllipse); public: RMWindow(); |