Merge branch 'tony' into tony

This commit is contained in:
Paul Gilbert 2012-06-07 20:52:57 +10:00
commit 8f93c7be16
21 changed files with 1682 additions and 1693 deletions

View file

@ -109,7 +109,7 @@ const char *staccFileNames[] = {
void ReapplyChangedHotspot(void) { void ReapplyChangedHotspot(void) {
int i; int i;
for (i = 0; i < GLOBALS.curChangedHotspot; i++) for (i = 0; i < GLOBALS.curChangedHotspot; i++)
GLOBALS.Loc->GetItemFromCode(GLOBALS.ChangedHotspot[i].dwCode)->ChangeHotspot(RMPoint(GLOBALS.ChangedHotspot[i].nX, GLOBALS.ChangedHotspot[i].nY)); GLOBALS.Loc->getItemFromCode(GLOBALS.ChangedHotspot[i].dwCode)->changeHotspot(RMPoint(GLOBALS.ChangedHotspot[i].nX, GLOBALS.ChangedHotspot[i].nY));
} }
void SaveChangedHotspot(Common::OutSaveFile *f) { void SaveChangedHotspot(Common::OutSaveFile *f) {
@ -141,9 +141,9 @@ void LoadChangedHotspot(Common::InSaveFile *f) {
*/ */
void MCharResetCodes(void) { void MCharResetCodes(void) {
for (int i = 0; i < 10; i++) for (int i = 0; i < 10; i++)
GLOBALS.MCharacter[i].item = GLOBALS.Loc->GetItemFromCode(GLOBALS.MCharacter[i].code); GLOBALS.MCharacter[i].item = GLOBALS.Loc->getItemFromCode(GLOBALS.MCharacter[i].code);
for (int i = 0; i < 10; i++) for (int i = 0; i < 10; i++)
GLOBALS.Character[i].item = GLOBALS.Loc->GetItemFromCode(GLOBALS.Character[i].code); GLOBALS.Character[i].item = GLOBALS.Loc->getItemFromCode(GLOBALS.Character[i].code);
} }
void CharsSaveAll(Common::OutSaveFile *f) { void CharsSaveAll(Common::OutSaveFile *f) {
@ -168,19 +168,19 @@ void CharsLoadAll(Common::InSaveFile *f) {
} }
DECLARE_CUSTOM_FUNCTION(FaceToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(FaceToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_STANDDOWN); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_STANDDOWN);
} }
DECLARE_CUSTOM_FUNCTION(BackToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(BackToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_STANDUP); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_STANDUP);
} }
DECLARE_CUSTOM_FUNCTION(LeftToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(LeftToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_STANDLEFT); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_STANDLEFT);
} }
DECLARE_CUSTOM_FUNCTION(RightToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(RightToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_STANDRIGHT); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_STANDRIGHT);
} }
@ -263,8 +263,8 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX
if (GLOBALS.bSkipIdle) return; if (GLOBALS.bSkipIdle) return;
_ctx->msg.Load(dwMessage); _ctx->msg.load(dwMessage);
if (!_ctx->msg.IsValid()) { if (!_ctx->msg.isValid()) {
return; return;
} }
@ -285,15 +285,15 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX
} }
if (GLOBALS.nTonyNextTalkType != GLOBALS.Tony->TALK_NORMAL) { if (GLOBALS.nTonyNextTalkType != GLOBALS.Tony->TALK_NORMAL) {
CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.nTonyNextTalkType); CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.nTonyNextTalkType);
if (!GLOBALS.bStaticTalk) if (!GLOBALS.bStaticTalk)
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL;
} else { } else {
if (_ctx->msg.NumPeriods() > 1) if (_ctx->msg.numPeriods() > 1)
CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.Tony->TALK_FIANCHI); CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.Tony->TALK_FIANCHI);
else else
CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.Tony->TALK_NORMAL); CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.Tony->TALK_NORMAL);
} }
if (GLOBALS.curBackText) if (GLOBALS.curBackText)
@ -301,7 +301,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX
GLOBALS.bTonyIsSpeaking = true; GLOBALS.bTonyIsSpeaking = true;
for (_ctx->i = 0; _ctx->i < _ctx->msg.NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { for (_ctx->i = 0; _ctx->i < _ctx->msg.numPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) {
_ctx->text.setInput(GLOBALS.Input); _ctx->text.setInput(GLOBALS.Input);
// Alignment // Alignment
@ -315,9 +315,9 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX
// Set the position // Set the position
if (nX == 0 && nY == 0) if (nX == 0 && nY == 0)
_ctx->text.setPosition(GLOBALS.Tony->Position() - RMPoint(0, 130) - GLOBALS.Loc->ScrollPosition()); _ctx->text.setPosition(GLOBALS.Tony->position() - RMPoint(0, 130) - GLOBALS.Loc->scrollPosition());
else else
_ctx->text.setPosition(RMPoint(nX, nY) - GLOBALS.Loc->ScrollPosition()); _ctx->text.setPosition(RMPoint(nX, nY) - GLOBALS.Loc->scrollPosition());
// Handling for always display // Handling for always display
if (GLOBALS.bAlwaysDisplay) { if (GLOBALS.bAlwaysDisplay) {
@ -359,13 +359,13 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX
if (GLOBALS.curBackText) if (GLOBALS.curBackText)
GLOBALS.curBackText->show(); GLOBALS.curBackText->show();
CORO_INVOKE_0(GLOBALS.Tony->EndTalk); CORO_INVOKE_0(GLOBALS.Tony->endTalk);
CORO_END_CODE; CORO_END_CODE;
} }
DECLARE_CUSTOM_FUNCTION(ChangeBoxStatus)(CORO_PARAM, uint32 nLoc, uint32 nBox, uint32 nStatus, uint32) { DECLARE_CUSTOM_FUNCTION(ChangeBoxStatus)(CORO_PARAM, uint32 nLoc, uint32 nBox, uint32 nStatus, uint32) {
GLOBALS.Boxes->ChangeBoxStatus(nLoc, nBox, nStatus); GLOBALS.Boxes->changeBoxStatus(nLoc, nBox, nStatus);
} }
@ -408,16 +408,16 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32
_ctx->msg = new RMMessage(nMsg); _ctx->msg = new RMMessage(nMsg);
GLOBALS.SFM_nLoc = GLOBALS.Loc->TEMPGetNumLoc(); GLOBALS.SFM_nLoc = GLOBALS.Loc->TEMPGetNumLoc();
GLOBALS.SFM_pt = GLOBALS.Tony->Position(); GLOBALS.SFM_pt = GLOBALS.Tony->position();
if (GLOBALS.bSkipIdle) if (GLOBALS.bSkipIdle)
return; return;
CORO_INVOKE_2(GLOBALS.UnloadLocation, false, NULL); CORO_INVOKE_2(GLOBALS.UnloadLocation, false, NULL);
GLOBALS.Tony->Hide(); GLOBALS.Tony->hide();
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { for (_ctx->i = 0; _ctx->i < _ctx->msg->numPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) {
_ctx->text.setInput(GLOBALS.Input); _ctx->text.setInput(GLOBALS.Input);
// Alignment // Alignment
@ -474,7 +474,7 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony,
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.LoadLocation(GLOBALS.SFM_nLoc, RMPoint(GLOBALS.SFM_pt.x, GLOBALS.SFM_pt.y), RMPoint(-1, -1)); GLOBALS.LoadLocation(GLOBALS.SFM_nLoc, RMPoint(GLOBALS.SFM_pt.x, GLOBALS.SFM_pt.y), RMPoint(-1, -1));
if (!bNotEnableTony) if (!bNotEnableTony)
GLOBALS.Tony->Show(); GLOBALS.Tony->show();
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
MCharResetCodes(); MCharResetCodes();
@ -574,11 +574,11 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint
} }
DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(CORO_PARAM, uint32 nLoc, uint32 lX, uint32 lY, uint32) { DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(CORO_PARAM, uint32 nLoc, uint32 lX, uint32 lY, uint32) {
GLOBALS.StartLocPos[nLoc].Set(lX, lY); GLOBALS.StartLocPos[nLoc].set(lX, lY);
} }
DECLARE_CUSTOM_FUNCTION(SaveTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(SaveTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS.saveTonyPos = GLOBALS.Tony->Position(); GLOBALS.saveTonyPos = GLOBALS.Tony->position();
GLOBALS.saveTonyLoc = GLOBALS.Loc->TEMPGetNumLoc(); GLOBALS.saveTonyLoc = GLOBALS.Loc->TEMPGetNumLoc();
} }
@ -604,7 +604,7 @@ DECLARE_CUSTOM_FUNCTION(EnableInput)(CORO_PARAM, uint32, uint32, uint32, uint32)
} }
DECLARE_CUSTOM_FUNCTION(StopTony)(CORO_PARAM, uint32, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(StopTony)(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS.Tony->StopNoAction(coroParam); GLOBALS.Tony->stopNoAction(coroParam);
} }
DECLARE_CUSTOM_FUNCTION(CustEnableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(CustEnableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) {
@ -624,11 +624,11 @@ void TonyGenericTake1(CORO_PARAM, uint32 nDirection) {
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Tony->Take(nDirection, 0); GLOBALS.Tony->take(nDirection, 0);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
if (!GLOBALS.bSkipIdle) if (!GLOBALS.bSkipIdle)
CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern);
CORO_END_CODE; CORO_END_CODE;
} }
@ -640,14 +640,14 @@ void TonyGenericTake2(CORO_PARAM, uint32 nDirection) {
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Tony->Take(nDirection, 1); GLOBALS.Tony->take(nDirection, 1);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
if (!GLOBALS.bSkipIdle) if (!GLOBALS.bSkipIdle)
CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern);
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Tony->Take(nDirection, 2); GLOBALS.Tony->take(nDirection, 2);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
CORO_END_CODE; CORO_END_CODE;
@ -660,11 +660,11 @@ void TonyGenericPut1(CORO_PARAM, uint32 nDirection) {
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Tony->Put(nDirection, 0); GLOBALS.Tony->put(nDirection, 0);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
if (!GLOBALS.bSkipIdle) if (!GLOBALS.bSkipIdle)
CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern);
CORO_END_CODE; CORO_END_CODE;
} }
@ -676,14 +676,14 @@ void TonyGenericPut2(CORO_PARAM, uint32 nDirection) {
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Tony->Put(nDirection, 1); GLOBALS.Tony->put(nDirection, 1);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
if (!GLOBALS.bSkipIdle) if (!GLOBALS.bSkipIdle)
CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern);
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Tony->Put(nDirection, 2); GLOBALS.Tony->put(nDirection, 2);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
CORO_END_CODE; CORO_END_CODE;
@ -749,9 +749,9 @@ DECLARE_CUSTOM_FUNCTION(TonyPutDown2)(CORO_PARAM, uint32, uint32, uint32, uint32
DECLARE_CUSTOM_FUNCTION(TonyPerTerra)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(TonyPerTerra)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) {
if (dwParte == 0) if (dwParte == 0)
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_PERTERRALEFT); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_PERTERRALEFT);
else else
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_PERTERRARIGHT); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_PERTERRARIGHT);
} }
DECLARE_CUSTOM_FUNCTION(TonySiRialza)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(TonySiRialza)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) {
@ -761,18 +761,18 @@ DECLARE_CUSTOM_FUNCTION(TonySiRialza)(CORO_PARAM, uint32 dwParte, uint32, uint32
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
if (dwParte == 0) if (dwParte == 0)
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SIRIALZALEFT); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_SIRIALZALEFT);
else else
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SIRIALZARIGHT); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_SIRIALZARIGHT);
if (!GLOBALS.bSkipIdle) if (!GLOBALS.bSkipIdle)
CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern);
CORO_END_CODE; CORO_END_CODE;
} }
DECLARE_CUSTOM_FUNCTION(TonyPastorella)(CORO_PARAM, uint32 bIsPast, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(TonyPastorella)(CORO_PARAM, uint32 bIsPast, uint32, uint32, uint32) {
GLOBALS.Tony->SetPastorella(bIsPast); GLOBALS.Tony->setPastorella(bIsPast);
} }
DECLARE_CUSTOM_FUNCTION(TonyFischietto)(CORO_PARAM, uint32, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(TonyFischietto)(CORO_PARAM, uint32, uint32, uint32, uint32) {
@ -781,11 +781,11 @@ DECLARE_CUSTOM_FUNCTION(TonyFischietto)(CORO_PARAM, uint32, uint32, uint32, uint
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_FISCHIETTORIGHT); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_FISCHIETTORIGHT);
if (!GLOBALS.bSkipIdle) if (!GLOBALS.bSkipIdle)
CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern);
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_STANDRIGHT); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_STANDRIGHT);
CORO_END_CODE; CORO_END_CODE;
} }
@ -834,31 +834,31 @@ DECLARE_CUSTOM_FUNCTION(TonySpaventatoSenzaMani)(CORO_PARAM, uint32 dwText, uint
DECLARE_CUSTOM_FUNCTION(TonyConMartello)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(TonyConMartello)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
TonySetNumTexts(dwText); TonySetNumTexts(dwText);
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONMARTELLO; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONMARTELLO;
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_CONMARTELLO); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_CONMARTELLO);
} }
DECLARE_CUSTOM_FUNCTION(TonyConBicchiere)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(TonyConBicchiere)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
TonySetNumTexts(dwText); TonySetNumTexts(dwText);
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONBICCHIERE; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONBICCHIERE;
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_CONBICCHIERE); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_CONBICCHIERE);
} }
DECLARE_CUSTOM_FUNCTION(TonyConVerme)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(TonyConVerme)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
TonySetNumTexts(dwText); TonySetNumTexts(dwText);
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONVERME; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONVERME;
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_CONVERME); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_CONVERME);
} }
DECLARE_CUSTOM_FUNCTION(TonyConCorda)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(TonyConCorda)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
TonySetNumTexts(dwText); TonySetNumTexts(dwText);
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCORDA; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCORDA;
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_CONCORDA); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_CONCORDA);
} }
DECLARE_CUSTOM_FUNCTION(TonyConSegretaria)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(TonyConSegretaria)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
TonySetNumTexts(dwText); TonySetNumTexts(dwText);
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONSEGRETARIA; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONSEGRETARIA;
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_CONSEGRETARIA); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_CONSEGRETARIA);
} }
DECLARE_CUSTOM_FUNCTION(TonyConConiglioANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(TonyConConiglioANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
@ -889,7 +889,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConPupazzoStart)(CORO_PARAM, uint32, uint32, uint32,
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONPUPAZZOSTATIC; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONPUPAZZOSTATIC;
GLOBALS.bStaticTalk = true; GLOBALS.bStaticTalk = true;
CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONPUPAZZOSTATIC); CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONPUPAZZOSTATIC);
CORO_END_CODE; CORO_END_CODE;
} }
@ -900,7 +900,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConPupazzoEnd)(CORO_PARAM, uint32, uint32, uint32, u
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONPUPAZZOSTATIC); CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONPUPAZZOSTATIC);
GLOBALS.bStaticTalk = false; GLOBALS.bStaticTalk = false;
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL;
@ -915,7 +915,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConConiglioStart)(CORO_PARAM, uint32, uint32, uint32
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCONIGLIOSTATIC; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCONIGLIOSTATIC;
GLOBALS.bStaticTalk = true; GLOBALS.bStaticTalk = true;
CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONCONIGLIOSTATIC); CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONCONIGLIOSTATIC);
CORO_END_CODE; CORO_END_CODE;
} }
@ -926,7 +926,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConConiglioEnd)(CORO_PARAM, uint32, uint32, uint32,
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONCONIGLIOSTATIC); CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONCONIGLIOSTATIC);
GLOBALS.bStaticTalk = false; GLOBALS.bStaticTalk = false;
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL;
@ -941,7 +941,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConRicettaStart)(CORO_PARAM, uint32, uint32, uint32,
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONRICETTASTATIC; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONRICETTASTATIC;
GLOBALS.bStaticTalk = true; GLOBALS.bStaticTalk = true;
CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONRICETTASTATIC); CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONRICETTASTATIC);
CORO_END_CODE; CORO_END_CODE;
} }
@ -952,7 +952,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConRicettaEnd)(CORO_PARAM, uint32, uint32, uint32, u
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONRICETTASTATIC); CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONRICETTASTATIC);
GLOBALS.bStaticTalk = false; GLOBALS.bStaticTalk = false;
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL;
@ -967,7 +967,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConCarteStart)(CORO_PARAM, uint32, uint32, uint32, u
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCARTESTATIC; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCARTESTATIC;
GLOBALS.bStaticTalk = true; GLOBALS.bStaticTalk = true;
CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONCARTESTATIC); CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONCARTESTATIC);
CORO_END_CODE; CORO_END_CODE;
} }
@ -978,7 +978,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConCarteEnd)(CORO_PARAM, uint32, uint32, uint32, uin
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONCARTESTATIC); CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONCARTESTATIC);
GLOBALS.bStaticTalk = false; GLOBALS.bStaticTalk = false;
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL;
@ -993,7 +993,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoStart)(CORO_PARAM, uint32, uint32, uint32
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONTACCUINOSTATIC; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONTACCUINOSTATIC;
GLOBALS.bStaticTalk = true; GLOBALS.bStaticTalk = true;
CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONTACCUINOSTATIC); CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONTACCUINOSTATIC);
CORO_END_CODE; CORO_END_CODE;
} }
@ -1004,7 +1004,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoEnd)(CORO_PARAM, uint32, uint32, uint32,
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONTACCUINOSTATIC); CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONTACCUINOSTATIC);
GLOBALS.bStaticTalk = false; GLOBALS.bStaticTalk = false;
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL;
@ -1019,7 +1019,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConMegafonoStart)(CORO_PARAM, uint32, uint32, uint32
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONMEGAFONOSTATIC; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONMEGAFONOSTATIC;
GLOBALS.bStaticTalk = true; GLOBALS.bStaticTalk = true;
CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONMEGAFONOSTATIC); CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONMEGAFONOSTATIC);
CORO_END_CODE; CORO_END_CODE;
} }
@ -1030,7 +1030,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConMegafonoEnd)(CORO_PARAM, uint32, uint32, uint32,
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONMEGAFONOSTATIC); CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONMEGAFONOSTATIC);
GLOBALS.bStaticTalk = false; GLOBALS.bStaticTalk = false;
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL;
@ -1045,7 +1045,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConBarbaStart)(CORO_PARAM, uint32, uint32, uint32, u
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONBARBASTATIC; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONBARBASTATIC;
GLOBALS.bStaticTalk = true; GLOBALS.bStaticTalk = true;
CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONBARBASTATIC); CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONBARBASTATIC);
CORO_END_CODE; CORO_END_CODE;
} }
@ -1056,7 +1056,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConBarbaEnd)(CORO_PARAM, uint32, uint32, uint32, uin
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONBARBASTATIC); CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONBARBASTATIC);
GLOBALS.bStaticTalk = false; GLOBALS.bStaticTalk = false;
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL;
@ -1071,7 +1071,7 @@ DECLARE_CUSTOM_FUNCTION(TonySpaventatoStart)(CORO_PARAM, uint32, uint32, uint32,
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_SPAVENTATOSTATIC; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_SPAVENTATOSTATIC;
GLOBALS.bStaticTalk = true; GLOBALS.bStaticTalk = true;
CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_SPAVENTATOSTATIC); CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_SPAVENTATOSTATIC);
CORO_END_CODE; CORO_END_CODE;
} }
@ -1082,7 +1082,7 @@ DECLARE_CUSTOM_FUNCTION(TonySpaventatoEnd)(CORO_PARAM, uint32, uint32, uint32, u
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_SPAVENTATOSTATIC); CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_SPAVENTATOSTATIC);
GLOBALS.bStaticTalk = false; GLOBALS.bStaticTalk = false;
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL;
@ -1101,8 +1101,8 @@ DECLARE_CUSTOM_FUNCTION(TonySniffaLeft)(CORO_PARAM, uint32, uint32, uint32, uint
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SNIFFA_LEFT); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_SNIFFA_LEFT);
CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern);
CORO_INVOKE_4(LeftToMe, 0, 0, 0, 0); CORO_INVOKE_4(LeftToMe, 0, 0, 0, 0);
CORO_END_CODE; CORO_END_CODE;
@ -1114,8 +1114,8 @@ DECLARE_CUSTOM_FUNCTION(TonySniffaRight)(CORO_PARAM, uint32, uint32, uint32, uin
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SNIFFA_RIGHT); GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_SNIFFA_RIGHT);
CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern);
CORO_INVOKE_4(RightToMe, 0, 0, 0, 0); CORO_INVOKE_4(RightToMe, 0, 0, 0, 0);
CORO_END_CODE; CORO_END_CODE;
@ -1160,11 +1160,11 @@ DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(CORO_PARAM, uint32 nPos, uint32, uint32, ui
DECLARE_CUSTOM_FUNCTION(EnableTony)(CORO_PARAM, uint32, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(EnableTony)(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS.Tony->Show(); GLOBALS.Tony->show();
} }
DECLARE_CUSTOM_FUNCTION(DisableTony)(CORO_PARAM, uint32 bShowOmbra, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(DisableTony)(CORO_PARAM, uint32 bShowOmbra, uint32, uint32, uint32) {
GLOBALS.Tony->Hide(bShowOmbra); GLOBALS.Tony->hide(bShowOmbra);
} }
DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uint32, uint32) {
@ -1174,17 +1174,17 @@ DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uin
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
_ctx->item = GLOBALS.Loc->GetItemFromCode(nItem); _ctx->item = GLOBALS.Loc->getItemFromCode(nItem);
if (!GLOBALS.bSkipIdle && _ctx->item != NULL) if (!GLOBALS.bSkipIdle && _ctx->item != NULL)
CORO_INVOKE_1(_ctx->item->WaitForEndPattern, GLOBALS.hSkipIdle); CORO_INVOKE_1(_ctx->item->waitForEndPattern, GLOBALS.hSkipIdle);
CORO_END_CODE; CORO_END_CODE;
} }
DECLARE_CUSTOM_FUNCTION(SetTonyPosition)(CORO_PARAM, uint32 nX, uint32 nY, uint32 nLoc, uint32) { DECLARE_CUSTOM_FUNCTION(SetTonyPosition)(CORO_PARAM, uint32 nX, uint32 nY, uint32 nLoc, uint32) {
GLOBALS.Tony->SetPosition(RMPoint(nX, nY), nLoc); GLOBALS.Tony->setPosition(RMPoint(nX, nY), nLoc);
} }
DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) {
@ -1193,16 +1193,16 @@ DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint3
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
CORO_INVOKE_1(GLOBALS.Tony->Move, RMPoint(nX, nY)); CORO_INVOKE_1(GLOBALS.Tony->move, RMPoint(nX, nY));
if (!GLOBALS.bSkipIdle) if (!GLOBALS.bSkipIdle)
CORO_INVOKE_0(GLOBALS.Tony->WaitForEndMovement); CORO_INVOKE_0(GLOBALS.Tony->waitForEndMovement);
CORO_END_CODE; CORO_END_CODE;
} }
DECLARE_CUSTOM_FUNCTION(MoveTony)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(MoveTony)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) {
GLOBALS.Tony->Move(coroParam, RMPoint(nX, nY)); GLOBALS.Tony->move(coroParam, RMPoint(nX, nY));
} }
DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) { DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) {
@ -1217,34 +1217,34 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32
_ctx->lx = (int32)nX; _ctx->lx = (int32)nX;
_ctx->ly = (int32)nY; _ctx->ly = (int32)nY;
_ctx->pt = GLOBALS.Loc->ScrollPosition(); _ctx->pt = GLOBALS.Loc->scrollPosition();
while ((_ctx->lx != 0 || _ctx->ly != 0) && !GLOBALS.bSkipIdle) { while ((_ctx->lx != 0 || _ctx->ly != 0) && !GLOBALS.bSkipIdle) {
if (_ctx->lx > 0) { if (_ctx->lx > 0) {
_ctx->lx -= (int32)sX; _ctx->lx -= (int32)sX;
if (_ctx->lx < 0) _ctx->lx = 0; if (_ctx->lx < 0) _ctx->lx = 0;
_ctx->pt.Offset((int32)sX, 0); _ctx->pt.offset((int32)sX, 0);
} else if (_ctx->lx < 0) { } else if (_ctx->lx < 0) {
_ctx->lx += (int32)sX; _ctx->lx += (int32)sX;
if (_ctx->lx > 0) _ctx->lx = 0; if (_ctx->lx > 0) _ctx->lx = 0;
_ctx->pt.Offset(-(int32)sX, 0); _ctx->pt.offset(-(int32)sX, 0);
} }
if (_ctx->ly > 0) { if (_ctx->ly > 0) {
_ctx->ly -= sY; _ctx->ly -= sY;
if (_ctx->ly < 0) _ctx->ly = 0; if (_ctx->ly < 0) _ctx->ly = 0;
_ctx->pt.Offset(0, sY); _ctx->pt.offset(0, sY);
} else if (_ctx->ly < 0) { } else if (_ctx->ly < 0) {
_ctx->ly += sY; _ctx->ly += sY;
if (_ctx->ly > 0) _ctx->ly = 0; if (_ctx->ly > 0) _ctx->ly = 0;
_ctx->pt.Offset(0, -(int32)sY); _ctx->pt.offset(0, -(int32)sY);
} }
CORO_INVOKE_0(GLOBALS.WaitFrame); CORO_INVOKE_0(GLOBALS.WaitFrame);
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Loc->SetScrollPosition(_ctx->pt); GLOBALS.Loc->setScrollPosition(_ctx->pt);
GLOBALS.Tony->SetScrollPosition(_ctx->pt); GLOBALS.Tony->setScrollPosition(_ctx->pt);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
} }
@ -1276,7 +1276,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui
_ctx->stepX = sX; _ctx->stepX = sX;
_ctx->stepY = sY; _ctx->stepY = sY;
_ctx->startpt = GLOBALS.Loc->ScrollPosition(); _ctx->startpt = GLOBALS.Loc->scrollPosition();
_ctx->dwStartTime = _vm->getTime(); _ctx->dwStartTime = _vm->getTime();
@ -1308,8 +1308,8 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui
CORO_INVOKE_0(GLOBALS.WaitFrame); CORO_INVOKE_0(GLOBALS.WaitFrame);
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Loc->SetScrollPosition(_ctx->pt); GLOBALS.Loc->setScrollPosition(_ctx->pt);
GLOBALS.Tony->SetScrollPosition(_ctx->pt); GLOBALS.Tony->setScrollPosition(_ctx->pt);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
} }
@ -1329,8 +1329,8 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui
} }
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Loc->SetScrollPosition(_ctx->pt); GLOBALS.Loc->setScrollPosition(_ctx->pt);
GLOBALS.Tony->SetScrollPosition(_ctx->pt); GLOBALS.Tony->setScrollPosition(_ctx->pt);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
CORO_END_CODE; CORO_END_CODE;
@ -1354,7 +1354,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uin
GLOBALS.curChangedHotspot++; GLOBALS.curChangedHotspot++;
} }
GLOBALS.Loc->GetItemFromCode(dwCode)->ChangeHotspot(RMPoint(nX, nY)); GLOBALS.Loc->getItemFromCode(dwCode)->changeHotspot(RMPoint(nX, nY));
} }
@ -1384,8 +1384,8 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32
CORO_INVOKE_0(GLOBALS.WaitFrame); CORO_INVOKE_0(GLOBALS.WaitFrame);
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Loc->SetFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); GLOBALS.Loc->setFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry));
GLOBALS.Tony->SetFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); GLOBALS.Tony->setFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry));
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
_ctx->i = _vm->_randomSource.getRandomNumber(2); _ctx->i = _vm->_randomSource.getRandomNumber(2);
@ -1397,8 +1397,8 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32
} }
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Loc->SetFixedScroll(RMPoint(0, 0)); GLOBALS.Loc->setFixedScroll(RMPoint(0, 0));
GLOBALS.Tony->SetFixedScroll(RMPoint(0, 0)); GLOBALS.Tony->setFixedScroll(RMPoint(0, 0));
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
CORO_END_CODE; CORO_END_CODE;
@ -1413,7 +1413,7 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32
DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) {
assert(nChar < 16); assert(nChar < 16);
GLOBALS.Character[nChar].code = nCode; GLOBALS.Character[nChar].code = nCode;
GLOBALS.Character[nChar].item = GLOBALS.Loc->GetItemFromCode(nCode); GLOBALS.Character[nChar].item = GLOBALS.Loc->getItemFromCode(nCode);
GLOBALS.Character[nChar].r = 255; GLOBALS.Character[nChar].r = 255;
GLOBALS.Character[nChar].g = 255; GLOBALS.Character[nChar].g = 255;
GLOBALS.Character[nChar].b = 255; GLOBALS.Character[nChar].b = 255;
@ -1461,18 +1461,18 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess
_ctx->curOffset = 0; _ctx->curOffset = 0;
assert(nChar < 16); assert(nChar < 16);
_ctx->pt = GLOBALS.Character[nChar].item->CalculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->ScrollPosition(); _ctx->pt = GLOBALS.Character[nChar].item->calculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->scrollPosition();
if (GLOBALS.Character[nChar].starttalkpattern != 0) { if (GLOBALS.Character[nChar].starttalkpattern != 0) {
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].starttalkpattern); GLOBALS.Character[nChar].item->setPattern(GLOBALS.Character[nChar].starttalkpattern);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
CORO_INVOKE_0(GLOBALS.Character[nChar].item->WaitForEndPattern); CORO_INVOKE_0(GLOBALS.Character[nChar].item->waitForEndPattern);
} }
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].talkpattern); GLOBALS.Character[nChar].item->setPattern(GLOBALS.Character[nChar].talkpattern);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
_ctx->curVoc = SearchVoiceHeader(0, dwMessage); _ctx->curVoc = SearchVoiceHeader(0, dwMessage);
@ -1483,7 +1483,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess
_ctx->curOffset = _ctx->curVoc->_offset; _ctx->curOffset = _ctx->curVoc->_offset;
} }
for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { for (_ctx->i = 0; _ctx->i < _ctx->msg->numPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) {
if (bIsBack) { if (bIsBack) {
GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc);
if (GLOBALS.bTonyIsSpeaking) if (GLOBALS.bTonyIsSpeaking)
@ -1545,13 +1545,13 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess
if (GLOBALS.Character[nChar].endtalkpattern != 0) { if (GLOBALS.Character[nChar].endtalkpattern != 0) {
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].endtalkpattern); GLOBALS.Character[nChar].item->setPattern(GLOBALS.Character[nChar].endtalkpattern);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
CORO_INVOKE_0(GLOBALS.Character[nChar].item->WaitForEndPattern); CORO_INVOKE_0(GLOBALS.Character[nChar].item->waitForEndPattern);
} }
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].standpattern); GLOBALS.Character[nChar].item->setPattern(GLOBALS.Character[nChar].standpattern);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
delete _ctx->msg; delete _ctx->msg;
@ -1581,7 +1581,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, ui
if (nCode == 0) if (nCode == 0)
GLOBALS.MCharacter[nChar].item = NULL; GLOBALS.MCharacter[nChar].item = NULL;
else else
GLOBALS.MCharacter[nChar].item = GLOBALS.Loc->GetItemFromCode(nCode); GLOBALS.MCharacter[nChar].item = GLOBALS.Loc->getItemFromCode(nCode);
GLOBALS.MCharacter[nChar].r = 255; GLOBALS.MCharacter[nChar].r = 255;
GLOBALS.MCharacter[nChar].g = 255; GLOBALS.MCharacter[nChar].g = 255;
GLOBALS.MCharacter[nChar].b = 255; GLOBALS.MCharacter[nChar].b = 255;
@ -1598,7 +1598,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, ui
} }
DECLARE_CUSTOM_FUNCTION(MCharResetCode)(CORO_PARAM, uint32 nChar, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(MCharResetCode)(CORO_PARAM, uint32 nChar, uint32, uint32, uint32) {
GLOBALS.MCharacter[nChar].item = GLOBALS.Loc->GetItemFromCode(GLOBALS.MCharacter[nChar].code); GLOBALS.MCharacter[nChar].item = GLOBALS.Loc->getItemFromCode(GLOBALS.MCharacter[nChar].code);
} }
@ -1670,7 +1670,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes
// Calculates the position of the text according to the current frame // Calculates the position of the text according to the current frame
if (GLOBALS.MCharacter[nChar].x == -1) if (GLOBALS.MCharacter[nChar].x == -1)
_ctx->pt = GLOBALS.MCharacter[nChar].item->CalculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->ScrollPosition(); _ctx->pt = GLOBALS.MCharacter[nChar].item->calculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->scrollPosition();
else else
_ctx->pt = RMPoint(GLOBALS.MCharacter[nChar].x, GLOBALS.MCharacter[nChar].y); _ctx->pt = RMPoint(GLOBALS.MCharacter[nChar].x, GLOBALS.MCharacter[nChar].y);
@ -1680,7 +1680,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes
// Try to run the custom function to initialise the speech // Try to run the custom function to initialise the speech
if (GLOBALS.MCharacter[nChar].item) { if (GLOBALS.MCharacter[nChar].item) {
_ctx->h = mpalQueryDoAction(30, GLOBALS.MCharacter[nChar].item->MpalCode(), _ctx->parm); _ctx->h = mpalQueryDoAction(30, GLOBALS.MCharacter[nChar].item->mpalCode(), _ctx->parm);
if (_ctx->h != CORO_INVALID_PID_VALUE) { if (_ctx->h != CORO_INVALID_PID_VALUE) {
CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE);
} }
@ -1695,7 +1695,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes
_ctx->curOffset = _ctx->curVoc->_offset; _ctx->curOffset = _ctx->curVoc->_offset;
} }
for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { for (_ctx->i = 0; _ctx->i < _ctx->msg->numPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) {
// Create a different object depending on whether it's background or not // Create a different object depending on whether it's background or not
if (bIsBack) { if (bIsBack) {
GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc);
@ -1759,7 +1759,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes
// Try to run the custom function to close the speech // Try to run the custom function to close the speech
if (GLOBALS.MCharacter[nChar].item) { if (GLOBALS.MCharacter[nChar].item) {
_ctx->h = mpalQueryDoAction(31, GLOBALS.MCharacter[nChar].item->MpalCode(), _ctx->parm); _ctx->h = mpalQueryDoAction(31, GLOBALS.MCharacter[nChar].item->mpalCode(), _ctx->parm);
if (_ctx->h != CORO_INVALID_PID_VALUE) if (_ctx->h != CORO_INVALID_PID_VALUE)
CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE);
} }
@ -1767,11 +1767,6 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes
CORO_END_CODE; CORO_END_CODE;
} }
/* /*
* Dialoghi * Dialoghi
*/ */
@ -1815,46 +1810,46 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg
if (nPers == 0) { if (nPers == 0) {
_ctx->text = new RMTextDialog; _ctx->text = new RMTextDialog;
_ctx->text->setColor(0, 255, 0); _ctx->text->setColor(0, 255, 0);
_ctx->text->setPosition(GLOBALS.Tony->Position() - RMPoint(0, 130) - GLOBALS.Loc->ScrollPosition()); _ctx->text->setPosition(GLOBALS.Tony->position() - RMPoint(0, 130) - GLOBALS.Loc->scrollPosition());
_ctx->text->writeText(_ctx->string, 0); _ctx->text->writeText(_ctx->string, 0);
if (GLOBALS.dwTonyNumTexts > 0) { if (GLOBALS.dwTonyNumTexts > 0) {
if (!GLOBALS.bTonyInTexts) { if (!GLOBALS.bTonyInTexts) {
if (GLOBALS.nTonyNextTalkType != GLOBALS.Tony->TALK_NORMAL) { if (GLOBALS.nTonyNextTalkType != GLOBALS.Tony->TALK_NORMAL) {
CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.nTonyNextTalkType); CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.nTonyNextTalkType);
if (!GLOBALS.bStaticTalk) if (!GLOBALS.bStaticTalk)
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL;
} else } else
CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.Tony->TALK_NORMAL); CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.Tony->TALK_NORMAL);
GLOBALS.bTonyInTexts = true; GLOBALS.bTonyInTexts = true;
} }
GLOBALS.dwTonyNumTexts--; GLOBALS.dwTonyNumTexts--;
} else { } else {
CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.nTonyNextTalkType); CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.nTonyNextTalkType);
if (!GLOBALS.bStaticTalk) if (!GLOBALS.bStaticTalk)
GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL;
} }
} else if (!GLOBALS.IsMChar[nPers]) { } else if (!GLOBALS.IsMChar[nPers]) {
_ctx->text = new RMTextDialog; _ctx->text = new RMTextDialog;
_ctx->pt = GLOBALS.Character[nPers].item->CalculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->ScrollPosition(); _ctx->pt = GLOBALS.Character[nPers].item->calculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->scrollPosition();
if (GLOBALS.Character[nPers].starttalkpattern != 0) { if (GLOBALS.Character[nPers].starttalkpattern != 0) {
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].starttalkpattern); GLOBALS.Character[nPers].item->setPattern(GLOBALS.Character[nPers].starttalkpattern);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
CORO_INVOKE_0(GLOBALS.Character[nPers].item->WaitForEndPattern); CORO_INVOKE_0(GLOBALS.Character[nPers].item->waitForEndPattern);
} }
GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].talkpattern); GLOBALS.Character[nPers].item->setPattern(GLOBALS.Character[nPers].talkpattern);
_ctx->text->setColor(GLOBALS.Character[nPers].r, GLOBALS.Character[nPers].g, GLOBALS.Character[nPers].b); _ctx->text->setColor(GLOBALS.Character[nPers].r, GLOBALS.Character[nPers].g, GLOBALS.Character[nPers].b);
_ctx->text->writeText(_ctx->string, 0); _ctx->text->writeText(_ctx->string, 0);
_ctx->text->setPosition(_ctx->pt); _ctx->text->setPosition(_ctx->pt);
} else { } else {
if (GLOBALS.MCharacter[nPers].x == -1) if (GLOBALS.MCharacter[nPers].x == -1)
_ctx->pt = GLOBALS.MCharacter[nPers].item->CalculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->ScrollPosition(); _ctx->pt = GLOBALS.MCharacter[nPers].item->calculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->scrollPosition();
else else
_ctx->pt = RMPoint(GLOBALS.MCharacter[nPers].x, GLOBALS.MCharacter[nPers].y); _ctx->pt = RMPoint(GLOBALS.MCharacter[nPers].x, GLOBALS.MCharacter[nPers].y);
@ -1866,7 +1861,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg
GLOBALS.MCharacter[nPers].numtexts--; GLOBALS.MCharacter[nPers].numtexts--;
} else { } else {
// Try to run the custom function to initialise the speech // Try to run the custom function to initialise the speech
_ctx->h = mpalQueryDoAction(30, GLOBALS.MCharacter[nPers].item->MpalCode(), _ctx->parm); _ctx->h = mpalQueryDoAction(30, GLOBALS.MCharacter[nPers].item->mpalCode(), _ctx->parm);
if (_ctx->h != CORO_INVALID_PID_VALUE) if (_ctx->h != CORO_INVALID_PID_VALUE)
CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE);
@ -1922,18 +1917,18 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg
if (!GLOBALS.IsMChar[nPers]) { if (!GLOBALS.IsMChar[nPers]) {
if (GLOBALS.Character[nPers].endtalkpattern != 0) { if (GLOBALS.Character[nPers].endtalkpattern != 0) {
GLOBALS.Freeze(); GLOBALS.Freeze();
GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].endtalkpattern); GLOBALS.Character[nPers].item->setPattern(GLOBALS.Character[nPers].endtalkpattern);
GLOBALS.Unfreeze(); GLOBALS.Unfreeze();
CORO_INVOKE_0(GLOBALS.Character[nPers].item->WaitForEndPattern); CORO_INVOKE_0(GLOBALS.Character[nPers].item->waitForEndPattern);
} }
GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].standpattern); GLOBALS.Character[nPers].item->setPattern(GLOBALS.Character[nPers].standpattern);
delete _ctx->text; delete _ctx->text;
} else { } else {
if ((GLOBALS.MCharacter[nPers].bInTexts && GLOBALS.MCharacter[nPers].numtexts == 0) || !GLOBALS.MCharacter[nPers].bInTexts) { if ((GLOBALS.MCharacter[nPers].bInTexts && GLOBALS.MCharacter[nPers].numtexts == 0) || !GLOBALS.MCharacter[nPers].bInTexts) {
// Try to run the custom function to close the speech // Try to run the custom function to close the speech
GLOBALS.MCharacter[nPers].curTalk = (GLOBALS.MCharacter[nPers].curTalk % 10) + GLOBALS.MCharacter[nPers].curgroup * 10; GLOBALS.MCharacter[nPers].curTalk = (GLOBALS.MCharacter[nPers].curTalk % 10) + GLOBALS.MCharacter[nPers].curgroup * 10;
_ctx->h = mpalQueryDoAction(31, GLOBALS.MCharacter[nPers].item->MpalCode(), GLOBALS.MCharacter[nPers].curTalk); _ctx->h = mpalQueryDoAction(31, GLOBALS.MCharacter[nPers].item->mpalCode(), GLOBALS.MCharacter[nPers].curTalk);
if (_ctx->h != CORO_INVALID_PID_VALUE) if (_ctx->h != CORO_INVALID_PID_VALUE)
CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE);
@ -1946,7 +1941,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg
} }
} else { } else {
if ((GLOBALS.dwTonyNumTexts == 0 && GLOBALS.bTonyInTexts) || !GLOBALS.bTonyInTexts) { if ((GLOBALS.dwTonyNumTexts == 0 && GLOBALS.bTonyInTexts) || !GLOBALS.bTonyInTexts) {
CORO_INVOKE_0(GLOBALS.Tony->EndTalk); CORO_INVOKE_0(GLOBALS.Tony->endTalk);
GLOBALS.dwTonyNumTexts = 0; GLOBALS.dwTonyNumTexts = 0;
GLOBALS.bTonyInTexts = false; GLOBALS.bTonyInTexts = false;
} }
@ -2201,11 +2196,11 @@ DECLARE_CUSTOM_FUNCTION(PlayStacchetto)(CORO_PARAM, uint32 nMusic, uint32 nFX, u
DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) {
if (nItem == 0) { if (nItem == 0) {
GLOBALS.Tony->PlaySfx(nSFX); GLOBALS.Tony->playSfx(nSFX);
} else { } else {
RMItem *item = GLOBALS.Loc->GetItemFromCode(nItem); RMItem *item = GLOBALS.Loc->getItemFromCode(nItem);
if (item) if (item)
item->PlaySfx(nSFX); item->playSfx(nSFX);
} }
} }
@ -2325,9 +2320,9 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3
_ctx->msg = new RMMessage(nMsg); _ctx->msg = new RMMessage(nMsg);
_ctx->hDisable = CoroScheduler.createEvent(true, false); _ctx->hDisable = CoroScheduler.createEvent(true, false);
_ctx->text = new RMTextDialog[_ctx->msg->NumPeriods()]; _ctx->text = new RMTextDialog[_ctx->msg->numPeriods()];
for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods(); _ctx->i++) { for (_ctx->i = 0; _ctx->i < _ctx->msg->numPeriods(); _ctx->i++) {
_ctx->text[_ctx->i].setInput(GLOBALS.Input); _ctx->text[_ctx->i].setInput(GLOBALS.Input);
// Alignment // Alignment

View file

@ -87,7 +87,7 @@ bool Debugger::Cmd_Scene(int argc, const char **argv) {
} }
int sceneNumber = strToInt(argv[1]); int sceneNumber = strToInt(argv[1]);
if (sceneNumber >= _vm->_theBoxes.GetLocBoxesCount()) { if (sceneNumber >= _vm->_theBoxes.getLocBoxesCount()) {
DebugPrintf("Invalid scene\n"); DebugPrintf("Invalid scene\n");
return true; return true;
} }
@ -99,8 +99,8 @@ bool Debugger::Cmd_Scene(int argc, const char **argv) {
} else { } else {
// Get the box areas for the scene, and choose one so as to have a default // Get the box areas for the scene, and choose one so as to have a default
// position for Tony that will be in the walkable areas // position for Tony that will be in the walkable areas
RMBoxLoc *box = _vm->_theBoxes.GetBoxes(sceneNumber); RMBoxLoc *box = _vm->_theBoxes.getBoxes(sceneNumber);
scenePos.Set(box->boxes[0].hotspot[0].hotx, box->boxes[0].hotspot[0].hoty); scenePos.set(box->boxes[0].hotspot[0].hotx, box->boxes[0].hotspot[0].hoty);
} }
// Set up a process to change the scene // Set up a process to change the scene

