Skip to content

Commit

Permalink
TONY: Bugfixes for showing the credits screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed May 10, 2012
1 parent 82361a3 commit 724deb6
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
4 changes: 2 additions & 2 deletions engines/tony/custom.cpp
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions engines/tony/mpal/mpal.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion engines/tony/mpal/mpal.h
Expand Up @@ -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))


/****************************************************************************\
Expand Down
28 changes: 24 additions & 4 deletions engines/tony/window.cpp
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions engines/tony/window.h
Expand Up @@ -97,6 +97,7 @@ class RMWindow {

void CreateBWPrecalcTable(void);
void WipeEffect(Common::Rect &rcBoundEllipse);
void GetNewFrameWipe(byte *lpBuf, Common::Rect &rcBoundEllipse);

public:
RMWindow();
Expand Down

0 comments on commit 724deb6

Please sign in to comment.