diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index c82d0fcd2b9..5089914d88f 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 da736a138f7..e82df113288 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 9a85f2df17c..cd46219b575 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 f68c6129115..18dcfb7cb6b 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 5190fc4d16a..06f684a15b4 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();