View file

@ -82,8 +82,8 @@ void RMFont::load(const byte *buf, int nChars, int dimx, int dimy, uint32 palRes
void RMFont::load(uint32 resID, int nChars, int dimx, int dimy, uint32 palResID) { void RMFont::load(uint32 resID, int nChars, int dimx, int dimy, uint32 palResID) {
RMRes res(resID); RMRes res(resID);
if ((int)res.Size() < nChars * (dimy * dimx + 8)) if ((int)res.size() < nChars * (dimy * dimx + 8))
nChars = res.Size() / (dimy * dimx + 8); nChars = res.size() / (dimy * dimx + 8);
load(res, nChars, dimx, dimy, palResID); load(res, nChars, dimx, dimy, palResID);
} }
@ -137,7 +137,7 @@ int RMFont::stringLen(const RMString &text) {
int len, i; int len, i;
len = 0; len = 0;
for (i = 0; i < text.Length() - 1; i++) for (i = 0; i < text.length() - 1; i++)
len += letterLength(text[i], text[i + 1]); len += letterLength(text[i], text[i + 1]);
len += letterLength(text[i]); len += letterLength(text[i]);
@ -1968,9 +1968,9 @@ void RMText::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
// Horizontally // Horizontally
if (aHorType == HCENTER) if (aHorType == HCENTER)
prim->Dst().TopLeft() -= RMPoint(_dimx / 2, 0); prim->Dst().topLeft() -= RMPoint(_dimx / 2, 0);
else if (aHorType == HRIGHT) else if (aHorType == HRIGHT)
prim->Dst().TopLeft() -= RMPoint(_dimx, 0); prim->Dst().topLeft() -= RMPoint(_dimx, 0);
// Vertically // Vertically
@ -2146,7 +2146,7 @@ void RMTextDialog::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *p
if (_bShowed) { if (_bShowed) {
if (GLOBALS.bCfgSottotitoli || _bAlwaysDisplay) { if (GLOBALS.bCfgSottotitoli || _bAlwaysDisplay) {
prim->Dst().TopLeft() = dst; prim->Dst().topLeft() = dst;
CORO_INVOKE_2(RMText::draw, bigBuf, prim); CORO_INVOKE_2(RMText::draw, bigBuf, prim);
} }
} }
@ -2180,7 +2180,7 @@ RMTextDialogScrolling::RMTextDialogScrolling() {
RMTextDialogScrolling::RMTextDialogScrolling(RMLocation *loc) { RMTextDialogScrolling::RMTextDialogScrolling(RMLocation *loc) {
curLoc = loc; curLoc = loc;
startScroll = loc->ScrollPosition(); startScroll = loc->scrollPosition();
} }
RMTextDialogScrolling::~RMTextDialogScrolling() { RMTextDialogScrolling::~RMTextDialogScrolling() {
@ -2196,7 +2196,7 @@ void RMTextDialogScrolling::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPri
_ctx->curDst = dst; _ctx->curDst = dst;
if (curLoc != NULL) if (curLoc != NULL)
dst -= curLoc->ScrollPosition() - startScroll; dst -= curLoc->scrollPosition() - startScroll;
CORO_INVOKE_2(RMTextDialog::draw, bigBuf, prim); CORO_INVOKE_2(RMTextDialog::draw, bigBuf, prim);
@ -2240,19 +2240,19 @@ void RMTextItemName::doFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation &
bigBuf.addPrim(new RMGfxPrimitive(this)); bigBuf.addPrim(new RMGfxPrimitive(this));
// Update the scrolling co-ordinates // Update the scrolling co-ordinates
_curscroll = loc.ScrollPosition(); _curscroll = loc.scrollPosition();
// Check if we are on the inventory // Check if we are on the inventory
if (inv.itemInFocus(_mpos)) if (inv.itemInFocus(_mpos))
_item = inv.whichItemIsIn(_mpos); _item = inv.whichItemIsIn(_mpos);
else else
_item = loc.WhichItemIsIn(_mpos); _item = loc.whichItemIsIn(_mpos);
itemName = ""; itemName = "";
// If there an item, get its name // If there an item, get its name
if (_item != NULL) if (_item != NULL)
_item->GetName(itemName); _item->getName(itemName);
// Write it // Write it
writeText(itemName, 1); writeText(itemName, 1);
@ -2262,7 +2262,7 @@ void RMTextItemName::doFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation &
if (_item == NULL) if (_item == NULL)
ptr.setSpecialPointer(RMPointer::PTR_NONE); ptr.setSpecialPointer(RMPointer::PTR_NONE);
else { else {
_ctx->hThread = mpalQueryDoAction(20, _item->MpalCode(), 0); _ctx->hThread = mpalQueryDoAction(20, _item->mpalCode(), 0);
if (_ctx->hThread == CORO_INVALID_PID_VALUE) if (_ctx->hThread == CORO_INVALID_PID_VALUE)
ptr.setSpecialPointer(RMPointer::PTR_NONE); ptr.setSpecialPointer(RMPointer::PTR_NONE);
else else
@ -2285,7 +2285,7 @@ void RMTextItemName::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive
return; return;
// Set the destination coordinates of the mouse // Set the destination coordinates of the mouse
prim->Dst().TopLeft() = _mpos - RMPoint(0, 30); prim->Dst().topLeft() = _mpos - RMPoint(0, 30);
CORO_INVOKE_2(RMText::draw, bigBuf, prim); CORO_INVOKE_2(RMText::draw, bigBuf, prim);
@ -2296,7 +2296,7 @@ RMPoint RMTextItemName::getHotspot() {
if (_item == NULL) if (_item == NULL)
return _mpos + _curscroll; return _mpos + _curscroll;
else else
return _item->Hotspot(); return _item->hotspot();
} }
RMItem *RMTextItemName::getSelectedItem() { RMItem *RMTextItemName::getSelectedItem() {
@ -2308,7 +2308,7 @@ bool RMTextItemName::isItemSelected() {
} }
bool RMTextItemName::isNormalItemSelected() { bool RMTextItemName::isNormalItemSelected() {
return _item != NULL && _itemName.Length() > 0; return _item != NULL && _itemName.length() > 0;
} }
@ -2321,8 +2321,8 @@ RMDialogChoice::RMDialogChoice() {
RMResRaw dlg2(RES_I_DLGTEXTLINE); RMResRaw dlg2(RES_I_DLGTEXTLINE);
RMRes dlgpal(RES_I_DLGTEXTPAL); RMRes dlgpal(RES_I_DLGTEXTPAL);
DlgText.init(dlg1, dlg1.Width(), dlg1.Height()); DlgText.init(dlg1, dlg1.width(), dlg1.height());
DlgTextLine.init(dlg2, dlg2.Width(), dlg2.Height()); DlgTextLine.init(dlg2, dlg2.width(), dlg2.height());
DlgText.loadPaletteWA(dlgpal); DlgText.loadPaletteWA(dlgpal);
DlgTextLine.loadPaletteWA(dlgpal); DlgTextLine.loadPaletteWA(dlgpal);
@ -2407,18 +2407,18 @@ void RMDialogChoice::prepare(CORO_PARAM) {
addPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83 + 83))); addPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83 + 83)));
addPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83 + 83 + 83))); addPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83 + 83 + 83)));
_ctx->ptPos.Set(20, 90); _ctx->ptPos.set(20, 90);
for (_ctx->i = 0; _ctx->i < _numChoices; _ctx->i++) { for (_ctx->i = 0; _ctx->i < _numChoices; _ctx->i++) {
addPrim(new RMGfxPrimitive(&_drawedStrings[_ctx->i], _ctx->ptPos)); addPrim(new RMGfxPrimitive(&_drawedStrings[_ctx->i], _ctx->ptPos));
_ptDrawStrings[_ctx->i] = _ctx->ptPos; _ptDrawStrings[_ctx->i] = _ctx->ptPos;
_ctx->ptPos.Offset(0, _drawedStrings[_ctx->i].getDimy() + 15); _ctx->ptPos.offset(0, _drawedStrings[_ctx->i].getDimy() + 15);
} }
CORO_INVOKE_0(drawOT); CORO_INVOKE_0(drawOT);
clearOT(); clearOT();
_ptDrawPos.Set(0, 480 - _ctx->ptPos.y); _ptDrawPos.set(0, 480 - _ctx->ptPos.y);
CORO_END_CODE; CORO_END_CODE;
} }
@ -2438,8 +2438,8 @@ void RMDialogChoice::setSelected(CORO_PARAM, int pos) {
if (_curSelection != -1) { if (_curSelection != -1) {
_ctx->box.SetColor(0xCC, 0xCC, 0xFF); _ctx->box.SetColor(0xCC, 0xCC, 0xFF);
_ctx->rc.TopLeft() = RMPoint(18, _ptDrawStrings[_curSelection].y); _ctx->rc.topLeft() = RMPoint(18, _ptDrawStrings[_curSelection].y);
_ctx->rc.BottomRight() = _ctx->rc.TopLeft() + RMPoint(597, _drawedStrings[_curSelection].getDimy()); _ctx->rc.bottomRight() = _ctx->rc.topLeft() + RMPoint(597, _drawedStrings[_curSelection].getDimy());
addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc)); addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc));
addPrim(new RMGfxPrimitive(&_drawedStrings[_curSelection], _ptDrawStrings[_curSelection])); addPrim(new RMGfxPrimitive(&_drawedStrings[_curSelection], _ptDrawStrings[_curSelection]));
@ -2449,8 +2449,8 @@ void RMDialogChoice::setSelected(CORO_PARAM, int pos) {
if (pos != -1) { if (pos != -1) {
_ctx->box.SetColor(100, 100, 100); _ctx->box.SetColor(100, 100, 100);
_ctx->rc.TopLeft() = RMPoint(18, _ptDrawStrings[pos].y); _ctx->rc.topLeft() = RMPoint(18, _ptDrawStrings[pos].y);
_ctx->rc.BottomRight() = _ctx->rc.TopLeft() + RMPoint(597, _drawedStrings[pos].getDimy()); _ctx->rc.bottomRight() = _ctx->rc.topLeft() + RMPoint(597, _drawedStrings[pos].getDimy());
addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc)); addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc));
addPrim(new RMGfxPrimitive(&_drawedStrings[pos], _ptDrawStrings[pos])); addPrim(new RMGfxPrimitive(&_drawedStrings[pos], _ptDrawStrings[pos]));
} }
@ -2485,7 +2485,7 @@ void RMDialogChoice::show(CORO_PARAM, RMGfxTargetBuffer *bigBuf) {
_ctx->starttime = _vm->getTime(); _ctx->starttime = _vm->getTime();
_ctx->deltay = 480 - _ptDrawPos.y; _ctx->deltay = 480 - _ptDrawPos.y;
_ctx->destpt = _ptDrawPos; _ctx->destpt = _ptDrawPos;
_ptDrawPos.Set(0, 480); _ptDrawPos.set(0, 480);
if (!_nInList && bigBuf != NULL) if (!_nInList && bigBuf != NULL)
bigBuf->addPrim(new RMGfxPrimitive(this)); bigBuf->addPrim(new RMGfxPrimitive(this));

View file

@ -124,11 +124,11 @@ void mainSetPalesati(bool bPalesati) {
RMOptionButton::RMOptionButton(uint32 dwRes, RMPoint pt, bool bDoubleState) { RMOptionButton::RMOptionButton(uint32 dwRes, RMPoint pt, bool bDoubleState) {
RMResRaw raw(dwRes); RMResRaw raw(dwRes);
assert(raw.IsValid()); assert(raw.isValid());
_buf = new RMGfxSourceBuffer16(false); _buf = new RMGfxSourceBuffer16(false);
_buf->init(raw, raw.Width(), raw.Height()); _buf->init(raw, raw.width(), raw.height());
_rect.SetRect(pt.x, pt.y, pt.x + raw.Width() - 1, pt.y + raw.Height() - 1); _rect.setRect(pt.x, pt.y, pt.x + raw.width() - 1, pt.y + raw.height() - 1);
_bActive = false; _bActive = false;
_bHasGfx = true; _bHasGfx = true;
_bDoubleState = bDoubleState; _bDoubleState = bDoubleState;
@ -149,7 +149,7 @@ RMOptionButton::~RMOptionButton() {
bool RMOptionButton::doFrame(const RMPoint &mousePos, bool bLeftClick, bool bRightClick) { bool RMOptionButton::doFrame(const RMPoint &mousePos, bool bLeftClick, bool bRightClick) {
if (!_bDoubleState) { if (!_bDoubleState) {
if (_rect.PtInRect(mousePos)) { if (_rect.ptInRect(mousePos)) {
if (!_bActive) { if (!_bActive) {
_bActive = true; _bActive = true;
return true; return true;
@ -161,7 +161,7 @@ bool RMOptionButton::doFrame(const RMPoint &mousePos, bool bLeftClick, bool bRig
} }
} }
} else { } else {
if (bLeftClick && _rect.PtInRect(mousePos)) { if (bLeftClick && _rect.ptInRect(mousePos)) {
_bActive = !_bActive; _bActive = !_bActive;
return true; return true;
} }
@ -511,12 +511,12 @@ void RMOptionScreen::refreshAll(CORO_PARAM) {
RMString s; RMString s;
if (_bEditSaveName && _nEditPos == _ctx->i) if (_bEditSaveName && _nEditPos == _ctx->i)
s.Format("%02d)%s*", _statePos + _ctx->i, _EditName); s.format("%02d)%s*", _statePos + _ctx->i, _EditName);
else { else {
if (_statePos == 0 && _ctx->i == 0) if (_statePos == 0 && _ctx->i == 0)
s.Format("Autosave"); s.format("Autosave");
else else
s.Format("%02d)%s", _statePos + _ctx->i, (const char *)_curThumbName[_ctx->i]); s.format("%02d)%s", _statePos + _ctx->i, (const char *)_curThumbName[_ctx->i]);
} }
_ctx->num[_ctx->i] = new RMText; _ctx->num[_ctx->i] = new RMText;
@ -585,10 +585,10 @@ void RMOptionScreen::initState(CORO_PARAM) {
error("Invalid state"); error("Invalid state");
} }
assert(_ctx->raw->IsValid()); assert(_ctx->raw->isValid());
assert(_menu == NULL); assert(_menu == NULL);
_menu = new RMGfxSourceBuffer16(false); _menu = new RMGfxSourceBuffer16(false);
_menu->init(*_ctx->raw, _ctx->raw->Width(), _ctx->raw->Height()); _menu->init(*_ctx->raw, _ctx->raw->width(), _ctx->raw->height());
delete _ctx->raw; delete _ctx->raw;
if (_nState == MENULOAD || _nState == MENUSAVE) { if (_nState == MENULOAD || _nState == MENUSAVE) {
@ -647,10 +647,10 @@ void RMOptionScreen::initState(CORO_PARAM) {
_ButtonSoundMenu = new RMOptionButton(RMRect(212, 32, 306, 64)); _ButtonSoundMenu = new RMOptionButton(RMRect(212, 32, 306, 64));
_ctx->raw = new RMResRaw(20021); _ctx->raw = new RMResRaw(20021);
assert(_ctx->raw->IsValid()); assert(_ctx->raw->isValid());
assert(_QuitConfirm == NULL); assert(_QuitConfirm == NULL);
_QuitConfirm = new RMGfxSourceBuffer16(false); _QuitConfirm = new RMGfxSourceBuffer16(false);
_QuitConfirm->init(*_ctx->raw, _ctx->raw->Width(), _ctx->raw->Height()); _QuitConfirm->init(*_ctx->raw, _ctx->raw->width(), _ctx->raw->height());
delete _ctx->raw; delete _ctx->raw;
assert(_ButtonQuitYes == NULL); assert(_ButtonQuitYes == NULL);
@ -662,10 +662,10 @@ void RMOptionScreen::initState(CORO_PARAM) {
if (_bNoLoadSave) { if (_bNoLoadSave) {
_ctx->raw = new RMResRaw(20028); _ctx->raw = new RMResRaw(20028);
assert(_ctx->raw->IsValid()); assert(_ctx->raw->isValid());
assert(_HideLoadSave == NULL); assert(_HideLoadSave == NULL);
_HideLoadSave = new RMGfxSourceBuffer16(false); _HideLoadSave = new RMGfxSourceBuffer16(false);
_HideLoadSave->init(*_ctx->raw, _ctx->raw->Width(), _ctx->raw->Height()); _HideLoadSave->init(*_ctx->raw, _ctx->raw->width(), _ctx->raw->height());
delete _ctx->raw; delete _ctx->raw;
} }
@ -1485,7 +1485,7 @@ void RMPointer::init(void) {
RMResRaw res(RES_P_GO + i); RMResRaw res(RES_P_GO + i);
_pointer[i] = new RMGfxSourceBuffer8RLEByteAA; _pointer[i] = new RMGfxSourceBuffer8RLEByteAA;
_pointer[i]->init(res, res.Width(), res.Height(), false); _pointer[i]->init(res, res.width(), res.height(), false);
_pointer[i]->loadPaletteWA(RES_P_PAL); _pointer[i]->loadPaletteWA(RES_P_PAL);
} }
@ -1493,17 +1493,17 @@ void RMPointer::init(void) {
RMRes res(RES_P_PAP1 + i); RMRes res(RES_P_PAP1 + i);
RMDataStream ds; RMDataStream ds;
ds.OpenBuffer(res); ds.openBuffer(res);
_specialPointer[i] = new RMItem; _specialPointer[i] = new RMItem;
ds >> *_specialPointer[i]; ds >> *_specialPointer[i];
} }
//m_hotspot[0].Set(19,5); //m_hotspot[0].set(19,5);
_hotspot[0].Set(5, 1); _hotspot[0].set(5, 1);
_hotspot[1].Set(32, 28); _hotspot[1].set(32, 28);
_hotspot[2].Set(45, 23); _hotspot[2].set(45, 23);
_hotspot[3].Set(35, 25); _hotspot[3].set(35, 25);
_hotspot[4].Set(32, 28); _hotspot[4].set(32, 28);
// Default=GO // Default=GO
_nCurPointer = 0; _nCurPointer = 0;

View file

@ -39,18 +39,18 @@ namespace Tony {
#define INIT_GFX16_FROMRAW(dwRes, buf16) \ #define INIT_GFX16_FROMRAW(dwRes, buf16) \
raw = new RMResRaw(dwRes); \ raw = new RMResRaw(dwRes); \
assert(raw->IsValid()); \ assert(raw->isValid()); \
assert((buf16) == NULL); \ assert((buf16) == NULL); \
(buf16) = new RMGfxSourceBuffer16(false); \ (buf16) = new RMGfxSourceBuffer16(false); \
(buf16)->init(*raw,raw->Width(),raw->Height()); \ (buf16)->init(*raw,raw->width(),raw->height()); \
delete raw; delete raw;
#define INIT_GFX8_FROMRAW(raw, dwRes, buf8) \ #define INIT_GFX8_FROMRAW(raw, dwRes, buf8) \
raw = new RMResRaw(dwRes); \ raw = new RMResRaw(dwRes); \
assert(raw->IsValid()); \ assert(raw->isValid()); \
assert((buf8) == NULL); \ assert((buf8) == NULL); \
(buf8) = new RMGfxSourceBuffer8RLEByte(); \ (buf8) = new RMGfxSourceBuffer8RLEByte(); \
(buf8)->init(*raw, raw->Width(), raw->Height(), true); \ (buf8)->init(*raw, raw->width(), raw->height(), true); \
delete raw; delete raw;
@ -115,7 +115,7 @@ public:
void setSpecialPointer(POINTER ptr) { void setSpecialPointer(POINTER ptr) {
_nCurSpecialPointer = ptr; _nCurSpecialPointer = ptr;
if (_nCurSpecialPointer && _nCurSpecialPointer != PTR_CUSTOM) if (_nCurSpecialPointer && _nCurSpecialPointer != PTR_CUSTOM)
_specialPointer[ptr - 1]->SetPattern(1); _specialPointer[ptr - 1]->setPattern(1);
} }
POINTER getSpecialPointer(void) { POINTER getSpecialPointer(void) {
return (POINTER)_nCurSpecialPointer; return (POINTER)_nCurSpecialPointer;

View file

@ -146,7 +146,7 @@ int RMGfxSourceBuffer::init(const byte *buf, int dimx, int dimy, bool bLoadPalet
void RMGfxSourceBuffer::init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) { void RMGfxSourceBuffer::init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) {
create(dimx, dimy, Bpp()); create(dimx, dimy, Bpp());
ds.Read(_buf, dimx * dimy * Bpp() / 8); ds.read(_buf, dimx * dimy * Bpp() / 8);
// Invokes the method for preparing the surface (inherited) // Invokes the method for preparing the surface (inherited)
prepareImage(); prepareImage();
@ -448,7 +448,7 @@ void RMGfxSourceBufferPal::init(RMDataStream &ds, int dimx, int dimy, bool bLoad
// Load the palette if necessary // Load the palette if necessary
if (bLoadPalette) { if (bLoadPalette) {
byte *suxpal = new byte[256 * 3]; byte *suxpal = new byte[256 * 3];
ds.Read(suxpal, 256 * 3); ds.read(suxpal, 256 * 3);
loadPaletteWA(suxpal); loadPaletteWA(suxpal);
delete[] suxpal; delete[] suxpal;
} }
@ -512,8 +512,8 @@ void RMGfxSourceBuffer8::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimit
u = prim->Src().x1; u = prim->Src().x1;
v = prim->Src().y1; v = prim->Src().y1;
width = prim->Src().Width(); width = prim->Src().width();
height = prim->Src().Height(); height = prim->Src().height();
} }
if (!clip2D(dst.x1, dst.y1, u, v, width, height, prim->haveSrc(), &bigBuf)) if (!clip2D(dst.x1, dst.y1, u, v, width, height, prim->haveSrc(), &bigBuf))
@ -620,8 +620,8 @@ void RMGfxSourceBuffer8AB::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrim
u = prim->Src().x1; u = prim->Src().x1;
v = prim->Src().y1; v = prim->Src().y1;
width = prim->Src().Width(); width = prim->Src().width();
height = prim->Src().Height(); height = prim->Src().height();
} }
if (!clip2D(dst.x1, dst.y1, u, v, width, height, prim->haveSrc(), &bigBuf)) if (!clip2D(dst.x1, dst.y1, u, v, width, height, prim->haveSrc(), &bigBuf))
@ -702,7 +702,7 @@ void RMGfxSourceBuffer8RLE::init(RMDataStream &ds, int dimx, int dimy, bool bLoa
ds >> size; ds >> size;
_buf = new byte[size]; _buf = new byte[size];
ds.Read(_buf, size); ds.read(_buf, size);
_dimx = dimx; _dimx = dimx;
_dimy = dimy; _dimy = dimy;
@ -1767,7 +1767,7 @@ void RMGfxSourceBuffer8RLEByteAA::init(RMDataStream &ds, int dimx, int dimy, boo
if (!bNeedRLECompress) { if (!bNeedRLECompress) {
// Load the anti-aliasing mask // Load the anti-aliasing mask
_aabuf = new byte[dimx * dimy]; _aabuf = new byte[dimx * dimy];
ds.Read(_aabuf, dimx * dimy); ds.read(_aabuf, dimx * dimy);
} }
} }
@ -1805,7 +1805,7 @@ void RMGfxSourceBuffer8RLEWordAA::init(RMDataStream &ds, int dimx, int dimy, boo
if (!bNeedRLECompress) { if (!bNeedRLECompress) {
// Load the anti-aliasing mask // Load the anti-aliasing mask
_aabuf = new byte[dimx * dimy]; _aabuf = new byte[dimx * dimy];
ds.Read(_aabuf, dimx * dimy); ds.read(_aabuf, dimx * dimy);
} }
} }
@ -1839,8 +1839,8 @@ void RMGfxSourceBuffer16::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimi
if (prim->haveSrc()) { if (prim->haveSrc()) {
u = prim->Src().x1; u = prim->Src().x1;
v = prim->Src().y1; v = prim->Src().y1;
dimx = prim->Src().Width(); dimx = prim->Src().width();
dimy = prim->Src().Height(); dimy = prim->Src().height();
} }
if (prim->haveDst()) { if (prim->haveDst()) {
@ -1932,11 +1932,11 @@ void RMGfxBox::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim)
buf += rcDst.y1 * bigBuf.getDimx() + rcDst.x1; buf += rcDst.y1 * bigBuf.getDimx() + rcDst.x1;
// Loop through the pixels // Loop through the pixels
for (j = 0; j < rcDst.Height(); j++) { for (j = 0; j < rcDst.height(); j++) {
for (i = 0; i < rcDst.Width(); i++) for (i = 0; i < rcDst.width(); i++)
*buf ++ = wFillColor; *buf ++ = wFillColor;
buf += bigBuf.getDimx() - rcDst.Width(); buf += bigBuf.getDimx() - rcDst.width();
} }
} }

View file

@ -110,8 +110,8 @@ public:
RMGfxPrimitive() { RMGfxPrimitive() {
_bFlag = 0; _bFlag = 0;
_task = NULL; _task = NULL;
_src.SetEmpty(); _src.setEmpty();
_dst.SetEmpty(); _dst.setEmpty();
} }
RMGfxPrimitive(RMGfxTask *task) { RMGfxPrimitive(RMGfxTask *task) {
@ -124,41 +124,41 @@ public:
_src = src; _src = src;
_dst = dst; _dst = dst;
_bFlag = 0; _bFlag = 0;
_bStretch = (src.Width() != dst.Width() || src.Height() != dst.Height()); _bStretch = (src.width() != dst.width() || src.height() != dst.height());
} }
RMGfxPrimitive(RMGfxTask *task, const RMPoint &src, RMRect &dst) { RMGfxPrimitive(RMGfxTask *task, const RMPoint &src, RMRect &dst) {
_task = task; _task = task;
_src.TopLeft() = src; _src.topLeft() = src;
_dst = dst; _dst = dst;
_bFlag = 0; _bFlag = 0;
} }
RMGfxPrimitive(RMGfxTask *task, const RMPoint &src, RMPoint &dst) { RMGfxPrimitive(RMGfxTask *task, const RMPoint &src, RMPoint &dst) {
_task = task; _task = task;
_src.TopLeft() = src; _src.topLeft() = src;
_dst.TopLeft() = dst; _dst.topLeft() = dst;
_bFlag = 0; _bFlag = 0;
} }
RMGfxPrimitive(RMGfxTask *task, const RMRect &src, RMPoint &dst) { RMGfxPrimitive(RMGfxTask *task, const RMRect &src, RMPoint &dst) {
_task = task; _task = task;
_src = src; _src = src;
_dst.TopLeft() = dst; _dst.topLeft() = dst;
_bFlag = 0; _bFlag = 0;
} }
RMGfxPrimitive(RMGfxTask *task, const RMRect &dst) { RMGfxPrimitive(RMGfxTask *task, const RMRect &dst) {
_task = task; _task = task;
_dst = dst; _dst = dst;
_src.SetEmpty(); _src.setEmpty();
_bFlag = 0; _bFlag = 0;
} }
RMGfxPrimitive(RMGfxTask *task, const RMPoint &dst) { RMGfxPrimitive(RMGfxTask *task, const RMPoint &dst) {
_task = task; _task = task;
_dst.TopLeft() = dst; _dst.topLeft() = dst;
_src.SetEmpty(); _src.setEmpty();
_bFlag = 0; _bFlag = 0;
} }
@ -174,27 +174,27 @@ public:
_src = src; _src = src;
} }
void setSrc(const RMPoint &src) { void setSrc(const RMPoint &src) {
_src.TopLeft() = src; _src.topLeft() = src;
} }
void setDst(const RMRect &dst) { void setDst(const RMRect &dst) {
_dst = dst; _dst = dst;
} }
void setDst(const RMPoint &dst) { void setDst(const RMPoint &dst) {
_dst.TopLeft() = dst; _dst.topLeft() = dst;
} }
void setStrecth(bool bStretch) { void setStrecth(bool bStretch) {
_bStretch = bStretch; _bStretch = bStretch;
} }
bool haveDst() { bool haveDst() {
return !_dst.IsEmpty(); return !_dst.isEmpty();
} }
RMRect &Dst() { RMRect &Dst() {
return _dst; return _dst;
} }
bool haveSrc() { bool haveSrc() {
return !_src.IsEmpty(); return !_src.isEmpty();
} }
RMRect &Src() { RMRect &Src() {
return _src; return _src;

View file

@ -126,7 +126,7 @@ void RMGfxEngine::openOptionScreen(CORO_PARAM, int type) {
if (type == 1 || type == 2) { if (type == 1 || type == 2) {
GLOBALS.bIdleExited = true; GLOBALS.bIdleExited = true;
} else { } else {
CORO_INVOKE_0(_tony.StopNoAction); CORO_INVOKE_0(_tony.stopNoAction);
GLOBALS.bIdleExited = false; GLOBALS.bIdleExited = false;
@ -170,7 +170,7 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) {
_loc.doFrame(&_bigBuf); _loc.doFrame(&_bigBuf);
// Check the mouse input // Check the mouse input
if (_bInput && !_tony.InAction()) { if (_bInput && !_tony.inAction()) {
// If we are on the inventory, it is it who controls all input // If we are on the inventory, it is it who controls all input
if (_inv.haveFocus(_input.mousePos()) && !_inter.active()) { if (_inv.haveFocus(_input.mousePos()) && !_inter.active()) {
// Left Click // Left Click
@ -197,7 +197,7 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) {
// ************* // *************
if (_input.mouseRightReleased()) { if (_input.mouseRightReleased()) {
if (_inv.rightRelease(_input.mousePos(), _curAction)) { if (_inv.rightRelease(_input.mousePos(), _curAction)) {
CORO_INVOKE_3(_tony.MoveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), _curAction); CORO_INVOKE_3(_tony.moveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), _curAction);
_curAction = TA_GOTO; _curAction = TA_GOTO;
_point.setAction(_curAction); _point.setAction(_curAction);
@ -207,7 +207,7 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) {
// Options Menu // Options Menu
// ************ // ************
if (_bGUIOption) { if (_bGUIOption) {
if (!_tony.InAction() && _bInput) { if (!_tony.inAction() && _bInput) {
if ((_input.mouseLeftClicked() && _input.mousePos().x < 3 && _input.mousePos().y < 3)) { if ((_input.mouseLeftClicked() && _input.mousePos().x < 3 && _input.mousePos().y < 3)) {
CORO_INVOKE_1(openOptionScreen, 0); CORO_INVOKE_1(openOptionScreen, 0);
goto SKIPCLICKSINISTRO; goto SKIPCLICKSINISTRO;
@ -229,9 +229,9 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) {
if (_input.mouseLeftClicked() && !_inter.active()) { if (_input.mouseLeftClicked() && !_inter.active()) {
if (_curAction != TA_COMBINE) if (_curAction != TA_COMBINE)
CORO_INVOKE_3(_tony.MoveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), _point.curAction()); CORO_INVOKE_3(_tony.moveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), _point.curAction());
else if (_itemName.getSelectedItem() != NULL) else if (_itemName.getSelectedItem() != NULL)
CORO_INVOKE_4(_tony.MoveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), TA_COMBINE, _curActionObj); CORO_INVOKE_4(_tony.moveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), TA_COMBINE, _curActionObj);
if (_curAction == TA_COMBINE) { if (_curAction == TA_COMBINE) {
_inv.endCombine(); _inv.endCombine();
@ -271,7 +271,7 @@ SKIPCLICKSINISTRO:
if (_bGUIInterface) { if (_bGUIInterface) {
if (_inter.released(_input.mousePos(), _curAction)) { if (_inter.released(_input.mousePos(), _curAction)) {
_point.setAction(_curAction); _point.setAction(_curAction);
CORO_INVOKE_3(_tony.MoveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), _curAction); CORO_INVOKE_3(_tony.moveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), _curAction);
_curAction = TA_GOTO; _curAction = TA_GOTO;
_point.setAction(_curAction); _point.setAction(_curAction);
@ -288,23 +288,23 @@ SKIPCLICKSINISTRO:
// Interface & Inventory // Interface & Inventory
_inter.doFrame(_bigBuf, _input.mousePos()); _inter.doFrame(_bigBuf, _input.mousePos());
_inv.doFrame(_bigBuf, _point, _input.mousePos(), (!_tony.InAction() && !_inter.active() && _bGUIInventory)); _inv.doFrame(_bigBuf, _point, _input.mousePos(), (!_tony.inAction() && !_inter.active() && _bGUIInventory));
} }
// Animate Tony // Animate Tony
CORO_INVOKE_2(_tony.DoFrame, &_bigBuf, _nCurLoc); CORO_INVOKE_2(_tony.doFrame, &_bigBuf, _nCurLoc);
// Update screen scrolling to keep Tony in focus // Update screen scrolling to keep Tony in focus
if (_tony.MustUpdateScrolling() && _bLocationLoaded) { if (_tony.mustUpdateScrolling() && _bLocationLoaded) {
RMPoint showThis = _tony.Position(); RMPoint showThis = _tony.position();
showThis.y -= 60; showThis.y -= 60;
_loc.UpdateScrolling(showThis); _loc.updateScrolling(showThis);
} }
if (_bLocationLoaded) if (_bLocationLoaded)
_tony.SetScrollPosition(_loc.ScrollPosition()); _tony.setScrollPosition(_loc.scrollPosition());
if ((!_tony.InAction() && _bInput) || _bAlwaysDrawMouse) { if ((!_tony.inAction() && _bInput) || _bAlwaysDrawMouse) {
_point.setCoord(_input.mousePos()); _point.setCoord(_input.mousePos());
_point.doFrame(&_bigBuf); _point.doFrame(&_bigBuf);
} }
@ -362,17 +362,17 @@ void RMGfxEngine::itemIrq(uint32 dwItem, int nPattern, int nStatus) {
assert(GLOBALS.GfxEngine); assert(GLOBALS.GfxEngine);
if (GLOBALS.GfxEngine->_bLocationLoaded) { if (GLOBALS.GfxEngine->_bLocationLoaded) {
item = GLOBALS.GfxEngine->_loc.GetItemFromCode(dwItem); item = GLOBALS.GfxEngine->_loc.getItemFromCode(dwItem);
if (item != NULL) { if (item != NULL) {
if (nPattern != -1) { if (nPattern != -1) {
if (GLOBALS.bPatIrqFreeze) if (GLOBALS.bPatIrqFreeze)
mainFreeze(); mainFreeze();
item->SetPattern(nPattern, true); item->setPattern(nPattern, true);
if (GLOBALS.bPatIrqFreeze) if (GLOBALS.bPatIrqFreeze)
mainUnfreeze(); mainUnfreeze();
} }
if (nStatus != -1) if (nStatus != -1)
item->SetStatus(nStatus); item->setStatus(nStatus);
} }
} }
} }
@ -384,12 +384,12 @@ void RMGfxEngine::initForNewLocation(int nLoc, RMPoint ptTonyStart, RMPoint star
start.y = ptTonyStart.y - RM_SY / 2; start.y = ptTonyStart.y - RM_SY / 2;
} }
_loc.SetScrollPosition(start); _loc.setScrollPosition(start);
if (ptTonyStart.x == 0 && ptTonyStart.y == 0) { if (ptTonyStart.x == 0 && ptTonyStart.y == 0) {
} else { } else {
_tony.SetPosition(ptTonyStart, nLoc); _tony.setPosition(ptTonyStart, nLoc);
_tony.SetScrollPosition(start); _tony.setScrollPosition(start);
} }
_curAction = TA_GOTO; _curAction = TA_GOTO;
@ -412,10 +412,10 @@ uint32 RMGfxEngine::loadLocation(int nLoc, RMPoint ptTonyStart, RMPoint start) {
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
// Try the loading of the location // Try the loading of the location
RMRes res(_nCurLoc); RMRes res(_nCurLoc);
if (!res.IsValid()) if (!res.isValid())
continue; continue;
_loc.Load(res); _loc.load(res);
initForNewLocation(nLoc, ptTonyStart, start); initForNewLocation(nLoc, ptTonyStart, start);
bLoaded = true; bLoaded = true;
break; break;
@ -455,7 +455,7 @@ void RMGfxEngine::unloadLocation(CORO_PARAM, bool bDoOnExit, uint32 *result) {
_bLocationLoaded = false; _bLocationLoaded = false;
_bigBuf.clearOT(); _bigBuf.clearOT();
_loc.Unload(); _loc.unload();
if (result != NULL) if (result != NULL)
*result = CORO_INVALID_PID_VALUE; *result = CORO_INVALID_PID_VALUE;
@ -503,7 +503,7 @@ void RMGfxEngine::init() {
// Initialise Tony // Initialise Tony
_tony.init(); _tony.init();
_tony.LinkToBoxes(&_vm->_theBoxes); _tony.linkToBoxes(&_vm->_theBoxes);
// Initialise the inventory and the interface // Initialise the inventory and the interface
_inv.init(); _inv.init();
@ -515,7 +515,7 @@ void RMGfxEngine::init() {
enableInput(); enableInput();
// Starting the game // Starting the game
_tony.ExecuteAction(20, 1, 0); _tony.executeAction(20, 1, 0);
} }
void RMGfxEngine::close(void) { void RMGfxEngine::close(void) {
@ -523,7 +523,7 @@ void RMGfxEngine::close(void) {
_inter.close(); _inter.close();
_inv.close(); _inv.close();
_tony.Close(); _tony.close();
_point.close(); _point.close();
_input.close(); _input.close();
} }
@ -579,7 +579,7 @@ void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Comm
uint size; uint size;
int i; int i;
char buf[4]; char buf[4];
RMPoint tp = _tony.Position(); RMPoint tp = _tony.position();
// Saving: MPAL variables, current location, and Tony inventory position // Saving: MPAL variables, current location, and Tony inventory position
@ -627,9 +627,9 @@ void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Comm
delete[] state; delete[] state;
// boxes // boxes
size = _vm->_theBoxes.GetSaveStateSize(); size = _vm->_theBoxes.getSaveStateSize();
state = new byte[size]; state = new byte[size];
_vm->_theBoxes.SaveState(state); _vm->_theBoxes.saveState(state);
f->writeUint32LE(size); f->writeUint32LE(size);
f->write(state, size); f->write(state, size);
delete[] state; delete[] state;
@ -638,7 +638,7 @@ void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Comm
bool bStat; bool bStat;
// Saves the state of the shepherdess and show yourself // Saves the state of the shepherdess and show yourself
bStat = _tony.GetPastorella(); bStat = _tony.getPastorella();
f->writeByte(bStat); f->writeByte(bStat);
bStat = _inter.getPalesati(); bStat = _inter.getPalesati();
f->writeByte(bStat); f->writeByte(bStat);
@ -765,7 +765,7 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
_ctx->size = _ctx->f->readUint32LE(); _ctx->size = _ctx->f->readUint32LE();
_ctx->state = new byte[_ctx->size]; _ctx->state = new byte[_ctx->size];
_ctx->f->read(_ctx->state, _ctx->size); _ctx->f->read(_ctx->state, _ctx->size);
_vm->_theBoxes.LoadState(_ctx->state); _vm->_theBoxes.loadState(_ctx->state);
delete[] _ctx->state; delete[] _ctx->state;
} }
@ -774,7 +774,7 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
bool bStat = false; bool bStat = false;
bStat = _ctx->f->readByte(); bStat = _ctx->f->readByte();
_tony.SetPastorella(bStat); _tony.setPastorella(bStat);
bStat = _ctx->f->readByte(); bStat = _ctx->f->readByte();
_inter.setPalesati(bStat); _inter.setPalesati(bStat);
@ -813,7 +813,7 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
CORO_INVOKE_2(unloadLocation, false, NULL); CORO_INVOKE_2(unloadLocation, false, NULL);
loadLocation(_ctx->loc, _ctx->tp, RMPoint(-1, -1)); loadLocation(_ctx->loc, _ctx->tp, RMPoint(-1, -1));
_tony.SetPattern(RMTony::PAT_STANDRIGHT); _tony.setPattern(RMTony::PAT_STANDRIGHT);
mainUnfreeze(); mainUnfreeze();
// On older versions, need to an enter action // On older versions, need to an enter action
@ -838,7 +838,7 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
void RMGfxEngine::pauseSound(bool bPause) { void RMGfxEngine::pauseSound(bool bPause) {
if (_bLocationLoaded) if (_bLocationLoaded)
_loc.PauseSound(bPause); _loc.pauseSound(bPause);
} }
void RMGfxEngine::initWipe(int type) { void RMGfxEngine::initWipe(int type) {
@ -861,7 +861,7 @@ void RMGfxEngine::waitWipeEnd(CORO_PARAM) {
} }
bool RMGfxEngine::canLoadSave() { bool RMGfxEngine::canLoadSave() {
return _bInput && !_tony.InAction() && !_vm->getIsDemo(); return _bInput && !_tony.inAction() && !_vm->getIsDemo();
} }
} // End of namespace Tony } // End of namespace Tony

View file

@ -34,7 +34,7 @@ namespace Tony {
RMInput::RMInput() { RMInput::RMInput() {
// Setup mouse fields // Setup mouse fields
_clampMouse = false; _clampMouse = false;
_mousePos.Set(0, 0); _mousePos.set(0, 0);
_leftButton = _rightButton = false; _leftButton = _rightButton = false;
_leftClickMouse = _leftReleaseMouse = false; _leftClickMouse = _leftReleaseMouse = false;
_rightClickMouse = _rightReleaseMouse = false; _rightClickMouse = _rightReleaseMouse = false;
@ -60,7 +60,7 @@ void RMInput::poll(void) {
case Common::EVENT_LBUTTONUP: case Common::EVENT_LBUTTONUP:
case Common::EVENT_RBUTTONDOWN: case Common::EVENT_RBUTTONDOWN:
case Common::EVENT_RBUTTONUP: case Common::EVENT_RBUTTONUP:
_mousePos.Set(_event.mouse.x, _event.mouse.y); _mousePos.set(_event.mouse.x, _event.mouse.y);
if (_event.type == Common::EVENT_LBUTTONDOWN) { if (_event.type == Common::EVENT_LBUTTONDOWN) {
_leftButton = true; _leftButton = true;

View file

@ -97,47 +97,47 @@ void RMInventory::init(void) {
RMRes res(curres); RMRes res(curres);
RMDataStream ds; RMDataStream ds;
assert(res.IsValid()); assert(res.isValid());
// Initialise the MPAL inventory item by reading it in. // Initialise the MPAL inventory item by reading it in.
_items[i].icon.SetInitCurPattern(false); _items[i].icon.setInitCurPattern(false);
ds.OpenBuffer(res); ds.openBuffer(res);
ds >> _items[i].icon; ds >> _items[i].icon;
ds.Close(); ds.close();
// Puts in the default pattern 1 // Puts in the default pattern 1
_items[i].pointer = NULL; _items[i].pointer = NULL;
_items[i].status = 1; _items[i].status = 1;
_items[i].icon.SetPattern(1); _items[i].icon.setPattern(1);
_items[i].icon.doFrame(this, false); _items[i].icon.doFrame(this, false);
curres++; curres++;
if (i == 0 || i == 28 || i == 29) if (i == 0 || i == 28 || i == 29)
continue; continue;
_items[i].pointer = new RMGfxSourceBuffer8RLEByteAA[_items[i].icon.NumPattern()]; _items[i].pointer = new RMGfxSourceBuffer8RLEByteAA[_items[i].icon.numPattern()];
for (j = 0; j < _items[i].icon.NumPattern(); j++) { for (j = 0; j < _items[i].icon.numPattern(); j++) {
RMResRaw raw(curres); RMResRaw raw(curres);
assert(raw.IsValid()); assert(raw.isValid());
_items[i].pointer[j].init((const byte *)raw, raw.Width(), raw.Height(), true); _items[i].pointer[j].init((const byte *)raw, raw.width(), raw.height(), true);
curres++; curres++;
} }
} }
_items[28].icon.SetPattern(1); _items[28].icon.setPattern(1);
_items[29].icon.SetPattern(1); _items[29].icon.setPattern(1);
// Download interface // Download interface
RMDataStream ds; RMDataStream ds;
RMRes res(RES_I_MINIINTER); RMRes res(RES_I_MINIINTER);
assert(res.IsValid()); assert(res.isValid());
ds.OpenBuffer(res); ds.openBuffer(res);
ds >> miniInterface; ds >> miniInterface;
miniInterface.SetPattern(1); miniInterface.setPattern(1);
ds.Close(); ds.close();
// Create the text for hints on the mini interface // Create the text for hints on the mini interface
_hints[0].setAlignType(RMText::HCENTER, RMText::VTOP); _hints[0].setAlignType(RMText::HCENTER, RMText::VTOP);
@ -202,11 +202,11 @@ void RMInventory::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
if (_state == SELECTING) { if (_state == SELECTING) {
if (!GLOBALS.bCfgInvUp) { if (!GLOBALS.bCfgInvUp) {
_ctx->pos.Set((_nSelectObj + 1) * 64 - 20, RM_SY - 113); _ctx->pos.set((_nSelectObj + 1) * 64 - 20, RM_SY - 113);
_ctx->pos2.Set((_nSelectObj + 1) * 64 + 34, RM_SY - 150); _ctx->pos2.set((_nSelectObj + 1) * 64 + 34, RM_SY - 150);
} else { } else {
_ctx->pos.Set((_nSelectObj + 1) * 64 - 20, 72 - 4); // The brown part is at the top :( _ctx->pos.set((_nSelectObj + 1) * 64 - 20, 72 - 4); // The brown part is at the top :(
_ctx->pos2.Set((_nSelectObj + 1) * 64 + 34, 119 - 4); _ctx->pos2.set((_nSelectObj + 1) * 64 + 34, 119 - 4);
} }
_ctx->p = new RMGfxPrimitive(prim->_task, _ctx->pos); _ctx->p = new RMGfxPrimitive(prim->_task, _ctx->pos);
@ -264,7 +264,7 @@ void RMInventory::addItem(int code) {
g_system->lockMutex(_csModifyInterface); g_system->lockMutex(_csModifyInterface);
if (_curPos + 8 == _nInv) { if (_curPos + 8 == _nInv) {
// Break through the inventory! On the flashing pattern // Break through the inventory! On the flashing pattern
_items[28].icon.SetPattern(2); _items[28].icon.setPattern(2);
} }
_inv[_nInv++] = code - 10000; _inv[_nInv++] = code - 10000;
@ -281,7 +281,7 @@ void RMInventory::changeItemStatus(uint32 code, uint32 dwStatus) {
error("Specified object code is not valid"); error("Specified object code is not valid");
} else { } else {
g_system->lockMutex(_csModifyInterface); g_system->lockMutex(_csModifyInterface);
_items[code - 10000].icon.SetPattern(dwStatus); _items[code - 10000].icon.setPattern(dwStatus);
_items[code - 10000].status = dwStatus; _items[code - 10000].status = dwStatus;
prepare(); prepare();
@ -355,12 +355,12 @@ bool RMInventory::leftClick(const RMPoint &mpos, int &nCombineObj) {
if (_curPos + 8 >= _nInv) { if (_curPos + 8 >= _nInv) {
_bBlinkingRight = false; _bBlinkingRight = false;
_items[28].icon.SetPattern(1); _items[28].icon.setPattern(1);
} }
if (_curPos > 0) { if (_curPos > 0) {
_bBlinkingLeft = true; _bBlinkingLeft = true;
_items[29].icon.SetPattern(2); _items[29].icon.setPattern(2);
} }
prepare(); prepare();
@ -376,12 +376,12 @@ bool RMInventory::leftClick(const RMPoint &mpos, int &nCombineObj) {
if (_curPos == 0) { if (_curPos == 0) {
_bBlinkingLeft = false; _bBlinkingLeft = false;
_items[29].icon.SetPattern(1); _items[29].icon.setPattern(1);
} }
if (_curPos + 8 < _nInv) { if (_curPos + 8 < _nInv) {
_bBlinkingRight = true; _bBlinkingRight = true;
_items[28].icon.SetPattern(2); _items[28].icon.setPattern(2);
} }
prepare(); prepare();
@ -420,12 +420,12 @@ void RMInventory::rightClick(const RMPoint &mpos) {
if (_curPos + 8 <= _nInv) { if (_curPos + 8 <= _nInv) {
_bBlinkingRight = false; _bBlinkingRight = false;
_items[28].icon.SetPattern(1); _items[28].icon.setPattern(1);
} }
if (_curPos > 0) { if (_curPos > 0) {
_bBlinkingLeft = true; _bBlinkingLeft = true;
_items[29].icon.SetPattern(2); _items[29].icon.setPattern(2);
} }
prepare(); prepare();
@ -441,12 +441,12 @@ void RMInventory::rightClick(const RMPoint &mpos) {
if (_curPos == 0) { if (_curPos == 0) {
_bBlinkingLeft = false; _bBlinkingLeft = false;
_items[29].icon.SetPattern(1); _items[29].icon.setPattern(1);
} }
if (_curPos + 8 < _nInv) { if (_curPos + 8 < _nInv) {
_bBlinkingRight = true; _bBlinkingRight = true;
_items[28].icon.SetPattern(2); _items[28].icon.setPattern(2);
} }
prepare(); prepare();
@ -495,24 +495,24 @@ void RMInventory::doFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
if ((_state == CLOSING || _state == OPENING || _state == OPENED) && checkPointInside(mpos)) { if ((_state == CLOSING || _state == OPENING || _state == OPENED) && checkPointInside(mpos)) {
if (mpos.x > RM_SX - 64) { if (mpos.x > RM_SX - 64) {
if (_curPos + 8 < _nInv && !_bBlinkingRight) { if (_curPos + 8 < _nInv && !_bBlinkingRight) {
_items[28].icon.SetPattern(3); _items[28].icon.setPattern(3);
_bBlinkingRight = true; _bBlinkingRight = true;
bNeedRedraw = true; bNeedRedraw = true;
} }
} else if (_bBlinkingRight) { } else if (_bBlinkingRight) {
_items[28].icon.SetPattern(2); _items[28].icon.setPattern(2);
_bBlinkingRight = false; _bBlinkingRight = false;
bNeedRedraw = true; bNeedRedraw = true;
} }
if (mpos.x < 64) { if (mpos.x < 64) {
if (_curPos > 0 && !_bBlinkingLeft) { if (_curPos > 0 && !_bBlinkingLeft) {
_items[29].icon.SetPattern(3); _items[29].icon.setPattern(3);
_bBlinkingLeft = true; _bBlinkingLeft = true;
bNeedRedraw = true; bNeedRedraw = true;
} }
} else if (_bBlinkingLeft) { } else if (_bBlinkingLeft) {
_items[29].icon.SetPattern(2); _items[29].icon.setPattern(2);
_bBlinkingLeft = false; _bBlinkingLeft = false;
bNeedRedraw = true; bNeedRedraw = true;
} }
@ -633,28 +633,28 @@ void RMInventory::doFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
if (mpos.y > starty && mpos.y < starty + 45) { if (mpos.y > starty && mpos.y < starty + 45) {
if (mpos.x > startx && mpos.x < startx + 40) { if (mpos.x > startx && mpos.x < startx + 40) {
if (miniAction != 1) { if (miniAction != 1) {
miniInterface.SetPattern(2); miniInterface.setPattern(2);
miniAction = 1; miniAction = 1;
_vm->playUtilSFX(1); _vm->playUtilSFX(1);
} }
} else if (mpos.x >= startx + 40 && mpos.x < startx + 80) { } else if (mpos.x >= startx + 40 && mpos.x < startx + 80) {
if (miniAction != 2) { if (miniAction != 2) {
miniInterface.SetPattern(3); miniInterface.setPattern(3);
miniAction = 2; miniAction = 2;
_vm->playUtilSFX(1); _vm->playUtilSFX(1);
} }
} else if (mpos.x >= startx + 80 && mpos.x < startx + 108) { } else if (mpos.x >= startx + 80 && mpos.x < startx + 108) {
if (miniAction != 3) { if (miniAction != 3) {
miniInterface.SetPattern(4); miniInterface.setPattern(4);
miniAction = 3; miniAction = 3;
_vm->playUtilSFX(1); _vm->playUtilSFX(1);
} }
} else { } else {
miniInterface.SetPattern(1); miniInterface.setPattern(1);
miniAction = 0; miniAction = 0;
} }
} else { } else {
miniInterface.SetPattern(1); miniInterface.setPattern(1);
miniAction = 0; miniAction = 0;
} }
@ -729,19 +729,19 @@ int RMInventory::loadState(byte *state) {
if (i < _nItems) { if (i < _nItems) {
_items[i].status = x; _items[i].status = x;
_items[i].icon.SetPattern(x); _items[i].icon.setPattern(x);
} }
} }
_curPos = 0; _curPos = 0;
_bCombining = false; _bCombining = false;
_items[29].icon.SetPattern(1); _items[29].icon.setPattern(1);
if (_nInv > 8) if (_nInv > 8)
_items[28].icon.SetPattern(2); _items[28].icon.setPattern(2);
else else
_items[28].icon.SetPattern(1); _items[28].icon.setPattern(1);
prepare(); prepare();
drawOT(Common::nullContext); drawOT(Common::nullContext);
@ -774,7 +774,7 @@ int RMInterface::onWhichBox(RMPoint pt) {
// Find the verb // Find the verb
for (i = 0; i < max; i++) for (i = 0; i < max; i++)
if (_hotbbox[i].PtInRect(pt)) if (_hotbbox[i].ptInRect(pt))
return i; return i;
// Found no verb // Found no verb
@ -788,13 +788,13 @@ void RMInterface::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
prim->Dst().TopLeft() = _openStart; prim->Dst().topLeft() = _openStart;
CORO_INVOKE_2(RMGfxSourceBuffer8RLEByte::draw, bigBuf, prim); CORO_INVOKE_2(RMGfxSourceBuffer8RLEByte::draw, bigBuf, prim);
// Check if there is a draw hot zone // Check if there is a draw hot zone
_ctx->h = onWhichBox(_mpos); _ctx->h = onWhichBox(_mpos);
if (_ctx->h != -1) { if (_ctx->h != -1) {
prim->Dst().TopLeft() = _openStart; prim->Dst().topLeft() = _openStart;
CORO_INVOKE_2(_hotzone[_ctx->h].draw, bigBuf, prim); CORO_INVOKE_2(_hotzone[_ctx->h].draw, bigBuf, prim);
if (_lastHotZone != _ctx->h) { if (_lastHotZone != _ctx->h) {
@ -803,7 +803,7 @@ void RMInterface::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
} }
if (GLOBALS.bCfgInterTips) { if (GLOBALS.bCfgInterTips) {
prim->Dst().TopLeft() = _openStart + RMPoint(70, 177); prim->Dst().topLeft() = _openStart + RMPoint(70, 177);
CORO_INVOKE_2(_hints[_ctx->h].draw, bigBuf, prim); CORO_INVOKE_2(_hints[_ctx->h].draw, bigBuf, prim);
} }
} else } else
@ -896,21 +896,21 @@ void RMInterface::init(void) {
setPriority(191); setPriority(191);
RMGfxSourceBuffer::init(inter, inter.Width(), inter.Height()); RMGfxSourceBuffer::init(inter, inter.width(), inter.height());
loadPaletteWA(RES_I_INTERPAL); loadPaletteWA(RES_I_INTERPAL);
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
RMResRaw part(RES_I_INTERP1 + i); RMResRaw part(RES_I_INTERP1 + i);
_hotzone[i].init(part, part.Width(), part.Height()); _hotzone[i].init(part, part.width(), part.height());
_hotzone[i].loadPaletteWA(pal); _hotzone[i].loadPaletteWA(pal);
} }
_hotbbox[0].SetRect(126, 123, 159, 208); // Take _hotbbox[0].setRect(126, 123, 159, 208); // Take
_hotbbox[1].SetRect(90, 130, 125, 186); // About _hotbbox[1].setRect(90, 130, 125, 186); // About
_hotbbox[2].SetRect(110, 60, 152, 125); _hotbbox[2].setRect(110, 60, 152, 125);
_hotbbox[3].SetRect(56, 51, 93, 99); _hotbbox[3].setRect(56, 51, 93, 99);
_hotbbox[4].SetRect(51, 105, 82, 172); _hotbbox[4].setRect(51, 105, 82, 172);
_hints[0].setAlignType(RMText::HRIGHT, RMText::VTOP); _hints[0].setAlignType(RMText::HRIGHT, RMText::VTOP);
_hints[1].setAlignType(RMText::HRIGHT, RMText::VTOP); _hints[1].setAlignType(RMText::HRIGHT, RMText::VTOP);

View file

@ -123,11 +123,11 @@ public:
// Add an item to the inventory // Add an item to the inventory
void addItem(int code); void addItem(int code);
RMInventory &operator+=(RMItem *item) { RMInventory &operator+=(RMItem *item) {
addItem(item->MpalCode()); addItem(item->mpalCode());
return *this; return *this;
} }
RMInventory &operator+=(RMItem &item) { RMInventory &operator+=(RMItem &item) {
addItem(item.MpalCode()); addItem(item.mpalCode());
return *this; return *this;
} }
RMInventory &operator+=(int code) { RMInventory &operator+=(int code) {

File diff suppressed because it is too large Load diff

View file

@ -59,7 +59,7 @@ typedef enum {
*/ */
class RMPalette { class RMPalette {
public: public:
byte m_data[1024]; byte _data[1024];
public: public:
friend RMDataStream &operator>>(RMDataStream &ds, RMPalette &pal); friend RMDataStream &operator>>(RMDataStream &ds, RMPalette &pal);
@ -71,9 +71,9 @@ public:
*/ */
class RMSfx { class RMSfx {
public: public:
RMString m_name; RMString _name;
FPSFX *m_fx; FPSFX *_fx;
bool m_bPlayingLoop; bool _bPlayingLoop;
public: public:
RMSfx(); RMSfx();
@ -81,12 +81,12 @@ public:
friend RMDataStream &operator>>(RMDataStream &ds, RMSfx &sfx); friend RMDataStream &operator>>(RMDataStream &ds, RMSfx &sfx);
void Play(bool bLoop = false); void play(bool bLoop = false);
void SetVolume(int vol); void setVolume(int vol);
void Pause(bool bPause); void pause(bool bPause);
void Stop(void); void stop(void);
void ReadFromStream(RMDataStream &ds, bool bLOX = false); void readFromStream(RMDataStream &ds, bool bLOX = false);
}; };
@ -108,38 +108,38 @@ public:
// Class slot // Class slot
class RMSlot { class RMSlot {
private: private:
RMPoint m_pos; // Child co-ordinates RMPoint _pos; // Child co-ordinates
public: public:
RMSlotType m_type; RMSlotType _type;
int m_data; int _data;
byte m_flag; byte _flag;
public: public:
friend RMDataStream &operator>>(RMDataStream &ds, RMSlot &slot); friend RMDataStream &operator>>(RMDataStream &ds, RMSlot &slot);
RMPoint Pos() { RMPoint pos() {
return m_pos; return _pos;
} }
void ReadFromStream(RMDataStream &ds, bool bLOX = false); void readFromStream(RMDataStream &ds, bool bLOX = false);
}; };
public: public:
RMString m_name; RMString _name;
private: private:
int m_speed; int _speed;
RMPoint m_pos; // Parent coordinates RMPoint _pos; // Parent coordinates
RMPoint m_curPos; // Parent + child coordinates RMPoint _curPos; // Parent + child coordinates
int m_bLoop; int _bLoop;
int m_nSlots; int _nSlots;
int m_nCurSlot; int _nCurSlot;
int m_nCurSprite; int _nCurSprite;
RMSlot *m_slots; RMSlot *_slots;
uint32 m_nStartTime; uint32 _nStartTime;
public: public:
RMPattern(); RMPattern();
@ -148,24 +148,24 @@ public:
friend RMDataStream &operator>>(RMDataStream &ds, RMPattern &pat); friend RMDataStream &operator>>(RMDataStream &ds, RMPattern &pat);
// A warning that the pattern now and the current // A warning that the pattern now and the current
int Init(RMSfx *sfx, bool bPlayP0 = false, byte *bFlag = NULL); int init(RMSfx *sfx, bool bPlayP0 = false, byte *bFlag = NULL);
// Update the pattern, checking to see if it's time to change slot and executing // Update the pattern, checking to see if it's time to change slot and executing
// any associated commands // any associated commands
int Update(uint32 hEndPattern, byte &bFlag, RMSfx *sfx); int update(uint32 hEndPattern, byte &bFlag, RMSfx *sfx);
// Stop a sound effect // Stop a sound effect
void StopSfx(RMSfx *sfx); void stopSfx(RMSfx *sfx);
// Reads the position of the pattern // Reads the position of the pattern
RMPoint Pos() { RMPoint pos() {
return m_curPos; return _curPos;
} }
void ReadFromStream(RMDataStream &ds, bool bLOX = false); void readFromStream(RMDataStream &ds, bool bLOX = false);
private: private:
void UpdateCoord(void); void updateCoord(void);
}; };
@ -174,24 +174,24 @@ private:
*/ */
class RMSprite : public RMGfxTask { class RMSprite : public RMGfxTask {
public: public:
RMString m_name; RMString _name;
RMRect m_rcBox; RMRect _rcBox;
protected: protected:
RMGfxSourceBuffer *m_buf; RMGfxSourceBuffer *_buf;
public: public:
RMSprite(); RMSprite();
virtual ~RMSprite(); virtual ~RMSprite();
void Init(RMGfxSourceBuffer *buf); void init(RMGfxSourceBuffer *buf);
friend RMDataStream &operator>>(RMDataStream &ds, RMSprite &sprite); friend RMDataStream &operator>>(RMDataStream &ds, RMSprite &sprite);
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
void SetPalette(byte *lpBuf); void setPalette(byte *lpBuf);
void GetSizeFromStream(RMDataStream &ds, int *dimx, int *dimy); void getSizeFromStream(RMDataStream &ds, int *dimx, int *dimy);
void LOXGetSizeFromStream(RMDataStream &ds, int *dimx, int *dimy); void LOXGetSizeFromStream(RMDataStream &ds, int *dimx, int *dimy);
void ReadFromStream(RMDataStream &ds, bool bLOX = false); void readFromStream(RMDataStream &ds, bool bLOX = false);
}; };
@ -200,42 +200,42 @@ public:
*/ */
class RMItem : public RMGfxTask { class RMItem : public RMGfxTask {
public: public:
RMString m_name; RMString _name;
protected: protected:
int m_z; int _z;
RMPoint m_pos; // Coordinate nonno RMPoint _pos; // Coordinate nonno
RMColorMode m_cm; RMColorMode _cm;
RMPoint m_curScroll; RMPoint _curScroll;
byte m_FX; byte _FX;
byte m_FXparm; byte _FXparm;
virtual int GetCurPattern() { virtual int getCurPattern() {
return m_nCurPattern; return _nCurPattern;
} }
private: private:
int m_nCurPattern; int _nCurPattern;
int m_mpalCode; int _mpalCode;
RMPoint m_hot; RMPoint _hot;
RMRect m_rcBox; RMRect _rcBox;
int m_nSprites, m_nSfx, m_nPatterns; int _nSprites, _nSfx, _nPatterns;
byte m_bPal; byte _bPal;
RMPalette m_pal; RMPalette _pal;
RMSprite *m_sprites; RMSprite *_sprites;
RMSfx *m_sfx; RMSfx *_sfx;
RMPattern *m_patterns; RMPattern *_patterns;
byte m_bCurFlag; byte _bCurFlag;
int m_nCurSprite; int _nCurSprite;
bool m_bIsActive; bool _bIsActive;
uint32 m_hEndPattern; uint32 _hEndPattern;
bool m_bInitCurPattern; bool _bInitCurPattern;
public: public:
RMPoint CalculatePos(void); RMPoint calculatePos(void);
public: public:
RMItem(); RMItem();
@ -248,7 +248,7 @@ public:
bool doFrame(RMGfxTargetBuffer *bigBuf, bool bAddToList = true); bool doFrame(RMGfxTargetBuffer *bigBuf, bool bAddToList = true);
// Sets the current scrolling position // Sets the current scrolling position
void SetScrollPosition(const RMPoint &scroll); void setScrollPosition(const RMPoint &scroll);
// Overloading of check whether to remove from active list // Overloading of check whether to remove from active list
virtual void removeThis(CORO_PARAM, bool &result); virtual void removeThis(CORO_PARAM, bool &result);
@ -258,54 +258,54 @@ public:
// Overloaded priority: it's based on Z ordering // Overloaded priority: it's based on Z ordering
virtual int priority() { virtual int priority() {
return m_z; return _z;
} }
// Pattern number // Pattern number
int NumPattern() { int numPattern() {
return m_nPatterns; return _nPatterns;
} }
// Set anew animation pattern, changing abruptly from the current // Set anew animation pattern, changing abruptly from the current
virtual void SetPattern(int nPattern, bool bPlayP0 = false); virtual void setPattern(int nPattern, bool bPlayP0 = false);
// Set a new status // Set a new status
void SetStatus(int nStatus); void setStatus(int nStatus);
bool IsIn(const RMPoint &pt, int *size = NULL); bool isIn(const RMPoint &pt, int *size = NULL);
RMPoint Hotspot() { RMPoint hotspot() {
return m_hot; return _hot;
} }
bool GetName(RMString &name); bool getName(RMString &name);
int MpalCode() { int mpalCode() {
return m_mpalCode; return _mpalCode;
} }
// Unload // Unload
void Unload(void); void unload(void);
// Wait for the end of the current pattern // Wait for the end of the current pattern
void WaitForEndPattern(CORO_PARAM, uint32 hCustomSkip = CORO_INVALID_PID_VALUE); void waitForEndPattern(CORO_PARAM, uint32 hCustomSkip = CORO_INVALID_PID_VALUE);
// Sets a new hotspot fro the object // Sets a new hotspot fro the object
void ChangeHotspot(const RMPoint &pt); void changeHotspot(const RMPoint &pt);
void SetInitCurPattern(bool status) { void setInitCurPattern(bool status) {
m_bInitCurPattern = status; _bInitCurPattern = status;
} }
void PlaySfx(int nSfx); void playSfx(int nSfx);
void ReadFromStream(RMDataStream &ds, bool bLOX = false); void readFromStream(RMDataStream &ds, bool bLOX = false);
void PauseSound(bool bPause); void pauseSound(bool bPause);
protected: protected:
// Create a primitive that has as it's task this item // Create a primitive that has as it's task this item
virtual RMGfxPrimitive *NewItemPrimitive(); virtual RMGfxPrimitive *newItemPrimitive();
// Allocate memory for the sprites // Allocate memory for the sprites
virtual RMGfxSourceBuffer *NewItemSpriteBuffer(int dimx, int dimy, bool bPreRLE); virtual RMGfxSourceBuffer *newItemSpriteBuffer(int dimx, int dimy, bool bPreRLE);
}; };
@ -330,7 +330,7 @@ public:
bool bReversed; bool bReversed;
private: private:
void ReadFromStream(RMDataStream &ds); void readFromStream(RMDataStream &ds);
public: public:
friend RMDataStream &operator>>(RMDataStream &ds, RMBox &box); friend RMDataStream &operator>>(RMDataStream &ds, RMBox &box);
@ -343,47 +343,47 @@ public:
RMBox *boxes; RMBox *boxes;
private: private:
void ReadFromStream(RMDataStream &ds); void readFromStream(RMDataStream &ds);
public: public:
RMBoxLoc(); RMBoxLoc();
virtual ~RMBoxLoc(); virtual ~RMBoxLoc();
friend RMDataStream &operator >>(RMDataStream &ds, RMBoxLoc &bl); friend RMDataStream &operator >>(RMDataStream &ds, RMBoxLoc &bl);
void RecalcAllAdj(void); void recalcAllAdj(void);
}; };
#define GAME_BOXES_SIZE 200 #define GAME_BOXES_SIZE 200
class RMGameBoxes { class RMGameBoxes {
protected: protected:
RMBoxLoc *m_allBoxes[GAME_BOXES_SIZE]; RMBoxLoc *_allBoxes[GAME_BOXES_SIZE];
int m_nLocBoxes; int _nLocBoxes;
public: public:
RMGameBoxes(); RMGameBoxes();
~RMGameBoxes(); ~RMGameBoxes();
void Init(void); void init(void);
void Close(void); void close(void);
// Get binding boxes for a given location // Get binding boxes for a given location
RMBoxLoc *GetBoxes(int nLoc); RMBoxLoc *getBoxes(int nLoc);
int GetLocBoxesCount() const { return m_nLocBoxes; } int getLocBoxesCount() const { return _nLocBoxes; }
// Return the box which contains a given point // Return the box which contains a given point
int WhichBox(int nLoc, const RMPoint &pt); int whichBox(int nLoc, const RMPoint &pt);
// Check whether a point is inside a given box // Check whether a point is inside a given box
bool IsInBox(int nLoc, int nBox, const RMPoint &pt); bool isInBox(int nLoc, int nBox, const RMPoint &pt);
// Change the status of a box // Change the status of a box
void ChangeBoxStatus(int nLoc, int nBox, int status); void changeBoxStatus(int nLoc, int nBox, int status);
// Save state handling // Save state handling
int GetSaveStateSize(void); int getSaveStateSize(void);
void SaveState(byte *buf); void saveState(byte *buf);
void LoadState(byte *buf); void loadState(byte *buf);
}; };
class RMCharacter : protected RMItem { class RMCharacter : protected RMItem {
@ -426,21 +426,21 @@ private:
bool bMovingWithoutMinpath; bool bMovingWithoutMinpath;
RMGameBoxes *theBoxes; RMGameBoxes *theBoxes;
RMPoint m_fixedScroll; RMPoint _fixedScroll;
private: private:
int InWhichBox(const RMPoint &pt); int inWhichBox(const RMPoint &pt);
short FindPath(short source, short destination); short findPath(short source, short destination);
RMPoint Searching(char UP, char DOWN, char RIGHT, char LEFT, RMPoint punto); RMPoint searching(char UP, char DOWN, char RIGHT, char LEFT, RMPoint punto);
RMPoint NearestPoint(const RMPoint &punto); RMPoint nearestPoint(const RMPoint &punto);
void GoTo(CORO_PARAM, RMPoint destcoord, bool bReversed = false); void goTo(CORO_PARAM, RMPoint destcoord, bool bReversed = false);
short ScanLine(const RMPoint &punto); short scanLine(const RMPoint &punto);
RMPoint InvScanLine(const RMPoint &punto); RMPoint invScanLine(const RMPoint &punto);
RMPoint NearestHotSpot(int sourcebox, int destbox); RMPoint nearestHotSpot(int sourcebox, int destbox);
void NewBoxEntered(int nBox); void newBoxEntered(int nBox);
protected: protected:
bool bMoving; bool bMoving;
@ -452,42 +452,42 @@ public:
RMCharacter(); RMCharacter();
virtual ~RMCharacter(); virtual ~RMCharacter();
void LinkToBoxes(RMGameBoxes *theBoxes); void linkToBoxes(RMGameBoxes *theBoxes);
virtual void removeThis(CORO_PARAM, bool &result); virtual void removeThis(CORO_PARAM, bool &result);
// Update the position of a character // Update the position of a character
void DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int loc); void doFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int loc);
// Overloaded draw // Overloaded draw
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
// TRUE if you just stopped // TRUE if you just stopped
bool EndOfPath() { bool endOfPath() {
return bEndOfPath; return bEndOfPath;
} }
// Change the pattern of a character to STOP // Change the pattern of a character to STOP
virtual void Stop(CORO_PARAM); virtual void stop(CORO_PARAM);
// Check if the character is moving // Check if the character is moving
bool IsMoving() { bool isMoving() {
return bMoving; return bMoving;
} }
// Move the character to a certain position // Move the character to a certain position
void Move(CORO_PARAM, RMPoint pt, bool *result = NULL); void move(CORO_PARAM, RMPoint pt, bool *result = NULL);
// Place the character in a certain position WITHOUT moving // Place the character in a certain position WITHOUT moving
void SetPosition(const RMPoint &pt, int newloc = -1); void setPosition(const RMPoint &pt, int newloc = -1);
// Wait for the end of movement // Wait for the end of movement
void WaitForEndMovement(CORO_PARAM); void waitForEndMovement(CORO_PARAM);
void SetFixedScroll(const RMPoint &fix) { void setFixedScroll(const RMPoint &fix) {
m_fixedScroll = fix; _fixedScroll = fix;
} }
void SetSpeed(int speed) { void setSpeed(int speed) {
curSpeed = speed; curSpeed = speed;
} }
}; };
@ -495,26 +495,26 @@ public:
class RMWipe : public RMGfxTask { class RMWipe : public RMGfxTask {
private: private:
bool m_bFading; bool _bFading;
bool m_bEndFade; bool _bEndFade;
bool m_bUnregister; bool _bUnregister;
uint32 m_hUnregistered; uint32 _hUnregistered;
int m_nFadeStep; int _nFadeStep;
uint32 m_hEndOfFade; uint32 _hEndOfFade;
bool m_bMustRegister; bool _bMustRegister;
RMItem m_wip0r; RMItem _wip0r;
public: public:
RMWipe(); RMWipe();
virtual ~RMWipe(); virtual ~RMWipe();
void DoFrame(RMGfxTargetBuffer &bigBuf); void doFrame(RMGfxTargetBuffer &bigBuf);
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
void InitFade(int type); void initFade(int type);
void CloseFade(void); void closeFade(void);
void WaitForFadeEnd(CORO_PARAM); void waitForFadeEnd(CORO_PARAM);
virtual void Unregister(void); virtual void Unregister(void);
virtual void removeThis(CORO_PARAM, bool &result); virtual void removeThis(CORO_PARAM, bool &result);
@ -527,17 +527,17 @@ public:
*/ */
class RMLocation : public RMGfxTaskSetPrior { class RMLocation : public RMGfxTaskSetPrior {
public: public:
RMString m_name; // Name RMString _name; // Name
private: private:
RMColorMode m_cmode; // Color mode RMColorMode _cmode; // Color mode
RMGfxSourceBuffer *m_buf; // Location picture RMGfxSourceBuffer *_buf; // Location picture
int m_nItems; // Number of objects int _nItems; // Number of objects
RMItem *m_items; // Objects RMItem *_items; // Objects
RMPoint m_curScroll; // Current scroll position RMPoint _curScroll; // Current scroll position
RMPoint m_fixedScroll; RMPoint _fixedScroll;
public: public:
// @@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@@@@@@@@@@@@@@@@
@ -556,14 +556,14 @@ public:
virtual ~RMLocation(); virtual ~RMLocation();
// Load variations // Load variations
bool Load(const char *lpszFileName); bool load(const char *lpszFileName);
bool Load(Common::File &file); bool load(Common::File &file);
bool Load(const byte *buf); bool load(const byte *buf);
bool Load(RMDataStream &ds); bool load(RMDataStream &ds);
bool LoadLOX(RMDataStream &ds); bool loadLOX(RMDataStream &ds);
// Unload // Unload
void Unload(void); void unload(void);
// Overloaded draw // Overloaded draw
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
@ -572,27 +572,27 @@ public:
void doFrame(RMGfxTargetBuffer *bigBuf); void doFrame(RMGfxTargetBuffer *bigBuf);
// Return the item at a given point // Return the item at a given point
RMItem *WhichItemIsIn(const RMPoint &pt); RMItem *whichItemIsIn(const RMPoint &pt);
// Return the item based on it's MPAL code // Return the item based on it's MPAL code
RMItem *GetItemFromCode(uint32 dwCode); RMItem *getItemFromCode(uint32 dwCode);
// Set the current scroll position // Set the current scroll position
void SetScrollPosition(const RMPoint &scroll); void setScrollPosition(const RMPoint &scroll);
// Sets an additinal offset for scrolling // Sets an additinal offset for scrolling
void SetFixedScroll(const RMPoint &scroll); void setFixedScroll(const RMPoint &scroll);
// Update the scrolling coordinates to display the specified point // Update the scrolling coordinates to display the specified point
void UpdateScrolling(const RMPoint &ptShowThis); void updateScrolling(const RMPoint &ptShowThis);
// Read the current scroll position // Read the current scroll position
RMPoint ScrollPosition() { RMPoint scrollPosition() {
return m_curScroll; return _curScroll;
} }
// Pause sound // Pause sound
void PauseSound(bool bPause); void pauseSound(bool bPause);
}; };
@ -606,21 +606,21 @@ private:
int nPeriods; int nPeriods;
private: private:
void ParseMessage(void); void parseMessage(void);
public: public:
RMMessage(); RMMessage();
RMMessage(uint32 dwId); RMMessage(uint32 dwId);
virtual ~RMMessage(); virtual ~RMMessage();
void Load(uint32 dwId); void load(uint32 dwId);
bool IsValid() { bool isValid() {
return lpMessage != NULL; return lpMessage != NULL;
} }
int NumPeriods() { int numPeriods() {
return nPeriods; return nPeriods;
} }
char *Period(int num) { char *period(int num) {
return lpPeriods[num]; return lpPeriods[num];
} }
char *operator[](int num) { char *operator[](int num) {

View file

@ -37,42 +37,42 @@ namespace MPAL {
* @param resId MPAL resource to open * @param resId MPAL resource to open
*/ */
RMRes::RMRes(uint32 resID) { RMRes::RMRes(uint32 resID) {
m_h = _vm->_resUpdate.QueryResource(resID); _h = _vm->_resUpdate.queryResource(resID);
if (m_h == NULL) if (_h == NULL)
m_h = mpalQueryResource(resID); _h = mpalQueryResource(resID);
if (m_h != NULL) if (_h != NULL)
m_buf = (byte *)GlobalLock(m_h); _buf = (byte *)GlobalLock(_h);
} }
/** /**
* Destructor * Destructor
*/ */
RMRes::~RMRes() { RMRes::~RMRes() {
if (m_h != NULL) { if (_h != NULL) {
GlobalUnlock(m_h); GlobalUnlock(_h);
GlobalFree(m_h); GlobalFree(_h);
} }
} }
/** /**
* Returns a pointer to the resource * Returns a pointer to the resource
*/ */
const byte *RMRes::DataPointer() { const byte *RMRes::dataPointer() {
return m_buf; return _buf;
} }
/** /**
* Returns a pointer to the resource * Returns a pointer to the resource
*/ */
RMRes::operator const byte *() { RMRes::operator const byte *() {
return DataPointer(); return dataPointer();
} }
/** /**
* Returns the size of the resource * Returns the size of the resource
*/ */
unsigned int RMRes::Size() { unsigned int RMRes::size() {
return GlobalSize(m_h); return GlobalSize(_h);
} }
/****************************************************************************\ /****************************************************************************\
@ -86,19 +86,19 @@ RMResRaw::~RMResRaw() {
} }
const byte *RMResRaw::DataPointer() { const byte *RMResRaw::DataPointer() {
return m_buf + 8; return _buf + 8;
} }
RMResRaw::operator const byte *() { RMResRaw::operator const byte *() {
return DataPointer(); return DataPointer();
} }
int RMResRaw::Width() { int RMResRaw::width() {
return READ_LE_UINT16(m_buf + 4); return READ_LE_UINT16(_buf + 4);
} }
int RMResRaw::Height() { int RMResRaw::height() {
return READ_LE_UINT16(m_buf + 6); return READ_LE_UINT16(_buf + 6);
} }
} // end of namespace MPAL } // end of namespace MPAL

View file

@ -33,17 +33,17 @@ namespace MPAL {
class RMRes { class RMRes {
protected: protected:
HGLOBAL m_h; HGLOBAL _h;
byte *m_buf; byte *_buf;
public: public:
RMRes(uint32 resID); RMRes(uint32 resID);
virtual ~RMRes(); virtual ~RMRes();
// Attributes // Attributes
unsigned int Size(); unsigned int size();
const byte *DataPointer(); const byte *dataPointer();
bool IsValid() { return m_h != NULL; } bool isValid() { return _h != NULL; }
// Casting for access to data // Casting for access to data
operator const byte*(); operator const byte*();
@ -57,8 +57,8 @@ public:
const byte *DataPointer(); const byte *DataPointer();
operator const byte*(); operator const byte*();
int Width(); int width();
int Height(); int height();
}; };
} // end of namespace MPAL } // end of namespace MPAL

View file

@ -133,7 +133,7 @@ Common::ErrorCode TonyEngine::init() {
return Common::kUnknownError; return Common::kUnknownError;
// Initialise the update resources // Initialise the update resources
_resUpdate.Init("ROASTED.MPU"); _resUpdate.init("ROASTED.MPU");
// Initialise the music // Initialise the music
initMusic(); initMusic();
@ -143,7 +143,7 @@ Common::ErrorCode TonyEngine::init() {
return Common::kReadingFailed; return Common::kReadingFailed;
// Initialise the boxes // Initialise the boxes
_theBoxes.Init(); _theBoxes.init();
// Link to the custom graphics engine // Link to the custom graphics engine
_theEngine.initCustomDll(); _theEngine.initCustomDll();
@ -570,7 +570,7 @@ void TonyEngine::play(void) {
void TonyEngine::close(void) { void TonyEngine::close(void) {
closeMusic(); closeMusic();
CoroScheduler.closeEvent(_hEndOfFrame); CoroScheduler.closeEvent(_hEndOfFrame);
_theBoxes.Close(); _theBoxes.close();
_theEngine.close(); _theEngine.close();
_window.close(); _window.close();
delete[] _curThumbnail; delete[] _curThumbnail;

File diff suppressed because it is too large Load diff

View file

@ -81,36 +81,36 @@ public:
}; };
private: private:
bool m_bShow; bool _bShow;
bool m_bShowOmbra; bool _bShowOmbra;
bool m_bCorpoDavanti; bool _bCorpoDavanti;
RMGfxSourceBuffer8AB m_ombra; RMGfxSourceBuffer8AB _ombra;
bool m_bActionPending; bool _bActionPending;
RMItem *m_ActionItem; RMItem *_ActionItem;
int m_Action; int _Action;
int m_ActionParm; int _ActionParm;
static bool m_bAction; static bool _bAction;
bool m_bPastorella; bool _bPastorella;
bool m_bIsStaticTalk; bool _bIsStaticTalk;
bool m_bIsTalking; bool _bIsTalking;
int m_nPatB4Talking; int _nPatB4Talking;
TALKTYPE m_nTalkType; TALKTYPE _nTalkType;
DIRECTION m_TalkDirection; DIRECTION _TalkDirection;
RMPoint m_nBodyOffset; RMPoint _nBodyOffset;
int m_nTimeLastStep; int _nTimeLastStep;
RMItem m_body; RMItem _body;
uint32 hActionThread; uint32 hActionThread;
protected: protected:
// Overload of the allocation allocation of sprites // Overload of the allocation allocation of sprites
virtual RMGfxSourceBuffer *NewItemSpriteBuffer(int dimx, int dimy, bool bPreRLE); virtual RMGfxSourceBuffer *newItemSpriteBuffer(int dimx, int dimy, bool bPreRLE);
// Watch thread which waits for the end of an action // Watch thread which waits for the end of an action
static void WaitEndOfAction(CORO_PARAM, const void *param); static void waitEndOfAction(CORO_PARAM, const void *param);
public: public:
enum PATTERNS { enum PATTERNS {
@ -365,87 +365,87 @@ public:
void init(void); void init(void);
// Free all memory // Free all memory
void Close(void); void close(void);
// Tony makes a frame, updating the movement, etc. // Tony makes a frame, updating the movement, etc.
void DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int curLoc); void doFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int curLoc);
// Draw method, which controls chararacter display // Draw method, which controls chararacter display
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
// Show or hide // Show or hide
void Show(void); void show(void);
void Hide(bool bShowOmbra = false); void hide(bool bShowOmbra = false);
// Move and make an action, if necessary // Move and make an action, if necessary
void MoveAndDoAction(CORO_PARAM, RMPoint dst, RMItem *item, int nAction, int nActionParm = 0); void moveAndDoAction(CORO_PARAM, RMPoint dst, RMItem *item, int nAction, int nActionParm = 0);
// Tony stops (on the right side with respect to any subject) // Tony stops (on the right side with respect to any subject)
virtual void Stop(CORO_PARAM); virtual void stop(CORO_PARAM);
void StopNoAction(CORO_PARAM); void stopNoAction(CORO_PARAM);
// Set a pattern // Set a pattern
void SetPattern(int npatt, bool bPlayP0 = false); void setPattern(int npatt, bool bPlayP0 = false);
// Reads the current pattern // Reads the current pattern
int GetCurPattern(); int getCurPattern();
// Waits until the end of a pattern // Waits until the end of a pattern
void WaitForEndPattern(CORO_PARAM, uint32 hCustomSkip = CORO_INVALID_PID_VALUE) { void waitForEndPattern(CORO_PARAM, uint32 hCustomSkip = CORO_INVALID_PID_VALUE) {
RMCharacter::WaitForEndPattern(coroParam, hCustomSkip); RMCharacter::waitForEndPattern(coroParam, hCustomSkip);
} }
// Check if currently in an action // Check if currently in an action
bool InAction() { bool inAction() {
return (m_bActionPending && m_Action != 0) | m_bAction; return (_bActionPending && _Action != 0) | _bAction;
} }
// Check if there needs to be an update for scrolling movement // Check if there needs to be an update for scrolling movement
bool MustUpdateScrolling() { bool mustUpdateScrolling() {
return ((!InAction()) || (IsMoving())); return ((!inAction()) || (isMoving()));
} }
// Returns Tony's position // Returns Tony's position
RMPoint Position() { RMPoint position() {
return m_pos; return _pos;
} }
// Set the scrolling position // Set the scrolling position
void SetScrollPosition(const RMPoint &pt) { void setScrollPosition(const RMPoint &pt) {
RMCharacter::SetScrollPosition(pt); RMCharacter::setScrollPosition(pt);
} }
// Set the take animation // Set the take animation
void Take(int nWhere, int nPart); void take(int nWhere, int nPart);
void Put(int nWhere, int nPart); void put(int nWhere, int nPart);
// Start or End Talk // Start or End Talk
bool StartTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &bodyStartPat, bool startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &bodyStartPat,
int &headLoopPat, int &bodyLoopPat); int &headLoopPat, int &bodyLoopPat);
void StartTalk(CORO_PARAM, TALKTYPE nTalkType); void startTalk(CORO_PARAM, TALKTYPE nTalkType);
bool EndTalkCalculate(int &headStandPat, int &headEndPat, int &bodyEndPat, int &finalPat, bool &bStatic); bool endTalkCalculate(int &headStandPat, int &headEndPat, int &bodyEndPat, int &finalPat, bool &bStatic);
void EndTalk(CORO_PARAM); void endTalk(CORO_PARAM);
// Start or End Static // Start or End Static
void StartStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat, void startStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat,
int &bodyStartPat, int &bodyLoopPat); int &bodyStartPat, int &bodyLoopPat);
void StartStatic(CORO_PARAM, TALKTYPE nTalkType); void startStatic(CORO_PARAM, TALKTYPE nTalkType);
void EndStaticCalculate(TALKTYPE nTalk, int &bodyEndPat, int &finalPat, int &headEndPat); void endStaticCalculate(TALKTYPE nTalk, int &bodyEndPat, int &finalPat, int &headEndPat);
void EndStatic(CORO_PARAM, TALKTYPE nTalkType); void endStatic(CORO_PARAM, TALKTYPE nTalkType);
// Tony disguises himself! // Tony disguises himself!
void SetPastorella(bool bIsPast) { void setPastorella(bool bIsPast) {
m_bPastorella = bIsPast; _bPastorella = bIsPast;
} }
int GetPastorella(void) { int getPastorella(void) {
return m_bPastorella; return _bPastorella;
} }
// Perform an action // Perform an action
void ExecuteAction(int nAction, int nActionItem, int nParm); void executeAction(int nAction, int nActionItem, int nParm);
void PlaySfx(int nSfx) { void playSfx(int nSfx) {
RMItem::PlaySfx(nSfx); RMItem::playSfx(nSfx);
} }
}; };

View file

@ -40,17 +40,17 @@ namespace Tony {
* Constructor * Constructor
*/ */
RMString::RMString() { RMString::RMString() {
m_string = NULL; _string = NULL;
m_length = 0; _length = 0;
m_realLength = 0; _realLength = 0;
} }
/** /**
* Destructor * Destructor
*/ */
RMString::~RMString() { RMString::~RMString() {
if (m_string != NULL) if (_string != NULL)
delete[] m_string; delete[] _string;
} }
/** /**
@ -58,9 +58,9 @@ RMString::~RMString() {
*/ */
RMString::RMString(const RMString &str) { RMString::RMString(const RMString &str) {
// Richiama l'overload su '=' per copiare // Richiama l'overload su '=' per copiare
m_string = NULL; _string = NULL;
m_length = 0; _length = 0;
m_realLength = 0; _realLength = 0;
*this = str; *this = str;
} }
@ -69,9 +69,9 @@ RMString::RMString(const RMString &str) {
*/ */
RMString::RMString(const char *str) { RMString::RMString(const char *str) {
// Use the overloaded '=' when copying // Use the overloaded '=' when copying
m_string = NULL; _string = NULL;
m_length = 0; _length = 0;
m_realLength = 0; _realLength = 0;
*this = str; *this = str;
} }
@ -80,9 +80,9 @@ RMString::RMString(const char *str) {
*/ */
RMString::RMString(const int ch) { RMString::RMString(const int ch) {
// Use the overloaded '=' when copying // Use the overloaded '=' when copying
m_string = NULL; _string = NULL;
m_length = 0; _length = 0;
m_realLength = 0; _realLength = 0;
*this = ch; *this = ch;
} }
@ -90,8 +90,8 @@ RMString::RMString(const int ch) {
* Returns the length of the string * Returns the length of the string
* @returns Length * @returns Length
*/ */
int RMString::Length() const { int RMString::length() const {
return m_length; return _length;
} }
/** /**
@ -99,9 +99,9 @@ int RMString::Length() const {
* @param nIndex Position of the character to return * @param nIndex Position of the character to return
* @returns Character * @returns Character
*/ */
char RMString::GetAt(int nIndex) { char RMString::getAt(int nIndex) {
assert(nIndex < m_length); assert(nIndex < _length);
return m_string[nIndex]; return _string[nIndex];
} }
/** /**
@ -109,9 +109,9 @@ char RMString::GetAt(int nIndex) {
* @param nIndex Position of the character to change * @param nIndex Position of the character to change
* @param c Character * @param c Character
*/ */
void RMString::SetAt(int nIndex, char c) { void RMString::setAt(int nIndex, char c) {
assert(nIndex < m_length); assert(nIndex < _length);
m_string[nIndex] = c; _string[nIndex] = c;
} }
/** /**
@ -120,8 +120,8 @@ void RMString::SetAt(int nIndex, char c) {
* @params Reference to the character * @params Reference to the character
*/ */
char &RMString::operator[](int nIndex) { char &RMString::operator[](int nIndex) {
assert(nIndex < m_length); assert(nIndex < _length);
return m_string[nIndex]; return _string[nIndex];
} }
/** /**
@ -131,21 +131,21 @@ char &RMString::operator[](int nIndex) {
*/ */
const RMString &RMString::operator=(const RMString &str) { const RMString &RMString::operator=(const RMString &str) {
// Set the new length // Set the new length
m_length = str.m_length; _length = str._length;
// If the source is empty, then destroy the current string buffer // If the source is empty, then destroy the current string buffer
if (m_length == 0) { if (_length == 0) {
if (m_realLength > 0) { if (_realLength > 0) {
delete[] m_string; delete[] _string;
m_string = NULL; _string = NULL;
m_realLength = 0; _realLength = 0;
} }
} else { } else {
// Resize if necessary // Resize if necessary
Resize(m_length + 1); resize(_length + 1);
// Copy the string // Copy the string
Common::copy(str.m_string, str.m_string + m_length + 1, m_string); Common::copy(str._string, str._string + _length + 1, _string);
} }
return *this; return *this;
@ -159,20 +159,20 @@ const RMString &RMString::operator=(const RMString &str) {
const RMString &RMString::operator=(const char *str) { const RMString &RMString::operator=(const char *str) {
// If the source is empty, then destroy the current string buffer // If the source is empty, then destroy the current string buffer
if (str == NULL) { if (str == NULL) {
if (m_realLength > 0) { if (_realLength > 0) {
delete[] m_string; delete[] _string;
m_string = NULL; _string = NULL;
m_realLength = m_length = 0; _realLength = _length = 0;
} }
} else { } else {
// Calculate the new length // Calculate the new length
m_length = strlen(str); _length = strlen(str);
// Resize if necessary // Resize if necessary
Resize(m_length + 1); resize(_length + 1);
// Copy the string // Copy the string
Common::copy(str, str + m_length + 1, m_string); Common::copy(str, str + _length + 1, _string);
} }
return *this; return *this;
@ -186,18 +186,18 @@ const RMString &RMString::operator=(const char *str) {
const RMString &RMString::operator=(const int ch) { const RMString &RMString::operator=(const int ch) {
if (ch == '\0') { if (ch == '\0') {
// Destroy the current string // Destroy the current string
if (m_realLength > 0) { if (_realLength > 0) {
delete [] m_string; delete [] _string;
m_string = NULL; _string = NULL;
m_length = m_realLength = 0; _length = _realLength = 0;
} }
} else { } else {
// Resize if necessary // Resize if necessary
Resize(2); resize(2);
m_string[0] = ch; _string[0] = ch;
m_string[1] = '\0'; _string[1] = '\0';
m_length = 1; _length = 1;
} }
return *this; return *this;
@ -208,21 +208,21 @@ const RMString &RMString::operator=(const int ch) {
* @param str String to concatenate * @param str String to concatenate
* @param size Length of the string * @param size Length of the string
*/ */
void RMString::Connect(const char *str, int size) { void RMString::connect(const char *str, int size) {
int nlen; int nlen;
if (size > 0) { if (size > 0) {
// Calculate the new lenght // Calculate the new lenght
nlen = m_length + size; nlen = _length + size;
// Resize // Resize
Resize(nlen + 1, true); resize(nlen + 1, true);
// Linkage with '\0' // Linkage with '\0'
Common::copy(str, str + size + 1, m_string + m_length); Common::copy(str, str + size + 1, _string + _length);
// Save the new length // Save the new length
m_length = nlen; _length = nlen;
} }
} }
@ -232,7 +232,7 @@ void RMString::Connect(const char *str, int size) {
* @returns Refrence to our string * @returns Refrence to our string
*/ */
const RMString &RMString::operator+=(RMString &str) { const RMString &RMString::operator+=(RMString &str) {
Connect(str, str.Length()); connect(str, str.length());
return *this; return *this;
} }
@ -242,7 +242,7 @@ const RMString &RMString::operator+=(RMString &str) {
* @returns Refrence to our string * @returns Refrence to our string
*/ */
const RMString &RMString::operator+=(const char *str) { const RMString &RMString::operator+=(const char *str) {
Connect(str, strlen(str)); connect(str, strlen(str));
return *this; return *this;
} }
@ -258,7 +258,7 @@ const RMString &RMString::operator+=(const int ch) {
str[0] = ch; str[0] = ch;
str[1] = '\0'; str[1] = '\0';
Connect(str, 1); connect(str, 1);
return *this; return *this;
} }
@ -267,7 +267,7 @@ const RMString &RMString::operator+=(const int ch) {
* @returns char * reference to string * @returns char * reference to string
*/ */
RMString::operator char *() const { RMString::operator char *() const {
return m_string; return _string;
} }
/** /**
@ -276,21 +276,21 @@ RMString::operator char *() const {
* @param bMaintain If true we must keep the original string, * @param bMaintain If true we must keep the original string,
if false we can destroy. if false we can destroy.
*/ */
void RMString::Resize(int size, bool bMantain) { void RMString::resize(int size, bool bMantain) {
if (m_realLength == 0) { if (_realLength == 0) {
m_string = new char[size]; _string = new char[size];
m_realLength = size; _realLength = size;
} else if (size > m_realLength) { } else if (size > _realLength) {
if (bMantain) { if (bMantain) {
char *app; char *app;
app = new char[size]; app = new char[size];
Common::copy(m_string, m_string + m_length + 1, app); Common::copy(_string, _string + _length + 1, app);
delete[] m_string; delete[] _string;
m_string = app; _string = app;
} else { } else {
delete[] m_string; delete[] _string;
m_string = new char[size]; _string = new char[size];
} }
} }
} }
@ -298,15 +298,15 @@ void RMString::Resize(int size, bool bMantain) {
/** /**
* Compacts the string to occupy less memory if possible. * Compacts the string to occupy less memory if possible.
*/ */
void RMString::Compact(void) { void RMString::compact(void) {
if (m_realLength + 1 > m_length) { if (_realLength + 1 > _length) {
char *app; char *app;
app = new char[m_length + 1]; app = new char[_length + 1];
Common::copy(m_string, m_string + m_length + 1, app); Common::copy(_string, _string + _length + 1, app);
delete[] m_string; delete[] _string;
m_string = app; _string = app;
} }
} }
@ -359,14 +359,14 @@ RMDataStream &operator>>(RMDataStream &df, RMString &var) {
int i; int i;
df >> len; df >> len;
var.Resize(len + 1); var.resize(len + 1);
var.m_length = len + 1; var._length = len + 1;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
df >> var[i]; df >> var[i];
var[i] = '\0'; var[i] = '\0';
var.m_length = len; var._length = len;
return df; return df;
} }
@ -374,7 +374,7 @@ RMDataStream &operator>>(RMDataStream &df, RMString &var) {
/** /**
* Formats a string * Formats a string
*/ */
void RMString::Format(const char *str, ...) { void RMString::format(const char *str, ...) {
static char buf[2048]; static char buf[2048];
va_list argList; va_list argList;
@ -393,29 +393,29 @@ RMFileStreamSlow::RMFileStreamSlow() : RMDataStream() {
} }
RMFileStreamSlow::~RMFileStreamSlow() { RMFileStreamSlow::~RMFileStreamSlow() {
Close(); close();
} }
void RMFileStreamSlow::Close() { void RMFileStreamSlow::close() {
delete _stream; delete _stream;
} }
bool RMFileStreamSlow::OpenFile(Common::File &file) { bool RMFileStreamSlow::openFile(Common::File &file) {
_stream = file.readStream(file.size()); _stream = file.readStream(file.size());
m_length = _stream->pos(); _length = _stream->pos();
return true; return true;
} }
bool RMFileStreamSlow::OpenFile(const char *lpFN) { bool RMFileStreamSlow::openFile(const char *lpFN) {
// Open file for reading // Open file for reading
Common::File f; Common::File f;
if (!f.open(lpFN)) if (!f.open(lpFN))
return false; return false;
m_length = f.size(); _length = f.size();
_stream = f.readStream(f.size()); _stream = f.readStream(f.size());
return true; return true;
@ -423,20 +423,20 @@ bool RMFileStreamSlow::OpenFile(const char *lpFN) {
RMDataStream &RMFileStreamSlow::operator+=(int nBytes) { RMDataStream &RMFileStreamSlow::operator+=(int nBytes) {
Seek(nBytes); seek(nBytes);
return *this; return *this;
} }
int RMFileStreamSlow::Pos() { int RMFileStreamSlow::pos() {
return _stream->pos(); return _stream->pos();
} }
bool RMFileStreamSlow::IsEOF() { bool RMFileStreamSlow::isEOF() {
return (Pos() >= m_length); return (pos() >= _length);
} }
int RMFileStreamSlow::Seek(int nBytes, RMDSPos where) { int RMFileStreamSlow::seek(int nBytes, RMDSPos where) {
switch (where) { switch (where) {
case START: case START:
return _stream->seek(nBytes); return _stream->seek(nBytes);
@ -453,7 +453,7 @@ int RMFileStreamSlow::Seek(int nBytes, RMDSPos where) {
} }
bool RMFileStreamSlow::Read(void *buf, int size) { bool RMFileStreamSlow::read(void *buf, int size) {
uint32 dwRead; uint32 dwRead;
dwRead = _stream->read(buf, size); dwRead = _stream->read(buf, size);
@ -462,39 +462,39 @@ bool RMFileStreamSlow::Read(void *buf, int size) {
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, char &var) { RMFileStreamSlow &operator>>(RMFileStreamSlow &df, char &var) {
df.Read(&var, 1); df.read(&var, 1);
return df; return df;
} }
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, byte &var) { RMFileStreamSlow &operator>>(RMFileStreamSlow &df, byte &var) {
df.Read(&var, 1); df.read(&var, 1);
return df; return df;
} }
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, uint16 &var) { RMFileStreamSlow &operator>>(RMFileStreamSlow &df, uint16 &var) {
uint16 v; uint16 v;
df.Read(&v, 2); df.read(&v, 2);
v = FROM_LE_16(v); v = FROM_LE_16(v);
return df; return df;
} }
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, int16 &var) { RMFileStreamSlow &operator>>(RMFileStreamSlow &df, int16 &var) {
uint16 v; uint16 v;
df.Read(&v, 2); df.read(&v, 2);
var = (int16)FROM_LE_16(v); var = (int16)FROM_LE_16(v);
return df; return df;
} }
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, int &var) { RMFileStreamSlow &operator>>(RMFileStreamSlow &df, int &var) {
int v; int v;
df.Read(&v, 4); df.read(&v, 4);
var = FROM_LE_32(v); var = FROM_LE_32(v);
return df; return df;
} }
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, uint32 &var) { RMFileStreamSlow &operator>>(RMFileStreamSlow &df, uint32 &var) {
uint32 v; uint32 v;
df.Read(&v, 4); df.read(&v, 4);
var = FROM_LE_32(v); var = FROM_LE_32(v);
return df; return df;
} }
@ -508,24 +508,24 @@ RMFileStreamSlow &operator>>(RMFileStreamSlow &df, uint32 &var) {
* Constructor * Constructor
*/ */
RMDataStream::RMDataStream() { RMDataStream::RMDataStream() {
m_length = 0; _length = 0;
m_pos = 0; _pos = 0;
m_bError = false; _bError = false;
} }
/** /**
* Destructor * Destructor
*/ */
RMDataStream::~RMDataStream() { RMDataStream::~RMDataStream() {
Close(); close();
} }
/** /**
* Close a stream * Close a stream
*/ */
void RMDataStream::Close(void) { void RMDataStream::close(void) {
m_length = 0; _length = 0;
m_pos = 0; _pos = 0;
} }
/** /**
@ -535,27 +535,27 @@ void RMDataStream::Close(void) {
* @remarks If the length of the buffer is not known, and cannot be * @remarks If the length of the buffer is not known, and cannot be
* specified, then EOF() and Seek() to end won't work. * specified, then EOF() and Seek() to end won't work.
*/ */
void RMDataStream::OpenBuffer(const byte *lpBuf, int size) { void RMDataStream::openBuffer(const byte *lpBuf, int size) {
m_length = size; _length = size;
m_buf = lpBuf; _buf = lpBuf;
m_bError = false; _bError = false;
m_pos = 0; _pos = 0;
} }
/** /**
* Returns the length of the stream * Returns the length of the stream
* @returns Stream length * @returns Stream length
*/ */
int RMDataStream::Length() { int RMDataStream::length() {
return m_length; return _length;
} }
/** /**
* Determines if the end of the stream has been reached * Determines if the end of the stream has been reached
* @returns true if end of stream reached, false if not * @returns true if end of stream reached, false if not
*/ */
bool RMDataStream::IsEOF() { bool RMDataStream::isEOF() {
return (m_pos >= m_length); return (_pos >= _length);
} }
/** /**
@ -565,7 +565,7 @@ bool RMDataStream::IsEOF() {
* @returns Value read from the stream * @returns Value read from the stream
*/ */
RMDataStream &operator>>(RMDataStream &df, char &var) { RMDataStream &operator>>(RMDataStream &df, char &var) {
df.Read(&var, 1); df.read(&var, 1);
return df; return df;
} }
@ -576,7 +576,7 @@ RMDataStream &operator>>(RMDataStream &df, char &var) {
* @returns Value read from the stream * @returns Value read from the stream
*/ */
RMDataStream &operator>>(RMDataStream &df, uint8 &var) { RMDataStream &operator>>(RMDataStream &df, uint8 &var) {
df.Read(&var, 1); df.read(&var, 1);
return df; return df;
} }
@ -588,7 +588,7 @@ RMDataStream &operator>>(RMDataStream &df, uint8 &var) {
*/ */
RMDataStream &operator>>(RMDataStream &df, uint16 &var) { RMDataStream &operator>>(RMDataStream &df, uint16 &var) {
uint16 v; uint16 v;
df.Read(&v, 2); df.read(&v, 2);
var = FROM_LE_16(v); var = FROM_LE_16(v);
return df; return df;
@ -602,7 +602,7 @@ RMDataStream &operator>>(RMDataStream &df, uint16 &var) {
*/ */
RMDataStream &operator>>(RMDataStream &df, int16 &var) { RMDataStream &operator>>(RMDataStream &df, int16 &var) {
uint16 v; uint16 v;
df.Read(&v, 2); df.read(&v, 2);
var = (int16)FROM_LE_16(v); var = (int16)FROM_LE_16(v);
return df; return df;
@ -616,7 +616,7 @@ RMDataStream &operator>>(RMDataStream &df, int16 &var) {
*/ */
RMDataStream &operator>>(RMDataStream &df, int &var) { RMDataStream &operator>>(RMDataStream &df, int &var) {
uint32 v; uint32 v;
df.Read(&v, 4); df.read(&v, 4);
var = (int)FROM_LE_32(v); var = (int)FROM_LE_32(v);
return df; return df;
@ -630,7 +630,7 @@ RMDataStream &operator>>(RMDataStream &df, int &var) {
*/ */
RMDataStream &operator>>(RMDataStream &df, uint32 &var) { RMDataStream &operator>>(RMDataStream &df, uint32 &var) {
uint32 v; uint32 v;
df.Read(&v, 4); df.read(&v, 4);
var = FROM_LE_32(v); var = FROM_LE_32(v);
return df; return df;
@ -642,17 +642,17 @@ RMDataStream &operator>>(RMDataStream &df, uint32 &var) {
* @param size Size of the buffer * @param size Size of the buffer
* @returns true if we have reached the end, false if not * @returns true if we have reached the end, false if not
*/ */
bool RMDataStream::Read(void *lpBuf, int size) { bool RMDataStream::read(void *lpBuf, int size) {
byte *dest = (byte *)lpBuf; byte *dest = (byte *)lpBuf;
if ((m_pos + size) > m_length) { if ((_pos + size) > _length) {
Common::copy(m_buf + m_pos, m_buf + m_pos + (m_length - m_pos), dest); Common::copy(_buf + _pos, _buf + _pos + (_length - _pos), dest);
return true; return true;
} else { } else {
Common::copy(m_buf + m_pos, m_buf + m_pos + size, dest); Common::copy(_buf + _pos, _buf + _pos + size, dest);
m_pos += size; _pos += size;
return false; return false;
} }
} }
@ -663,7 +663,7 @@ bool RMDataStream::Read(void *lpBuf, int size) {
* @returns The stream * @returns The stream
*/ */
RMDataStream &RMDataStream::operator+=(int nBytes) { RMDataStream &RMDataStream::operator+=(int nBytes) {
m_pos += nBytes; _pos += nBytes;
return *this; return *this;
} }
@ -673,57 +673,57 @@ RMDataStream &RMDataStream::operator+=(int nBytes) {
* @param origin Origin to do offset from * @param origin Origin to do offset from
* @returns The absolute current position in bytes * @returns The absolute current position in bytes
*/ */
int RMDataStream::Seek(int nBytes, RMDSPos origin) { int RMDataStream::seek(int nBytes, RMDSPos origin) {
switch (origin) { switch (origin) {
case CUR: case CUR:
break; break;
case START: case START:
m_pos = 0; _pos = 0;
break; break;
case END: case END:
if (m_length == SIZENOTKNOWN) if (_length == SIZENOTKNOWN)
return m_pos; return _pos;
m_pos = m_length; _pos = _length;
break; break;
} }
m_pos += nBytes; _pos += nBytes;
return m_pos; return _pos;
} }
/** /**
* Returns the current position of the stream * Returns the current position of the stream
* @returns The current position * @returns The current position
*/ */
int RMDataStream::Pos() { int RMDataStream::pos() {
return m_pos; return _pos;
} }
/** /**
* Check if an error occurred during reading the stream * Check if an error occurred during reading the stream
* @returns true if there was an error, false otherwise * @returns true if there was an error, false otherwise
*/ */
bool RMDataStream::IsError() { bool RMDataStream::isError() {
return m_bError; return _bError;
} }
/** /**
* Sets an error code for the stream * Sets an error code for the stream
* @param code Error code * @param code Error code
*/ */
void RMDataStream::SetError(int code) { void RMDataStream::setError(int code) {
m_bError = true; _bError = true;
m_ecode = code; _ecode = code;
} }
/** /**
* Returns the error code for the stream * Returns the error code for the stream
* @returns Error code * @returns Error code
*/ */
int RMDataStream::GetError() { int RMDataStream::getError() {
return m_ecode; return _ecode;
} }
/****************************************************************************\ /****************************************************************************\
@ -766,7 +766,7 @@ RMPoint &RMPoint::operator=(RMPoint p) {
/** /**
* Offsets the point by another point * Offsets the point by another point
*/ */
void RMPoint::Offset(const RMPoint &p) { void RMPoint::offset(const RMPoint &p) {
x += p.x; x += p.x;
y += p.y; y += p.y;
} }
@ -774,7 +774,7 @@ void RMPoint::Offset(const RMPoint &p) {
/** /**
* Offsets the point by a specified offset * Offsets the point by a specified offset
*/ */
void RMPoint::Offset(int xOff, int yOff) { void RMPoint::offset(int xOff, int yOff) {
x += xOff; x += xOff;
y += yOff; y += yOff;
} }
@ -801,7 +801,7 @@ RMPoint operator-(RMPoint p1, RMPoint p2) {
* Sum (offset) of a point * Sum (offset) of a point
*/ */
RMPoint &RMPoint::operator+=(RMPoint p) { RMPoint &RMPoint::operator+=(RMPoint p) {
Offset(p); offset(p);
return *this; return *this;
} }
@ -809,7 +809,7 @@ RMPoint &RMPoint::operator+=(RMPoint p) {
* Subtract (offset) of a point * Subtract (offset) of a point
*/ */
RMPoint &RMPoint::operator-=(RMPoint p) { RMPoint &RMPoint::operator-=(RMPoint p) {
Offset(-p); offset(-p);
return *this; return *this;
} }
@ -852,93 +852,93 @@ RMDataStream &operator>>(RMDataStream &ds, RMPoint &p) {
\****************************************************************************/ \****************************************************************************/
RMRect::RMRect() { RMRect::RMRect() {
SetEmpty(); setEmpty();
} }
void RMRect::SetEmpty(void) { void RMRect::setEmpty(void) {
x1 = y1 = x2 = y2 = 0; x1 = y1 = x2 = y2 = 0;
} }
RMRect::RMRect(const RMPoint &p1, const RMPoint &p2) { RMRect::RMRect(const RMPoint &p1, const RMPoint &p2) {
SetRect(p1, p2); setRect(p1, p2);
} }
RMRect::RMRect(int X1, int Y1, int X2, int Y2) { RMRect::RMRect(int X1, int Y1, int X2, int Y2) {
SetRect(X1, Y1, X2, Y2); setRect(X1, Y1, X2, Y2);
} }
RMRect::RMRect(const RMRect &rc) { RMRect::RMRect(const RMRect &rc) {
CopyRect(rc); copyRect(rc);
} }
void RMRect::SetRect(const RMPoint &p1, const RMPoint &p2) { void RMRect::setRect(const RMPoint &p1, const RMPoint &p2) {
x1 = p1.x; x1 = p1.x;
y1 = p1.y; y1 = p1.y;
x2 = p2.x; x2 = p2.x;
y2 = p2.y; y2 = p2.y;
} }
void RMRect::SetRect(int X1, int Y1, int X2, int Y2) { void RMRect::setRect(int X1, int Y1, int X2, int Y2) {
x1 = X1; x1 = X1;
y1 = Y1; y1 = Y1;
x2 = X2; x2 = X2;
y2 = Y2; y2 = Y2;
} }
void RMRect::SetRect(const RMRect &rc) { void RMRect::setRect(const RMRect &rc) {
CopyRect(rc); copyRect(rc);
} }
void RMRect::CopyRect(const RMRect &rc) { void RMRect::copyRect(const RMRect &rc) {
x1 = rc.x1; x1 = rc.x1;
y1 = rc.y1; y1 = rc.y1;
x2 = rc.x2; x2 = rc.x2;
y2 = rc.y2; y2 = rc.y2;
} }
RMPoint &RMRect::TopLeft() { RMPoint &RMRect::topLeft() {
// FIXME: This seems very bad // FIXME: This seems very bad
return *((RMPoint *)this); return *((RMPoint *)this);
} }
RMPoint &RMRect::BottomRight() { RMPoint &RMRect::bottomRight() {
// FIXME: This seems very bad // FIXME: This seems very bad
return *((RMPoint *)this + 1); return *((RMPoint *)this + 1);
} }
RMPoint RMRect::Center() { RMPoint RMRect::center() {
return RMPoint((x2 - x1) / 2, (y2 - y1) / 2); return RMPoint((x2 - x1) / 2, (y2 - y1) / 2);
} }
int RMRect::Width() const { int RMRect::width() const {
return x2 - x1; return x2 - x1;
} }
int RMRect::Height() const { int RMRect::height() const {
return y2 - y1; return y2 - y1;
} }
int RMRect::Size() const { int RMRect::size() const {
return Width() * Height(); return width() * height();
} }
bool RMRect::IsEmpty() const { bool RMRect::isEmpty() const {
return (x1 == 0 && y1 == 0 && x2 == 0 && y2 == 0); return (x1 == 0 && y1 == 0 && x2 == 0 && y2 == 0);
} }
const RMRect &RMRect::operator=(const RMRect &rc) { const RMRect &RMRect::operator=(const RMRect &rc) {
CopyRect(rc); copyRect(rc);
return *this; return *this;
} }
void RMRect::Offset(int xOff, int yOff) { void RMRect::offset(int xOff, int yOff) {
x1 += xOff; x1 += xOff;
y1 += yOff; y1 += yOff;
x2 += xOff; x2 += xOff;
y2 += yOff; y2 += yOff;
} }
void RMRect::Offset(const RMPoint &p) { void RMRect::offset(const RMPoint &p) {
x1 += p.x; x1 += p.x;
y1 += p.y; y1 += p.y;
x2 += p.x; x2 += p.x;
@ -946,12 +946,12 @@ void RMRect::Offset(const RMPoint &p) {
} }
const RMRect &RMRect::operator+=(RMPoint p) { const RMRect &RMRect::operator+=(RMPoint p) {
Offset(p); offset(p);
return *this; return *this;
} }
const RMRect &RMRect::operator-=(RMPoint p) { const RMRect &RMRect::operator-=(RMPoint p) {
Offset(-p); offset(-p);
return *this; return *this;
} }
@ -986,8 +986,8 @@ bool RMRect::operator!=(const RMRect &rc) {
return ((x1 != rc.x1) || (y1 != rc.y1) || (x2 != rc.x2) || (y2 != rc.y2)); return ((x1 != rc.x1) || (y1 != rc.y1) || (x2 != rc.x2) || (y2 != rc.y2));
} }
void RMRect::NormalizeRect(void) { void RMRect::normalizeRect(void) {
SetRect(MIN(x1, x2), MIN(y1, y2), MAX(x1, x2), MAX(y1, y2)); setRect(MIN(x1, x2), MIN(y1, y2), MAX(x1, x2), MAX(y1, y2));
} }
RMDataStream &operator>>(RMDataStream &ds, RMRect &rc) { RMDataStream &operator>>(RMDataStream &ds, RMRect &rc) {
@ -1014,7 +1014,7 @@ RMResUpdate::~RMResUpdate() {
_hFile.close(); _hFile.close();
} }
void RMResUpdate::Init(const Common::String &fileName) { void RMResUpdate::init(const Common::String &fileName) {
// Open the resource update file // Open the resource update file
if (!_hFile.open(fileName)) if (!_hFile.open(fileName))
// It doesn't exist, so exit immediately // It doesn't exist, so exit immediately
@ -1039,7 +1039,7 @@ void RMResUpdate::Init(const Common::String &fileName) {
} }
} }
HGLOBAL RMResUpdate::QueryResource(uint32 dwRes) { HGLOBAL RMResUpdate::queryResource(uint32 dwRes) {
// If there isn't an update file, return NULL // If there isn't an update file, return NULL
if (!_hFile.isOpen()) if (!_hFile.isOpen())
return NULL; return NULL;

View file

@ -44,11 +44,11 @@ using namespace ::Tony::MPAL;
*/ */
class RMDataStream { class RMDataStream {
protected: protected:
const byte *m_buf; const byte *_buf;
int m_length; int _length;
int m_pos; int _pos;
bool m_bError; bool _bError;
int m_ecode; int _ecode;
public: public:
enum RMDSPos { enum RMDSPos {
@ -68,15 +68,15 @@ public:
virtual ~RMDataStream(); virtual ~RMDataStream();
// Loading buffer // Loading buffer
void OpenBuffer(const byte *buf, int size = SIZENOTKNOWN); void openBuffer(const byte *buf, int size = SIZENOTKNOWN);
void Close(void); void close(void);
// Attributei // Attributei
int Length(); int length();
virtual int Pos(); virtual int pos();
// EOF // EOF
virtual bool IsEOF(); virtual bool isEOF();
// Read methods // Read methods
friend RMDataStream &operator>>(RMDataStream &df, char &var); friend RMDataStream &operator>>(RMDataStream &df, char &var);
@ -87,16 +87,16 @@ public:
friend RMDataStream &operator>>(RMDataStream &df, uint32 &var); friend RMDataStream &operator>>(RMDataStream &df, uint32 &var);
// General read // General read
virtual bool Read(void *buf, int size); virtual bool read(void *buf, int size);
// Skipping & Seeking // Skipping & Seeking
virtual RMDataStream &operator+=(int nBytes); virtual RMDataStream &operator+=(int nBytes);
virtual int Seek(int nBytes, RMDSPos origin = CUR); virtual int seek(int nBytes, RMDSPos origin = CUR);
// Error handling // Error handling
void SetError(int ecode); void setError(int ecode);
int GetError(); int getError();
bool IsError(); bool isError();
}; };
@ -105,17 +105,17 @@ public:
*/ */
class RMFileStream : public RMDataStream { class RMFileStream : public RMDataStream {
private: private:
byte *m_buf; byte *_buf;
public: public:
RMFileStream(); RMFileStream();
virtual ~RMFileStream(); virtual ~RMFileStream();
// Methods for opening file // Methods for opening file
bool OpenFile(const char *lpFN); bool openFile(const char *lpFN);
bool OpenFile(Common::File &file); bool openFile(Common::File &file);
void Close(void); void close(void);
}; };
@ -126,18 +126,18 @@ public:
RMFileStreamSlow(); RMFileStreamSlow();
virtual ~RMFileStreamSlow(); virtual ~RMFileStreamSlow();
bool OpenFile(const char *lpFN); bool openFile(const char *lpFN);
bool OpenFile(Common::File &file); bool openFile(Common::File &file);
void Close(void); void close(void);
RMDataStream &operator+=(int nBytes); RMDataStream &operator+=(int nBytes);
int Seek(int nBytes, RMDSPos where = CUR); int seek(int nBytes, RMDSPos where = CUR);
int Pos(); int pos();
virtual bool IsEOF(); virtual bool isEOF();
bool Read(void *buf, int size); bool read(void *buf, int size);
friend RMFileStreamSlow &operator>>(RMFileStreamSlow &df, char &var); friend RMFileStreamSlow &operator>>(RMFileStreamSlow &df, char &var);
friend RMFileStreamSlow &operator>>(RMFileStreamSlow &df, byte &var); friend RMFileStreamSlow &operator>>(RMFileStreamSlow &df, byte &var);
@ -152,9 +152,9 @@ public:
*/ */
class RMString { class RMString {
private: private:
char *m_string; char *_string;
int m_length; int _length;
int m_realLength; int _realLength;
public: public:
RMString(); RMString();
@ -166,12 +166,12 @@ public:
RMString(const int ch); RMString(const int ch);
// General methods // General methods
int Length() const; int length() const;
void Compact(); void compact();
// Access characters within string // Access characters within string
char GetAt(int nIndex); char getAt(int nIndex);
void SetAt(int nIndex, char c); void setAt(int nIndex, char c);
char &operator[](int nIndex); char &operator[](int nIndex);
// String cast // String cast
@ -200,11 +200,11 @@ public:
friend RMDataStream &operator>>(RMDataStream &df, RMString &var); friend RMDataStream &operator>>(RMDataStream &df, RMString &var);
// String formatting // String formatting
void Format(const char *str, ...); void format(const char *str, ...);
private: private:
void Resize(int size, bool bMantain = false); void resize(int size, bool bMantain = false);
void Connect(const char *str, int size); void connect(const char *str, int size);
}; };
/** /**
@ -224,14 +224,14 @@ public:
RMPoint &operator=(RMPoint p); RMPoint &operator=(RMPoint p);
// Set // Set
void Set(int x1, int y1) { void set(int x1, int y1) {
x = x1; x = x1;
y = y1; y = y1;
} }
// Offset // Offset
void Offset(int xOff, int yOff); void offset(int xOff, int yOff);
void Offset(const RMPoint &p); void offset(const RMPoint &p);
friend RMPoint operator+(RMPoint p1, RMPoint p2); friend RMPoint operator+(RMPoint p1, RMPoint p2);
friend RMPoint operator-(RMPoint p1, RMPoint p2); friend RMPoint operator-(RMPoint p1, RMPoint p2);
RMPoint &operator+=(RMPoint p); RMPoint &operator+=(RMPoint p);
@ -261,27 +261,27 @@ public:
RMRect(const RMRect &rc); RMRect(const RMRect &rc);
// Attributes // Attributes
RMPoint &TopLeft(); RMPoint &topLeft();
RMPoint &BottomRight(); RMPoint &bottomRight();
RMPoint Center(); RMPoint center();
int Width() const; int width() const;
int Height() const; int height() const;
bool IsEmpty() const; bool isEmpty() const;
int Size() const; int size() const;
// Set // Set
void SetRect(int x1, int y1, int x2, int y2); void setRect(int x1, int y1, int x2, int y2);
void SetRect(const RMPoint &p1, const RMPoint &p2); void setRect(const RMPoint &p1, const RMPoint &p2);
void SetEmpty(void); void setEmpty(void);
// Copiers // Copiers
void SetRect(const RMRect &rc); void setRect(const RMRect &rc);
void CopyRect(const RMRect &rc); void copyRect(const RMRect &rc);
const RMRect &operator=(const RMRect &rc); const RMRect &operator=(const RMRect &rc);
// Offset // Offset
void Offset(int xOff, int yOff); void offset(int xOff, int yOff);
void Offset(const RMPoint &p); void offset(const RMPoint &p);
friend RMRect operator+(const RMRect &rc, RMPoint p); friend RMRect operator+(const RMRect &rc, RMPoint p);
friend RMRect operator-(const RMRect &rc, RMPoint p); friend RMRect operator-(const RMRect &rc, RMPoint p);
friend RMRect operator+(RMPoint p, const RMRect &rc); friend RMRect operator+(RMPoint p, const RMRect &rc);
@ -294,10 +294,10 @@ public:
bool operator!=(const RMRect &rc); bool operator!=(const RMRect &rc);
// Normalise // Normalise
void NormalizeRect(); void normalizeRect();
// Point in rect // Point in rect
bool PtInRect(const RMPoint &pt) { bool ptInRect(const RMPoint &pt) {
return (pt.x >= x1 && pt.x <= x2 && pt.y >= y1 && pt.y <= y2); return (pt.x >= x1 && pt.x <= x2 && pt.y >= y1 && pt.y <= y2);
} }
@ -324,8 +324,8 @@ public:
RMResUpdate(); RMResUpdate();
~RMResUpdate(); ~RMResUpdate();
void Init(const Common::String &fileName); void init(const Common::String &fileName);
HGLOBAL QueryResource(uint32 dwRes); HGLOBAL queryResource(uint32 dwRes);
}; };
} // End of namespace Tony } // End of namespace Tony

View file

@ -57,8 +57,8 @@ private:
void plotLines(const byte *lpBuf, const Common::Point &center, int x, int y); void plotLines(const byte *lpBuf, const Common::Point &center, int x, int y);
protected: protected:
void * /*LPDIRECTDRAWCLIPPER*/ m_MainClipper; // void * /*LPDIRECTDRAWCLIPPER*/ _MainClipper;
void * /*LPDIRECTDRAWCLIPPER*/ m_BackClipper; // void * /*LPDIRECTDRAWCLIPPER*/ _BackClipper;
int fps, fcount; int fps, fcount;
int lastsecond, lastfcount; int lastsecond, lastfcount;