From 68bcaa61b9eb1108028b3db072ade95431b9f14f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 30 Apr 2012 23:16:19 +1000 Subject: TONY: More header files and functionality added --- engines/tony/custom.cpp | 2511 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2511 insertions(+) create mode 100644 engines/tony/custom.cpp (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp new file mode 100644 index 0000000000..55f6cbe77d --- /dev/null +++ b/engines/tony/custom.cpp @@ -0,0 +1,2511 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * + */ +/************************************************************************** + * ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ * + * Nayma Software srl * + * e -= We create much MORE than ALL =- * + * u- z$$$c '. ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ * + * .d" d$$$$$b "b. * + * .z$* d$$$$$$$L ^*$c. * + * #$$$. $$$$$$$$$ .$$$" Project: Roasted Moths........ * + * ^*$b 4$$$$$$$$$F .d$*" * + * ^$$. 4$$$$$$$$$F .$P" Module: Custom.CPP........... * + * *$. '$$$$$$$$$ 4$P 4 * + * J *$ "$$$$$$$" $P r Author: Giovanni Bajo........ * + * z$ '$$$P*4c.*$$$*.z@*R$$$ $. * + * z$" "" #$F^ "" '$c Desc: Custom functions..... * + * z$$beu .ue=" $ "=e.. .zed$$c ..................... * + * "#$e z$*" . `. ^*Nc e$"" ..................... * + * "$$". .r" ^4. .^$$" ..................... * + * ^.@*"6L=\ebu^+C$"*b." * + * "**$. "c 4$$$ J" J$P*" OS: [ ] DOS [X] WIN95 [ ] PORT * + * ^"--.^ 9$" .--"" COMP: [ ] WATCOM [X] VISUAL C++ * + * " [ ] EIFFEL [ ] GCC/GXX/DJGPP * + * * + * This source code is Copyright (C) Nayma Software. ALL RIGHTS RESERVED * + * * + ************************************************************************** + */ + +#include "common/system.h" +#include "common/savefile.h" +#include "tony/mpal/mpal.h" +#include "tony/mpal/memory.h" +#include "tony/adv.h" +#include "tony/custom.h" +#include "tony/font.h" +#include "tony/game.h" +#include "tony/gfxcore.h" +#include "tony/tony.h" +#include "tony/tonychar.h" +#include "tony/utils.h" + +namespace Tony { + +extern bool bPatIrqFreeze; + +RMTony *Tony; +RMPointer *Pointer; +RMGameBoxes *Boxes; +RMLocation *Loc; +RMInventory *Inventory; +RMInput *Input; + +HANDLE (*LoadLocation)(int, RMPoint, RMPoint start); +HANDLE (*UnloadLocation)(bool bDoOnExit); +void (*LinkGraphicTask)(RMGfxTask *task); +void (*Freeze)(void); +void (*Unfreeze)(void); +void (*WaitFrame)(void); +void (*PlayMusic)(int nChannel, const char *fileName, int nFX, bool bLoop, int nSync); +void (*WaitWipeEnd)(void); +void (*CloseWipe)(void); +void (*InitWipe)(int type); +void (*EnableGUI)(void); +void (*DisableGUI)(void); +void (*SetPalesati)(bool bpal); + +uint32 dwTonyNumTexts = 0; +bool bTonyInTexts = false; +bool bStaticTalk = false; +RMTony::TALKTYPE nTonyNextTalkType; + +RMPoint StartLocPos[256]; +OSystem::MutexRef cs[10]; +OSystem::MutexRef vdb; +HANDLE mut[10]; + +bool bSkipIdle = false; +HANDLE hSkipIdle; + +int lastMusic = 0, lastTappeto = 0; + +int tappeti[200]; + +#define T_GRILLI 1 +#define T_GRILLIOV 2 +#define T_GRILLIVENTO 3 +#define T_GRILLIVENTO1 4 +#define T_VENTO 5 +#define T_MARE 6 +#define T_MAREMETA 7 + +char* tappetiFile[] = { + "None", + "1.ADP", // Grilli.WAV + "2.ADP", // Grilli-Ovattati.WAV + "3.ADP", // Grilli-Vento.WAV + "3.ADP", // Grilli-Vento1.WAV + "5.ADP", // Vento1.WAV + "4.ADP", // Mare1.WAV + "6.ADP" // Mare1.WAV metà volume +}; + +struct { + uint32 code; + RMItem *item; + byte r, g, b; + int talkpattern; + int standpattern; + int starttalkpattern, endtalkpattern; + int numtexts; + + void Save(Common::OutSaveFile *f) { + f->writeUint32LE(code); + f->writeUint32LE(0); + f->writeByte(r); + f->writeByte(g); + f->writeByte(b); + f->writeUint32LE(talkpattern); + f->writeUint32LE(standpattern); + f->writeUint32LE(starttalkpattern); + f->writeUint32LE(endtalkpattern); + f->writeUint32LE(numtexts); + } + void Load(Common::InSaveFile *f) { + code = f->readUint32LE(); + f->readUint32LE(); + item = NULL; + r = f->readByte(); + g = f->readByte(); + b = f->readByte(); + talkpattern = f->readUint32LE(); + standpattern = f->readUint32LE(); + starttalkpattern = f->readUint32LE(); + endtalkpattern = f->readUint32LE(); + numtexts = f->readUint32LE(); + } +} Character[16]; + +struct { + uint32 code; + RMItem *item; + byte r, g, b; + int x, y; + int numtalks[10]; + int curgroup; + int numtexts; + bool bInTexts; + int curTalk; + bool bAlwaysBack; + + void Save(Common::OutSaveFile *f) { + f->writeUint32LE(code); + f->writeUint32LE(0); + f->writeByte(r); + f->writeByte(g); + f->writeByte(b); + f->writeUint32LE(x); + f->writeUint32LE(y); + for (int i = 0; i < 10; ++i) + f->writeUint32LE(numtalks[i]); + f->writeUint32LE(curgroup); + f->writeUint32LE(numtexts); + f->writeByte(bInTexts); + f->writeUint32LE(curTalk); + f->writeByte(bAlwaysBack); + } + void Load(Common::InSaveFile *f) { + code = f->readUint32LE(); + f->readUint32LE(); + item = NULL; + r = f->readByte(); + g = f->readByte(); + b = f->readByte(); + x = f->readUint32LE(); + y = f->readUint32LE(); + for (int i = 0; i < 10; ++i) + numtalks[i] = f->readUint32LE(); + curgroup = f->readUint32LE(); + numtexts = f->readUint32LE(); + bInTexts = f->readByte(); + curTalk = f->readUint32LE(); + bAlwaysBack = f->readByte(); + } +} MCharacter[10]; + +bool IsMChar[16]; + +bool bAlwaysDisplay; + +RMPoint saveTonyPos; +int saveTonyLoc; + +RMTextDialog *curBackText = NULL; +bool bTonyIsSpeaking = false; + +int curChangedHotspot = 0; + +struct { + uint32 dwCode; + uint32 nX,nY; + + void Save(Common::OutSaveFile *f) { + f->writeUint32LE(dwCode); + f->writeUint32LE(nX); + f->writeUint32LE(nY); + } + void Load(Common::InSaveFile *f) { + dwCode = f->readUint32LE(); + nX = f->readUint32LE(); + nY = f->readUint32LE(); + } +} ChangedHotspot[256]; + +void ReapplyChangedHotspot(void) { + int i; + for (i = 0; iGetItemFromCode(ChangedHotspot[i].dwCode)->ChangeHotspot(RMPoint(ChangedHotspot[i].nX, ChangedHotspot[i].nY)); +} + +void SaveChangedHotspot(Common::OutSaveFile *f) { + f->writeByte(curChangedHotspot); + if (curChangedHotspot > 0) { + for (int i = 0; i < curChangedHotspot; ++i) + ChangedHotspot[i].Save(f); + } +} + +void LoadChangedHotspot(Common::InSaveFile *f) { + curChangedHotspot = f->readByte(); + + if (curChangedHotspot > 0) { + for (int i = 0; i < curChangedHotspot; ++i) + ChangedHotspot[i].Load(f); + } +} + + +/* + Classi richieste per le funzioni custom! + + Tony (per muoverlo) -> si puo' fare tramite MPAL l'animazione? Penso proprio di sì + + SendMessage -> Direi che basta theEngine.SendMessage() + ChangeLocation -> theEngine.ChangeLocation() + AddInventory -> theEngine.AddInventory() +*/ + +void MCharResetCodes(void) { + for (int i = 0; i < 10; i++) + MCharacter[i].item = Loc->GetItemFromCode(MCharacter[i].code); + for (int i = 0; i < 10; i++) + Character[i].item = Loc->GetItemFromCode(Character[i].code); +} + +void CharsSaveAll(Common::OutSaveFile *f) { + for (int i = 0; i < 10; i++) { + f->writeByte(IsMChar[i]); + if (IsMChar[i]) { + MCharacter[i].Save(f); + } else { + Character[i].Save(f); + } + } +} + +void CharsLoadAll(Common::InSaveFile *f) { + for (int i = 0; i < 10; i++) { + IsMChar[i] = f->readByte(); + if (IsMChar[i]) + MCharacter[i].Load(f); + else + Character[i].Load(f); + } +} + +DECLARE_CUSTOM_FUNCTION(FaceToMe)(uint32, uint32, uint32, uint32) { + Tony->SetPattern(Tony->PAT_STANDDOWN); +} + +DECLARE_CUSTOM_FUNCTION(BackToMe)(uint32, uint32, uint32, uint32) { + Tony->SetPattern(Tony->PAT_STANDUP); +} + +DECLARE_CUSTOM_FUNCTION(LeftToMe)(uint32, uint32, uint32, uint32) { + Tony->SetPattern(Tony->PAT_STANDLEFT); +} + +DECLARE_CUSTOM_FUNCTION(RightToMe)(uint32, uint32, uint32, uint32) { + Tony->SetPattern(Tony->PAT_STANDRIGHT); +} + + +DECLARE_CUSTOM_FUNCTION(TonySetPalesati)(uint32 bStatus, uint32, uint32, uint32) { + SetPalesati(bStatus); +} + +DECLARE_CUSTOM_FUNCTION(MySleep)(uint32 dwTime, uint32, uint32, uint32) { + if (bSkipIdle) return; + Sleep(dwTime); +} + +DECLARE_CUSTOM_FUNCTION(SetAlwaysDisplay)(uint32 val, uint32, uint32, uint32) { + bAlwaysDisplay = (val != 0); +} + + +DECLARE_CUSTOM_FUNCTION(SetPointer)(uint32 dwPointer, uint32, uint32, uint32) { + switch (dwPointer) { + case 1: + Pointer->SetSpecialPointer(Pointer->PTR_FRECCIASU); + break; + case 2: + Pointer->SetSpecialPointer(Pointer->PTR_FRECCIAGIU); + break; + case 3: + Pointer->SetSpecialPointer(Pointer->PTR_FRECCIASINISTRA); + break; + case 4: + Pointer->SetSpecialPointer(Pointer->PTR_FRECCIADESTRA); + break; + case 5: + Pointer->SetSpecialPointer(Pointer->PTR_FRECCIAMAPPA); + break; + + default: + Pointer->SetSpecialPointer(Pointer->PTR_NONE); + break; + } +} + +VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) { + uint i; + int code; + + code = (codehi << 16) | codelo; + + if (_vm->_voices.size() == 0) + return NULL; + + for (i = 0; i < _vm->_voices.size(); i++) + if (_vm->_voices[i].code == code) + return &_vm->_voices[i]; + + return NULL; +} + + +DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(uint32 dwMessage, uint32 nX, uint32 nY, uint32) { + RMMessage msg(dwMessage); + int i; + int curOffset = 0; + + if (bSkipIdle) return; + + if (!msg.IsValid()) + return; + + VoiceHeader *curVoc = SearchVoiceHeader(0, dwMessage); + FPSFX *voice = NULL; + if (curVoc) { + // Si posiziona all'interno del database delle voci all'inizio della prima + curOffset = curVoc->offset; + + // PRIMA VOLTA PREALLOCA + g_system->lockMutex(vdb); + //fseek(_vm->m_vdbFP, curOffset, SEEK_SET); + _vm->_vdbFP.seek(curOffset); + _vm->_theSound.CreateSfx(&voice); + voice->LoadVoiceFromVDB(_vm->_vdbFP); +// curOffset = ftell(_vm->m_vdbFP); + curOffset = _vm->_vdbFP.pos(); + + voice->SetLoop(false); + g_system->unlockMutex(vdb); + } + + if (nTonyNextTalkType != Tony->TALK_NORMAL) { + Tony->StartTalk(nTonyNextTalkType); + if (!bStaticTalk) + nTonyNextTalkType = Tony->TALK_NORMAL; + } else { + if (msg.NumPeriods() > 1) + Tony->StartTalk(Tony->TALK_FIANCHI); + else + Tony->StartTalk(Tony->TALK_NORMAL); + } + + if (curBackText) + curBackText->Hide(); + bTonyIsSpeaking = true; + + for (i = 0; i < msg.NumPeriods() && !bSkipIdle; i++) { + RMTextDialog text; + + text.SetInput(Input); + + // Allineamento + text.SetAlignType(RMText::HCENTER,RMText::VBOTTOM); + + // Colore + text.SetColor(0,255,0); + + // Scrive il testo + text.WriteText(msg[i],0); + + // Setta la posizione + if (nX == 0 && nY == 0) + text.SetPosition(Tony->Position() - RMPoint(0, 130) - Loc->ScrollPosition()); + else + text.SetPosition(RMPoint(nX, nY) - Loc->ScrollPosition()); + + // Setta l'always display + if (bAlwaysDisplay) { text.SetAlwaysDisplay(); text.ForceTime(); } + + // Registra il testo + LinkGraphicTask(&text); + + if (curVoc) { + if (i == 0) { + voice->Play(); + text.SetCustomSkipHandle2(voice->hEndOfBuffer); + } else { + g_system->lockMutex(vdb); + // fseek(_vm->m_vdbFP, curOffset, SEEK_SET); + _vm->_vdbFP.seek(curOffset); + _vm->_theSound.CreateSfx(&voice); + voice->LoadVoiceFromVDB(_vm->_vdbFP); + // curOffset = ftell(_vm->m_vdbFP); + curOffset = _vm->_vdbFP.pos(); + voice->SetLoop(false); + voice->Play(); + text.SetCustomSkipHandle2(voice->hEndOfBuffer); + g_system->unlockMutex(vdb); + } + } + + // Aspetta la fine della visualizzazione + text.SetCustomSkipHandle(hSkipIdle); + text.WaitForEndDisplay(); + + if (curVoc) { + voice->Stop(); + voice->Release(); + voice=NULL; + } + } + + bTonyIsSpeaking = false; + if (curBackText) + curBackText->Show(); + + Tony->EndTalk(); +} + +DECLARE_CUSTOM_FUNCTION(ChangeBoxStatus)(uint32 nLoc, uint32 nBox, uint32 nStatus, uint32) { + Boxes->ChangeBoxStatus(nLoc,nBox,nStatus); +} + + +DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { + HANDLE h; + + Freeze(); + + curChangedHotspot = 0; + if (bUseStartPos != 0) + LoadLocation(nLoc, RMPoint(tX, tY), StartLocPos[nLoc]); + else + LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); + + Unfreeze(); + h = mpalQueryDoAction(0, nLoc, 0); + + // On Enter? + if (h != INVALID_HANDLE_VALUE) + WaitForSingleObject(h, INFINITE); +} + + +RMPoint SFM_pt; +int SFM_nLoc; + +DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(uint32 nMsg, uint32 nFont, uint32, uint32) { + RMMessage msg(nMsg); + RMGfxClearTask clear; + int i; + + SFM_nLoc = Loc->TEMPGetNumLoc(); + SFM_pt = Tony->Position(); + + if (bSkipIdle) return; + + UnloadLocation(false); + Tony->Hide(); + Unfreeze(); + + for (i = 0; i < msg.NumPeriods() && !bSkipIdle; i++) { + RMTextDialog text; + + text.SetInput(Input); + + // Allineamento + text.SetAlignType(RMText::HCENTER,RMText::VCENTER); + + // Forza il testo a scomparire a tempo + text.ForceTime(); + + // Colore + text.SetColor(255,255,255); + + // Scrive il testo + if (nFont== 0) + text.WriteText(msg[i],1); + else if (nFont==1) + text.WriteText(msg[i],0); + + // Setta la posizione + text.SetPosition(RMPoint(320,240)); + + text.SetAlwaysDisplay(); + text.ForceTime(); + + // Registra il testo + LinkGraphicTask(&clear); + LinkGraphicTask(&text); + + // Aspetta la fine della visualizzazione + text.SetCustomSkipHandle(hSkipIdle); + text.WaitForEndDisplay(); + } +} + +DECLARE_CUSTOM_FUNCTION(ClearScreen)(uint32, uint32, uint32, uint32) { + RMGfxClearTask clear; + + LinkGraphicTask(&clear); + WaitFrame(); +} + +DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(uint32 bNotEnableTony, uint32, uint32, uint32) { + Freeze(); + LoadLocation(SFM_nLoc,RMPoint(SFM_pt.x,SFM_pt.y),RMPoint(-1,-1)); + if (!bNotEnableTony) + Tony->Show(); + Unfreeze(); + + MCharResetCodes(); + ReapplyChangedHotspot(); +} + + +DECLARE_CUSTOM_FUNCTION(SendFullscreenMessage)(uint32 nMsg, uint32 nFont, uint32, uint32) { + SendFullscreenMsgStart(nMsg,nFont,0,0); + SendFullscreenMsgEnd(0, 0, 0, 0); +} + +bool bNoOcchioDiBue = false; + +DECLARE_CUSTOM_FUNCTION(NoOcchioDiBue)(uint32, uint32, uint32, uint32) { + bNoOcchioDiBue = true; +} + +DECLARE_CUSTOM_FUNCTION(CloseLocation)(uint32, uint32, uint32, uint32) { + if (!bNoOcchioDiBue) { + InitWipe(1); + WaitWipeEnd(); + } + + _vm->StopMusic(4); + + // On Exit e lascia freezzato + UnloadLocation(true); + Unfreeze(); +} + + +DECLARE_CUSTOM_FUNCTION(ChangeLocation)(uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { + HANDLE h; + + if (!bNoOcchioDiBue) { + InitWipe(1); + WaitWipeEnd(); + } + + if (lastTappeto != tappeti[nLoc]) { + _vm->StopMusic(4); + } + + // On Exit e lascia freezzato + UnloadLocation(true); + + curChangedHotspot = 0; + if (bUseStartPos != 0) + LoadLocation(nLoc, RMPoint(tX, tY), StartLocPos[nLoc]); + else + LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); + + if (lastTappeto != tappeti[nLoc]) { + lastTappeto = tappeti[nLoc]; + if (lastTappeto != 0) + _vm->PlayMusic(4, tappetiFile[lastTappeto], 0, true, 2000); + } + + if (!bNoOcchioDiBue) { + InitWipe(2); + } + + Unfreeze(); + + + h = mpalQueryDoAction(0,nLoc,0); + + if (!bNoOcchioDiBue) { + WaitWipeEnd(); + CloseWipe(); + } + + bNoOcchioDiBue = false; + + // On Enter? + if (h != INVALID_HANDLE_VALUE) + WaitForSingleObject(h,INFINITE); + +} + +DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(uint32 nLoc, uint32 lX, uint32 lY, uint32) { + StartLocPos[nLoc].Set(lX,lY); +} + +DECLARE_CUSTOM_FUNCTION(SaveTonyPosition)(uint32, uint32, uint32, uint32) { + saveTonyPos = Tony->Position(); + saveTonyLoc = Loc->TEMPGetNumLoc(); +} + +DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(uint32, uint32, uint32, uint32) { + ChangeLocation(saveTonyLoc, saveTonyPos.x, saveTonyPos.y, 0); + MCharResetCodes(); +} + + +DECLARE_CUSTOM_FUNCTION(DisableInput)(uint32, uint32, uint32, uint32) { + MainDisableInput(); +} + + +DECLARE_CUSTOM_FUNCTION(EnableInput)(uint32, uint32, uint32, uint32) { + MainEnableInput(); +} + +DECLARE_CUSTOM_FUNCTION(StopTony)(uint32, uint32, uint32, uint32) { + Tony->StopNoAction(); +} + + +DECLARE_CUSTOM_FUNCTION(CustEnableGUI)(uint32, uint32, uint32, uint32) { + EnableGUI(); +} + +DECLARE_CUSTOM_FUNCTION(CustDisableGUI)(uint32, uint32, uint32, uint32) +{ + DisableGUI(); +} + + +void TonyGenericTake1(uint32 nDirection) { + Freeze(); + Tony->Take(nDirection,0); + Unfreeze(); + + if (!bSkipIdle) + Tony->WaitForEndPattern(); +} + +void TonyGenericTake2(uint32 nDirection) { + Freeze(); + Tony->Take(nDirection,1); + Unfreeze(); + + if (!bSkipIdle) + Tony->WaitForEndPattern(); + + Freeze(); + Tony->Take(nDirection,2); + Unfreeze(); +} + +void TonyGenericPut1(uint32 nDirection) { + Freeze(); + Tony->Put(nDirection,0); + Unfreeze(); + + if (!bSkipIdle) + Tony->WaitForEndPattern(); +} + +void TonyGenericPut2(uint32 nDirection) { + Freeze(); + Tony->Put(nDirection,1); + Unfreeze(); + + if (!bSkipIdle) + Tony->WaitForEndPattern(); + + Freeze(); + Tony->Put(nDirection,2); + Unfreeze(); +} + + +DECLARE_CUSTOM_FUNCTION(TonyTakeUp1)(uint32, uint32, uint32, uint32) { + TonyGenericTake1(0); +} + + +DECLARE_CUSTOM_FUNCTION(TonyTakeMid1)(uint32, uint32, uint32, uint32) { + TonyGenericTake1(1); +} + +DECLARE_CUSTOM_FUNCTION(TonyTakeDown1)(uint32, uint32, uint32, uint32) { + TonyGenericTake1(2); +} + + + +DECLARE_CUSTOM_FUNCTION(TonyTakeUp2)(uint32, uint32, uint32, uint32) { + TonyGenericTake2(0); +} + + +DECLARE_CUSTOM_FUNCTION(TonyTakeMid2)(uint32, uint32, uint32, uint32) { + TonyGenericTake2(1); +} + +DECLARE_CUSTOM_FUNCTION(TonyTakeDown2)(uint32, uint32, uint32, uint32) { + TonyGenericTake2(2); +} + + + + + + + +DECLARE_CUSTOM_FUNCTION(TonyPutUp1)(uint32, uint32, uint32, uint32) { + TonyGenericPut1(0); +} + + +DECLARE_CUSTOM_FUNCTION(TonyPutMid1)(uint32, uint32, uint32, uint32) { + TonyGenericPut1(1); +} + +DECLARE_CUSTOM_FUNCTION(TonyPutDown1)(uint32, uint32, uint32, uint32) { + TonyGenericPut1(2); +} + +DECLARE_CUSTOM_FUNCTION(TonyPutUp2)(uint32, uint32, uint32, uint32) { + TonyGenericPut2(0); +} + + +DECLARE_CUSTOM_FUNCTION(TonyPutMid2)(uint32, uint32, uint32, uint32) { + TonyGenericPut2(1); +} + +DECLARE_CUSTOM_FUNCTION(TonyPutDown2)(uint32, uint32, uint32, uint32) { + TonyGenericPut2(2); +} + + + +DECLARE_CUSTOM_FUNCTION(TonyPerTerra)(uint32 dwParte, uint32, uint32, uint32) { + if (dwParte== 0) + Tony->SetPattern(Tony->PAT_PERTERRALEFT); + else + Tony->SetPattern(Tony->PAT_PERTERRARIGHT); +} + +DECLARE_CUSTOM_FUNCTION(TonySiRialza)(uint32 dwParte, uint32, uint32, uint32) { + if (dwParte== 0) + Tony->SetPattern(Tony->PAT_SIRIALZALEFT); + else + Tony->SetPattern(Tony->PAT_SIRIALZARIGHT); + + if (!bSkipIdle) + Tony->WaitForEndPattern(); +} + +DECLARE_CUSTOM_FUNCTION(TonyPastorella)(uint32 bIsPast, uint32, uint32, uint32) { + Tony->SetPastorella(bIsPast); +} + +DECLARE_CUSTOM_FUNCTION(TonyFischietto)(uint32, uint32, uint32, uint32) { + Tony->SetPattern(Tony->PAT_FISCHIETTORIGHT); + if (!bSkipIdle) + Tony->WaitForEndPattern(); + Tony->SetPattern(Tony->PAT_STANDRIGHT); +} + + +void TonySetNumTexts(uint32 dwText) { + dwTonyNumTexts=dwText; + bTonyInTexts = false; +} + +DECLARE_CUSTOM_FUNCTION(TonyRide)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_RIDE; +} + +DECLARE_CUSTOM_FUNCTION(TonyRidacchia)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_RIDE2; +} + +DECLARE_CUSTOM_FUNCTION(TonyFianchi)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_FIANCHI; +} + +DECLARE_CUSTOM_FUNCTION(TonyCanta)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_CANTA; +} + +DECLARE_CUSTOM_FUNCTION(TonySiIndica)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_SIINDICA; +} + +DECLARE_CUSTOM_FUNCTION(TonySpaventatoConMani)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_SPAVENTATO; +} + +DECLARE_CUSTOM_FUNCTION(TonySpaventatoSenzaMani)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_SPAVENTATO2; +} + +DECLARE_CUSTOM_FUNCTION(TonyConMartello)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_CONMARTELLO; + Tony->SetPattern(Tony->PAT_CONMARTELLO); +} + +DECLARE_CUSTOM_FUNCTION(TonyConBicchiere)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_CONBICCHIERE; + Tony->SetPattern(Tony->PAT_CONBICCHIERE); +} + +DECLARE_CUSTOM_FUNCTION(TonyConVerme)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_CONVERME; + Tony->SetPattern(Tony->PAT_CONVERME); +} + +DECLARE_CUSTOM_FUNCTION(TonyConCorda)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_CONCORDA; + Tony->SetPattern(Tony->PAT_CONCORDA); +} + +DECLARE_CUSTOM_FUNCTION(TonyConSegretaria)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_CONSEGRETARIA; + Tony->SetPattern(Tony->PAT_CONSEGRETARIA); +} + +DECLARE_CUSTOM_FUNCTION(TonyConConiglioANIM)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_CONCONIGLIO; +} + +DECLARE_CUSTOM_FUNCTION(TonyConRicettaANIM)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_CONRICETTA; +} + +DECLARE_CUSTOM_FUNCTION(TonyConCarteANIM)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_CONCARTE; +} + +DECLARE_CUSTOM_FUNCTION(TonyConPupazzoANIM)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_CONPUPAZZO; +} + +DECLARE_CUSTOM_FUNCTION(TonyConPupazzoStart)(uint32, uint32, uint32, uint32) { + nTonyNextTalkType = Tony->TALK_CONPUPAZZOSTATIC; + bStaticTalk = true; + Tony->StartStatic(Tony->TALK_CONPUPAZZOSTATIC); +} + +DECLARE_CUSTOM_FUNCTION(TonyConPupazzoEnd)(uint32, uint32, uint32, uint32) { + Tony->EndStatic(Tony->TALK_CONPUPAZZOSTATIC); + bStaticTalk = false; + nTonyNextTalkType = Tony->TALK_NORMAL; +} + +DECLARE_CUSTOM_FUNCTION(TonyConConiglioStart)(uint32, uint32, uint32, uint32) { + nTonyNextTalkType = Tony->TALK_CONCONIGLIOSTATIC; + bStaticTalk = true; + Tony->StartStatic(Tony->TALK_CONCONIGLIOSTATIC); +} + +DECLARE_CUSTOM_FUNCTION(TonyConConiglioEnd)(uint32, uint32, uint32, uint32) { + Tony->EndStatic(Tony->TALK_CONCONIGLIOSTATIC); + bStaticTalk = false; + nTonyNextTalkType = Tony->TALK_NORMAL; +} + +DECLARE_CUSTOM_FUNCTION(TonyConRicettaStart)(uint32, uint32, uint32, uint32) { + nTonyNextTalkType = Tony->TALK_CONRICETTASTATIC; + bStaticTalk = true; + Tony->StartStatic(Tony->TALK_CONRICETTASTATIC); +} + +DECLARE_CUSTOM_FUNCTION(TonyConRicettaEnd)(uint32, uint32, uint32, uint32) { + Tony->EndStatic(Tony->TALK_CONRICETTASTATIC); + bStaticTalk = false; + nTonyNextTalkType = Tony->TALK_NORMAL; +} + +DECLARE_CUSTOM_FUNCTION(TonyConCarteStart)(uint32, uint32, uint32, uint32) { + nTonyNextTalkType = Tony->TALK_CONCARTESTATIC; + bStaticTalk = true; + Tony->StartStatic(Tony->TALK_CONCARTESTATIC); +} + +DECLARE_CUSTOM_FUNCTION(TonyConCarteEnd)(uint32, uint32, uint32, uint32) { + Tony->EndStatic(Tony->TALK_CONCARTESTATIC); + bStaticTalk = false; + nTonyNextTalkType = Tony->TALK_NORMAL; +} + +DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoStart)(uint32, uint32, uint32, uint32) { + nTonyNextTalkType = Tony->TALK_CONTACCUINOSTATIC; + bStaticTalk = true; + Tony->StartStatic(Tony->TALK_CONTACCUINOSTATIC); +} + +DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoEnd)(uint32, uint32, uint32, uint32) { + Tony->EndStatic(Tony->TALK_CONTACCUINOSTATIC); + bStaticTalk = false; + nTonyNextTalkType = Tony->TALK_NORMAL; +} + +DECLARE_CUSTOM_FUNCTION(TonyConMegafonoStart)(uint32, uint32, uint32, uint32) { + nTonyNextTalkType = Tony->TALK_CONMEGAFONOSTATIC; + bStaticTalk = true; + Tony->StartStatic(Tony->TALK_CONMEGAFONOSTATIC); +} + +DECLARE_CUSTOM_FUNCTION(TonyConMegafonoEnd)(uint32, uint32, uint32, uint32) { + Tony->EndStatic(Tony->TALK_CONMEGAFONOSTATIC); + bStaticTalk = false; + nTonyNextTalkType = Tony->TALK_NORMAL; +} + +DECLARE_CUSTOM_FUNCTION(TonyConBarbaStart)(uint32, uint32, uint32, uint32) { + nTonyNextTalkType = Tony->TALK_CONBARBASTATIC; + bStaticTalk = true; + Tony->StartStatic(Tony->TALK_CONBARBASTATIC); +} + +DECLARE_CUSTOM_FUNCTION(TonyConBarbaEnd)(uint32, uint32, uint32, uint32) { + Tony->EndStatic(Tony->TALK_CONBARBASTATIC); + bStaticTalk = false; + nTonyNextTalkType = Tony->TALK_NORMAL; +} + +DECLARE_CUSTOM_FUNCTION(TonySpaventatoStart)(uint32, uint32, uint32, uint32) { + nTonyNextTalkType = Tony->TALK_SPAVENTATOSTATIC; + bStaticTalk = true; + Tony->StartStatic(Tony->TALK_SPAVENTATOSTATIC); +} + +DECLARE_CUSTOM_FUNCTION(TonySpaventatoEnd)(uint32, uint32, uint32, uint32) { + Tony->EndStatic(Tony->TALK_SPAVENTATOSTATIC); + bStaticTalk = false; + nTonyNextTalkType = Tony->TALK_NORMAL; +} + + + +DECLARE_CUSTOM_FUNCTION(TonySchifato)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_SCHIFATO; +} + +DECLARE_CUSTOM_FUNCTION(TonySniffaLeft)(uint32, uint32, uint32, uint32) { + Tony->SetPattern(Tony->PAT_SNIFFA_LEFT); + Tony->WaitForEndPattern(); + LeftToMe(0, 0, 0, 0); +} + +DECLARE_CUSTOM_FUNCTION(TonySniffaRight)(uint32, uint32, uint32, uint32) { + Tony->SetPattern(Tony->PAT_SNIFFA_RIGHT); + Tony->WaitForEndPattern(); + RightToMe(0, 0, 0, 0); +} + +DECLARE_CUSTOM_FUNCTION(TonyNaah)(uint32 dwText, uint32, uint32, uint32) { + TonySetNumTexts(dwText); + nTonyNextTalkType = Tony->TALK_NAAH; +} + +DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(uint32 nPos, uint32, uint32, uint32) { + switch (nPos) { + case 1: + nTonyNextTalkType = Tony->TALK_MACBETH1; + break; + case 2: + nTonyNextTalkType = Tony->TALK_MACBETH2; + break; + case 3: + nTonyNextTalkType = Tony->TALK_MACBETH3; + break; + case 4: + nTonyNextTalkType = Tony->TALK_MACBETH4; + break; + case 5: + nTonyNextTalkType = Tony->TALK_MACBETH5; + break; + case 6: + nTonyNextTalkType = Tony->TALK_MACBETH6; + break; + case 7: + nTonyNextTalkType = Tony->TALK_MACBETH7; + break; + case 8: + nTonyNextTalkType = Tony->TALK_MACBETH8; + break; + case 9: + nTonyNextTalkType = Tony->TALK_MACBETH9; + break; + } +} + + +DECLARE_CUSTOM_FUNCTION(EnableTony)(uint32, uint32, uint32, uint32) { + Tony->Show(); +} + +DECLARE_CUSTOM_FUNCTION(DisableTony)(uint32 bShowOmbra, uint32, uint32, uint32) { + Tony->Hide(bShowOmbra); +} + +DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(uint32 nItem, uint32, uint32, uint32) { + RMItem *item = Loc->GetItemFromCode(nItem); + + if (!bSkipIdle && item != NULL) + item->WaitForEndPattern(hSkipIdle); +} + + +DECLARE_CUSTOM_FUNCTION(SetTonyPosition)(uint32 nX, uint32 nY, uint32 nLoc, uint32) { + Tony->SetPosition(RMPoint(nX,nY),nLoc); +} + +DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(uint32 nX, uint32 nY, uint32, uint32) { + Tony->Move(RMPoint(nX,nY)); + + if (!bSkipIdle) + Tony->WaitForEndMovement(); +} + +DECLARE_CUSTOM_FUNCTION(MoveTony)(uint32 nX, uint32 nY, uint32, uint32) { + Tony->Move(RMPoint(nX,nY)); +} + +DECLARE_CUSTOM_FUNCTION(ScrollLocation)(uint32 nX, uint32 nY, uint32 sX, uint32 sY) { + int lx, ly; + RMPoint pt; + + // Prende le coordinate di quanto scrollare + lx=*((int*)&nX); + ly=*((int*)&nY); + + pt=Loc->ScrollPosition(); + + while ((lx != 0 || ly != 0) && !bSkipIdle) { + if (lx>0) { + lx -= (int32)sX; if (lx<0) lx = 0; + pt.Offset((int32)sX, 0); + } else if (lx<0) { + lx += (int32)sX; if (lx>0) lx = 0; + pt.Offset(-(int32)sX, 0); + } + + if (ly > 0) { + ly-=sY; if (ly<0) ly = 0; + pt.Offset(0,sY); + } + else if (ly<0) + { + ly+=sY; if (ly>0) ly = 0; + pt.Offset(0, -(int32)sY); + } + + WaitFrame(); + + Freeze(); + Loc->SetScrollPosition(pt); + Tony->SetScrollPosition(pt); + Unfreeze(); + + } +} + +DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(uint32 nX, uint32 nY, uint32 sX, uint32 sY) { + int lx, ly; + RMPoint pt,startpt; + uint32 dwStartTime,dwCurTime,dwTotalTime; + uint32 stepX, stepY; + int dimx,dimy; + + // Prende le coordinate di quanto scrollare + lx=*((int*)&nX); + ly=*((int*)&nY); + dimx=lx; + dimy=ly; + if (lx<0) dimx = -lx; + if (ly<0) dimy = -ly; + + stepX = sX; + stepY = sY; + + startpt = Loc->ScrollPosition(); + + dwStartTime = timeGetTime(); + + if (sX) + dwTotalTime = dimx*(1000/35)/sX; + else + dwTotalTime = dimy*(1000/35)/sY; + + while ((lx != 0 || ly != 0) && !bSkipIdle) + { + dwCurTime=timeGetTime()-dwStartTime; + if (dwCurTime>dwTotalTime) + break; + + pt = startpt; + + if (sX) { + if (lx > 0) + pt.x += (dimx * dwCurTime) / dwTotalTime; + else + pt.x -= (dimx * dwCurTime) / dwTotalTime; + } else { + if (ly > 0) + pt.y += (dimy*dwCurTime) / dwTotalTime; + else + pt.y -= (dimy*dwCurTime) / dwTotalTime; + + } + +/* + sX = stepX * (dwCurTime-dwLastTime) / (1000/35); + sY = stepY * (dwCurTime-dwLastTime) / (1000/35); + + if (lx>0) + { + lx-=sX; if (lx<0) lx = 0; + pt.Offset(sX,0); + } + else if (lx<0) + { + lx+=sX; if (lx>0) lx = 0; + pt.Offset(-sX,0); + } + + if (ly>0) + { + ly-=sY; if (ly<0) ly = 0; + pt.Offset(0,sY); + } + else if (ly<0) + { + ly+=sY; if (ly>0) ly = 0; + pt.Offset(0,-sY); + } +*/ + WaitFrame(); + + Freeze(); + Loc->SetScrollPosition(pt); + Tony->SetScrollPosition(pt); + Unfreeze(); + + } + + + // Setta la posizione finale + if (sX) { + if (lx>0) + pt.x = startpt.x + dimx; + else + pt.x = startpt.x - dimx; + } else { + if (ly>0) + pt.y = startpt.y + dimy; + else + pt.y = startpt.y - dimy; + + } + + Freeze(); + Loc->SetScrollPosition(pt); + Tony->SetScrollPosition(pt); + Unfreeze(); +} + + +DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(uint32 dwCode, uint32 nX, uint32 nY, uint32) { + int i; + + for (i = 0; i < curChangedHotspot; i++) + if (ChangedHotspot[i].dwCode == dwCode) { + ChangedHotspot[i].nX=nX; + ChangedHotspot[i].nY=nY; + break; + } + + if (i == curChangedHotspot) { + ChangedHotspot[i].dwCode=dwCode; + ChangedHotspot[i].nX=nX; + ChangedHotspot[i].nY=nY; + curChangedHotspot++; + } + + Loc->GetItemFromCode(dwCode)->ChangeHotspot(RMPoint(nX,nY)); +} + + +DECLARE_CUSTOM_FUNCTION(AutoSave)(uint32, uint32, uint32, uint32) { + _vm->AutoSave(); +} + +DECLARE_CUSTOM_FUNCTION(Abort)(uint32, uint32, uint32, uint32) { + _vm->Abort(); +} + +DECLARE_CUSTOM_FUNCTION(TremaSchermo)(uint32 nScosse, uint32, uint32, uint32) { + uint32 i; + uint32 curTime = _vm->GetTime(); + int dirx,diry; + + dirx = 1; + diry = 1; + + while (_vm->GetTime() < curTime + nScosse) { + WaitFrame(); + + Freeze(); + Loc->SetFixedScroll(RMPoint(1 * dirx, 1 * diry)); + Tony->SetFixedScroll(RMPoint(1 * dirx, 1 * diry)); + Unfreeze(); + + i = _vm->_randomSource.getRandomNumber(2); + + if (i == 0 || i == 2) + dirx = -dirx; + else if (i == 1 || i == 2) + diry = -diry; + } + + Freeze(); + Loc->SetFixedScroll(RMPoint(0, 0)); + Tony->SetFixedScroll(RMPoint(0, 0)); + Unfreeze(); +} + + + +/* + * Personaggi + */ + +DECLARE_CUSTOM_FUNCTION(CharSetCode)(uint32 nChar, uint32 nCode, uint32, uint32) { + assert(nChar < 16); + Character[nChar].code = nCode; + Character[nChar].item = Loc->GetItemFromCode(nCode); + Character[nChar].r = 255; + Character[nChar].g = 255; + Character[nChar].b = 255; + Character[nChar].talkpattern = 0; + Character[nChar].starttalkpattern = 0; + Character[nChar].endtalkpattern = 0; + Character[nChar].standpattern = 0; + + IsMChar[nChar] = false; +} + +DECLARE_CUSTOM_FUNCTION(CharSetColor)(uint32 nChar, uint32 r, uint32 g, uint32 b) { + assert(nChar<16); + Character[nChar].r = r; + Character[nChar].g = g; + Character[nChar].b = b; +} + +DECLARE_CUSTOM_FUNCTION(CharSetTalkPattern)(uint32 nChar, uint32 tp, uint32 sp, uint32) { + assert(nChar<16); + Character[nChar].talkpattern = tp; + Character[nChar].standpattern = sp; +} + +DECLARE_CUSTOM_FUNCTION(CharSetStartEndTalkPattern)(uint32 nChar, uint32 sp, uint32 ep, uint32) { + assert(nChar<16); + Character[nChar].starttalkpattern=sp; + Character[nChar].endtalkpattern=ep; +} + +DECLARE_CUSTOM_FUNCTION(CharSendMessage)(uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32) { + RMMessage msg(dwMessage); + int i; + RMPoint pt; + RMTextDialog *text; + int curOffset = 0; + + assert(nChar<16); + pt=Character[nChar].item->CalculatePos()-RMPoint(-60,20)-Loc->ScrollPosition(); + + if (Character[nChar].starttalkpattern != 0) { + Freeze(); + Character[nChar].item->SetPattern(Character[nChar].starttalkpattern); + Unfreeze(); + Character[nChar].item->WaitForEndPattern(); + } + + Freeze(); + Character[nChar].item->SetPattern(Character[nChar].talkpattern); + Unfreeze(); + + VoiceHeader *curVoc = SearchVoiceHeader(0, dwMessage); + FPSFX *voice = NULL; + if (curVoc) { + // Si posiziona all'interno del database delle voci all'inizio della prima +// fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); + g_system->lockMutex(vdb); + _vm->_vdbFP.seek(curVoc->offset); + curOffset = curVoc->offset; + g_system->unlockMutex(vdb); + } + + for (i = 0; iHide(); + } else + text = new RMTextDialog; + + text->SetInput(Input); + + // Skipping + text->SetSkipStatus(!bIsBack); + + // Allineamento + text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); + + // Colore + text->SetColor(Character[nChar].r,Character[nChar].g,Character[nChar].b); + + // Scrive il testo + text->WriteText(msg[i],0); + + // Setta la posizione + text->SetPosition(pt); + + // Setta l'always display + if (bAlwaysDisplay) { text->SetAlwaysDisplay(); text->ForceTime(); } + + // Registra il testo + LinkGraphicTask(text); + + if (curVoc) { + g_system->lockMutex(vdb); + _vm->_theSound.CreateSfx(&voice); + _vm->_vdbFP.seek(curOffset); + voice->LoadVoiceFromVDB(_vm->_vdbFP); + voice->SetLoop(false); + if (bIsBack) voice->SetVolume(55); + voice->Play(); + text->SetCustomSkipHandle2(voice->hEndOfBuffer); + curOffset = _vm->_vdbFP.pos(); + g_system->unlockMutex(vdb); + } + + // Aspetta la fine della visualizzazione + text->SetCustomSkipHandle(hSkipIdle); + text->WaitForEndDisplay(); + + if (curVoc) { + voice->Stop(); + voice->Release(); + voice=NULL; + } + + + curBackText=NULL; + delete text; + } + + if (Character[nChar].endtalkpattern != 0) { + Freeze(); + Character[nChar].item->SetPattern(Character[nChar].endtalkpattern); + Unfreeze(); + Character[nChar].item->WaitForEndPattern(); + } + + Freeze(); + Character[nChar].item->SetPattern(Character[nChar].standpattern); + Unfreeze(); +} + +DECLARE_CUSTOM_FUNCTION(AddInventory)(uint32 dwCode, uint32, uint32, uint32) { + Inventory->AddItem(dwCode); +} + +DECLARE_CUSTOM_FUNCTION(RemoveInventory)(uint32 dwCode, uint32, uint32, uint32) { + Inventory->RemoveItem(dwCode); +} + +DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(uint32 dwCode, uint32 dwStatus, uint32, uint32) { + Inventory->ChangeItemStatus(dwCode,dwStatus); +} + + + + +/* + * Mastri Personaggi + */ + +DECLARE_CUSTOM_FUNCTION(MCharSetCode)(uint32 nChar, uint32 nCode, uint32, uint32) { + assert(nChar < 10); + MCharacter[nChar].code=nCode; + if (nCode== 0) + MCharacter[nChar].item=NULL; + else + MCharacter[nChar].item=Loc->GetItemFromCode(nCode); + MCharacter[nChar].r=255; + MCharacter[nChar].g=255; + MCharacter[nChar].b=255; + MCharacter[nChar].x=-1; + MCharacter[nChar].y=-1; + MCharacter[nChar].bAlwaysBack = 0; + + for (int i = 0; i < 10; i++) + MCharacter[nChar].numtalks[i] = 1; + + MCharacter[nChar].curgroup = 0; + + IsMChar[nChar] = true; +} + +DECLARE_CUSTOM_FUNCTION(MCharResetCode)(uint32 nChar, uint32, uint32, uint32) { + MCharacter[nChar].item=Loc->GetItemFromCode(MCharacter[nChar].code); +} + + +DECLARE_CUSTOM_FUNCTION(MCharSetPosition)(uint32 nChar, uint32 nX, uint32 nY, uint32) { + assert(nChar < 10); + MCharacter[nChar].x=nX; + MCharacter[nChar].y=nY; +} + + +DECLARE_CUSTOM_FUNCTION(MCharSetColor)(uint32 nChar, uint32 r, uint32 g, uint32 b) { + assert(nChar < 10); + MCharacter[nChar].r=r; + MCharacter[nChar].g=g; + MCharacter[nChar].b=b; +} + + +DECLARE_CUSTOM_FUNCTION(MCharSetNumTalksInGroup)(uint32 nChar, uint32 nGroup, uint32 nTalks, uint32) { + assert(nChar < 10); + assert(nGroup < 10); + + MCharacter[nChar].numtalks[nGroup]=nTalks; +} + + +DECLARE_CUSTOM_FUNCTION(MCharSetCurrentGroup)(uint32 nChar, uint32 nGroup, uint32, uint32) +{ + assert(nChar < 10); + assert(nGroup < 10); + + MCharacter[nChar].curgroup = nGroup; +} + +DECLARE_CUSTOM_FUNCTION(MCharSetNumTexts)(uint32 nChar, uint32 nTexts, uint32, uint32) { + assert(nChar < 10); + + MCharacter[nChar].numtexts=nTexts-1; + MCharacter[nChar].bInTexts = false; +} + +DECLARE_CUSTOM_FUNCTION(MCharSetAlwaysBack)(uint32 nChar, uint32 bAlwaysBack, uint32, uint32) { + assert(nChar < 10); + + MCharacter[nChar].bAlwaysBack=bAlwaysBack; +} + + +DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32 nFont) { + RMMessage msg(dwMessage); + int i; + int parm; + RMPoint pt; + HANDLE h; + RMTextDialog *text; + int curOffset = 0; + + assert(nChar < 10); + + bIsBack |= MCharacter[nChar].bAlwaysBack ? 1 : 0; + + // Calcola la posizione del testo in base al frame corrente + if (MCharacter[nChar].x==-1) + pt=MCharacter[nChar].item->CalculatePos()-RMPoint(-60,20)-Loc->ScrollPosition(); + else + pt=RMPoint(MCharacter[nChar].x,MCharacter[nChar].y); + + // Parametro per le azioni speciali: random tra le parlate + parm = (MCharacter[nChar].curgroup * 10) + _vm->_randomSource.getRandomNumber( + MCharacter[nChar].numtalks[MCharacter[nChar].curgroup] - 1) + 1; + + // Cerca di eseguire la funzione custom per inizializzare la parlata + if (MCharacter[nChar].item) { + h = mpalQueryDoAction(30,MCharacter[nChar].item->MpalCode(), parm); + if (h != INVALID_HANDLE_VALUE) + WaitForSingleObject(h,INFINITE); + } + + VoiceHeader *curVoc = SearchVoiceHeader(0, dwMessage); + FPSFX *voice = NULL; + if (curVoc) { + // Si posiziona all'interno del database delle voci all'inizio della prima + g_system->lockMutex(vdb); + // fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); + _vm->_vdbFP.seek(curVoc->offset); + curOffset = curVoc->offset; + g_system->unlockMutex(vdb); + } + + for (i = 0; i < msg.NumPeriods() && !bSkipIdle; i++) { + // Crea l'oggetto diverso se è back o no + if (bIsBack) { + curBackText=text = new RMTextDialogScrolling(Loc); + if (bTonyIsSpeaking) + curBackText->Hide(); + } + else + text = new RMTextDialog; + + text->SetInput(Input); + + // Skipping + text->SetSkipStatus(!bIsBack); + + // Allineamento + text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); + + // Colore + text->SetColor(MCharacter[nChar].r,MCharacter[nChar].g,MCharacter[nChar].b); + + // Scrive il testo + text->WriteText(msg[i],nFont); + + // Setta la posizione + text->SetPosition(pt); + + // Setta l'always display + if (bAlwaysDisplay) { text->SetAlwaysDisplay(); text->ForceTime(); } + + // Registra il testo + LinkGraphicTask(text); + + if (curVoc) { + g_system->lockMutex(vdb); + _vm->_theSound.CreateSfx(&voice); + _vm->_vdbFP.seek(curOffset); + voice->LoadVoiceFromVDB(_vm->_vdbFP); + voice->SetLoop(false); + if (bIsBack) voice->SetVolume(55); + voice->Play(); + text->SetCustomSkipHandle2(voice->hEndOfBuffer); + curOffset = _vm->_vdbFP.pos(); + g_system->unlockMutex(vdb); + } + + // Aspetta la fine della visualizzazione + text->SetCustomSkipHandle(hSkipIdle); + text->WaitForEndDisplay(); + + if (curVoc) { + voice->Stop(); + voice->Release(); + voice=NULL; + } + + curBackText=NULL; + delete text; + } + + + // Cerca di eseguire la funzione custom per chiudere la parlata + if (MCharacter[nChar].item) { + h=mpalQueryDoAction(31,MCharacter[nChar].item->MpalCode(),parm); + if (h!=INVALID_HANDLE_VALUE) + WaitForSingleObject(h,INFINITE); + } +} + + + + + + +/* + * Dialoghi + */ + +int curDialog; + +DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(uint32 nPers, uint32 nMsg, uint32, uint32) { + LPSTR string; + RMTextDialog* text; + int parm; + HANDLE h; + bool bIsBack = false; + + // La SendDialogMessage può andare in background se è un personaggio in MCHAR settato + // con la SetAlwaysBack + if (nPers != 0 && IsMChar[nPers] && MCharacter[nPers].bAlwaysBack) + bIsBack = true; + + VoiceHeader *curVoc = SearchVoiceHeader(curDialog, nMsg); + FPSFX *voice = NULL; + + if (curVoc) { + // Si posiziona all'interno del database delle voci all'inizio della prima + g_system->lockMutex(vdb); +// fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); + _vm->_vdbFP.seek(curVoc->offset); + _vm->_theSound.CreateSfx(&voice); + voice->LoadVoiceFromVDB(_vm->_vdbFP); + voice->SetLoop(false); + if (bIsBack) voice->SetVolume(55); + g_system->unlockMutex(vdb); + } + + string=mpalQueryDialogPeriod(nMsg); + + if (nPers == 0) { + text = new RMTextDialog; + text->SetColor(0,255,0); + text->SetPosition(Tony->Position()-RMPoint(0,130)-Loc->ScrollPosition()); + text->WriteText(string,0); + + if (dwTonyNumTexts > 0) { + if (!bTonyInTexts) { + if (nTonyNextTalkType != Tony->TALK_NORMAL) { + Tony->StartTalk(nTonyNextTalkType); + if (!bStaticTalk) + nTonyNextTalkType = Tony->TALK_NORMAL; + } else + Tony->StartTalk(Tony->TALK_NORMAL); + + bTonyInTexts = true; + } + dwTonyNumTexts--; + } else { + Tony->StartTalk(nTonyNextTalkType); + if (!bStaticTalk) + nTonyNextTalkType = Tony->TALK_NORMAL; + } + } else if (!IsMChar[nPers]) { + RMPoint pt; + + text = new RMTextDialog; + + pt=Character[nPers].item->CalculatePos()-RMPoint(-60,20)-Loc->ScrollPosition(); + + if (Character[nPers].starttalkpattern != 0) { + Freeze(); + Character[nPers].item->SetPattern(Character[nPers].starttalkpattern); + Unfreeze(); + Character[nPers].item->WaitForEndPattern(); + } + + Character[nPers].item->SetPattern(Character[nPers].talkpattern); + + text->SetColor(Character[nPers].r,Character[nPers].g,Character[nPers].b); + text->WriteText(string,0); + text->SetPosition(pt); + } else { + RMPoint pt; + + if (MCharacter[nPers].x==-1) + pt=MCharacter[nPers].item->CalculatePos()-RMPoint(-60,20)-Loc->ScrollPosition(); + else + pt=RMPoint(MCharacter[nPers].x,MCharacter[nPers].y); + + // Parametro per le azioni speciali: random tra le parlate + parm = (MCharacter[nPers].curgroup * 10) + _vm->_randomSource.getRandomNumber( + MCharacter[nPers].numtalks[MCharacter[nPers].curgroup] - 1) + 1; + + if (MCharacter[nPers].numtexts != 0 && MCharacter[nPers].bInTexts) { + MCharacter[nPers].numtexts--; + } else { + // Cerca di eseguire la funzione custom per inizializzare la parlata + h = mpalQueryDoAction(30, MCharacter[nPers].item->MpalCode(), parm); + if (h != INVALID_HANDLE_VALUE) + WaitForSingleObject(h,INFINITE); + + MCharacter[nPers].curTalk = parm; + + if (MCharacter[nPers].numtexts != 0) { + MCharacter[nPers].bInTexts = true; + MCharacter[nPers].numtexts--; + } + } + + if (MCharacter[nPers].bAlwaysBack) { + text = curBackText = new RMTextDialogScrolling(Loc); + if (bTonyIsSpeaking) + curBackText->Hide(); + bIsBack = true; + } else + text = new RMTextDialog; + + text->SetSkipStatus(!MCharacter[nPers].bAlwaysBack); + text->SetColor(MCharacter[nPers].r,MCharacter[nPers].g,MCharacter[nPers].b); + text->WriteText(string,0); + text->SetPosition(pt); + } + + if (!bSkipIdle) { + text->SetInput(Input); + if (bAlwaysDisplay) { text->SetAlwaysDisplay(); text->ForceTime(); } + text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); + LinkGraphicTask(text); + + if (curVoc) { + voice->Play(); + text->SetCustomSkipHandle2(voice->hEndOfBuffer); + } + + // Aspetta la fine della visualizzazione + text->SetCustomSkipHandle(hSkipIdle); + text->WaitForEndDisplay(); + } + + if (curVoc) { + voice->Stop(); + voice->Release(); + voice=NULL; + } + + if (nPers != 0) { + if (!IsMChar[nPers]) { + if (Character[nPers].endtalkpattern != 0) { + Freeze(); + Character[nPers].item->SetPattern(Character[nPers].endtalkpattern); + Unfreeze(); + Character[nPers].item->WaitForEndPattern(); + } + + Character[nPers].item->SetPattern(Character[nPers].standpattern); + delete text; + } else { + if ((MCharacter[nPers].bInTexts && MCharacter[nPers].numtexts== 0) || !MCharacter[nPers].bInTexts) { + // Cerca di eseguire la funzione custom per chiudere la parlata + MCharacter[nPers].curTalk = (MCharacter[nPers].curTalk%10) + MCharacter[nPers].curgroup*10; + h=mpalQueryDoAction(31,MCharacter[nPers].item->MpalCode(),MCharacter[nPers].curTalk); + if (h!=INVALID_HANDLE_VALUE) + WaitForSingleObject(h,INFINITE); + + MCharacter[nPers].bInTexts = false; + MCharacter[nPers].numtexts = 0; + } + + curBackText = NULL; + delete text; + } + } else { + if ((dwTonyNumTexts== 0 && bTonyInTexts) || !bTonyInTexts) { + Tony->EndTalk(); + dwTonyNumTexts = 0; + bTonyInTexts = false; + } + + delete text; + } + + GlobalFree(string); +} + + +// @@@@ QUESTA NON SI PUO' SKIPPARE!!!!!!!!!!!!!!!!!!! + +DECLARE_CUSTOM_FUNCTION(StartDialog)(uint32 nDialog, uint32 nStartGroup, uint32, uint32) { + int nChoice; + uint32 *sl; + int i,num; + char* string; + RMDialogChoice dc; + int sel; + + curDialog = nDialog; + + // Chiama l'MPAL per iniziare il dialogo + mpalQueryDoDialog(nDialog,nStartGroup); + + // Aspetta che una scelta si presenti + while ((nChoice=mpalQueryDialogWaitForChoice()) != -1) { + // Si fa dare la lista di opzioni e le conta + sl=mpalQueryDialogSelectList(nChoice); + for (num = 0; sl[num] != 0; num++) + ; + + // Se c'e' una sola opzione, la fa automaticamente, e aspetta la prossima scelta + if (num==1) + { + mpalQueryDialogSelection(nChoice,sl[0]); + GlobalFree(sl); + continue; + } + + // Crea una scelta per il dialogo + dc.Init(); + dc.SetNumChoices(num); + + // Scrive tutte le possibili opzioni + for (i = 0;i < num; i++) { + string = mpalQueryDialogPeriod(sl[i]); + assert(string != NULL); + dc.AddChoice(string); + GlobalFree(string); + } + + // Attiva l'oggetto + LinkGraphicTask(&dc); + dc.Show(); + + // Disegna il puntatore + Pointer->SetSpecialPointer(Pointer->PTR_NONE); + MainShowMouse(); + + while (!(Input->MouseLeftClicked() && ((sel = dc.GetSelection()) != -1))) { + WaitFrame(); + Freeze(); + dc.DoFrame(Input->MousePos()); + Unfreeze(); + } + + // Nascondi il puntatore + MainHideMouse(); + + dc.Hide(); + mpalQueryDialogSelection(nChoice, sl[sel]); + + // Chiude la scelta + dc.Close(); + + GlobalFree(sl); + } +} + + + + + +/* + * Sync tra idle e mpal + */ + +DECLARE_CUSTOM_FUNCTION(TakeOwnership)(uint32 num, uint32, uint32, uint32) { +// EnterCriticalSection(&cs[num]); + WaitForSingleObject(mut[num],INFINITE); +} + +DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(uint32 num, uint32, uint32, uint32) { +// LeaveCriticalSection(&cs[num]); +// g_system->unlockMutex(mut[num]); + warning("TODO: ReleaseOwnership"); +} + + + + + + + + + + + +/* + * Musica + * ------ + * + * Effetti di fade supportati: + * + * nFX = 0 - La nuova musica si sostituisce a quella vecchia + * nFX=1 - La nuova musica si interfade con quella vecchia + * nFX=2 - La nuova musica subentra a tempo con quella vecchia + * + */ + +int curSonoriz = 0; + +bool bFadeOutStop; + +void ThreadFadeInMusic(void *nMusic) { + int i; + int nChannel = (int)nMusic; + + debug("Start FadeIn Music\n"); + + for (i = 0; i < 16; i++) { + _vm->SetMusicVolume(nChannel, i * 4); + Sleep(100); + } + _vm->SetMusicVolume(nChannel, 64); + + debug("End FadeIn Music\n"); + _endthread(); +} + +void ThreadFadeOutMusic(void *nMusic) { + int i; + int nChannel = (int)nMusic; + int startVolume = _vm->GetMusicVolume(nChannel); + + debug("Start FadeOut Music\n"); + + for (i = 16; i > 0 && !bFadeOutStop; i--) { + if (i * 4 < startVolume) + _vm->SetMusicVolume(nChannel, i * 4); + Sleep(100); + } + + if (!bFadeOutStop) + _vm->SetMusicVolume(nChannel, 0); + + // Se è uno stacchetto ferma tutto + if (nChannel == 2) + _vm->StopMusic(2); + + debug("End FadeOut Music\n"); + + _endthread(); +} + +DECLARE_CUSTOM_FUNCTION(FadeInSonoriz)(uint32, uint32, uint32, uint32) { + _beginthread(ThreadFadeInMusic, 10240, (void*)curSonoriz); +} + +DECLARE_CUSTOM_FUNCTION(FadeOutSonoriz)(uint32, uint32, uint32, uint32) { + bFadeOutStop = false; + _beginthread(ThreadFadeOutMusic, 10240, (void *)curSonoriz); +} + +DECLARE_CUSTOM_FUNCTION(FadeOutStacchetto)(uint32, uint32, uint32, uint32) { + bFadeOutStop = false; + _beginthread(ThreadFadeOutMusic, 10240, (void*)2); +} + +DECLARE_CUSTOM_FUNCTION(FadeInStacchetto)(uint32, uint32, uint32, uint32) { + _beginthread(ThreadFadeInMusic, 10240, (void*)2); +} + +DECLARE_CUSTOM_FUNCTION(StopSonoriz)(uint32, uint32, uint32, uint32) { + _vm->StopMusic(curSonoriz); +} + +DECLARE_CUSTOM_FUNCTION(StopStacchetto)(uint32, uint32, uint32, uint32) { + _vm->StopMusic(2); +} + +DECLARE_CUSTOM_FUNCTION(MuteSonoriz)(uint32, uint32, uint32, uint32) { + _vm->SetMusicVolume(curSonoriz, 0); +} + +DECLARE_CUSTOM_FUNCTION(DemuteSonoriz)(uint32, uint32, uint32, uint32) { + bFadeOutStop = true; + _vm->SetMusicVolume(curSonoriz, 64); +} + +DECLARE_CUSTOM_FUNCTION(MuteStacchetto)(uint32, uint32, uint32, uint32) { + _vm->SetMusicVolume(2, 0); +} + +DECLARE_CUSTOM_FUNCTION(DemuteStacchetto)(uint32, uint32, uint32, uint32) { + _vm->SetMusicVolume(2, 64); +} + +struct { + const char *name; + int sync; +} musicFiles[] = +{ +/* + { "PREGAME1.ADP", 0 }, { "SONO1.ADP", 0 }, + { "SONO2.ADP", 0 }, { "SONO3.ADP", 0 }, + { "CADUTA.ADP",0 }, { "RISVEGLIO.ADP", 0 }, + { "BACKGROUND.ADP", 0 }, { "PREGAME3.ADP", 0 }, + { "BARBUTA1.ADP", 2450 }, { "BARBUTA2.ADP", 0 }, +*/ + { "00.ADP", 0 }, { "01.ADP", 0 }, + { "02.ADP", 0 }, { "03.ADP", 0 }, + { "04.ADP",0 }, { "05.ADP", 0 }, + { "06.ADP", 0 }, { "07.ADP", 0 }, + { "08.ADP", 2450 }, { "09.ADP", 0 }, + +/* + { "BARBUTA3.ADP", 0 }, { "15-RUFUS.ADP", 0 }, + { "20-MAMMA.ADP", 0 }, { "32-MAMMARADIO.ADP", 0 }, + { "24-TUNNELOV-MIDI.ADP", 0 }, { "34-RAZZO.ADP", 0 }, + { "27-ZUCC1.ADP", 0 }, { "BEAST.ADP", 0 }, + { "22-MORTIMER.ADP", 0 }, { "25-PUB-OVATTATO.ADP", 0 }, +*/ + { "10.ADP", 0 }, { "11.ADP", 0 }, + { "12.ADP", 0 }, { "13.ADP", 0 }, + { "14.ADP", 0 }, { "15.ADP", 0 }, + { "16.ADP", 0 }, { "17.ADP", 0 }, + { "18.ADP", 0 }, { "19.ADP", 0 }, +/* + { "25-PUB.ADP", 0 }, { "ALBERGO.ADP", 0 }, + { "37.ADP", 0 }, { "26-PIRAT.ADP", 0 }, + { "LORENZBACK.ADP", 0 }, { "LORENZ3.ADP", 0 }, + { "CASTLE.ADP", 0 }, { "53-BACKR.ADP", 0 }, + { "16-SMIL1.ADP", 1670 }, { "16-SMIL2.ADP", 0 }, +*/ + { "20.ADP", 0 }, { "21.ADP", 0 }, + { "22.ADP", 0 }, { "23.ADP", 0 }, + { "24.ADP", 0 }, { "25.ADP", 0 }, + { "26.ADP", 0 }, { "27.ADP", 0 }, + { "28.ADP", 1670 }, { "29.ADP", 0 }, +/* + { "16-SMILE.ADP", 0 }, { "16-DIALOG2.ADP", 0 }, + { "07-SHAKE1.ADP", 2900 }, { "07-SHAKE2.ADP", 0 }, + { "07-SHAKE3.ADP", 0 }, { "46-BEEE.ADP", 0 }, + { "434748.ADP", 0 }, { "TORRE.ADP", 0 }, + { "50-DRAGO.ADP", 0 }, { "56-OPERA.ADP", 0 }, +*/ + { "30.ADP", 0 }, { "31.ADP", 0 }, + { "32.ADP", 2900 }, { "33.ADP", 0 }, + { "34.ADP", 0 }, { "35.ADP", 0 }, + { "36.ADP", 0 }, { "37.ADP", 0 }, + { "38.ADP", 0 }, { "39.ADP", 0 }, +/* + { "FLAUTARP.ADP", 0 }, { "01-2001.ADP", 1920 }, + { "02-INTROPANORAMICA.ADP", 1560 }, { "03-PANORAMICA.ADP", 1920 }, + { "04-INTERNI.ADP", 1920 }, { "05-CADEPIUMA.ADP", 1920 }, + { "06-SCENDESCALE.ADP", 1920 }, { "07-THRILL.ADP", 1920 }, + { "08-CADUTAZUCCA.ADP", 1920 }, { "09-PIUMAALEGGIA.ADP", 1920 }, +*/ + { "40.ADP", 0 }, { "41.ADP", 1920 }, + { "42.ADP", 1560 }, { "43.ADP", 1920 }, + { "44.ADP", 1920 }, { "45.ADP", 1920 }, + { "46.ADP", 1920 }, { "47.ADP", 1920 }, + { "48.ADP", 1920 }, { "49.ADP", 1920 }, + +/* + { "10-JACKZUCCONA.ADP", 1920 }, { "11-JACKIMPRECAALLAGRANDELUNA.ADP", 1920 }, + { "12-GRANDELUNALOGO.ADP", 1920 }, { "60-BACKGROUND.ADP", 0 }, + { "TONYSTAR.ADP", 0 }, { "FUNNY.ADP", 0 }, + { "60-INIZIODIALOGO.ADP", 0 }, { "60-DIALOGO.ADP", 0 }, + { "60-JACKFELICE.ADP", 0 }, { "24-TONYVIOLENTATO.ADP", 0 } +*/ + + { "50.ADP", 1920 }, { "51.ADP", 1920 }, + { "52.ADP", 1920 }, { "53.ADP", 0 }, + { "54.ADP", 0 }, { "55.ADP", 0 }, + { "56.ADP", 0 }, { "57.ADP", 0 }, + { "58.ADP", 0 }, { "59.ADP", 0 } + +}; + + +const char *staccFileNames[] = { +/* + "05-MUCCA.ADP", "06-HALOW.ADP", + "LETTERAINIZIO.ADP", "LETTERAPAURA.ADP", + "LETTERAFINE.ADP", "PREGAME2.ADP", + "07-TIMOT.ADP", "15-SHOTRUFUS.ADP", + "15-SHOTTONY.ADP", "27-ZUCC2.ADP", +*/ + "S00.ADP", "S01.ADP", + "S02.ADP", "S03.ADP", + "S04.ADP", "S05.ADP", + "S06.ADP", "S07.ADP", + "S08.ADP", "S09.ADP", + +/* + "53-DLOGO.ADP", "16-DIALOG1.ADP", + "TORRE1.ADP", "GARG1.ADP", + "LORENZ1.ADP", "24-FIGHT.ADP", + "08-MACBETH-PREPARA.ADP", "08-MACBETH-RECITA.ADP", + "GATTO1.ADP" +*/ + "S10.ADP", "S11.ADP", + "S12.ADP", "S13.ADP", + "S14.ADP", "S15.ADP", + "S16.ADP", "S17.ADP", + "S18.ADP" +}; + + +void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int nSync = 0) { + if (nSync == 0) + nSync = 2000; + debug("Start CustPlayMusic\n"); + PlayMusic(nChannel, mFN, nFX, bLoop, nSync); + debug("End CustPlayMusic\n"); +} + +DECLARE_CUSTOM_FUNCTION(PlaySonoriz)(uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) { + if (nFX == 0 || nFX == 1 || nFX==2) { + debug("PlaySonoriz stop fadeout\n"); + bFadeOutStop = true; + } + + lastMusic = nMusic; + CustPlayMusic(curSonoriz, musicFiles[nMusic].name, nFX, bNoLoop ? false : true, musicFiles[nMusic].sync); +} + +DECLARE_CUSTOM_FUNCTION(PlayStacchetto)(uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) { + CustPlayMusic(2,staccFileNames[nMusic],nFX,bLoop); +} + +DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(uint32 nItem, uint32 nSFX, uint32, uint32) { + if (nItem== 0) { + Tony->PlaySfx(nSFX); + } else { + RMItem *item = Loc->GetItemFromCode(nItem); + if (item) + item->PlaySfx(nSFX); + } +} + + +void RestoreMusic(void) { + PlaySonoriz(lastMusic, 0, 0, 0); + if (lastTappeto != 0) + CustPlayMusic(4, tappetiFile[lastTappeto], 0, true); +} + +void SaveMusic(Common::OutSaveFile *f) { + f->writeByte(lastMusic); + f->writeByte(lastTappeto); +} + +void LoadMusic(Common::InSaveFile *f) { + lastMusic = f->readByte(); + lastTappeto = f->readByte(); +} + + +DECLARE_CUSTOM_FUNCTION(StacchettoFadeStart)(uint32 nStacc, uint32 bLoop, uint32, uint32) { + FadeOutSonoriz(0, 0, 0, 0); + MuteStacchetto(0, 0, 0, 0); + PlayStacchetto(nStacc, 0, bLoop, 0); + FadeInStacchetto(0, 0, 0, 0); +} + +DECLARE_CUSTOM_FUNCTION(StacchettoFadeEnd)(uint32 nStacc, uint32 bLoop, uint32, uint32) { + FadeOutStacchetto(0, 0, 0, 0); + FadeInSonoriz(0, 0, 0, 0); +} + + + + +DECLARE_CUSTOM_FUNCTION(MustSkipIdleStart)(uint32, uint32, uint32, uint32) { + bSkipIdle = true; + SetEvent(hSkipIdle); +} + +DECLARE_CUSTOM_FUNCTION(MustSkipIdleEnd)(uint32, uint32, uint32, uint32) { + bSkipIdle = false; + ResetEvent(hSkipIdle); +} + +DECLARE_CUSTOM_FUNCTION(PatIrqFreeze)(uint32 bStatus, uint32, uint32, uint32) { + bPatIrqFreeze = bStatus; +} + +DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(uint32 , uint32, uint32, uint32) { + Freeze(); + _vm->OpenInitLoadMenu(); + Unfreeze(); +} + +DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(uint32 , uint32, uint32, uint32) { + Freeze(); + _vm->OpenInitOptions(); + Unfreeze(); +} + + +DECLARE_CUSTOM_FUNCTION(DoCredits)(uint32 nMsg, uint32 dwTime, uint32, uint32) { + RMMessage msg(nMsg); + RMTextDialog *text; + HANDLE hDisable = CreateEvent(NULL, true, false, NULL); + int i; + uint32 startTime; + + text = new RMTextDialog[msg.NumPeriods()]; + + for (i = 0; i < msg.NumPeriods(); i++) { + text[i].SetInput(Input); + + // Allineamento + if (msg[i][0] == '@') { + text[i].SetAlignType(RMText::HCENTER, RMText::VTOP); + text[i].WriteText(&msg[i][1], 3); + text[i].SetPosition(RMPoint(414, 70 + i * 26)); // 70 + } else { + text[i].SetAlignType(RMText::HLEFT,RMText::VTOP); + text[i].WriteText(msg[i], 3); + text[i].SetPosition(RMPoint(260, 70 + i * 26)); + } + + + // Setta la posizione + text[i].SetAlwaysDisplay(); + text[i].SetForcedTime(dwTime * 1000); + text[i].SetNoTab(); + + // Aspetta la fine della visualizzazione + text[i].SetCustomSkipHandle(hDisable); + + // Registra il testo + LinkGraphicTask(&text[i]); + } + + startTime = _vm->GetTime(); + + while (startTime + dwTime * 1000 > _vm->GetTime()) { + WaitFrame(); + if (Input->MouseLeftClicked() || Input->MouseRightClicked()) + break; + if ((GetAsyncKeyState(Common::KEYCODE_TAB) & 0x8001) == 0x8001) + break; + } + + SetEvent(hDisable); + + WaitFrame(); + WaitFrame(); + + delete[] text; +} + + + +BEGIN_CUSTOM_FUNCTION_MAP() + + ASSIGN( 1, CustLoadLocation) + ASSIGN( 2, MySleep) + ASSIGN( 3, SetPointer) + ASSIGN( 5, MoveTony) + ASSIGN( 6, FaceToMe) + ASSIGN( 7, BackToMe) + ASSIGN( 8, LeftToMe) + ASSIGN( 9, RightToMe) + ASSIGN( 10, SendTonyMessage) + ASSIGN( 11, ChangeBoxStatus) + ASSIGN( 12, ChangeLocation) + ASSIGN( 13, DisableTony) + ASSIGN( 14, EnableTony) + ASSIGN( 15, WaitForPatternEnd) + ASSIGN( 16, SetLocStartPosition) + ASSIGN( 17, ScrollLocation) + ASSIGN( 18, MoveTonyAndWait) + ASSIGN( 19, ChangeHotspot) + ASSIGN( 20, AddInventory) + ASSIGN( 21, RemoveInventory) + ASSIGN( 22, ChangeInventoryStatus) + ASSIGN( 23, SetTonyPosition) + ASSIGN( 24, SendFullscreenMessage) + ASSIGN( 25, SaveTonyPosition) + ASSIGN( 26, RestoreTonyPosition) + ASSIGN( 27, DisableInput) + ASSIGN( 28, EnableInput) + ASSIGN( 29, StopTony) + + ASSIGN( 30, TonyTakeUp1) + ASSIGN( 31, TonyTakeMid1) + ASSIGN( 32, TonyTakeDown1) + ASSIGN( 33, TonyTakeUp2) + ASSIGN( 34, TonyTakeMid2) + ASSIGN( 35, TonyTakeDown2) + + ASSIGN( 72, TonyPutUp1) + ASSIGN( 73, TonyPutMid1) + ASSIGN( 74, TonyPutDown1) + ASSIGN( 75, TonyPutUp2) + ASSIGN( 76, TonyPutMid2) + ASSIGN( 77, TonyPutDown2) + + ASSIGN( 36, TonyPerTerra) + ASSIGN( 37, TonySiRialza) + ASSIGN( 38, TonyPastorella) + ASSIGN( 39, TonyFischietto) + + ASSIGN( 40, TonyRide) + ASSIGN( 41, TonyFianchi) + ASSIGN( 42, TonyCanta) + ASSIGN( 43, TonySiIndica) + ASSIGN( 44, TonySpaventatoConMani) + ASSIGN( 49, TonySpaventatoSenzaMani) + ASSIGN( 45, TonyConBicchiere) + ASSIGN( 46, TonyConVerme) + ASSIGN( 47, TonyConMartello) + ASSIGN( 48, TonyConCorda) + ASSIGN( 90, TonyConConiglioANIM) + ASSIGN( 91, TonyConRicettaANIM) + ASSIGN( 92, TonyConCarteANIM) + ASSIGN( 93, TonyConPupazzoANIM) + ASSIGN( 94, TonyConPupazzoStart) + ASSIGN( 95, TonyConPupazzoEnd) + ASSIGN( 96, TonyConConiglioStart) + ASSIGN( 97, TonyConConiglioEnd) + ASSIGN( 98, TonyConRicettaStart) + ASSIGN( 99, TonyConRicettaEnd) + ASSIGN(100, TonyConCarteStart) + ASSIGN(101, TonyConCarteEnd) + ASSIGN(102, TonyConTaccuinoStart) + ASSIGN(103, TonyConTaccuinoEnd) + ASSIGN(104, TonyConMegafonoStart) + ASSIGN(105, TonyConMegafonoEnd) + ASSIGN(106, TonyConBarbaStart) + ASSIGN(107, TonyConBarbaEnd) + ASSIGN(108, TonyRidacchia) + ASSIGN(109, TonySchifato) + ASSIGN(110, TonyNaah) + ASSIGN(111, TonyMacbeth) + ASSIGN(112, TonySniffaLeft) + ASSIGN(113, TonySniffaRight) + ASSIGN(114, TonySpaventatoStart) + ASSIGN(115, TonySpaventatoEnd) + ASSIGN(116, TonyConSegretaria) + + ASSIGN( 50, CharSetCode) + ASSIGN( 51, CharSetColor) + ASSIGN( 52, CharSetTalkPattern) + ASSIGN( 53, CharSendMessage) + ASSIGN( 54, CharSetStartEndTalkPattern) + + ASSIGN( 60, MCharSetCode) + ASSIGN( 61, MCharSetColor) + ASSIGN( 62, MCharSetCurrentGroup) + ASSIGN( 63, MCharSetNumTalksInGroup) + ASSIGN( 64, MCharSetNumTexts) + ASSIGN( 65, MCharSendMessage) + ASSIGN( 66, MCharSetPosition) + ASSIGN( 67, MCharSetAlwaysBack) + ASSIGN( 68, MCharResetCode) + + ASSIGN( 70, StartDialog) + ASSIGN( 71, SendDialogMessage) + + ASSIGN( 80, TakeOwnership) + ASSIGN( 81, ReleaseOwnership) + + ASSIGN( 86, PlaySonoriz) + ASSIGN( 87, PlayStacchetto) + ASSIGN( 88, FadeInSonoriz) + ASSIGN( 89, FadeOutSonoriz) + ASSIGN(123, FadeInStacchetto) + ASSIGN(124, FadeOutStacchetto) + ASSIGN(125, MuteSonoriz) + ASSIGN(126, DemuteSonoriz) + ASSIGN(127, MuteStacchetto) + ASSIGN(128, DemuteStacchetto) + ASSIGN( 84, StopSonoriz) + ASSIGN( 85, StopStacchetto) + ASSIGN( 83, PlayItemSfx) + ASSIGN(129, StacchettoFadeStart) + ASSIGN(130, StacchettoFadeEnd) + + ASSIGN(120, TremaSchermo) + ASSIGN(121, AutoSave) + ASSIGN(122, Abort) + ASSIGN(131, NoOcchioDiBue) + ASSIGN(132, SendFullscreenMsgStart) + ASSIGN(133, SendFullscreenMsgEnd) + ASSIGN(134, CustEnableGUI) + ASSIGN(135, CustDisableGUI) + ASSIGN(136, ClearScreen) + ASSIGN(137, PatIrqFreeze) + ASSIGN(138, TonySetPalesati) + ASSIGN(139, OpenInitLoadMenu) + ASSIGN(140, OpenInitOptions) + ASSIGN(141, SyncScrollLocation) + ASSIGN(142, CloseLocation) + ASSIGN(143, SetAlwaysDisplay) + ASSIGN(144, DoCredits) + + ASSIGN( 200, MustSkipIdleStart); + ASSIGN( 201, MustSkipIdleEnd); + +END_CUSTOM_FUNCTION_MAP() + +void SetupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation *loc, RMInventory *inv, RMInput *input) { + Tony = tony; + Pointer = ptr; + Boxes = box; + Loc = loc; + Inventory = inv; + Input = input; + + LoadLocation = MainLoadLocation; + UnloadLocation = MainUnloadLocation; + LinkGraphicTask = MainLinkGraphicTask; + Freeze = MainFreeze; + Unfreeze = MainUnfreeze; + WaitFrame = MainWaitFrame; + PlayMusic = MainPlayMusic; + InitWipe = MainInitWipe; + CloseWipe = MainCloseWipe; + WaitWipeEnd = MainWaitWipeEnd; + DisableGUI = MainDisableGUI; + EnableGUI = MainEnableGUI; + SetPalesati = MainSetPalesati; + + g_system->lockMutex(vdb); + + bAlwaysDisplay = false; + int i; +/* + for (i = 0;i < 10; i++) + InitializeCriticalSection(&cs[i]); + for (i = 0;i < 10; i++) + mut[i] = CreateMutex(NULL, false, NULL); +*/ + for (i = 0; i < 200; i++) + tappeti[i] = 0; + + tappeti[6] = T_GRILLI; + tappeti[7] = T_GRILLI; + tappeti[8] = T_GRILLIOV; + tappeti[10] = T_GRILLI; + tappeti[12] = T_GRILLI; + tappeti[13] = T_GRILLIOV; + tappeti[15] = T_GRILLI; + tappeti[16] = T_GRILLIVENTO; + tappeti[18] = T_GRILLI; + tappeti[19] = T_GRILLIVENTO; + tappeti[20] = T_GRILLI; + tappeti[23] = T_GRILLI; + tappeti[26] = T_MAREMETA; + tappeti[27] = T_GRILLI; + tappeti[28] = T_GRILLIVENTO; + tappeti[31] = T_GRILLI; + tappeti[33] = T_MARE; + tappeti[35] = T_MARE; + tappeti[36] = T_GRILLI; + tappeti[37] = T_GRILLI; + tappeti[40] = T_GRILLI; + tappeti[41] = T_GRILLI; + tappeti[42] = T_GRILLI; + tappeti[45] = T_GRILLI; + tappeti[51] = T_GRILLI; + tappeti[52] = T_GRILLIVENTO1; + tappeti[53] = T_GRILLI; + tappeti[54] = T_GRILLI; + tappeti[57] = T_VENTO; + tappeti[58] = T_VENTO; + tappeti[60] = T_VENTO; + + + + // Crea l'evento per skippare le idle + hSkipIdle = CreateEvent(NULL, true, false, NULL); +} + +} // end of namespace Tony -- cgit v1.2.3 From 6d0f1fca46c8bd9b5b4e7ccaf6631850c29d1447 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 3 May 2012 23:08:19 +1000 Subject: TONY: Formatting fixes --- engines/tony/custom.cpp | 94 ++++++++++++++++++++++--------------------------- 1 file changed, 42 insertions(+), 52 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 55f6cbe77d..209fc11212 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -218,7 +218,7 @@ int curChangedHotspot = 0; struct { uint32 dwCode; - uint32 nX,nY; + uint32 nX, nY; void Save(Common::OutSaveFile *f) { f->writeUint32LE(dwCode); @@ -629,7 +629,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(uint32 nLoc, uint32 tX, uint32 tY, uint3 Unfreeze(); - h = mpalQueryDoAction(0,nLoc,0); + h = mpalQueryDoAction(0, nLoc,0); if (!bNoOcchioDiBue) { WaitWipeEnd(); @@ -1079,18 +1079,18 @@ DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(uint32 nItem, uint32, uint32, uint32) DECLARE_CUSTOM_FUNCTION(SetTonyPosition)(uint32 nX, uint32 nY, uint32 nLoc, uint32) { - Tony->SetPosition(RMPoint(nX,nY),nLoc); + Tony->SetPosition(RMPoint(nX, nY), nLoc); } DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(uint32 nX, uint32 nY, uint32, uint32) { - Tony->Move(RMPoint(nX,nY)); + Tony->Move(RMPoint(nX, nY)); if (!bSkipIdle) Tony->WaitForEndMovement(); } DECLARE_CUSTOM_FUNCTION(MoveTony)(uint32 nX, uint32 nY, uint32, uint32) { - Tony->Move(RMPoint(nX,nY)); + Tony->Move(RMPoint(nX, nY)); } DECLARE_CUSTOM_FUNCTION(ScrollLocation)(uint32 nX, uint32 nY, uint32 sX, uint32 sY) { @@ -1103,22 +1103,20 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(uint32 nX, uint32 nY, uint32 sX, uint32 pt=Loc->ScrollPosition(); - while ((lx != 0 || ly != 0) && !bSkipIdle) { - if (lx>0) { - lx -= (int32)sX; if (lx<0) lx = 0; + while ((lx != 0 || ly != 0) && !bSkipIdle) { + if (lx > 0) { + lx -= (int32)sX; if (lx < 0) lx = 0; pt.Offset((int32)sX, 0); - } else if (lx<0) { - lx += (int32)sX; if (lx>0) lx = 0; + } else if (lx < 0) { + lx += (int32)sX; if (lx > 0) lx = 0; pt.Offset(-(int32)sX, 0); } if (ly > 0) { - ly-=sY; if (ly<0) ly = 0; - pt.Offset(0,sY); - } - else if (ly<0) - { - ly+=sY; if (ly>0) ly = 0; + ly -= sY; if (ly < 0) ly = 0; + pt.Offset(0, sY); + } else if (ly < 0) { + ly += sY; if (ly > 0) ly = 0; pt.Offset(0, -(int32)sY); } @@ -1134,18 +1132,18 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(uint32 nX, uint32 nY, uint32 sX, uint32 DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(uint32 nX, uint32 nY, uint32 sX, uint32 sY) { int lx, ly; - RMPoint pt,startpt; - uint32 dwStartTime,dwCurTime,dwTotalTime; + RMPoint pt, startpt; + uint32 dwStartTime, dwCurTime, dwTotalTime; uint32 stepX, stepY; - int dimx,dimy; + int dimx, dimy; // Prende le coordinate di quanto scrollare lx=*((int*)&nX); ly=*((int*)&nY); - dimx=lx; - dimy=ly; - if (lx<0) dimx = -lx; - if (ly<0) dimy = -ly; + dimx = lx; + dimy = ly; + if (lx < 0) dimx = -lx; + if (ly < 0) dimy = -ly; stepX = sX; stepY = sY; @@ -1155,13 +1153,12 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(uint32 nX, uint32 nY, uint32 sX, uin dwStartTime = timeGetTime(); if (sX) - dwTotalTime = dimx*(1000/35)/sX; + dwTotalTime = dimx * (1000 / 35) / sX; else - dwTotalTime = dimy*(1000/35)/sY; + dwTotalTime = dimy * (1000 / 35) / sY; - while ((lx != 0 || ly != 0) && !bSkipIdle) - { - dwCurTime=timeGetTime()-dwStartTime; + while ((lx != 0 || ly != 0) && !bSkipIdle) { + dwCurTime = _vm->GetTime() - dwStartTime; if (dwCurTime>dwTotalTime) break; @@ -1181,28 +1178,22 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(uint32 nX, uint32 nY, uint32 sX, uin } /* - sX = stepX * (dwCurTime-dwLastTime) / (1000/35); - sY = stepY * (dwCurTime-dwLastTime) / (1000/35); + sX = stepX * (dwCurTime-dwLastTime) / (1000 / 35); + sY = stepY * (dwCurTime-dwLastTime) / (1000 / 35); - if (lx>0) - { - lx-=sX; if (lx<0) lx = 0; + if (lx > 0) { + lx-=sX; if (lx < 0) lx = 0; pt.Offset(sX,0); - } - else if (lx<0) - { - lx+=sX; if (lx>0) lx = 0; + } else if (lx < 0) { + lx+=sX; if (lx > 0) lx = 0; pt.Offset(-sX,0); } - if (ly>0) - { + if (ly > 0) { ly-=sY; if (ly<0) ly = 0; pt.Offset(0,sY); - } - else if (ly<0) - { - ly+=sY; if (ly>0) ly = 0; + } else if (ly<0) { + ly+=sY; if (ly > 0) ly = 0; pt.Offset(0,-sY); } */ @@ -1218,12 +1209,12 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(uint32 nX, uint32 nY, uint32 sX, uin // Setta la posizione finale if (sX) { - if (lx>0) + if (lx > 0) pt.x = startpt.x + dimx; else pt.x = startpt.x - dimx; } else { - if (ly>0) + if (ly > 0) pt.y = startpt.y + dimy; else pt.y = startpt.y - dimy; @@ -1254,7 +1245,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(uint32 dwCode, uint32 nX, uint32 nY, uint curChangedHotspot++; } - Loc->GetItemFromCode(dwCode)->ChangeHotspot(RMPoint(nX,nY)); + Loc->GetItemFromCode(dwCode)->ChangeHotspot(RMPoint(nX, nY)); } @@ -1274,7 +1265,7 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(uint32 nScosse, uint32, uint32, uint32) { dirx = 1; diry = 1; - while (_vm->GetTime() < curTime + nScosse) { + while (_vm->GetTime() < curTime + nScosse) { WaitFrame(); Freeze(); @@ -1359,7 +1350,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(uint32 nChar, uint32 dwMessage, uint32 VoiceHeader *curVoc = SearchVoiceHeader(0, dwMessage); FPSFX *voice = NULL; - if (curVoc) { + if (curVoc) { // Si posiziona all'interno del database delle voci all'inizio della prima // fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); g_system->lockMutex(vdb); @@ -1734,7 +1725,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(uint32 nPers, uint32 nMsg, uint32, ui parm = (MCharacter[nPers].curgroup * 10) + _vm->_randomSource.getRandomNumber( MCharacter[nPers].numtalks[MCharacter[nPers].curgroup] - 1) + 1; - if (MCharacter[nPers].numtexts != 0 && MCharacter[nPers].bInTexts) { + if (MCharacter[nPers].numtexts != 0 && MCharacter[nPers].bInTexts) { MCharacter[nPers].numtexts--; } else { // Cerca di eseguire la funzione custom per inizializzare la parlata @@ -1849,9 +1840,8 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(uint32 nDialog, uint32 nStartGroup, uint32, ; // Se c'e' una sola opzione, la fa automaticamente, e aspetta la prossima scelta - if (num==1) - { - mpalQueryDialogSelection(nChoice,sl[0]); + if (num == 1) { + mpalQueryDialogSelection(nChoice, sl[0]); GlobalFree(sl); continue; } -- cgit v1.2.3 From 5b2c69b1f291b1ee3d7f3be4ffd40e427b437ac6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 4 May 2012 00:11:38 +1000 Subject: TONY: Implemented some missing and incorrect init code --- engines/tony/custom.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 209fc11212..6f6e7a1534 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2447,13 +2447,14 @@ void SetupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation EnableGUI = MainEnableGUI; SetPalesati = MainSetPalesati; - g_system->lockMutex(vdb); + vdb = g_system->createMutex(); bAlwaysDisplay = false; int i; -/* + for (i = 0;i < 10; i++) - InitializeCriticalSection(&cs[i]); + cs[i] = g_system->createMutex(); +/* for (i = 0;i < 10; i++) mut[i] = CreateMutex(NULL, false, NULL); */ -- cgit v1.2.3 From 557c43c2dbd6d830332be8c8b69c7660d53d665f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 4 May 2012 21:40:44 +1000 Subject: TONY: Converted anonymous structs to have explicit names --- engines/tony/custom.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 6f6e7a1534..d710667db6 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -110,7 +110,7 @@ int tappeti[200]; #define T_MARE 6 #define T_MAREMETA 7 -char* tappetiFile[] = { +const char *tappetiFile[] = { "None", "1.ADP", // Grilli.WAV "2.ADP", // Grilli-Ovattati.WAV @@ -121,7 +121,7 @@ char* tappetiFile[] = { "6.ADP" // Mare1.WAV metà volume }; -struct { +struct CharacterStruct { uint32 code; RMItem *item; byte r, g, b; @@ -155,9 +155,10 @@ struct { endtalkpattern = f->readUint32LE(); numtexts = f->readUint32LE(); } -} Character[16]; +}; +CharacterStruct Character[16]; -struct { +struct MCharacterStruct { uint32 code; RMItem *item; byte r, g, b; @@ -202,7 +203,8 @@ struct { curTalk = f->readUint32LE(); bAlwaysBack = f->readByte(); } -} MCharacter[10]; +}; +MCharacterStruct MCharacter[10]; bool IsMChar[16]; @@ -216,7 +218,7 @@ bool bTonyIsSpeaking = false; int curChangedHotspot = 0; -struct { +struct ChangedHotspotStruct { uint32 dwCode; uint32 nX, nY; @@ -230,7 +232,8 @@ struct { nX = f->readUint32LE(); nY = f->readUint32LE(); } -} ChangedHotspot[256]; +}; +ChangedHotspotStruct ChangedHotspot[256]; void ReapplyChangedHotspot(void) { int i; @@ -2015,11 +2018,11 @@ DECLARE_CUSTOM_FUNCTION(DemuteStacchetto)(uint32, uint32, uint32, uint32) { _vm->SetMusicVolume(2, 64); } -struct { +struct MusicFileEntry { const char *name; int sync; -} musicFiles[] = -{ +}; +const MusicFileEntry musicFiles[] = { /* { "PREGAME1.ADP", 0 }, { "SONO1.ADP", 0 }, { "SONO2.ADP", 0 }, { "SONO3.ADP", 0 }, -- cgit v1.2.3 From 3184a5a874f3cfaa75424e7efb21f1cca3702988 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 4 May 2012 22:58:42 +1000 Subject: TONY: Fix warnings about return values not being used --- engines/tony/custom.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index d710667db6..3400235563 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1833,7 +1833,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(uint32 nDialog, uint32 nStartGroup, uint32, curDialog = nDialog; // Chiama l'MPAL per iniziare il dialogo - mpalQueryDoDialog(nDialog,nStartGroup); + mpalQueryDoDialogU32(nDialog, nStartGroup); // Aspetta che una scelta si presenti while ((nChoice=mpalQueryDialogWaitForChoice()) != -1) { @@ -1844,7 +1844,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(uint32 nDialog, uint32 nStartGroup, uint32, // Se c'e' una sola opzione, la fa automaticamente, e aspetta la prossima scelta if (num == 1) { - mpalQueryDialogSelection(nChoice, sl[0]); + mpalQueryDialogSelectionU32(nChoice, sl[0]); GlobalFree(sl); continue; } @@ -1880,7 +1880,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(uint32 nDialog, uint32 nStartGroup, uint32, MainHideMouse(); dc.Hide(); - mpalQueryDialogSelection(nChoice, sl[sel]); + mpalQueryDialogSelectionU32(nChoice, sl[sel]); // Chiude la scelta dc.Close(); -- cgit v1.2.3 From 10deebed553fc5d458a20756d963835aa1a86afe Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 6 May 2012 12:21:29 +1000 Subject: TONY: Beginnings of refactoring Tony engine's threads to use coroutines --- engines/tony/custom.cpp | 335 +++++++++++++++++++++++++++--------------------- 1 file changed, 189 insertions(+), 146 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 3400235563..1d28fa9ece 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -297,38 +297,38 @@ void CharsLoadAll(Common::InSaveFile *f) { } } -DECLARE_CUSTOM_FUNCTION(FaceToMe)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(FaceToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->SetPattern(Tony->PAT_STANDDOWN); } -DECLARE_CUSTOM_FUNCTION(BackToMe)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(BackToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->SetPattern(Tony->PAT_STANDUP); } -DECLARE_CUSTOM_FUNCTION(LeftToMe)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(LeftToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->SetPattern(Tony->PAT_STANDLEFT); } -DECLARE_CUSTOM_FUNCTION(RightToMe)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(RightToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->SetPattern(Tony->PAT_STANDRIGHT); } -DECLARE_CUSTOM_FUNCTION(TonySetPalesati)(uint32 bStatus, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySetPalesati)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { SetPalesati(bStatus); } -DECLARE_CUSTOM_FUNCTION(MySleep)(uint32 dwTime, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint32) { if (bSkipIdle) return; Sleep(dwTime); } -DECLARE_CUSTOM_FUNCTION(SetAlwaysDisplay)(uint32 val, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(SetAlwaysDisplay)(CORO_PARAM, uint32 val, uint32, uint32, uint32) { bAlwaysDisplay = (val != 0); } -DECLARE_CUSTOM_FUNCTION(SetPointer)(uint32 dwPointer, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32, uint32) { switch (dwPointer) { case 1: Pointer->SetSpecialPointer(Pointer->PTR_FRECCIASU); @@ -369,7 +369,7 @@ VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) { } -DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(uint32 dwMessage, uint32 nX, uint32 nY, uint32) { +DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX, uint32 nY, uint32) { RMMessage msg(dwMessage); int i; int curOffset = 0; @@ -476,12 +476,12 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(uint32 dwMessage, uint32 nX, uint32 nY, Tony->EndTalk(); } -DECLARE_CUSTOM_FUNCTION(ChangeBoxStatus)(uint32 nLoc, uint32 nBox, uint32 nStatus, uint32) { +DECLARE_CUSTOM_FUNCTION(ChangeBoxStatus)(CORO_PARAM, uint32 nLoc, uint32 nBox, uint32 nStatus, uint32) { Boxes->ChangeBoxStatus(nLoc,nBox,nStatus); } -DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { +DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { HANDLE h; Freeze(); @@ -504,7 +504,7 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(uint32 nLoc, uint32 tX, uint32 tY, uin RMPoint SFM_pt; int SFM_nLoc; -DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(uint32 nMsg, uint32 nFont, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) { RMMessage msg(nMsg); RMGfxClearTask clear; int i; @@ -554,14 +554,14 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(uint32 nMsg, uint32 nFont, uint3 } } -DECLARE_CUSTOM_FUNCTION(ClearScreen)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) { RMGfxClearTask clear; LinkGraphicTask(&clear); WaitFrame(); } -DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(uint32 bNotEnableTony, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) { Freeze(); LoadLocation(SFM_nLoc,RMPoint(SFM_pt.x,SFM_pt.y),RMPoint(-1,-1)); if (!bNotEnableTony) @@ -573,18 +573,25 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(uint32 bNotEnableTony, uint32, uin } -DECLARE_CUSTOM_FUNCTION(SendFullscreenMessage)(uint32 nMsg, uint32 nFont, uint32, uint32) { - SendFullscreenMsgStart(nMsg,nFont,0,0); - SendFullscreenMsgEnd(0, 0, 0, 0); +DECLARE_CUSTOM_FUNCTION(SendFullscreenMessage)(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + CORO_INVOKE_4(SendFullscreenMsgStart, nMsg, nFont, 0, 0); + CORO_INVOKE_4(SendFullscreenMsgEnd, 0, 0, 0, 0); + + CORO_END_CODE; } bool bNoOcchioDiBue = false; -DECLARE_CUSTOM_FUNCTION(NoOcchioDiBue)(uint32, uint32, uint32, uint32) { - bNoOcchioDiBue = true; +DECLARE_CUSTOM_FUNCTION(NoOcchioDiBue)(CORO_PARAM, uint32, uint32, uint32, uint32) { + bNoOcchioDiBue = true; } -DECLARE_CUSTOM_FUNCTION(CloseLocation)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint32) { if (!bNoOcchioDiBue) { InitWipe(1); WaitWipeEnd(); @@ -598,7 +605,7 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(uint32, uint32, uint32, uint32) { } -DECLARE_CUSTOM_FUNCTION(ChangeLocation)(uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { +DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { HANDLE h; if (!bNoOcchioDiBue) { @@ -647,40 +654,48 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(uint32 nLoc, uint32 tX, uint32 tY, uint3 } -DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(uint32 nLoc, uint32 lX, uint32 lY, uint32) { +DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(CORO_PARAM, uint32 nLoc, uint32 lX, uint32 lY, uint32) { StartLocPos[nLoc].Set(lX,lY); } -DECLARE_CUSTOM_FUNCTION(SaveTonyPosition)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(SaveTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) { saveTonyPos = Tony->Position(); saveTonyLoc = Loc->TEMPGetNumLoc(); } -DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(uint32, uint32, uint32, uint32) { - ChangeLocation(saveTonyLoc, saveTonyPos.x, saveTonyPos.y, 0); +DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + CORO_INVOKE_4(ChangeLocation, saveTonyLoc, saveTonyPos.x, saveTonyPos.y, 0); + MCharResetCodes(); + + CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(DisableInput)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(DisableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) { MainDisableInput(); } -DECLARE_CUSTOM_FUNCTION(EnableInput)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(EnableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) { MainEnableInput(); } -DECLARE_CUSTOM_FUNCTION(StopTony)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(StopTony)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->StopNoAction(); } -DECLARE_CUSTOM_FUNCTION(CustEnableGUI)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(CustEnableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) { EnableGUI(); } -DECLARE_CUSTOM_FUNCTION(CustDisableGUI)(uint32, uint32, uint32, uint32) +DECLARE_CUSTOM_FUNCTION(CustDisableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) { DisableGUI(); } @@ -731,31 +746,31 @@ void TonyGenericPut2(uint32 nDirection) { } -DECLARE_CUSTOM_FUNCTION(TonyTakeUp1)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyTakeUp1)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericTake1(0); } -DECLARE_CUSTOM_FUNCTION(TonyTakeMid1)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyTakeMid1)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericTake1(1); } -DECLARE_CUSTOM_FUNCTION(TonyTakeDown1)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyTakeDown1)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericTake1(2); } -DECLARE_CUSTOM_FUNCTION(TonyTakeUp2)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyTakeUp2)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericTake2(0); } -DECLARE_CUSTOM_FUNCTION(TonyTakeMid2)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyTakeMid2)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericTake2(1); } -DECLARE_CUSTOM_FUNCTION(TonyTakeDown2)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyTakeDown2)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericTake2(2); } @@ -765,42 +780,42 @@ DECLARE_CUSTOM_FUNCTION(TonyTakeDown2)(uint32, uint32, uint32, uint32) { -DECLARE_CUSTOM_FUNCTION(TonyPutUp1)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyPutUp1)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericPut1(0); } -DECLARE_CUSTOM_FUNCTION(TonyPutMid1)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyPutMid1)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericPut1(1); } -DECLARE_CUSTOM_FUNCTION(TonyPutDown1)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyPutDown1)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericPut1(2); } -DECLARE_CUSTOM_FUNCTION(TonyPutUp2)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyPutUp2)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericPut2(0); } -DECLARE_CUSTOM_FUNCTION(TonyPutMid2)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyPutMid2)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericPut2(1); } -DECLARE_CUSTOM_FUNCTION(TonyPutDown2)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyPutDown2)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericPut2(2); } -DECLARE_CUSTOM_FUNCTION(TonyPerTerra)(uint32 dwParte, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyPerTerra)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { if (dwParte== 0) Tony->SetPattern(Tony->PAT_PERTERRALEFT); else Tony->SetPattern(Tony->PAT_PERTERRARIGHT); } -DECLARE_CUSTOM_FUNCTION(TonySiRialza)(uint32 dwParte, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySiRialza)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { if (dwParte== 0) Tony->SetPattern(Tony->PAT_SIRIALZALEFT); else @@ -810,11 +825,11 @@ DECLARE_CUSTOM_FUNCTION(TonySiRialza)(uint32 dwParte, uint32, uint32, uint32) { Tony->WaitForEndPattern(); } -DECLARE_CUSTOM_FUNCTION(TonyPastorella)(uint32 bIsPast, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyPastorella)(CORO_PARAM, uint32 bIsPast, uint32, uint32, uint32) { Tony->SetPastorella(bIsPast); } -DECLARE_CUSTOM_FUNCTION(TonyFischietto)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyFischietto)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->SetPattern(Tony->PAT_FISCHIETTORIGHT); if (!bSkipIdle) Tony->WaitForEndPattern(); @@ -827,182 +842,182 @@ void TonySetNumTexts(uint32 dwText) { bTonyInTexts = false; } -DECLARE_CUSTOM_FUNCTION(TonyRide)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyRide)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_RIDE; } -DECLARE_CUSTOM_FUNCTION(TonyRidacchia)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyRidacchia)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_RIDE2; } -DECLARE_CUSTOM_FUNCTION(TonyFianchi)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyFianchi)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_FIANCHI; } -DECLARE_CUSTOM_FUNCTION(TonyCanta)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyCanta)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_CANTA; } -DECLARE_CUSTOM_FUNCTION(TonySiIndica)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySiIndica)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_SIINDICA; } -DECLARE_CUSTOM_FUNCTION(TonySpaventatoConMani)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySpaventatoConMani)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_SPAVENTATO; } -DECLARE_CUSTOM_FUNCTION(TonySpaventatoSenzaMani)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySpaventatoSenzaMani)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_SPAVENTATO2; } -DECLARE_CUSTOM_FUNCTION(TonyConMartello)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConMartello)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_CONMARTELLO; Tony->SetPattern(Tony->PAT_CONMARTELLO); } -DECLARE_CUSTOM_FUNCTION(TonyConBicchiere)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConBicchiere)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_CONBICCHIERE; Tony->SetPattern(Tony->PAT_CONBICCHIERE); } -DECLARE_CUSTOM_FUNCTION(TonyConVerme)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConVerme)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_CONVERME; Tony->SetPattern(Tony->PAT_CONVERME); } -DECLARE_CUSTOM_FUNCTION(TonyConCorda)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConCorda)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_CONCORDA; Tony->SetPattern(Tony->PAT_CONCORDA); } -DECLARE_CUSTOM_FUNCTION(TonyConSegretaria)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConSegretaria)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_CONSEGRETARIA; Tony->SetPattern(Tony->PAT_CONSEGRETARIA); } -DECLARE_CUSTOM_FUNCTION(TonyConConiglioANIM)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConConiglioANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_CONCONIGLIO; } -DECLARE_CUSTOM_FUNCTION(TonyConRicettaANIM)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConRicettaANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_CONRICETTA; } -DECLARE_CUSTOM_FUNCTION(TonyConCarteANIM)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConCarteANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_CONCARTE; } -DECLARE_CUSTOM_FUNCTION(TonyConPupazzoANIM)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConPupazzoANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_CONPUPAZZO; } -DECLARE_CUSTOM_FUNCTION(TonyConPupazzoStart)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConPupazzoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { nTonyNextTalkType = Tony->TALK_CONPUPAZZOSTATIC; bStaticTalk = true; Tony->StartStatic(Tony->TALK_CONPUPAZZOSTATIC); } -DECLARE_CUSTOM_FUNCTION(TonyConPupazzoEnd)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConPupazzoEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->EndStatic(Tony->TALK_CONPUPAZZOSTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; } -DECLARE_CUSTOM_FUNCTION(TonyConConiglioStart)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConConiglioStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { nTonyNextTalkType = Tony->TALK_CONCONIGLIOSTATIC; bStaticTalk = true; Tony->StartStatic(Tony->TALK_CONCONIGLIOSTATIC); } -DECLARE_CUSTOM_FUNCTION(TonyConConiglioEnd)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConConiglioEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->EndStatic(Tony->TALK_CONCONIGLIOSTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; } -DECLARE_CUSTOM_FUNCTION(TonyConRicettaStart)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConRicettaStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { nTonyNextTalkType = Tony->TALK_CONRICETTASTATIC; bStaticTalk = true; Tony->StartStatic(Tony->TALK_CONRICETTASTATIC); } -DECLARE_CUSTOM_FUNCTION(TonyConRicettaEnd)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConRicettaEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->EndStatic(Tony->TALK_CONRICETTASTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; } -DECLARE_CUSTOM_FUNCTION(TonyConCarteStart)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConCarteStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { nTonyNextTalkType = Tony->TALK_CONCARTESTATIC; bStaticTalk = true; Tony->StartStatic(Tony->TALK_CONCARTESTATIC); } -DECLARE_CUSTOM_FUNCTION(TonyConCarteEnd)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConCarteEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->EndStatic(Tony->TALK_CONCARTESTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; } -DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoStart)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { nTonyNextTalkType = Tony->TALK_CONTACCUINOSTATIC; bStaticTalk = true; Tony->StartStatic(Tony->TALK_CONTACCUINOSTATIC); } -DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoEnd)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->EndStatic(Tony->TALK_CONTACCUINOSTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; } -DECLARE_CUSTOM_FUNCTION(TonyConMegafonoStart)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConMegafonoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { nTonyNextTalkType = Tony->TALK_CONMEGAFONOSTATIC; bStaticTalk = true; Tony->StartStatic(Tony->TALK_CONMEGAFONOSTATIC); } -DECLARE_CUSTOM_FUNCTION(TonyConMegafonoEnd)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConMegafonoEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->EndStatic(Tony->TALK_CONMEGAFONOSTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; } -DECLARE_CUSTOM_FUNCTION(TonyConBarbaStart)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConBarbaStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { nTonyNextTalkType = Tony->TALK_CONBARBASTATIC; bStaticTalk = true; Tony->StartStatic(Tony->TALK_CONBARBASTATIC); } -DECLARE_CUSTOM_FUNCTION(TonyConBarbaEnd)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyConBarbaEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->EndStatic(Tony->TALK_CONBARBASTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; } -DECLARE_CUSTOM_FUNCTION(TonySpaventatoStart)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySpaventatoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { nTonyNextTalkType = Tony->TALK_SPAVENTATOSTATIC; bStaticTalk = true; Tony->StartStatic(Tony->TALK_SPAVENTATOSTATIC); } -DECLARE_CUSTOM_FUNCTION(TonySpaventatoEnd)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySpaventatoEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->EndStatic(Tony->TALK_SPAVENTATOSTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; @@ -1010,29 +1025,43 @@ DECLARE_CUSTOM_FUNCTION(TonySpaventatoEnd)(uint32, uint32, uint32, uint32) { -DECLARE_CUSTOM_FUNCTION(TonySchifato)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySchifato)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_SCHIFATO; } -DECLARE_CUSTOM_FUNCTION(TonySniffaLeft)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySniffaLeft)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + Tony->SetPattern(Tony->PAT_SNIFFA_LEFT); Tony->WaitForEndPattern(); - LeftToMe(0, 0, 0, 0); + CORO_INVOKE_4(LeftToMe, 0, 0, 0, 0); + + CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonySniffaRight)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySniffaRight)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + Tony->SetPattern(Tony->PAT_SNIFFA_RIGHT); Tony->WaitForEndPattern(); - RightToMe(0, 0, 0, 0); + CORO_INVOKE_4(RightToMe, 0, 0, 0, 0); + + CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyNaah)(uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyNaah)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); nTonyNextTalkType = Tony->TALK_NAAH; } -DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(uint32 nPos, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(CORO_PARAM, uint32 nPos, uint32, uint32, uint32) { switch (nPos) { case 1: nTonyNextTalkType = Tony->TALK_MACBETH1; @@ -1065,15 +1094,15 @@ DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(uint32 nPos, uint32, uint32, uint32) { } -DECLARE_CUSTOM_FUNCTION(EnableTony)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(EnableTony)(CORO_PARAM, uint32, uint32, uint32, uint32) { Tony->Show(); } -DECLARE_CUSTOM_FUNCTION(DisableTony)(uint32 bShowOmbra, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(DisableTony)(CORO_PARAM, uint32 bShowOmbra, uint32, uint32, uint32) { Tony->Hide(bShowOmbra); } -DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(uint32 nItem, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uint32, uint32) { RMItem *item = Loc->GetItemFromCode(nItem); if (!bSkipIdle && item != NULL) @@ -1081,22 +1110,22 @@ DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(uint32 nItem, uint32, uint32, uint32) } -DECLARE_CUSTOM_FUNCTION(SetTonyPosition)(uint32 nX, uint32 nY, uint32 nLoc, uint32) { +DECLARE_CUSTOM_FUNCTION(SetTonyPosition)(CORO_PARAM, uint32 nX, uint32 nY, uint32 nLoc, uint32) { Tony->SetPosition(RMPoint(nX, nY), nLoc); } -DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(uint32 nX, uint32 nY, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) { Tony->Move(RMPoint(nX, nY)); if (!bSkipIdle) Tony->WaitForEndMovement(); } -DECLARE_CUSTOM_FUNCTION(MoveTony)(uint32 nX, uint32 nY, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(MoveTony)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) { Tony->Move(RMPoint(nX, nY)); } -DECLARE_CUSTOM_FUNCTION(ScrollLocation)(uint32 nX, uint32 nY, uint32 sX, uint32 sY) { +DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) { int lx, ly; RMPoint pt; @@ -1133,7 +1162,7 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(uint32 nX, uint32 nY, uint32 sX, uint32 } } -DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(uint32 nX, uint32 nY, uint32 sX, uint32 sY) { +DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) { int lx, ly; RMPoint pt, startpt; uint32 dwStartTime, dwCurTime, dwTotalTime; @@ -1231,7 +1260,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(uint32 nX, uint32 nY, uint32 sX, uin } -DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(uint32 dwCode, uint32 nX, uint32 nY, uint32) { +DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uint32 nY, uint32) { int i; for (i = 0; i < curChangedHotspot; i++) @@ -1252,15 +1281,15 @@ DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(uint32 dwCode, uint32 nX, uint32 nY, uint } -DECLARE_CUSTOM_FUNCTION(AutoSave)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(AutoSave)(CORO_PARAM, uint32, uint32, uint32, uint32) { _vm->AutoSave(); } -DECLARE_CUSTOM_FUNCTION(Abort)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(Abort)(CORO_PARAM, uint32, uint32, uint32, uint32) { _vm->Abort(); } -DECLARE_CUSTOM_FUNCTION(TremaSchermo)(uint32 nScosse, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) { uint32 i; uint32 curTime = _vm->GetTime(); int dirx,diry; @@ -1296,7 +1325,7 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(uint32 nScosse, uint32, uint32, uint32) { * Personaggi */ -DECLARE_CUSTOM_FUNCTION(CharSetCode)(uint32 nChar, uint32 nCode, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { assert(nChar < 16); Character[nChar].code = nCode; Character[nChar].item = Loc->GetItemFromCode(nCode); @@ -1311,26 +1340,26 @@ DECLARE_CUSTOM_FUNCTION(CharSetCode)(uint32 nChar, uint32 nCode, uint32, uint32) IsMChar[nChar] = false; } -DECLARE_CUSTOM_FUNCTION(CharSetColor)(uint32 nChar, uint32 r, uint32 g, uint32 b) { +DECLARE_CUSTOM_FUNCTION(CharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) { assert(nChar<16); Character[nChar].r = r; Character[nChar].g = g; Character[nChar].b = b; } -DECLARE_CUSTOM_FUNCTION(CharSetTalkPattern)(uint32 nChar, uint32 tp, uint32 sp, uint32) { +DECLARE_CUSTOM_FUNCTION(CharSetTalkPattern)(CORO_PARAM, uint32 nChar, uint32 tp, uint32 sp, uint32) { assert(nChar<16); Character[nChar].talkpattern = tp; Character[nChar].standpattern = sp; } -DECLARE_CUSTOM_FUNCTION(CharSetStartEndTalkPattern)(uint32 nChar, uint32 sp, uint32 ep, uint32) { +DECLARE_CUSTOM_FUNCTION(CharSetStartEndTalkPattern)(CORO_PARAM, uint32 nChar, uint32 sp, uint32 ep, uint32) { assert(nChar<16); Character[nChar].starttalkpattern=sp; Character[nChar].endtalkpattern=ep; } -DECLARE_CUSTOM_FUNCTION(CharSendMessage)(uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32) { +DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32) { RMMessage msg(dwMessage); int i; RMPoint pt; @@ -1433,15 +1462,15 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(uint32 nChar, uint32 dwMessage, uint32 Unfreeze(); } -DECLARE_CUSTOM_FUNCTION(AddInventory)(uint32 dwCode, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(AddInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { Inventory->AddItem(dwCode); } -DECLARE_CUSTOM_FUNCTION(RemoveInventory)(uint32 dwCode, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(RemoveInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { Inventory->RemoveItem(dwCode); } -DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(uint32 dwCode, uint32 dwStatus, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32 dwStatus, uint32, uint32) { Inventory->ChangeItemStatus(dwCode,dwStatus); } @@ -1452,7 +1481,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(uint32 dwCode, uint32 dwStatus, u * Mastri Personaggi */ -DECLARE_CUSTOM_FUNCTION(MCharSetCode)(uint32 nChar, uint32 nCode, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { assert(nChar < 10); MCharacter[nChar].code=nCode; if (nCode== 0) @@ -1474,19 +1503,19 @@ DECLARE_CUSTOM_FUNCTION(MCharSetCode)(uint32 nChar, uint32 nCode, uint32, uint32 IsMChar[nChar] = true; } -DECLARE_CUSTOM_FUNCTION(MCharResetCode)(uint32 nChar, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(MCharResetCode)(CORO_PARAM, uint32 nChar, uint32, uint32, uint32) { MCharacter[nChar].item=Loc->GetItemFromCode(MCharacter[nChar].code); } -DECLARE_CUSTOM_FUNCTION(MCharSetPosition)(uint32 nChar, uint32 nX, uint32 nY, uint32) { +DECLARE_CUSTOM_FUNCTION(MCharSetPosition)(CORO_PARAM, uint32 nChar, uint32 nX, uint32 nY, uint32) { assert(nChar < 10); MCharacter[nChar].x=nX; MCharacter[nChar].y=nY; } -DECLARE_CUSTOM_FUNCTION(MCharSetColor)(uint32 nChar, uint32 r, uint32 g, uint32 b) { +DECLARE_CUSTOM_FUNCTION(MCharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) { assert(nChar < 10); MCharacter[nChar].r=r; MCharacter[nChar].g=g; @@ -1494,7 +1523,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSetColor)(uint32 nChar, uint32 r, uint32 g, uint32 } -DECLARE_CUSTOM_FUNCTION(MCharSetNumTalksInGroup)(uint32 nChar, uint32 nGroup, uint32 nTalks, uint32) { +DECLARE_CUSTOM_FUNCTION(MCharSetNumTalksInGroup)(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32 nTalks, uint32) { assert(nChar < 10); assert(nGroup < 10); @@ -1502,7 +1531,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSetNumTalksInGroup)(uint32 nChar, uint32 nGroup, ui } -DECLARE_CUSTOM_FUNCTION(MCharSetCurrentGroup)(uint32 nChar, uint32 nGroup, uint32, uint32) +DECLARE_CUSTOM_FUNCTION(MCharSetCurrentGroup)(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32, uint32) { assert(nChar < 10); assert(nGroup < 10); @@ -1510,21 +1539,21 @@ DECLARE_CUSTOM_FUNCTION(MCharSetCurrentGroup)(uint32 nChar, uint32 nGroup, uint3 MCharacter[nChar].curgroup = nGroup; } -DECLARE_CUSTOM_FUNCTION(MCharSetNumTexts)(uint32 nChar, uint32 nTexts, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(MCharSetNumTexts)(CORO_PARAM, uint32 nChar, uint32 nTexts, uint32, uint32) { assert(nChar < 10); MCharacter[nChar].numtexts=nTexts-1; MCharacter[nChar].bInTexts = false; } -DECLARE_CUSTOM_FUNCTION(MCharSetAlwaysBack)(uint32 nChar, uint32 bAlwaysBack, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(MCharSetAlwaysBack)(CORO_PARAM, uint32 nChar, uint32 bAlwaysBack, uint32, uint32) { assert(nChar < 10); MCharacter[nChar].bAlwaysBack=bAlwaysBack; } -DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32 nFont) { +DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32 nFont) { RMMessage msg(dwMessage); int i; int parm; @@ -1645,7 +1674,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(uint32 nChar, uint32 dwMessage, uint32 int curDialog; -DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(uint32 nPers, uint32 nMsg, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg, uint32, uint32) { LPSTR string; RMTextDialog* text; int parm; @@ -1822,7 +1851,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(uint32 nPers, uint32 nMsg, uint32, ui // @@@@ QUESTA NON SI PUO' SKIPPARE!!!!!!!!!!!!!!!!!!! -DECLARE_CUSTOM_FUNCTION(StartDialog)(uint32 nDialog, uint32 nStartGroup, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGroup, uint32, uint32) { int nChoice; uint32 *sl; int i,num; @@ -1897,12 +1926,12 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(uint32 nDialog, uint32 nStartGroup, uint32, * Sync tra idle e mpal */ -DECLARE_CUSTOM_FUNCTION(TakeOwnership)(uint32 num, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { // EnterCriticalSection(&cs[num]); WaitForSingleObject(mut[num],INFINITE); } -DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(uint32 num, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { // LeaveCriticalSection(&cs[num]); // g_system->unlockMutex(mut[num]); warning("TODO: ReleaseOwnership"); @@ -1975,46 +2004,46 @@ void ThreadFadeOutMusic(void *nMusic) { _endthread(); } -DECLARE_CUSTOM_FUNCTION(FadeInSonoriz)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(FadeInSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { _beginthread(ThreadFadeInMusic, 10240, (void*)curSonoriz); } -DECLARE_CUSTOM_FUNCTION(FadeOutSonoriz)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(FadeOutSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { bFadeOutStop = false; _beginthread(ThreadFadeOutMusic, 10240, (void *)curSonoriz); } -DECLARE_CUSTOM_FUNCTION(FadeOutStacchetto)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(FadeOutStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { bFadeOutStop = false; _beginthread(ThreadFadeOutMusic, 10240, (void*)2); } -DECLARE_CUSTOM_FUNCTION(FadeInStacchetto)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(FadeInStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { _beginthread(ThreadFadeInMusic, 10240, (void*)2); } -DECLARE_CUSTOM_FUNCTION(StopSonoriz)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(StopSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { _vm->StopMusic(curSonoriz); } -DECLARE_CUSTOM_FUNCTION(StopStacchetto)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(StopStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { _vm->StopMusic(2); } -DECLARE_CUSTOM_FUNCTION(MuteSonoriz)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(MuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { _vm->SetMusicVolume(curSonoriz, 0); } -DECLARE_CUSTOM_FUNCTION(DemuteSonoriz)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(DemuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { bFadeOutStop = true; _vm->SetMusicVolume(curSonoriz, 64); } -DECLARE_CUSTOM_FUNCTION(MuteStacchetto)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(MuteStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { _vm->SetMusicVolume(2, 0); } -DECLARE_CUSTOM_FUNCTION(DemuteStacchetto)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(DemuteStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { _vm->SetMusicVolume(2, 64); } @@ -2139,7 +2168,7 @@ void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int debug("End CustPlayMusic\n"); } -DECLARE_CUSTOM_FUNCTION(PlaySonoriz)(uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) { +DECLARE_CUSTOM_FUNCTION(PlaySonoriz)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) { if (nFX == 0 || nFX == 1 || nFX==2) { debug("PlaySonoriz stop fadeout\n"); bFadeOutStop = true; @@ -2149,11 +2178,11 @@ DECLARE_CUSTOM_FUNCTION(PlaySonoriz)(uint32 nMusic, uint32 nFX, uint32 bNoLoop, CustPlayMusic(curSonoriz, musicFiles[nMusic].name, nFX, bNoLoop ? false : true, musicFiles[nMusic].sync); } -DECLARE_CUSTOM_FUNCTION(PlayStacchetto)(uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) { +DECLARE_CUSTOM_FUNCTION(PlayStacchetto)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) { CustPlayMusic(2,staccFileNames[nMusic],nFX,bLoop); } -DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(uint32 nItem, uint32 nSFX, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) { if (nItem== 0) { Tony->PlaySfx(nSFX); } else { @@ -2165,7 +2194,7 @@ DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(uint32 nItem, uint32 nSFX, uint32, uint32) void RestoreMusic(void) { - PlaySonoriz(lastMusic, 0, 0, 0); + PlaySonoriz(nullContext, lastMusic, 0, 0, 0); if (lastTappeto != 0) CustPlayMusic(4, tappetiFile[lastTappeto], 0, true); } @@ -2181,49 +2210,63 @@ void LoadMusic(Common::InSaveFile *f) { } -DECLARE_CUSTOM_FUNCTION(StacchettoFadeStart)(uint32 nStacc, uint32 bLoop, uint32, uint32) { - FadeOutSonoriz(0, 0, 0, 0); - MuteStacchetto(0, 0, 0, 0); - PlayStacchetto(nStacc, 0, bLoop, 0); - FadeInStacchetto(0, 0, 0, 0); +DECLARE_CUSTOM_FUNCTION(StacchettoFadeStart)(CORO_PARAM, uint32 nStacc, uint32 bLoop, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + CORO_INVOKE_4(FadeOutSonoriz, 0, 0, 0, 0); + CORO_INVOKE_4(MuteStacchetto, 0, 0, 0, 0); + CORO_INVOKE_4(PlayStacchetto, nStacc, 0, bLoop, 0); + CORO_INVOKE_4(FadeInStacchetto, 0, 0, 0, 0); + + CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(StacchettoFadeEnd)(uint32 nStacc, uint32 bLoop, uint32, uint32) { - FadeOutStacchetto(0, 0, 0, 0); - FadeInSonoriz(0, 0, 0, 0); +DECLARE_CUSTOM_FUNCTION(StacchettoFadeEnd)(CORO_PARAM, uint32 nStacc, uint32 bLoop, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + CORO_INVOKE_4(FadeOutStacchetto, 0, 0, 0, 0); + CORO_INVOKE_4(FadeInSonoriz, 0, 0, 0, 0); + + CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(MustSkipIdleStart)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(MustSkipIdleStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { bSkipIdle = true; SetEvent(hSkipIdle); } -DECLARE_CUSTOM_FUNCTION(MustSkipIdleEnd)(uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(MustSkipIdleEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { bSkipIdle = false; ResetEvent(hSkipIdle); } -DECLARE_CUSTOM_FUNCTION(PatIrqFreeze)(uint32 bStatus, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(PatIrqFreeze)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { bPatIrqFreeze = bStatus; } -DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(uint32 , uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, uint32) { Freeze(); _vm->OpenInitLoadMenu(); Unfreeze(); } -DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(uint32 , uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uint32) { Freeze(); _vm->OpenInitOptions(); Unfreeze(); } -DECLARE_CUSTOM_FUNCTION(DoCredits)(uint32 nMsg, uint32 dwTime, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint32, uint32) { RMMessage msg(nMsg); RMTextDialog *text; HANDLE hDisable = CreateEvent(NULL, true, false, NULL); -- cgit v1.2.3 From 770e55d06578f7f51959ea331da7baaaaa0e360d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 6 May 2012 15:18:03 +1000 Subject: TONY: Further conversion of initially launched threads to processes. This includes all the dependent routines that they call. --- engines/tony/custom.cpp | 61 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 19 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 1d28fa9ece..2683634012 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -72,7 +72,7 @@ RMInventory *Inventory; RMInput *Input; HANDLE (*LoadLocation)(int, RMPoint, RMPoint start); -HANDLE (*UnloadLocation)(bool bDoOnExit); +void (*UnloadLocation)(CORO_PARAM, bool bDoOnExit, HANDLE *result); void (*LinkGraphicTask)(RMGfxTask *task); void (*Freeze)(void); void (*Unfreeze)(void); @@ -505,20 +505,27 @@ RMPoint SFM_pt; int SFM_nLoc; DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) { - RMMessage msg(nMsg); - RMGfxClearTask clear; - int i; + CORO_BEGIN_CONTEXT; + RMMessage *msg; + RMGfxClearTask clear; + int i; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + _ctx->msg = new RMMessage(nMsg); SFM_nLoc = Loc->TEMPGetNumLoc(); SFM_pt = Tony->Position(); - if (bSkipIdle) return; + if (bSkipIdle) + return; - UnloadLocation(false); + CORO_INVOKE_2(UnloadLocation, false, NULL); Tony->Hide(); Unfreeze(); - for (i = 0; i < msg.NumPeriods() && !bSkipIdle; i++) { + for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !bSkipIdle; _ctx->i++) { RMTextDialog text; text.SetInput(Input); @@ -533,25 +540,29 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 text.SetColor(255,255,255); // Scrive il testo - if (nFont== 0) - text.WriteText(msg[i],1); - else if (nFont==1) - text.WriteText(msg[i],0); + if (nFont == 0) + text.WriteText((*_ctx->msg)[_ctx->i], 1); + else if (nFont == 1) + text.WriteText((*_ctx->msg)[_ctx->i], 0); // Setta la posizione - text.SetPosition(RMPoint(320,240)); + text.SetPosition(RMPoint(320, 240)); text.SetAlwaysDisplay(); text.ForceTime(); // Registra il testo - LinkGraphicTask(&clear); + LinkGraphicTask(&_ctx->clear); LinkGraphicTask(&text); // Aspetta la fine della visualizzazione text.SetCustomSkipHandle(hSkipIdle); text.WaitForEndDisplay(); } + + delete _ctx->msg; + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -592,6 +603,11 @@ DECLARE_CUSTOM_FUNCTION(NoOcchioDiBue)(CORO_PARAM, uint32, uint32, uint32, uint3 } DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + if (!bNoOcchioDiBue) { InitWipe(1); WaitWipeEnd(); @@ -600,13 +616,19 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 _vm->StopMusic(4); // On Exit e lascia freezzato - UnloadLocation(true); + CORO_INVOKE_2(UnloadLocation, true, NULL); Unfreeze(); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { - HANDLE h; + CORO_BEGIN_CONTEXT; + HANDLE h; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); if (!bNoOcchioDiBue) { InitWipe(1); @@ -618,7 +640,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint } // On Exit e lascia freezzato - UnloadLocation(true); + CORO_INVOKE_2(UnloadLocation, true, NULL); curChangedHotspot = 0; if (bUseStartPos != 0) @@ -639,7 +661,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint Unfreeze(); - h = mpalQueryDoAction(0, nLoc,0); + _ctx->h = mpalQueryDoAction(0, nLoc, 0); if (!bNoOcchioDiBue) { WaitWipeEnd(); @@ -649,9 +671,10 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint bNoOcchioDiBue = false; // On Enter? - if (h != INVALID_HANDLE_VALUE) - WaitForSingleObject(h,INFINITE); + if (_ctx->h != INVALID_HANDLE_VALUE) + WaitForSingleObject(_ctx->h, INFINITE); + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(CORO_PARAM, uint32 nLoc, uint32 lX, uint32 lY, uint32) { -- cgit v1.2.3 From 156d8cdb733fe03688da9e2e9844b722681bed7f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 6 May 2012 21:24:55 +1000 Subject: TONY: Bugfix for waitForSingleObject, and added action process debug information --- engines/tony/custom.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 2683634012..dadc84e606 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1680,7 +1680,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes // Cerca di eseguire la funzione custom per chiudere la parlata if (MCharacter[nChar].item) { - h=mpalQueryDoAction(31,MCharacter[nChar].item->MpalCode(),parm); + h = mpalQueryDoAction(31,MCharacter[nChar].item->MpalCode(),parm); if (h!=INVALID_HANDLE_VALUE) WaitForSingleObject(h,INFINITE); } @@ -1724,7 +1724,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg g_system->unlockMutex(vdb); } - string=mpalQueryDialogPeriod(nMsg); + string = mpalQueryDialogPeriod(nMsg); if (nPers == 0) { text = new RMTextDialog; @@ -1847,7 +1847,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if ((MCharacter[nPers].bInTexts && MCharacter[nPers].numtexts== 0) || !MCharacter[nPers].bInTexts) { // Cerca di eseguire la funzione custom per chiudere la parlata MCharacter[nPers].curTalk = (MCharacter[nPers].curTalk%10) + MCharacter[nPers].curgroup*10; - h=mpalQueryDoAction(31,MCharacter[nPers].item->MpalCode(),MCharacter[nPers].curTalk); + h = mpalQueryDoAction(31,MCharacter[nPers].item->MpalCode(),MCharacter[nPers].curTalk); if (h!=INVALID_HANDLE_VALUE) WaitForSingleObject(h,INFINITE); @@ -1872,7 +1872,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg } -// @@@@ QUESTA NON SI PUO' SKIPPARE!!!!!!!!!!!!!!!!!!! +// @@@@ This cannot be skipped!!!!!!!!!!!!!!!!!!! DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGroup, uint32, uint32) { int nChoice; @@ -1888,9 +1888,9 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr mpalQueryDoDialogU32(nDialog, nStartGroup); // Aspetta che una scelta si presenti - while ((nChoice=mpalQueryDialogWaitForChoice()) != -1) { + while ((nChoice = mpalQueryDialogWaitForChoice()) != -1) { // Si fa dare la lista di opzioni e le conta - sl=mpalQueryDialogSelectList(nChoice); + sl = mpalQueryDialogSelectList(nChoice); for (num = 0; sl[num] != 0; num++) ; @@ -1906,7 +1906,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr dc.SetNumChoices(num); // Scrive tutte le possibili opzioni - for (i = 0;i < num; i++) { + for (i = 0; i < num; i++) { string = mpalQueryDialogPeriod(sl[i]); assert(string != NULL); dc.AddChoice(string); -- cgit v1.2.3 From 0b8974ec4ab37ef056ac50c098d3fe8045ec172b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 6 May 2012 23:51:11 +1000 Subject: TONY: Beginnings of converting dialog processes to coroutines --- engines/tony/custom.cpp | 70 ++++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 30 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index dadc84e606..e7878c5a5d 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1699,7 +1699,7 @@ int curDialog; DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg, uint32, uint32) { LPSTR string; - RMTextDialog* text; + RMTextDialog *text; int parm; HANDLE h; bool bIsBack = false; @@ -1875,70 +1875,80 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg // @@@@ This cannot be skipped!!!!!!!!!!!!!!!!!!! DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGroup, uint32, uint32) { - int nChoice; - uint32 *sl; - int i,num; - char* string; - RMDialogChoice dc; - int sel; + CORO_BEGIN_CONTEXT; + uint32 nChoice; + uint32 *sl; + int i, num; + char *string; + RMDialogChoice dc; + int sel; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); curDialog = nDialog; - // Chiama l'MPAL per iniziare il dialogo + // Call MPAL to start the dialog mpalQueryDoDialogU32(nDialog, nStartGroup); - // Aspetta che una scelta si presenti - while ((nChoice = mpalQueryDialogWaitForChoice()) != -1) { + // Wait until a choice is selected + mpalQueryDialogWaitForChoice(&_ctx->nChoice); + while (_ctx->nChoice != -1) { // Si fa dare la lista di opzioni e le conta - sl = mpalQueryDialogSelectList(nChoice); - for (num = 0; sl[num] != 0; num++) + _ctx->sl = mpalQueryDialogSelectList(_ctx->nChoice); + for (_ctx->num = 0; _ctx->sl[_ctx->num] != 0; _ctx->num++) ; // Se c'e' una sola opzione, la fa automaticamente, e aspetta la prossima scelta - if (num == 1) { - mpalQueryDialogSelectionU32(nChoice, sl[0]); - GlobalFree(sl); + if (_ctx->num == 1) { + mpalQueryDialogSelectionU32(_ctx->nChoice, _ctx->sl[0]); + GlobalFree(_ctx->sl); continue; } // Crea una scelta per il dialogo - dc.Init(); - dc.SetNumChoices(num); + _ctx->dc.Init(); + _ctx->dc.SetNumChoices(_ctx->num); // Scrive tutte le possibili opzioni - for (i = 0; i < num; i++) { - string = mpalQueryDialogPeriod(sl[i]); - assert(string != NULL); - dc.AddChoice(string); - GlobalFree(string); + for (_ctx->i = 0; _ctx->i < _ctx->num; _ctx->i++) { + _ctx->string = mpalQueryDialogPeriod(_ctx->sl[_ctx->i]); + assert(_ctx->string != NULL); + _ctx->dc.AddChoice(_ctx->string); + GlobalFree(_ctx->string); } // Attiva l'oggetto - LinkGraphicTask(&dc); - dc.Show(); + LinkGraphicTask(&_ctx->dc); + _ctx->dc.Show(); // Disegna il puntatore Pointer->SetSpecialPointer(Pointer->PTR_NONE); MainShowMouse(); - while (!(Input->MouseLeftClicked() && ((sel = dc.GetSelection()) != -1))) { + while (!(Input->MouseLeftClicked() && ((_ctx->sel = _ctx->dc.GetSelection()) != -1))) { WaitFrame(); Freeze(); - dc.DoFrame(Input->MousePos()); + _ctx->dc.DoFrame(Input->MousePos()); Unfreeze(); } // Nascondi il puntatore MainHideMouse(); - dc.Hide(); - mpalQueryDialogSelectionU32(nChoice, sl[sel]); + _ctx->dc.Hide(); + mpalQueryDialogSelectionU32(_ctx->nChoice, _ctx->sl[_ctx->sel]); // Chiude la scelta - dc.Close(); + _ctx->dc.Close(); + + GlobalFree(_ctx->sl); - GlobalFree(sl); + // Wait for the next choice to be made + mpalQueryDialogWaitForChoice(&_ctx->nChoice); } + + CORO_END_CODE; } -- cgit v1.2.3 From 8527302057052e784c3ea32ca8eebb0220bf15e6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 8 May 2012 08:25:33 +1000 Subject: TONY: Added support for threading events to scheduler, converted more procs to coroutines --- engines/tony/custom.cpp | 610 +++++++++++++++++++++++++++++++----------------- 1 file changed, 402 insertions(+), 208 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index e7878c5a5d..800b5d8d50 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -370,50 +370,62 @@ VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) { DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX, uint32 nY, uint32) { - RMMessage msg(dwMessage); - int i; - int curOffset = 0; + CORO_BEGIN_CONTEXT; + RMMessage *msg; + int i; + int curOffset; + VoiceHeader *curVoc; + FPSFX *voice; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + _ctx->curOffset = 0; if (bSkipIdle) return; - if (!msg.IsValid()) + _ctx->msg = new RMMessage(dwMessage); + if (!_ctx->msg->IsValid()) { + delete _ctx->msg; return; + } - VoiceHeader *curVoc = SearchVoiceHeader(0, dwMessage); - FPSFX *voice = NULL; - if (curVoc) { + _ctx->curVoc = SearchVoiceHeader(0, dwMessage); + _ctx->voice = NULL; + if (_ctx->curVoc) { // Si posiziona all'interno del database delle voci all'inizio della prima - curOffset = curVoc->offset; + _ctx->curOffset = _ctx->curVoc->offset; // PRIMA VOLTA PREALLOCA g_system->lockMutex(vdb); - //fseek(_vm->m_vdbFP, curOffset, SEEK_SET); - _vm->_vdbFP.seek(curOffset); - _vm->_theSound.CreateSfx(&voice); - voice->LoadVoiceFromVDB(_vm->_vdbFP); -// curOffset = ftell(_vm->m_vdbFP); - curOffset = _vm->_vdbFP.pos(); - - voice->SetLoop(false); + //fseek(_vm->m_vdbFP, _ctx->curOffset, SEEK_SET); + _vm->_vdbFP.seek(_ctx->curOffset); + _vm->_theSound.CreateSfx(&_ctx->voice); + _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); +// _ctx->curOffset = ftell(_vm->m_vdbFP); + _ctx->curOffset = _vm->_vdbFP.pos(); + + _ctx->voice->SetLoop(false); g_system->unlockMutex(vdb); } if (nTonyNextTalkType != Tony->TALK_NORMAL) { - Tony->StartTalk(nTonyNextTalkType); + CORO_INVOKE_1(Tony->StartTalk, nTonyNextTalkType); + if (!bStaticTalk) nTonyNextTalkType = Tony->TALK_NORMAL; } else { - if (msg.NumPeriods() > 1) - Tony->StartTalk(Tony->TALK_FIANCHI); + if (_ctx->msg->NumPeriods() > 1) + CORO_INVOKE_1(Tony->StartTalk, Tony->TALK_FIANCHI); else - Tony->StartTalk(Tony->TALK_NORMAL); + CORO_INVOKE_1(Tony->StartTalk, Tony->TALK_NORMAL); } if (curBackText) curBackText->Hide(); bTonyIsSpeaking = true; - for (i = 0; i < msg.NumPeriods() && !bSkipIdle; i++) { + for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !bSkipIdle; _ctx->i++) { RMTextDialog text; text.SetInput(Input); @@ -425,7 +437,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX text.SetColor(0,255,0); // Scrive il testo - text.WriteText(msg[i],0); + text.WriteText((*_ctx->msg)[_ctx->i],0); // Setta la posizione if (nX == 0 && nY == 0) @@ -439,21 +451,21 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX // Registra il testo LinkGraphicTask(&text); - if (curVoc) { - if (i == 0) { - voice->Play(); - text.SetCustomSkipHandle2(voice->hEndOfBuffer); + if (_ctx->curVoc) { + if (_ctx->i == 0) { + _ctx->voice->Play(); + text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } else { g_system->lockMutex(vdb); - // fseek(_vm->m_vdbFP, curOffset, SEEK_SET); - _vm->_vdbFP.seek(curOffset); - _vm->_theSound.CreateSfx(&voice); - voice->LoadVoiceFromVDB(_vm->_vdbFP); - // curOffset = ftell(_vm->m_vdbFP); - curOffset = _vm->_vdbFP.pos(); - voice->SetLoop(false); - voice->Play(); - text.SetCustomSkipHandle2(voice->hEndOfBuffer); + // fseek(_vm->m_vdbFP, _ctx->curOffset, SEEK_SET); + _vm->_vdbFP.seek(_ctx->curOffset); + _vm->_theSound.CreateSfx(&_ctx->voice); + _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); + // _ctx->curOffset = ftell(_vm->m_vdbFP); + _ctx->curOffset = _vm->_vdbFP.pos(); + _ctx->voice->SetLoop(false); + _ctx->voice->Play(); + text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); g_system->unlockMutex(vdb); } } @@ -462,10 +474,10 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX text.SetCustomSkipHandle(hSkipIdle); text.WaitForEndDisplay(); - if (curVoc) { - voice->Stop(); - voice->Release(); - voice=NULL; + if (_ctx->curVoc) { + _ctx->voice->Stop(); + _ctx->voice->Release(); + _ctx->voice=NULL; } } @@ -473,7 +485,10 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX if (curBackText) curBackText->Show(); - Tony->EndTalk(); + CORO_INVOKE_0(Tony->EndTalk); + delete _ctx->msg; + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(ChangeBoxStatus)(CORO_PARAM, uint32 nLoc, uint32 nBox, uint32 nStatus, uint32) { @@ -718,134 +733,164 @@ DECLARE_CUSTOM_FUNCTION(CustEnableGUI)(CORO_PARAM, uint32, uint32, uint32, uint3 EnableGUI(); } -DECLARE_CUSTOM_FUNCTION(CustDisableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) -{ - DisableGUI(); +DECLARE_CUSTOM_FUNCTION(CustDisableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) { + DisableGUI(); } -void TonyGenericTake1(uint32 nDirection) { + +void TonyGenericTake1(CORO_PARAM, uint32 nDirection) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + Freeze(); - Tony->Take(nDirection,0); + Tony->Take(nDirection, 0); Unfreeze(); if (!bSkipIdle) - Tony->WaitForEndPattern(); + CORO_INVOKE_0(Tony->WaitForEndPattern); + + CORO_END_CODE; } -void TonyGenericTake2(uint32 nDirection) { +void TonyGenericTake2(CORO_PARAM, uint32 nDirection) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + Freeze(); - Tony->Take(nDirection,1); + Tony->Take(nDirection, 1); Unfreeze(); if (!bSkipIdle) - Tony->WaitForEndPattern(); + CORO_INVOKE_0(Tony->WaitForEndPattern); Freeze(); Tony->Take(nDirection,2); Unfreeze(); + + CORO_END_CODE; } -void TonyGenericPut1(uint32 nDirection) { +void TonyGenericPut1(CORO_PARAM, uint32 nDirection) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + Freeze(); - Tony->Put(nDirection,0); + Tony->Put(nDirection, 0); Unfreeze(); if (!bSkipIdle) - Tony->WaitForEndPattern(); + CORO_INVOKE_0(Tony->WaitForEndPattern); + + CORO_END_CODE; } -void TonyGenericPut2(uint32 nDirection) { +void TonyGenericPut2(CORO_PARAM, uint32 nDirection) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + Freeze(); Tony->Put(nDirection,1); Unfreeze(); if (!bSkipIdle) - Tony->WaitForEndPattern(); + CORO_INVOKE_0(Tony->WaitForEndPattern); Freeze(); Tony->Put(nDirection,2); Unfreeze(); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyTakeUp1)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericTake1(0); + TonyGenericTake1(coroParam, 0); } DECLARE_CUSTOM_FUNCTION(TonyTakeMid1)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericTake1(1); + TonyGenericTake1(coroParam, 1); } DECLARE_CUSTOM_FUNCTION(TonyTakeDown1)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericTake1(2); + TonyGenericTake1(coroParam, 2); } DECLARE_CUSTOM_FUNCTION(TonyTakeUp2)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericTake2(0); + TonyGenericTake2(coroParam, 0); } DECLARE_CUSTOM_FUNCTION(TonyTakeMid2)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericTake2(1); + TonyGenericTake2(coroParam, 1); } DECLARE_CUSTOM_FUNCTION(TonyTakeDown2)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericTake2(2); + TonyGenericTake2(coroParam, 2); } - - - - DECLARE_CUSTOM_FUNCTION(TonyPutUp1)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericPut1(0); + TonyGenericPut1(coroParam, 0); } DECLARE_CUSTOM_FUNCTION(TonyPutMid1)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericPut1(1); + TonyGenericPut1(coroParam, 1); } DECLARE_CUSTOM_FUNCTION(TonyPutDown1)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericPut1(2); + TonyGenericPut1(coroParam, 2); } DECLARE_CUSTOM_FUNCTION(TonyPutUp2)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericPut2(0); + TonyGenericPut2(coroParam, 0); } DECLARE_CUSTOM_FUNCTION(TonyPutMid2)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericPut2(1); + TonyGenericPut2(coroParam, 1); } DECLARE_CUSTOM_FUNCTION(TonyPutDown2)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericPut2(2); + TonyGenericPut2(coroParam, 2); } - DECLARE_CUSTOM_FUNCTION(TonyPerTerra)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { - if (dwParte== 0) + if (dwParte == 0) Tony->SetPattern(Tony->PAT_PERTERRALEFT); else Tony->SetPattern(Tony->PAT_PERTERRARIGHT); } DECLARE_CUSTOM_FUNCTION(TonySiRialza)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { - if (dwParte== 0) + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + if (dwParte == 0) Tony->SetPattern(Tony->PAT_SIRIALZALEFT); else Tony->SetPattern(Tony->PAT_SIRIALZARIGHT); if (!bSkipIdle) - Tony->WaitForEndPattern(); + CORO_INVOKE_0(Tony->WaitForEndPattern); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyPastorella)(CORO_PARAM, uint32 bIsPast, uint32, uint32, uint32) { @@ -853,10 +898,18 @@ DECLARE_CUSTOM_FUNCTION(TonyPastorella)(CORO_PARAM, uint32 bIsPast, uint32, uint } DECLARE_CUSTOM_FUNCTION(TonyFischietto)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + Tony->SetPattern(Tony->PAT_FISCHIETTORIGHT); if (!bSkipIdle) - Tony->WaitForEndPattern(); + CORO_INVOKE_0(Tony->WaitForEndPattern); + Tony->SetPattern(Tony->PAT_STANDRIGHT); + + CORO_END_CODE; } @@ -951,101 +1004,212 @@ DECLARE_CUSTOM_FUNCTION(TonyConPupazzoANIM)(CORO_PARAM, uint32 dwText, uint32, u } DECLARE_CUSTOM_FUNCTION(TonyConPupazzoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + nTonyNextTalkType = Tony->TALK_CONPUPAZZOSTATIC; bStaticTalk = true; - Tony->StartStatic(Tony->TALK_CONPUPAZZOSTATIC); + CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONPUPAZZOSTATIC); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyConPupazzoEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->EndStatic(Tony->TALK_CONPUPAZZOSTATIC); + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONPUPAZZOSTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyConConiglioStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + nTonyNextTalkType = Tony->TALK_CONCONIGLIOSTATIC; bStaticTalk = true; - Tony->StartStatic(Tony->TALK_CONCONIGLIOSTATIC); + CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONCONIGLIOSTATIC); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyConConiglioEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->EndStatic(Tony->TALK_CONCONIGLIOSTATIC); + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONCONIGLIOSTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyConRicettaStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + nTonyNextTalkType = Tony->TALK_CONRICETTASTATIC; bStaticTalk = true; - Tony->StartStatic(Tony->TALK_CONRICETTASTATIC); + CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONRICETTASTATIC); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyConRicettaEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->EndStatic(Tony->TALK_CONRICETTASTATIC); + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONRICETTASTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyConCarteStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + nTonyNextTalkType = Tony->TALK_CONCARTESTATIC; bStaticTalk = true; - Tony->StartStatic(Tony->TALK_CONCARTESTATIC); + CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONCARTESTATIC); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyConCarteEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->EndStatic(Tony->TALK_CONCARTESTATIC); + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONCARTESTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + nTonyNextTalkType = Tony->TALK_CONTACCUINOSTATIC; bStaticTalk = true; - Tony->StartStatic(Tony->TALK_CONTACCUINOSTATIC); + CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONTACCUINOSTATIC); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->EndStatic(Tony->TALK_CONTACCUINOSTATIC); + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONTACCUINOSTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyConMegafonoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + nTonyNextTalkType = Tony->TALK_CONMEGAFONOSTATIC; bStaticTalk = true; - Tony->StartStatic(Tony->TALK_CONMEGAFONOSTATIC); + CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONMEGAFONOSTATIC); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyConMegafonoEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->EndStatic(Tony->TALK_CONMEGAFONOSTATIC); + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONMEGAFONOSTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyConBarbaStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + nTonyNextTalkType = Tony->TALK_CONBARBASTATIC; bStaticTalk = true; - Tony->StartStatic(Tony->TALK_CONBARBASTATIC); + CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONBARBASTATIC); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyConBarbaEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->EndStatic(Tony->TALK_CONBARBASTATIC); + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONBARBASTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonySpaventatoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + nTonyNextTalkType = Tony->TALK_SPAVENTATOSTATIC; bStaticTalk = true; - Tony->StartStatic(Tony->TALK_SPAVENTATOSTATIC); + CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_SPAVENTATOSTATIC); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonySpaventatoEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->EndStatic(Tony->TALK_SPAVENTATOSTATIC); + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_SPAVENTATOSTATIC); bStaticTalk = false; nTonyNextTalkType = Tony->TALK_NORMAL; -} + CORO_END_CODE; +} DECLARE_CUSTOM_FUNCTION(TonySchifato)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { @@ -1060,7 +1224,7 @@ DECLARE_CUSTOM_FUNCTION(TonySniffaLeft)(CORO_PARAM, uint32, uint32, uint32, uint CORO_BEGIN_CODE(_ctx); Tony->SetPattern(Tony->PAT_SNIFFA_LEFT); - Tony->WaitForEndPattern(); + CORO_INVOKE_0(Tony->WaitForEndPattern); CORO_INVOKE_4(LeftToMe, 0, 0, 0, 0); CORO_END_CODE; @@ -1073,7 +1237,7 @@ DECLARE_CUSTOM_FUNCTION(TonySniffaRight)(CORO_PARAM, uint32, uint32, uint32, uin CORO_BEGIN_CODE(_ctx); Tony->SetPattern(Tony->PAT_SNIFFA_RIGHT); - Tony->WaitForEndPattern(); + CORO_INVOKE_0(Tony->WaitForEndPattern); CORO_INVOKE_4(RightToMe, 0, 0, 0, 0); CORO_END_CODE; @@ -1126,10 +1290,18 @@ DECLARE_CUSTOM_FUNCTION(DisableTony)(CORO_PARAM, uint32 bShowOmbra, uint32, uint } DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uint32, uint32) { - RMItem *item = Loc->GetItemFromCode(nItem); + CORO_BEGIN_CONTEXT; + RMItem *item; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + _ctx->item = Loc->GetItemFromCode(nItem); - if (!bSkipIdle && item != NULL) - item->WaitForEndPattern(hSkipIdle); + if (!bSkipIdle && _ctx->item != NULL) + CORO_INVOKE_1(_ctx->item->WaitForEndPattern, hSkipIdle); + + CORO_END_CODE; } @@ -1383,106 +1555,119 @@ DECLARE_CUSTOM_FUNCTION(CharSetStartEndTalkPattern)(CORO_PARAM, uint32 nChar, ui } DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32) { - RMMessage msg(dwMessage); - int i; - RMPoint pt; - RMTextDialog *text; - int curOffset = 0; + CORO_BEGIN_CONTEXT; + RMMessage *msg; + int i; + RMPoint pt; + RMTextDialog *text; + int curOffset; + VoiceHeader *curVoc; + FPSFX *voice; + CORO_END_CONTEXT(_ctx); - assert(nChar<16); - pt=Character[nChar].item->CalculatePos()-RMPoint(-60,20)-Loc->ScrollPosition(); + CORO_BEGIN_CODE(_ctx); + + _ctx->msg = new RMMessage(dwMessage); + _ctx->curOffset = 0; + + assert(nChar < 16); + _ctx->pt = Character[nChar].item->CalculatePos() - RMPoint(-60, 20) - Loc->ScrollPosition(); if (Character[nChar].starttalkpattern != 0) { Freeze(); Character[nChar].item->SetPattern(Character[nChar].starttalkpattern); Unfreeze(); - Character[nChar].item->WaitForEndPattern(); + + CORO_INVOKE_0(Character[nChar].item->WaitForEndPattern); } Freeze(); Character[nChar].item->SetPattern(Character[nChar].talkpattern); Unfreeze(); - VoiceHeader *curVoc = SearchVoiceHeader(0, dwMessage); - FPSFX *voice = NULL; - if (curVoc) { + _ctx->curVoc = SearchVoiceHeader(0, dwMessage); + _ctx->voice = NULL; + if (_ctx->curVoc) { // Si posiziona all'interno del database delle voci all'inizio della prima -// fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); +// fseek(_vm->m_vdbFP, _ctx->curVoc->offset, SEEK_SET); g_system->lockMutex(vdb); - _vm->_vdbFP.seek(curVoc->offset); - curOffset = curVoc->offset; + _vm->_vdbFP.seek(_ctx->curVoc->offset); + _ctx->curOffset = _ctx->curVoc->offset; g_system->unlockMutex(vdb); } - for (i = 0; ii = 0; _ctx->i<_ctx->msg->NumPeriods() && !bSkipIdle; _ctx->i++) { if (bIsBack) { - curBackText = text = new RMTextDialogScrolling(Loc); + curBackText = _ctx->text = new RMTextDialogScrolling(Loc); if (bTonyIsSpeaking) curBackText->Hide(); } else - text = new RMTextDialog; + _ctx->text = new RMTextDialog; - text->SetInput(Input); + _ctx->text->SetInput(Input); // Skipping - text->SetSkipStatus(!bIsBack); + _ctx->text->SetSkipStatus(!bIsBack); // Allineamento - text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); + _ctx->text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); // Colore - text->SetColor(Character[nChar].r,Character[nChar].g,Character[nChar].b); + _ctx->text->SetColor(Character[nChar].r,Character[nChar].g,Character[nChar].b); // Scrive il testo - text->WriteText(msg[i],0); + _ctx->text->WriteText((*_ctx->msg)[_ctx->i],0); // Setta la posizione - text->SetPosition(pt); + _ctx->text->SetPosition(_ctx->pt); // Setta l'always display - if (bAlwaysDisplay) { text->SetAlwaysDisplay(); text->ForceTime(); } + if (bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } // Registra il testo - LinkGraphicTask(text); + LinkGraphicTask(_ctx->text); - if (curVoc) { + if (_ctx->curVoc) { g_system->lockMutex(vdb); - _vm->_theSound.CreateSfx(&voice); - _vm->_vdbFP.seek(curOffset); - voice->LoadVoiceFromVDB(_vm->_vdbFP); - voice->SetLoop(false); - if (bIsBack) voice->SetVolume(55); - voice->Play(); - text->SetCustomSkipHandle2(voice->hEndOfBuffer); - curOffset = _vm->_vdbFP.pos(); + _vm->_theSound.CreateSfx(&_ctx->voice); + _vm->_vdbFP.seek(_ctx->curOffset); + _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); + _ctx->voice->SetLoop(false); + if (bIsBack) _ctx->voice->SetVolume(55); + _ctx->voice->Play(); + _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->curOffset = _vm->_vdbFP.pos(); g_system->unlockMutex(vdb); } // Aspetta la fine della visualizzazione - text->SetCustomSkipHandle(hSkipIdle); - text->WaitForEndDisplay(); + _ctx->text->SetCustomSkipHandle(hSkipIdle); + _ctx->text->WaitForEndDisplay(); - if (curVoc) { - voice->Stop(); - voice->Release(); - voice=NULL; + if (_ctx->curVoc) { + _ctx->voice->Stop(); + _ctx->voice->Release(); + _ctx->voice=NULL; } curBackText=NULL; - delete text; + delete _ctx->text; } if (Character[nChar].endtalkpattern != 0) { Freeze(); Character[nChar].item->SetPattern(Character[nChar].endtalkpattern); Unfreeze(); - Character[nChar].item->WaitForEndPattern(); + CORO_INVOKE_0(Character[nChar].item->WaitForEndPattern); } Freeze(); Character[nChar].item->SetPattern(Character[nChar].standpattern); Unfreeze(); + delete _ctx->msg; + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(AddInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { @@ -1698,97 +1883,104 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes int curDialog; DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg, uint32, uint32) { - LPSTR string; - RMTextDialog *text; - int parm; - HANDLE h; - bool bIsBack = false; + CORO_BEGIN_CONTEXT; + LPSTR string; + RMTextDialog *text; + int parm; + HANDLE h; + bool bIsBack; + VoiceHeader *curVoc; + FPSFX *voice; + RMPoint pt; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + _ctx->bIsBack = false; // La SendDialogMessage può andare in background se è un personaggio in MCHAR settato // con la SetAlwaysBack if (nPers != 0 && IsMChar[nPers] && MCharacter[nPers].bAlwaysBack) - bIsBack = true; + _ctx->bIsBack = true; - VoiceHeader *curVoc = SearchVoiceHeader(curDialog, nMsg); - FPSFX *voice = NULL; + _ctx->curVoc = SearchVoiceHeader(curDialog, nMsg); + _ctx->voice = NULL; - if (curVoc) { + if (_ctx->curVoc) { // Si posiziona all'interno del database delle voci all'inizio della prima g_system->lockMutex(vdb); -// fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); - _vm->_vdbFP.seek(curVoc->offset); - _vm->_theSound.CreateSfx(&voice); - voice->LoadVoiceFromVDB(_vm->_vdbFP); - voice->SetLoop(false); - if (bIsBack) voice->SetVolume(55); +// fseek(_vm->m_vdbFP, _ctx->curVoc->offset, SEEK_SET); + _vm->_vdbFP.seek(_ctx->curVoc->offset); + _vm->_theSound.CreateSfx(&_ctx->voice); + _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); + _ctx->voice->SetLoop(false); + if (_ctx->bIsBack) _ctx->voice->SetVolume(55); g_system->unlockMutex(vdb); } - string = mpalQueryDialogPeriod(nMsg); + _ctx->string = mpalQueryDialogPeriod(nMsg); if (nPers == 0) { - text = new RMTextDialog; - text->SetColor(0,255,0); - text->SetPosition(Tony->Position()-RMPoint(0,130)-Loc->ScrollPosition()); - text->WriteText(string,0); + _ctx->text = new RMTextDialog; + _ctx->text->SetColor(0,255,0); + _ctx->text->SetPosition(Tony->Position()-RMPoint(0,130)-Loc->ScrollPosition()); + _ctx->text->WriteText(_ctx->string,0); if (dwTonyNumTexts > 0) { if (!bTonyInTexts) { if (nTonyNextTalkType != Tony->TALK_NORMAL) { - Tony->StartTalk(nTonyNextTalkType); + CORO_INVOKE_1(Tony->StartTalk, nTonyNextTalkType); if (!bStaticTalk) nTonyNextTalkType = Tony->TALK_NORMAL; } else - Tony->StartTalk(Tony->TALK_NORMAL); + CORO_INVOKE_1(Tony->StartTalk, Tony->TALK_NORMAL); bTonyInTexts = true; } dwTonyNumTexts--; } else { - Tony->StartTalk(nTonyNextTalkType); + CORO_INVOKE_1(Tony->StartTalk, nTonyNextTalkType); if (!bStaticTalk) nTonyNextTalkType = Tony->TALK_NORMAL; } } else if (!IsMChar[nPers]) { - RMPoint pt; - - text = new RMTextDialog; + _ctx->text = new RMTextDialog; - pt=Character[nPers].item->CalculatePos()-RMPoint(-60,20)-Loc->ScrollPosition(); + _ctx->pt = Character[nPers].item->CalculatePos() - RMPoint(-60, 20) - Loc->ScrollPosition(); if (Character[nPers].starttalkpattern != 0) { Freeze(); Character[nPers].item->SetPattern(Character[nPers].starttalkpattern); Unfreeze(); - Character[nPers].item->WaitForEndPattern(); + CORO_INVOKE_0(Character[nPers].item->WaitForEndPattern); } Character[nPers].item->SetPattern(Character[nPers].talkpattern); - text->SetColor(Character[nPers].r,Character[nPers].g,Character[nPers].b); - text->WriteText(string,0); - text->SetPosition(pt); + _ctx->text->SetColor(Character[nPers].r, Character[nPers].g,Character[nPers].b); + _ctx->text->WriteText(_ctx->string, 0); + _ctx->text->SetPosition(_ctx->pt); } else { RMPoint pt; - if (MCharacter[nPers].x==-1) - pt=MCharacter[nPers].item->CalculatePos()-RMPoint(-60,20)-Loc->ScrollPosition(); + if (MCharacter[nPers].x == -1) + pt = MCharacter[nPers].item->CalculatePos() - RMPoint(-60, 20) - Loc->ScrollPosition(); else - pt=RMPoint(MCharacter[nPers].x,MCharacter[nPers].y); + pt = RMPoint(MCharacter[nPers].x, MCharacter[nPers].y); // Parametro per le azioni speciali: random tra le parlate - parm = (MCharacter[nPers].curgroup * 10) + _vm->_randomSource.getRandomNumber( + _ctx->parm = (MCharacter[nPers].curgroup * 10) + _vm->_randomSource.getRandomNumber( MCharacter[nPers].numtalks[MCharacter[nPers].curgroup] - 1) + 1; if (MCharacter[nPers].numtexts != 0 && MCharacter[nPers].bInTexts) { MCharacter[nPers].numtexts--; } else { // Cerca di eseguire la funzione custom per inizializzare la parlata - h = mpalQueryDoAction(30, MCharacter[nPers].item->MpalCode(), parm); - if (h != INVALID_HANDLE_VALUE) - WaitForSingleObject(h,INFINITE); + _ctx->h = mpalQueryDoAction(30, MCharacter[nPers].item->MpalCode(), _ctx->parm); + if (_ctx->h != INVALID_HANDLE_VALUE) + WaitForSingleObject(_ctx->h,INFINITE); - MCharacter[nPers].curTalk = parm; + MCharacter[nPers].curTalk = _ctx->parm; if (MCharacter[nPers].numtexts != 0) { MCharacter[nPers].bInTexts = true; @@ -1797,39 +1989,39 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg } if (MCharacter[nPers].bAlwaysBack) { - text = curBackText = new RMTextDialogScrolling(Loc); + _ctx->text = curBackText = new RMTextDialogScrolling(Loc); if (bTonyIsSpeaking) curBackText->Hide(); - bIsBack = true; + _ctx->bIsBack = true; } else - text = new RMTextDialog; + _ctx->text = new RMTextDialog; - text->SetSkipStatus(!MCharacter[nPers].bAlwaysBack); - text->SetColor(MCharacter[nPers].r,MCharacter[nPers].g,MCharacter[nPers].b); - text->WriteText(string,0); - text->SetPosition(pt); + _ctx->text->SetSkipStatus(!MCharacter[nPers].bAlwaysBack); + _ctx->text->SetColor(MCharacter[nPers].r,MCharacter[nPers].g,MCharacter[nPers].b); + _ctx->text->WriteText(_ctx->string,0); + _ctx->text->SetPosition(pt); } if (!bSkipIdle) { - text->SetInput(Input); - if (bAlwaysDisplay) { text->SetAlwaysDisplay(); text->ForceTime(); } - text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); - LinkGraphicTask(text); - - if (curVoc) { - voice->Play(); - text->SetCustomSkipHandle2(voice->hEndOfBuffer); + _ctx->text->SetInput(Input); + if (bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } + _ctx->text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); + LinkGraphicTask(_ctx->text); + + if (_ctx->curVoc) { + _ctx->voice->Play(); + _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } // Aspetta la fine della visualizzazione - text->SetCustomSkipHandle(hSkipIdle); - text->WaitForEndDisplay(); + _ctx->text->SetCustomSkipHandle(hSkipIdle); + _ctx->text->WaitForEndDisplay(); } - if (curVoc) { - voice->Stop(); - voice->Release(); - voice=NULL; + if (_ctx->curVoc) { + _ctx->voice->Stop(); + _ctx->voice->Release(); + _ctx->voice=NULL; } if (nPers != 0) { @@ -1838,37 +2030,39 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg Freeze(); Character[nPers].item->SetPattern(Character[nPers].endtalkpattern); Unfreeze(); - Character[nPers].item->WaitForEndPattern(); + CORO_INVOKE_0(Character[nPers].item->WaitForEndPattern); } Character[nPers].item->SetPattern(Character[nPers].standpattern); - delete text; + delete _ctx->text; } else { if ((MCharacter[nPers].bInTexts && MCharacter[nPers].numtexts== 0) || !MCharacter[nPers].bInTexts) { // Cerca di eseguire la funzione custom per chiudere la parlata MCharacter[nPers].curTalk = (MCharacter[nPers].curTalk%10) + MCharacter[nPers].curgroup*10; - h = mpalQueryDoAction(31,MCharacter[nPers].item->MpalCode(),MCharacter[nPers].curTalk); - if (h!=INVALID_HANDLE_VALUE) - WaitForSingleObject(h,INFINITE); + _ctx->h = mpalQueryDoAction(31,MCharacter[nPers].item->MpalCode(),MCharacter[nPers].curTalk); + if (_ctx->h!=INVALID_HANDLE_VALUE) + WaitForSingleObject(_ctx->h,INFINITE); MCharacter[nPers].bInTexts = false; MCharacter[nPers].numtexts = 0; } curBackText = NULL; - delete text; + delete _ctx->text; } } else { if ((dwTonyNumTexts== 0 && bTonyInTexts) || !bTonyInTexts) { - Tony->EndTalk(); + CORO_INVOKE_0(Tony->EndTalk); dwTonyNumTexts = 0; bTonyInTexts = false; } - delete text; + delete _ctx->text; } - GlobalFree(string); + GlobalFree(_ctx->string); + + CORO_END_CODE; } -- cgit v1.2.3 From a254f100253bda1b23f280226b7b4d909206d49c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 8 May 2012 09:32:21 +1000 Subject: TONY: Added support for Windows-style threading events to scheduler --- engines/tony/custom.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 800b5d8d50..18a92899df 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1310,10 +1310,17 @@ DECLARE_CUSTOM_FUNCTION(SetTonyPosition)(CORO_PARAM, uint32 nX, uint32 nY, uint3 } DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + Tony->Move(RMPoint(nX, nY)); if (!bSkipIdle) - Tony->WaitForEndMovement(); + CORO_INVOKE_0(Tony->WaitForEndMovement); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(MoveTony)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) { -- cgit v1.2.3 From 26898dd7ad399a641f63eabf04aa2d839f8508fc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 9 May 2012 00:42:27 +1000 Subject: TONY: Completed bulk of initial coro refactoring --- engines/tony/custom.cpp | 622 ++++++++++++++++++++++++++++-------------------- 1 file changed, 360 insertions(+), 262 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 18a92899df..9d46d7e6b7 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -56,6 +56,7 @@ #include "tony/font.h" #include "tony/game.h" #include "tony/gfxcore.h" +#include "tony/sched.h" #include "tony/tony.h" #include "tony/tonychar.h" #include "tony/utils.h" @@ -76,9 +77,9 @@ void (*UnloadLocation)(CORO_PARAM, bool bDoOnExit, HANDLE *result); void (*LinkGraphicTask)(RMGfxTask *task); void (*Freeze)(void); void (*Unfreeze)(void); -void (*WaitFrame)(void); +void (*WaitFrame)(CORO_PARAM); void (*PlayMusic)(int nChannel, const char *fileName, int nFX, bool bLoop, int nSync); -void (*WaitWipeEnd)(void); +void (*WaitWipeEnd)(CORO_PARAM); void (*CloseWipe)(void); void (*InitWipe)(int type); void (*EnableGUI)(void); @@ -96,7 +97,7 @@ OSystem::MutexRef vdb; HANDLE mut[10]; bool bSkipIdle = false; -HANDLE hSkipIdle; +uint32 hSkipIdle; int lastMusic = 0, lastTappeto = 0; @@ -319,8 +320,16 @@ DECLARE_CUSTOM_FUNCTION(TonySetPalesati)(CORO_PARAM, uint32 bStatus, uint32, uin } DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint32) { - if (bSkipIdle) return; - Sleep(dwTime); + CORO_BEGIN_CONTEXT; + int i; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + if (!bSkipIdle) + CORO_INVOKE_1(g_scheduler->sleep, dwTime); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(SetAlwaysDisplay)(CORO_PARAM, uint32 val, uint32, uint32, uint32) { @@ -376,6 +385,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX int curOffset; VoiceHeader *curVoc; FPSFX *voice; + RMTextDialog text; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -422,39 +432,38 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX } if (curBackText) - curBackText->Hide(); + CORO_INVOKE_0(curBackText->Hide); + bTonyIsSpeaking = true; for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !bSkipIdle; _ctx->i++) { - RMTextDialog text; - - text.SetInput(Input); + _ctx->text.SetInput(Input); // Allineamento - text.SetAlignType(RMText::HCENTER,RMText::VBOTTOM); + _ctx->text.SetAlignType(RMText::HCENTER,RMText::VBOTTOM); // Colore - text.SetColor(0,255,0); + _ctx->text.SetColor(0,255,0); // Scrive il testo - text.WriteText((*_ctx->msg)[_ctx->i],0); + _ctx->text.WriteText((*_ctx->msg)[_ctx->i],0); // Setta la posizione if (nX == 0 && nY == 0) - text.SetPosition(Tony->Position() - RMPoint(0, 130) - Loc->ScrollPosition()); + _ctx->text.SetPosition(Tony->Position() - RMPoint(0, 130) - Loc->ScrollPosition()); else - text.SetPosition(RMPoint(nX, nY) - Loc->ScrollPosition()); + _ctx->text.SetPosition(RMPoint(nX, nY) - Loc->ScrollPosition()); // Setta l'always display - if (bAlwaysDisplay) { text.SetAlwaysDisplay(); text.ForceTime(); } + if (bAlwaysDisplay) { _ctx->text.SetAlwaysDisplay(); _ctx->text.ForceTime(); } // Registra il testo - LinkGraphicTask(&text); + LinkGraphicTask(&_ctx->text); if (_ctx->curVoc) { if (_ctx->i == 0) { _ctx->voice->Play(); - text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } else { g_system->lockMutex(vdb); // fseek(_vm->m_vdbFP, _ctx->curOffset, SEEK_SET); @@ -465,14 +474,14 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->curOffset = _vm->_vdbFP.pos(); _ctx->voice->SetLoop(false); _ctx->voice->Play(); - text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); g_system->unlockMutex(vdb); } } // Aspetta la fine della visualizzazione - text.SetCustomSkipHandle(hSkipIdle); - text.WaitForEndDisplay(); + _ctx->text.SetCustomSkipHandle(hSkipIdle); + CORO_INVOKE_0(_ctx->text.WaitForEndDisplay); if (_ctx->curVoc) { _ctx->voice->Stop(); @@ -497,7 +506,11 @@ DECLARE_CUSTOM_FUNCTION(ChangeBoxStatus)(CORO_PARAM, uint32 nLoc, uint32 nBox, u DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { - HANDLE h; + CORO_BEGIN_CONTEXT; + uint32 h; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); Freeze(); @@ -508,11 +521,13 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, ui LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); Unfreeze(); - h = mpalQueryDoAction(0, nLoc, 0); + _ctx->h = mpalQueryDoActionU32(0, nLoc, 0); // On Enter? - if (h != INVALID_HANDLE_VALUE) - WaitForSingleObject(h, INFINITE); + if (_ctx->h != INVALID_PID_VALUE) + CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); + + CORO_END_CODE; } @@ -524,6 +539,7 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 RMMessage *msg; RMGfxClearTask clear; int i; + RMTextDialog text; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -541,38 +557,36 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 Unfreeze(); for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !bSkipIdle; _ctx->i++) { - RMTextDialog text; - - text.SetInput(Input); + _ctx->text.SetInput(Input); // Allineamento - text.SetAlignType(RMText::HCENTER,RMText::VCENTER); + _ctx->text.SetAlignType(RMText::HCENTER,RMText::VCENTER); // Forza il testo a scomparire a tempo - text.ForceTime(); + _ctx->text.ForceTime(); // Colore - text.SetColor(255,255,255); + _ctx->text.SetColor(255,255,255); // Scrive il testo if (nFont == 0) - text.WriteText((*_ctx->msg)[_ctx->i], 1); + _ctx->text.WriteText((*_ctx->msg)[_ctx->i], 1); else if (nFont == 1) - text.WriteText((*_ctx->msg)[_ctx->i], 0); + _ctx->text.WriteText((*_ctx->msg)[_ctx->i], 0); // Setta la posizione - text.SetPosition(RMPoint(320, 240)); + _ctx->text.SetPosition(RMPoint(320, 240)); - text.SetAlwaysDisplay(); - text.ForceTime(); + _ctx->text.SetAlwaysDisplay(); + _ctx->text.ForceTime(); // Registra il testo LinkGraphicTask(&_ctx->clear); - LinkGraphicTask(&text); + LinkGraphicTask(&_ctx->text); // Aspetta la fine della visualizzazione - text.SetCustomSkipHandle(hSkipIdle); - text.WaitForEndDisplay(); + _ctx->text.SetCustomSkipHandle(hSkipIdle); + CORO_INVOKE_0(_ctx->text.WaitForEndDisplay); } delete _ctx->msg; @@ -581,10 +595,18 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 } DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) { - RMGfxClearTask clear; + CORO_BEGIN_CONTEXT; + char buf[256]; + RMGfxClearTask clear; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + LinkGraphicTask(&_ctx->clear); + + CORO_INVOKE_0(WaitFrame); - LinkGraphicTask(&clear); - WaitFrame(); + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) { @@ -625,7 +647,7 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 if (!bNoOcchioDiBue) { InitWipe(1); - WaitWipeEnd(); + CORO_INVOKE_0(WaitWipeEnd); } _vm->StopMusic(4); @@ -640,14 +662,14 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { CORO_BEGIN_CONTEXT; - HANDLE h; + uint32 h; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); if (!bNoOcchioDiBue) { InitWipe(1); - WaitWipeEnd(); + CORO_INVOKE_0(WaitWipeEnd); } if (lastTappeto != tappeti[nLoc]) { @@ -676,18 +698,18 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint Unfreeze(); - _ctx->h = mpalQueryDoAction(0, nLoc, 0); + _ctx->h = mpalQueryDoActionU32(0, nLoc, 0); if (!bNoOcchioDiBue) { - WaitWipeEnd(); + CORO_INVOKE_0(WaitWipeEnd); CloseWipe(); } bNoOcchioDiBue = false; // On Enter? - if (_ctx->h != INVALID_HANDLE_VALUE) - WaitForSingleObject(_ctx->h, INFINITE); + if (_ctx->h != INVALID_PID_VALUE) + CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); CORO_END_CODE; } @@ -725,7 +747,7 @@ DECLARE_CUSTOM_FUNCTION(EnableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) } DECLARE_CUSTOM_FUNCTION(StopTony)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->StopNoAction(); + Tony->StopNoAction(coroParam); } @@ -1328,114 +1350,123 @@ DECLARE_CUSTOM_FUNCTION(MoveTony)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint } DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) { - int lx, ly; - RMPoint pt; + CORO_BEGIN_CONTEXT; + int lx, ly; + RMPoint pt; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); // Prende le coordinate di quanto scrollare - lx=*((int*)&nX); - ly=*((int*)&nY); + _ctx->lx = (int32)nX; + _ctx->ly = (int32)nY; - pt=Loc->ScrollPosition(); + _ctx->pt = Loc->ScrollPosition(); - while ((lx != 0 || ly != 0) && !bSkipIdle) { - if (lx > 0) { - lx -= (int32)sX; if (lx < 0) lx = 0; - pt.Offset((int32)sX, 0); - } else if (lx < 0) { - lx += (int32)sX; if (lx > 0) lx = 0; - pt.Offset(-(int32)sX, 0); + while ((_ctx->lx != 0 || _ctx->ly != 0) && !bSkipIdle) { + if (_ctx->lx > 0) { + _ctx->lx -= (int32)sX; if (_ctx->lx < 0) _ctx->lx = 0; + _ctx->pt.Offset((int32)sX, 0); + } else if (_ctx->lx < 0) { + _ctx->lx += (int32)sX; if (_ctx->lx > 0) _ctx->lx = 0; + _ctx->pt.Offset(-(int32)sX, 0); } - if (ly > 0) { - ly -= sY; if (ly < 0) ly = 0; - pt.Offset(0, sY); - } else if (ly < 0) { - ly += sY; if (ly > 0) ly = 0; - pt.Offset(0, -(int32)sY); + if (_ctx->ly > 0) { + _ctx->ly -= sY; if (_ctx->ly < 0) _ctx->ly = 0; + _ctx->pt.Offset(0, sY); + } else if (_ctx->ly < 0) { + _ctx->ly += sY; if (_ctx->ly > 0) _ctx->ly = 0; + _ctx->pt.Offset(0, -(int32)sY); } - WaitFrame(); + CORO_INVOKE_0(WaitFrame); Freeze(); - Loc->SetScrollPosition(pt); - Tony->SetScrollPosition(pt); + Loc->SetScrollPosition(_ctx->pt); + Tony->SetScrollPosition(_ctx->pt); Unfreeze(); - } + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) { - int lx, ly; - RMPoint pt, startpt; - uint32 dwStartTime, dwCurTime, dwTotalTime; - uint32 stepX, stepY; - int dimx, dimy; + CORO_BEGIN_CONTEXT; + int lx, ly; + RMPoint pt, startpt; + uint32 dwStartTime, dwCurTime, dwTotalTime; + uint32 stepX, stepY; + int dimx, dimy; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); // Prende le coordinate di quanto scrollare - lx=*((int*)&nX); - ly=*((int*)&nY); - dimx = lx; - dimy = ly; - if (lx < 0) dimx = -lx; - if (ly < 0) dimy = -ly; + _ctx->lx=*((int*)&nX); + _ctx->ly=*((int*)&nY); + _ctx->dimx = _ctx->lx; + _ctx->dimy = _ctx->ly; + if (_ctx->lx < 0) _ctx->dimx = -_ctx->lx; + if (_ctx->ly < 0) _ctx->dimy = -_ctx->ly; - stepX = sX; - stepY = sY; + _ctx->stepX = sX; + _ctx->stepY = sY; - startpt = Loc->ScrollPosition(); + _ctx->startpt = Loc->ScrollPosition(); - dwStartTime = timeGetTime(); + _ctx->dwStartTime = _vm->GetTime(); if (sX) - dwTotalTime = dimx * (1000 / 35) / sX; + _ctx->dwTotalTime = _ctx->dimx * (1000 / 35) / sX; else - dwTotalTime = dimy * (1000 / 35) / sY; + _ctx->dwTotalTime = _ctx->dimy * (1000 / 35) / sY; - while ((lx != 0 || ly != 0) && !bSkipIdle) { - dwCurTime = _vm->GetTime() - dwStartTime; - if (dwCurTime>dwTotalTime) + while ((_ctx->lx != 0 || _ctx->ly != 0) && !bSkipIdle) { + _ctx->dwCurTime = _vm->GetTime() - _ctx->dwStartTime; + if (_ctx->dwCurTime > _ctx->dwTotalTime) break; - pt = startpt; + _ctx->pt = _ctx->startpt; if (sX) { - if (lx > 0) - pt.x += (dimx * dwCurTime) / dwTotalTime; + if (_ctx->lx > 0) + _ctx->pt.x += (_ctx->dimx * _ctx->dwCurTime) / _ctx->dwTotalTime; else - pt.x -= (dimx * dwCurTime) / dwTotalTime; + _ctx->pt.x -= (_ctx->dimx * _ctx->dwCurTime) / _ctx->dwTotalTime; } else { - if (ly > 0) - pt.y += (dimy*dwCurTime) / dwTotalTime; + if (_ctx->ly > 0) + _ctx->pt.y += (_ctx->dimy*_ctx->dwCurTime) / _ctx->dwTotalTime; else - pt.y -= (dimy*dwCurTime) / dwTotalTime; + _ctx->pt.y -= (_ctx->dimy*_ctx->dwCurTime) / _ctx->dwTotalTime; } /* - sX = stepX * (dwCurTime-dwLastTime) / (1000 / 35); - sY = stepY * (dwCurTime-dwLastTime) / (1000 / 35); - - if (lx > 0) { - lx-=sX; if (lx < 0) lx = 0; - pt.Offset(sX,0); - } else if (lx < 0) { - lx+=sX; if (lx > 0) lx = 0; - pt.Offset(-sX,0); + sX = _ctx->stepX * (_ctx->dwCurTime-dwLastTime) / (1000 / 35); + sY = _ctx->stepY * (_ctx->dwCurTime-dwLastTime) / (1000 / 35); + + if (_ctx->lx > 0) { + _ctx->lx-=sX; if (_ctx->lx < 0) _ctx->lx = 0; + _ctx->pt.Offset(sX,0); + } else if (_ctx->lx < 0) { + _ctx->lx+=sX; if (_ctx->lx > 0) _ctx->lx = 0; + _ctx->pt.Offset(-sX,0); } - if (ly > 0) { - ly-=sY; if (ly<0) ly = 0; - pt.Offset(0,sY); - } else if (ly<0) { - ly+=sY; if (ly > 0) ly = 0; - pt.Offset(0,-sY); + if (_ctx->ly > 0) { + _ctx->ly-=sY; if (_ctx->ly<0) _ctx->ly = 0; + _ctx->pt.Offset(0,sY); + } else if (_ctx->ly<0) { + _ctx->ly+=sY; if (_ctx->ly > 0) _ctx->ly = 0; + _ctx->pt.Offset(0,-sY); } */ - WaitFrame(); + CORO_INVOKE_0(WaitFrame); Freeze(); - Loc->SetScrollPosition(pt); - Tony->SetScrollPosition(pt); + Loc->SetScrollPosition(_ctx->pt); + Tony->SetScrollPosition(_ctx->pt); Unfreeze(); } @@ -1443,22 +1474,23 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui // Setta la posizione finale if (sX) { - if (lx > 0) - pt.x = startpt.x + dimx; + if (_ctx->lx > 0) + _ctx->pt.x = _ctx->startpt.x + _ctx->dimx; else - pt.x = startpt.x - dimx; + _ctx->pt.x = _ctx->startpt.x - _ctx->dimx; } else { - if (ly > 0) - pt.y = startpt.y + dimy; + if (_ctx->ly > 0) + _ctx->pt.y = _ctx->startpt.y + _ctx->dimy; else - pt.y = startpt.y - dimy; - + _ctx->pt.y = _ctx->startpt.y - _ctx->dimy; } Freeze(); - Loc->SetScrollPosition(pt); - Tony->SetScrollPosition(pt); + Loc->SetScrollPosition(_ctx->pt); + Tony->SetScrollPosition(_ctx->pt); Unfreeze(); + + CORO_END_CODE; } @@ -1484,7 +1516,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uin DECLARE_CUSTOM_FUNCTION(AutoSave)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->AutoSave(); + _vm->AutoSave(coroParam); } DECLARE_CUSTOM_FUNCTION(Abort)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -1492,33 +1524,41 @@ DECLARE_CUSTOM_FUNCTION(Abort)(CORO_PARAM, uint32, uint32, uint32, uint32) { } DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) { - uint32 i; - uint32 curTime = _vm->GetTime(); - int dirx,diry; + CORO_BEGIN_CONTEXT; + uint32 i; + uint32 curTime; + int dirx,diry; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + _ctx->curTime = _vm->GetTime(); - dirx = 1; - diry = 1; + _ctx->dirx = 1; + _ctx->diry = 1; - while (_vm->GetTime() < curTime + nScosse) { - WaitFrame(); + while (_vm->GetTime() < _ctx->curTime + nScosse) { + CORO_INVOKE_0(WaitFrame); Freeze(); - Loc->SetFixedScroll(RMPoint(1 * dirx, 1 * diry)); - Tony->SetFixedScroll(RMPoint(1 * dirx, 1 * diry)); + Loc->SetFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); + Tony->SetFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); Unfreeze(); - i = _vm->_randomSource.getRandomNumber(2); + _ctx->i = _vm->_randomSource.getRandomNumber(2); - if (i == 0 || i == 2) - dirx = -dirx; - else if (i == 1 || i == 2) - diry = -diry; + if (_ctx->i == 0 || _ctx->i == 2) + _ctx->dirx = -_ctx->dirx; + else if (_ctx->i == 1 || _ctx->i == 2) + _ctx->diry = -_ctx->diry; } Freeze(); Loc->SetFixedScroll(RMPoint(0, 0)); Tony->SetFixedScroll(RMPoint(0, 0)); Unfreeze(); + + CORO_END_CODE; } @@ -1607,7 +1647,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess if (bIsBack) { curBackText = _ctx->text = new RMTextDialogScrolling(Loc); if (bTonyIsSpeaking) - curBackText->Hide(); + CORO_INVOKE_0(curBackText->Hide); } else _ctx->text = new RMTextDialog; @@ -1649,7 +1689,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess // Aspetta la fine della visualizzazione _ctx->text->SetCustomSkipHandle(hSkipIdle); - _ctx->text->WaitForEndDisplay(); + CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); if (_ctx->curVoc) { _ctx->voice->Stop(); @@ -1769,13 +1809,22 @@ DECLARE_CUSTOM_FUNCTION(MCharSetAlwaysBack)(CORO_PARAM, uint32 nChar, uint32 bAl DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32 nFont) { - RMMessage msg(dwMessage); - int i; - int parm; - RMPoint pt; - HANDLE h; - RMTextDialog *text; - int curOffset = 0; + CORO_BEGIN_CONTEXT; + RMMessage *msg; + int i; + int parm; + RMPoint pt; + uint32 h; + RMTextDialog *text; + int curOffset; + VoiceHeader *curVoc; + FPSFX *voice; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + _ctx->msg = new RMMessage(dwMessage); + _ctx->curOffset = 0; assert(nChar < 10); @@ -1783,99 +1832,103 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes // Calcola la posizione del testo in base al frame corrente if (MCharacter[nChar].x==-1) - pt=MCharacter[nChar].item->CalculatePos()-RMPoint(-60,20)-Loc->ScrollPosition(); + _ctx->pt=MCharacter[nChar].item->CalculatePos()-RMPoint(-60,20)-Loc->ScrollPosition(); else - pt=RMPoint(MCharacter[nChar].x,MCharacter[nChar].y); + _ctx->pt=RMPoint(MCharacter[nChar].x,MCharacter[nChar].y); // Parametro per le azioni speciali: random tra le parlate - parm = (MCharacter[nChar].curgroup * 10) + _vm->_randomSource.getRandomNumber( + _ctx->parm = (MCharacter[nChar].curgroup * 10) + _vm->_randomSource.getRandomNumber( MCharacter[nChar].numtalks[MCharacter[nChar].curgroup] - 1) + 1; // Cerca di eseguire la funzione custom per inizializzare la parlata if (MCharacter[nChar].item) { - h = mpalQueryDoAction(30,MCharacter[nChar].item->MpalCode(), parm); - if (h != INVALID_HANDLE_VALUE) - WaitForSingleObject(h,INFINITE); + _ctx->h = mpalQueryDoActionU32(30, MCharacter[nChar].item->MpalCode(), _ctx->parm); + if (_ctx->h != INVALID_PID_VALUE) { + CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); + } } - VoiceHeader *curVoc = SearchVoiceHeader(0, dwMessage); - FPSFX *voice = NULL; - if (curVoc) { + _ctx->curVoc = SearchVoiceHeader(0, dwMessage); + _ctx->voice = NULL; + if (_ctx->curVoc) { // Si posiziona all'interno del database delle voci all'inizio della prima g_system->lockMutex(vdb); // fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); - _vm->_vdbFP.seek(curVoc->offset); - curOffset = curVoc->offset; + _vm->_vdbFP.seek(_ctx->curVoc->offset); + _ctx->curOffset = _ctx->curVoc->offset; g_system->unlockMutex(vdb); } - for (i = 0; i < msg.NumPeriods() && !bSkipIdle; i++) { + for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !bSkipIdle; _ctx->i++) { // Crea l'oggetto diverso se è back o no if (bIsBack) { - curBackText=text = new RMTextDialogScrolling(Loc); + curBackText=_ctx->text = new RMTextDialogScrolling(Loc); if (bTonyIsSpeaking) - curBackText->Hide(); + CORO_INVOKE_0(curBackText->Hide); } else - text = new RMTextDialog; + _ctx->text = new RMTextDialog; - text->SetInput(Input); + _ctx->text->SetInput(Input); // Skipping - text->SetSkipStatus(!bIsBack); + _ctx->text->SetSkipStatus(!bIsBack); // Allineamento - text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); + _ctx->text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); // Colore - text->SetColor(MCharacter[nChar].r,MCharacter[nChar].g,MCharacter[nChar].b); + _ctx->text->SetColor(MCharacter[nChar].r,MCharacter[nChar].g,MCharacter[nChar].b); // Scrive il testo - text->WriteText(msg[i],nFont); + _ctx->text->WriteText((*_ctx->msg)[_ctx->i], nFont); // Setta la posizione - text->SetPosition(pt); + _ctx->text->SetPosition(_ctx->pt); // Setta l'always display - if (bAlwaysDisplay) { text->SetAlwaysDisplay(); text->ForceTime(); } + if (bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } // Registra il testo - LinkGraphicTask(text); + LinkGraphicTask(_ctx->text); - if (curVoc) { + if (_ctx->curVoc) { g_system->lockMutex(vdb); - _vm->_theSound.CreateSfx(&voice); - _vm->_vdbFP.seek(curOffset); - voice->LoadVoiceFromVDB(_vm->_vdbFP); - voice->SetLoop(false); - if (bIsBack) voice->SetVolume(55); - voice->Play(); - text->SetCustomSkipHandle2(voice->hEndOfBuffer); - curOffset = _vm->_vdbFP.pos(); + _vm->_theSound.CreateSfx(&_ctx->voice); + _vm->_vdbFP.seek(_ctx->curOffset); + _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); + _ctx->voice->SetLoop(false); + if (bIsBack) _ctx->voice->SetVolume(55); + _ctx->voice->Play(); + _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->curOffset = _vm->_vdbFP.pos(); g_system->unlockMutex(vdb); } // Aspetta la fine della visualizzazione - text->SetCustomSkipHandle(hSkipIdle); - text->WaitForEndDisplay(); + _ctx->text->SetCustomSkipHandle(hSkipIdle); + CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); - if (curVoc) { - voice->Stop(); - voice->Release(); - voice=NULL; + if (_ctx->curVoc) { + _ctx->voice->Stop(); + _ctx->voice->Release(); + _ctx->voice = NULL; } - curBackText=NULL; - delete text; + curBackText = NULL; + delete _ctx->text; + delete _ctx->msg; } // Cerca di eseguire la funzione custom per chiudere la parlata if (MCharacter[nChar].item) { - h = mpalQueryDoAction(31,MCharacter[nChar].item->MpalCode(),parm); - if (h!=INVALID_HANDLE_VALUE) - WaitForSingleObject(h,INFINITE); + _ctx->h = mpalQueryDoActionU32(31, MCharacter[nChar].item->MpalCode(), _ctx->parm); + if (_ctx->h != INVALID_PID_VALUE) + CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); } + + CORO_END_CODE; } @@ -1894,7 +1947,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg LPSTR string; RMTextDialog *text; int parm; - HANDLE h; + uint32 h; bool bIsBack; VoiceHeader *curVoc; FPSFX *voice; @@ -1968,12 +2021,10 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->text->WriteText(_ctx->string, 0); _ctx->text->SetPosition(_ctx->pt); } else { - RMPoint pt; - if (MCharacter[nPers].x == -1) - pt = MCharacter[nPers].item->CalculatePos() - RMPoint(-60, 20) - Loc->ScrollPosition(); + _ctx->pt = MCharacter[nPers].item->CalculatePos() - RMPoint(-60, 20) - Loc->ScrollPosition(); else - pt = RMPoint(MCharacter[nPers].x, MCharacter[nPers].y); + _ctx->pt = RMPoint(MCharacter[nPers].x, MCharacter[nPers].y); // Parametro per le azioni speciali: random tra le parlate _ctx->parm = (MCharacter[nPers].curgroup * 10) + _vm->_randomSource.getRandomNumber( @@ -1983,9 +2034,9 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg MCharacter[nPers].numtexts--; } else { // Cerca di eseguire la funzione custom per inizializzare la parlata - _ctx->h = mpalQueryDoAction(30, MCharacter[nPers].item->MpalCode(), _ctx->parm); - if (_ctx->h != INVALID_HANDLE_VALUE) - WaitForSingleObject(_ctx->h,INFINITE); + _ctx->h = mpalQueryDoActionU32(30, MCharacter[nPers].item->MpalCode(), _ctx->parm); + if (_ctx->h != INVALID_PID_VALUE) + CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); MCharacter[nPers].curTalk = _ctx->parm; @@ -1998,7 +2049,8 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (MCharacter[nPers].bAlwaysBack) { _ctx->text = curBackText = new RMTextDialogScrolling(Loc); if (bTonyIsSpeaking) - curBackText->Hide(); + CORO_INVOKE_0(curBackText->Hide); + _ctx->bIsBack = true; } else _ctx->text = new RMTextDialog; @@ -2006,7 +2058,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->text->SetSkipStatus(!MCharacter[nPers].bAlwaysBack); _ctx->text->SetColor(MCharacter[nPers].r,MCharacter[nPers].g,MCharacter[nPers].b); _ctx->text->WriteText(_ctx->string,0); - _ctx->text->SetPosition(pt); + _ctx->text->SetPosition(_ctx->pt); } if (!bSkipIdle) { @@ -2022,7 +2074,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg // Aspetta la fine della visualizzazione _ctx->text->SetCustomSkipHandle(hSkipIdle); - _ctx->text->WaitForEndDisplay(); + CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); } if (_ctx->curVoc) { @@ -2046,9 +2098,9 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if ((MCharacter[nPers].bInTexts && MCharacter[nPers].numtexts== 0) || !MCharacter[nPers].bInTexts) { // Cerca di eseguire la funzione custom per chiudere la parlata MCharacter[nPers].curTalk = (MCharacter[nPers].curTalk%10) + MCharacter[nPers].curgroup*10; - _ctx->h = mpalQueryDoAction(31,MCharacter[nPers].item->MpalCode(),MCharacter[nPers].curTalk); - if (_ctx->h!=INVALID_HANDLE_VALUE) - WaitForSingleObject(_ctx->h,INFINITE); + _ctx->h = mpalQueryDoActionU32(31,MCharacter[nPers].item->MpalCode(),MCharacter[nPers].curTalk); + if (_ctx->h != INVALID_PID_VALUE) + CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); MCharacter[nPers].bInTexts = false; MCharacter[nPers].numtexts = 0; @@ -2121,14 +2173,14 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // Attiva l'oggetto LinkGraphicTask(&_ctx->dc); - _ctx->dc.Show(); + CORO_INVOKE_0(_ctx->dc.Show); // Disegna il puntatore Pointer->SetSpecialPointer(Pointer->PTR_NONE); MainShowMouse(); while (!(Input->MouseLeftClicked() && ((_ctx->sel = _ctx->dc.GetSelection()) != -1))) { - WaitFrame(); + CORO_INVOKE_0(WaitFrame); Freeze(); _ctx->dc.DoFrame(Input->MousePos()); Unfreeze(); @@ -2137,7 +2189,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // Nascondi il puntatore MainHideMouse(); - _ctx->dc.Hide(); + CORO_INVOKE_0(_ctx->dc.Hide); mpalQueryDialogSelectionU32(_ctx->nChoice, _ctx->sl[_ctx->sel]); // Chiude la scelta @@ -2162,7 +2214,8 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { // EnterCriticalSection(&cs[num]); - WaitForSingleObject(mut[num],INFINITE); +// WaitForSingleObject(mut[num],INFINITE); + warning("TODO"); } DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { @@ -2197,33 +2250,50 @@ int curSonoriz = 0; bool bFadeOutStop; -void ThreadFadeInMusic(void *nMusic) { - int i; - int nChannel = (int)nMusic; +void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) { + CORO_BEGIN_CONTEXT; + int i; + CORO_END_CONTEXT(_ctx); + + int nChannel = *(const int *)nMusic; + + CORO_BEGIN_CODE(_ctx); debug("Start FadeIn Music\n"); - for (i = 0; i < 16; i++) { - _vm->SetMusicVolume(nChannel, i * 4); - Sleep(100); + for (_ctx->i = 0; _ctx->i < 16; _ctx->i++) { + _vm->SetMusicVolume(nChannel, _ctx->i * 4); + + CORO_INVOKE_1(g_scheduler->sleep, 100); } _vm->SetMusicVolume(nChannel, 64); debug("End FadeIn Music\n"); - _endthread(); + + CORO_KILL_SELF(); + + CORO_END_CODE; } -void ThreadFadeOutMusic(void *nMusic) { - int i; - int nChannel = (int)nMusic; - int startVolume = _vm->GetMusicVolume(nChannel); +void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { + CORO_BEGIN_CONTEXT; + int i; + int startVolume; + CORO_END_CONTEXT(_ctx); + + int nChannel = *(const int *)nMusic; + + CORO_BEGIN_CODE(_ctx); + + _ctx->startVolume = _vm->GetMusicVolume(nChannel); debug("Start FadeOut Music\n"); - for (i = 16; i > 0 && !bFadeOutStop; i--) { - if (i * 4 < startVolume) - _vm->SetMusicVolume(nChannel, i * 4); - Sleep(100); + for (_ctx->i = 16; _ctx->i > 0 && !bFadeOutStop; _ctx->i--) { + if (_ctx->i * 4 < _ctx->startVolume) + _vm->SetMusicVolume(nChannel, _ctx->i * 4); + + CORO_INVOKE_1(g_scheduler->sleep, 100); } if (!bFadeOutStop) @@ -2235,25 +2305,29 @@ void ThreadFadeOutMusic(void *nMusic) { debug("End FadeOut Music\n"); - _endthread(); + CORO_KILL_SELF(); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(FadeInSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _beginthread(ThreadFadeInMusic, 10240, (void*)curSonoriz); + g_scheduler->createProcess(ThreadFadeInMusic, &curSonoriz, sizeof(int)); } DECLARE_CUSTOM_FUNCTION(FadeOutSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { bFadeOutStop = false; - _beginthread(ThreadFadeOutMusic, 10240, (void *)curSonoriz); + g_scheduler->createProcess(ThreadFadeOutMusic, &curSonoriz, sizeof(int)); } DECLARE_CUSTOM_FUNCTION(FadeOutStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { bFadeOutStop = false; - _beginthread(ThreadFadeOutMusic, 10240, (void*)2); + int channel = 2; + g_scheduler->createProcess(ThreadFadeOutMusic, &channel, sizeof(int)); } DECLARE_CUSTOM_FUNCTION(FadeInStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _beginthread(ThreadFadeInMusic, 10240, (void*)2); + int channel = 2; + g_scheduler->createProcess(ThreadFadeInMusic, &channel, sizeof(int)); } DECLARE_CUSTOM_FUNCTION(StopSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -2475,12 +2549,12 @@ DECLARE_CUSTOM_FUNCTION(StacchettoFadeEnd)(CORO_PARAM, uint32 nStacc, uint32 bLo DECLARE_CUSTOM_FUNCTION(MustSkipIdleStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { bSkipIdle = true; - SetEvent(hSkipIdle); + g_scheduler->setEvent(hSkipIdle); } DECLARE_CUSTOM_FUNCTION(MustSkipIdleEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { bSkipIdle = false; - ResetEvent(hSkipIdle); + g_scheduler->resetEvent(hSkipIdle); } DECLARE_CUSTOM_FUNCTION(PatIrqFreeze)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { @@ -2488,70 +2562,94 @@ DECLARE_CUSTOM_FUNCTION(PatIrqFreeze)(CORO_PARAM, uint32 bStatus, uint32, uint32 } DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + Freeze(); - _vm->OpenInitLoadMenu(); + CORO_INVOKE_0(_vm->OpenInitLoadMenu); Unfreeze(); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + Freeze(); - _vm->OpenInitOptions(); + CORO_INVOKE_0(_vm->OpenInitOptions); Unfreeze(); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint32, uint32) { - RMMessage msg(nMsg); - RMTextDialog *text; - HANDLE hDisable = CreateEvent(NULL, true, false, NULL); - int i; - uint32 startTime; + CORO_BEGIN_CONTEXT; + RMMessage *msg; + RMTextDialog *text; + uint32 hDisable; + int i; + uint32 startTime; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + _ctx->msg = new RMMessage(nMsg); + _ctx->hDisable = g_scheduler->createEvent(true, false); - text = new RMTextDialog[msg.NumPeriods()]; + _ctx->text = new RMTextDialog[_ctx->msg->NumPeriods()]; - for (i = 0; i < msg.NumPeriods(); i++) { - text[i].SetInput(Input); + for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods(); _ctx->i++) { + _ctx->text[_ctx->i].SetInput(Input); // Allineamento - if (msg[i][0] == '@') { - text[i].SetAlignType(RMText::HCENTER, RMText::VTOP); - text[i].WriteText(&msg[i][1], 3); - text[i].SetPosition(RMPoint(414, 70 + i * 26)); // 70 + if ((*_ctx->msg)[_ctx->i][0] == '@') { + _ctx->text[_ctx->i].SetAlignType(RMText::HCENTER, RMText::VTOP); + _ctx->text[_ctx->i].WriteText(_ctx->msg[_ctx->i][1], 3); + _ctx->text[_ctx->i].SetPosition(RMPoint(414, 70 + _ctx->i * 26)); // 70 } else { - text[i].SetAlignType(RMText::HLEFT,RMText::VTOP); - text[i].WriteText(msg[i], 3); - text[i].SetPosition(RMPoint(260, 70 + i * 26)); + _ctx->text[_ctx->i].SetAlignType(RMText::HLEFT,RMText::VTOP); + _ctx->text[_ctx->i].WriteText((*_ctx->msg)[_ctx->i], 3); + _ctx->text[_ctx->i].SetPosition(RMPoint(260, 70 + _ctx->i * 26)); } // Setta la posizione - text[i].SetAlwaysDisplay(); - text[i].SetForcedTime(dwTime * 1000); - text[i].SetNoTab(); + _ctx->text[_ctx->i].SetAlwaysDisplay(); + _ctx->text[_ctx->i].SetForcedTime(dwTime * 1000); + _ctx->text[_ctx->i].SetNoTab(); // Aspetta la fine della visualizzazione - text[i].SetCustomSkipHandle(hDisable); + _ctx->text[_ctx->i].SetCustomSkipHandle(_ctx->hDisable); // Registra il testo - LinkGraphicTask(&text[i]); + LinkGraphicTask(&_ctx->text[_ctx->i]); } - startTime = _vm->GetTime(); + _ctx->startTime = _vm->GetTime(); - while (startTime + dwTime * 1000 > _vm->GetTime()) { - WaitFrame(); + while (_ctx->startTime + dwTime * 1000 > _vm->GetTime()) { + CORO_INVOKE_0(WaitFrame); if (Input->MouseLeftClicked() || Input->MouseRightClicked()) break; if ((GetAsyncKeyState(Common::KEYCODE_TAB) & 0x8001) == 0x8001) break; } - SetEvent(hDisable); + g_scheduler->setEvent(_ctx->hDisable); + + CORO_INVOKE_0(WaitFrame); + CORO_INVOKE_0(WaitFrame); - WaitFrame(); - WaitFrame(); + delete[] _ctx->text; + delete _ctx->msg; - delete[] text; + CORO_END_CODE; } @@ -2776,7 +2874,7 @@ void SetupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation // Crea l'evento per skippare le idle - hSkipIdle = CreateEvent(NULL, true, false, NULL); + hSkipIdle = g_scheduler->createEvent(true, false); } } // end of namespace Tony -- cgit v1.2.3 From 5a069cdc861538fe763de48de8628d7d754f7959 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 9 May 2012 23:15:41 +1000 Subject: TONY: Refactored out usage of nullContext in favour of proper coroutines --- engines/tony/custom.cpp | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 9d46d7e6b7..150e199fc8 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -72,8 +72,8 @@ RMLocation *Loc; RMInventory *Inventory; RMInput *Input; -HANDLE (*LoadLocation)(int, RMPoint, RMPoint start); -void (*UnloadLocation)(CORO_PARAM, bool bDoOnExit, HANDLE *result); +uint32 (*LoadLocation)(int, RMPoint, RMPoint start); +void (*UnloadLocation)(CORO_PARAM, bool bDoOnExit, uint32 *result); void (*LinkGraphicTask)(RMGfxTask *task); void (*Freeze)(void); void (*Unfreeze)(void); @@ -521,7 +521,7 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, ui LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); Unfreeze(); - _ctx->h = mpalQueryDoActionU32(0, nLoc, 0); + _ctx->h = mpalQueryDoAction(0, nLoc, 0); // On Enter? if (_ctx->h != INVALID_PID_VALUE) @@ -698,7 +698,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint Unfreeze(); - _ctx->h = mpalQueryDoActionU32(0, nLoc, 0); + _ctx->h = mpalQueryDoAction(0, nLoc, 0); if (!bNoOcchioDiBue) { CORO_INVOKE_0(WaitWipeEnd); @@ -1842,7 +1842,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes // Cerca di eseguire la funzione custom per inizializzare la parlata if (MCharacter[nChar].item) { - _ctx->h = mpalQueryDoActionU32(30, MCharacter[nChar].item->MpalCode(), _ctx->parm); + _ctx->h = mpalQueryDoAction(30, MCharacter[nChar].item->MpalCode(), _ctx->parm); if (_ctx->h != INVALID_PID_VALUE) { CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); } @@ -1923,7 +1923,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes // Cerca di eseguire la funzione custom per chiudere la parlata if (MCharacter[nChar].item) { - _ctx->h = mpalQueryDoActionU32(31, MCharacter[nChar].item->MpalCode(), _ctx->parm); + _ctx->h = mpalQueryDoAction(31, MCharacter[nChar].item->MpalCode(), _ctx->parm); if (_ctx->h != INVALID_PID_VALUE) CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); } @@ -2034,7 +2034,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg MCharacter[nPers].numtexts--; } else { // Cerca di eseguire la funzione custom per inizializzare la parlata - _ctx->h = mpalQueryDoActionU32(30, MCharacter[nPers].item->MpalCode(), _ctx->parm); + _ctx->h = mpalQueryDoAction(30, MCharacter[nPers].item->MpalCode(), _ctx->parm); if (_ctx->h != INVALID_PID_VALUE) CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); @@ -2098,7 +2098,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if ((MCharacter[nPers].bInTexts && MCharacter[nPers].numtexts== 0) || !MCharacter[nPers].bInTexts) { // Cerca di eseguire la funzione custom per chiudere la parlata MCharacter[nPers].curTalk = (MCharacter[nPers].curTalk%10) + MCharacter[nPers].curgroup*10; - _ctx->h = mpalQueryDoActionU32(31,MCharacter[nPers].item->MpalCode(),MCharacter[nPers].curTalk); + _ctx->h = mpalQueryDoAction(31,MCharacter[nPers].item->MpalCode(),MCharacter[nPers].curTalk); if (_ctx->h != INVALID_PID_VALUE) CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); @@ -2142,7 +2142,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr curDialog = nDialog; // Call MPAL to start the dialog - mpalQueryDoDialogU32(nDialog, nStartGroup); + mpalQueryDoDialog(nDialog, nStartGroup); // Wait until a choice is selected mpalQueryDialogWaitForChoice(&_ctx->nChoice); @@ -2154,7 +2154,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // Se c'e' una sola opzione, la fa automaticamente, e aspetta la prossima scelta if (_ctx->num == 1) { - mpalQueryDialogSelectionU32(_ctx->nChoice, _ctx->sl[0]); + mpalQueryDialogSelection(_ctx->nChoice, _ctx->sl[0]); GlobalFree(_ctx->sl); continue; } @@ -2190,7 +2190,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr MainHideMouse(); CORO_INVOKE_0(_ctx->dc.Hide); - mpalQueryDialogSelectionU32(_ctx->nChoice, _ctx->sl[_ctx->sel]); + mpalQueryDialogSelection(_ctx->nChoice, _ctx->sl[_ctx->sel]); // Chiude la scelta _ctx->dc.Close(); @@ -2501,10 +2501,18 @@ DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint } -void RestoreMusic(void) { - PlaySonoriz(nullContext, lastMusic, 0, 0, 0); +void RestoreMusic(CORO_PARAM) { + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + CORO_INVOKE_4(PlaySonoriz, lastMusic, 0, 0, 0); + if (lastTappeto != 0) CustPlayMusic(4, tappetiFile[lastTappeto], 0, true); + + CORO_END_CODE; } void SaveMusic(Common::OutSaveFile *f) { -- cgit v1.2.3 From 82361a3ea3efb9b6454eb4805e777cd4bfc3a0e3 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 11 May 2012 00:09:34 +1000 Subject: TONY: Fixed some missed methods to coroutines --- engines/tony/custom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 150e199fc8..c82d0fcd2b 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1337,7 +1337,7 @@ DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint3 CORO_BEGIN_CODE(_ctx); - Tony->Move(RMPoint(nX, nY)); + CORO_INVOKE_1(Tony->Move, RMPoint(nX, nY)); if (!bSkipIdle) CORO_INVOKE_0(Tony->WaitForEndMovement); @@ -1346,7 +1346,7 @@ DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint3 } DECLARE_CUSTOM_FUNCTION(MoveTony)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) { - Tony->Move(RMPoint(nX, nY)); + Tony->Move(coroParam, RMPoint(nX, nY)); } DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) { -- cgit v1.2.3 From 724deb6b84b8a5f5a3aa96adc2a512c962f7081a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 11 May 2012 08:44:50 +1000 Subject: TONY: Bugfixes for showing the credits screen. --- engines/tony/custom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index c82d0fcd2b..5089914d88 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2615,10 +2615,10 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods(); _ctx->i++) { _ctx->text[_ctx->i].SetInput(Input); - // Allineamento + // Alignment if ((*_ctx->msg)[_ctx->i][0] == '@') { _ctx->text[_ctx->i].SetAlignType(RMText::HCENTER, RMText::VTOP); - _ctx->text[_ctx->i].WriteText(_ctx->msg[_ctx->i][1], 3); + _ctx->text[_ctx->i].WriteText(&(*_ctx->msg)[_ctx->i][1], 3); _ctx->text[_ctx->i].SetPosition(RMPoint(414, 70 + _ctx->i * 26)); // 70 } else { _ctx->text[_ctx->i].SetAlignType(RMText::HLEFT,RMText::VTOP); -- cgit v1.2.3 From 68c1b0b0e46b0575a4670d1ffda2fa3c8ae94ed8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 11 May 2012 23:15:59 +1000 Subject: TONY: Refactored Tony to use the Common coroutine scheduler --- engines/tony/custom.cpp | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 5089914d88..234dd0a4f9 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -327,7 +327,7 @@ DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint CORO_BEGIN_CODE(_ctx); if (!bSkipIdle) - CORO_INVOKE_1(g_scheduler->sleep, dwTime); + CORO_INVOKE_1(CoroScheduler.sleep, dwTime); CORO_END_CODE; } @@ -524,8 +524,8 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, ui _ctx->h = mpalQueryDoAction(0, nLoc, 0); // On Enter? - if (_ctx->h != INVALID_PID_VALUE) - CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); + if (_ctx->h != CORO_INVALID_PID_VALUE) + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); CORO_END_CODE; } @@ -708,8 +708,8 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint bNoOcchioDiBue = false; // On Enter? - if (_ctx->h != INVALID_PID_VALUE) - CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); + if (_ctx->h != CORO_INVALID_PID_VALUE) + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); CORO_END_CODE; } @@ -1843,8 +1843,8 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes // Cerca di eseguire la funzione custom per inizializzare la parlata if (MCharacter[nChar].item) { _ctx->h = mpalQueryDoAction(30, MCharacter[nChar].item->MpalCode(), _ctx->parm); - if (_ctx->h != INVALID_PID_VALUE) { - CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); + if (_ctx->h != CORO_INVALID_PID_VALUE) { + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); } } @@ -1924,8 +1924,8 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes // Cerca di eseguire la funzione custom per chiudere la parlata if (MCharacter[nChar].item) { _ctx->h = mpalQueryDoAction(31, MCharacter[nChar].item->MpalCode(), _ctx->parm); - if (_ctx->h != INVALID_PID_VALUE) - CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); + if (_ctx->h != CORO_INVALID_PID_VALUE) + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); } CORO_END_CODE; @@ -2035,8 +2035,8 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg } else { // Cerca di eseguire la funzione custom per inizializzare la parlata _ctx->h = mpalQueryDoAction(30, MCharacter[nPers].item->MpalCode(), _ctx->parm); - if (_ctx->h != INVALID_PID_VALUE) - CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); + if (_ctx->h != CORO_INVALID_PID_VALUE) + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); MCharacter[nPers].curTalk = _ctx->parm; @@ -2099,8 +2099,8 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg // Cerca di eseguire la funzione custom per chiudere la parlata MCharacter[nPers].curTalk = (MCharacter[nPers].curTalk%10) + MCharacter[nPers].curgroup*10; _ctx->h = mpalQueryDoAction(31,MCharacter[nPers].item->MpalCode(),MCharacter[nPers].curTalk); - if (_ctx->h != INVALID_PID_VALUE) - CORO_INVOKE_2(g_scheduler->waitForSingleObject, _ctx->h, INFINITE); + if (_ctx->h != CORO_INVALID_PID_VALUE) + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); MCharacter[nPers].bInTexts = false; MCharacter[nPers].numtexts = 0; @@ -2214,7 +2214,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { // EnterCriticalSection(&cs[num]); -// WaitForSingleObject(mut[num],INFINITE); +// WaitForSingleObject(mut[num],CORO_INFINITE); warning("TODO"); } @@ -2264,7 +2264,7 @@ void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) { for (_ctx->i = 0; _ctx->i < 16; _ctx->i++) { _vm->SetMusicVolume(nChannel, _ctx->i * 4); - CORO_INVOKE_1(g_scheduler->sleep, 100); + CORO_INVOKE_1(CoroScheduler.sleep, 100); } _vm->SetMusicVolume(nChannel, 64); @@ -2293,7 +2293,7 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { if (_ctx->i * 4 < _ctx->startVolume) _vm->SetMusicVolume(nChannel, _ctx->i * 4); - CORO_INVOKE_1(g_scheduler->sleep, 100); + CORO_INVOKE_1(CoroScheduler.sleep, 100); } if (!bFadeOutStop) @@ -2311,23 +2311,23 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { } DECLARE_CUSTOM_FUNCTION(FadeInSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - g_scheduler->createProcess(ThreadFadeInMusic, &curSonoriz, sizeof(int)); + CoroScheduler.createProcess(ThreadFadeInMusic, &curSonoriz, sizeof(int)); } DECLARE_CUSTOM_FUNCTION(FadeOutSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { bFadeOutStop = false; - g_scheduler->createProcess(ThreadFadeOutMusic, &curSonoriz, sizeof(int)); + CoroScheduler.createProcess(ThreadFadeOutMusic, &curSonoriz, sizeof(int)); } DECLARE_CUSTOM_FUNCTION(FadeOutStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { bFadeOutStop = false; int channel = 2; - g_scheduler->createProcess(ThreadFadeOutMusic, &channel, sizeof(int)); + CoroScheduler.createProcess(ThreadFadeOutMusic, &channel, sizeof(int)); } DECLARE_CUSTOM_FUNCTION(FadeInStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { int channel = 2; - g_scheduler->createProcess(ThreadFadeInMusic, &channel, sizeof(int)); + CoroScheduler.createProcess(ThreadFadeInMusic, &channel, sizeof(int)); } DECLARE_CUSTOM_FUNCTION(StopSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -2557,12 +2557,12 @@ DECLARE_CUSTOM_FUNCTION(StacchettoFadeEnd)(CORO_PARAM, uint32 nStacc, uint32 bLo DECLARE_CUSTOM_FUNCTION(MustSkipIdleStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { bSkipIdle = true; - g_scheduler->setEvent(hSkipIdle); + CoroScheduler.setEvent(hSkipIdle); } DECLARE_CUSTOM_FUNCTION(MustSkipIdleEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { bSkipIdle = false; - g_scheduler->resetEvent(hSkipIdle); + CoroScheduler.resetEvent(hSkipIdle); } DECLARE_CUSTOM_FUNCTION(PatIrqFreeze)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { @@ -2608,7 +2608,7 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 CORO_BEGIN_CODE(_ctx); _ctx->msg = new RMMessage(nMsg); - _ctx->hDisable = g_scheduler->createEvent(true, false); + _ctx->hDisable = CoroScheduler.createEvent(true, false); _ctx->text = new RMTextDialog[_ctx->msg->NumPeriods()]; @@ -2649,7 +2649,7 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 break; } - g_scheduler->setEvent(_ctx->hDisable); + CoroScheduler.setEvent(_ctx->hDisable); CORO_INVOKE_0(WaitFrame); CORO_INVOKE_0(WaitFrame); @@ -2882,7 +2882,7 @@ void SetupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation // Crea l'evento per skippare le idle - hSkipIdle = g_scheduler->createEvent(true, false); + hSkipIdle = CoroScheduler.createEvent(true, false); } } // end of namespace Tony -- cgit v1.2.3 From beef5fdb264850079208b5513cf72626ff7edd86 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 11 May 2012 23:23:05 +1000 Subject: TONY: Removal of now redundant includes, and deprecated scheduler/coroutine files --- engines/tony/custom.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 234dd0a4f9..89d3123b60 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -56,7 +56,6 @@ #include "tony/font.h" #include "tony/game.h" #include "tony/gfxcore.h" -#include "tony/sched.h" #include "tony/tony.h" #include "tony/tonychar.h" #include "tony/utils.h" -- cgit v1.2.3 From 3a61568b6f0c5d74ced621a5f4161efbcb33f6a9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 11 May 2012 23:39:32 +1000 Subject: TONY: Removed carriage returns from debug line strings --- engines/tony/custom.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 89d3123b60..a9e8e5bc62 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2258,7 +2258,7 @@ void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) { CORO_BEGIN_CODE(_ctx); - debug("Start FadeIn Music\n"); + debug("Start FadeIn Music"); for (_ctx->i = 0; _ctx->i < 16; _ctx->i++) { _vm->SetMusicVolume(nChannel, _ctx->i * 4); @@ -2267,7 +2267,7 @@ void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) { } _vm->SetMusicVolume(nChannel, 64); - debug("End FadeIn Music\n"); + debug("End FadeIn Music"); CORO_KILL_SELF(); @@ -2286,7 +2286,7 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { _ctx->startVolume = _vm->GetMusicVolume(nChannel); - debug("Start FadeOut Music\n"); + debug("Start FadeOut Music"); for (_ctx->i = 16; _ctx->i > 0 && !bFadeOutStop; _ctx->i--) { if (_ctx->i * 4 < _ctx->startVolume) @@ -2302,7 +2302,7 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { if (nChannel == 2) _vm->StopMusic(2); - debug("End FadeOut Music\n"); + debug("End FadeOut Music"); CORO_KILL_SELF(); @@ -2470,14 +2470,14 @@ const char *staccFileNames[] = { void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int nSync = 0) { if (nSync == 0) nSync = 2000; - debug("Start CustPlayMusic\n"); + debug("Start CustPlayMusic"); PlayMusic(nChannel, mFN, nFX, bLoop, nSync); - debug("End CustPlayMusic\n"); + debug("End CustPlayMusic"); } DECLARE_CUSTOM_FUNCTION(PlaySonoriz)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) { if (nFX == 0 || nFX == 1 || nFX==2) { - debug("PlaySonoriz stop fadeout\n"); + debug("PlaySonoriz stop fadeout"); bFadeOutStop = true; } -- cgit v1.2.3 From 109e5f8226c1db18926e307d4ecb9c3c83fdd7bc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 12 May 2012 20:49:36 +1000 Subject: TONY: Conversion of more methods to coroutines --- engines/tony/custom.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index a9e8e5bc62..a3a57dfce9 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2155,6 +2155,9 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr if (_ctx->num == 1) { mpalQueryDialogSelection(_ctx->nChoice, _ctx->sl[0]); GlobalFree(_ctx->sl); + + // Wait for the next choice to be made + mpalQueryDialogWaitForChoice(&_ctx->nChoice); continue; } @@ -2181,7 +2184,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr while (!(Input->MouseLeftClicked() && ((_ctx->sel = _ctx->dc.GetSelection()) != -1))) { CORO_INVOKE_0(WaitFrame); Freeze(); - _ctx->dc.DoFrame(Input->MousePos()); + CORO_INVOKE_1(_ctx->dc.DoFrame, Input->MousePos()); Unfreeze(); } @@ -2214,7 +2217,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { // EnterCriticalSection(&cs[num]); // WaitForSingleObject(mut[num],CORO_INFINITE); - warning("TODO"); + warning("TODO: TakeOwnership"); } DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { @@ -2644,7 +2647,7 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 CORO_INVOKE_0(WaitFrame); if (Input->MouseLeftClicked() || Input->MouseRightClicked()) break; - if ((GetAsyncKeyState(Common::KEYCODE_TAB) & 0x8001) == 0x8001) + if (_vm->GetEngine()->GetInput().GetAsyncKeyState(Common::KEYCODE_TAB)) break; } -- cgit v1.2.3 From 63e3b47857fe5a507858b4256b1f3f4d7fe50c22 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 13 May 2012 00:53:09 +1000 Subject: TONY: Fix compiler warnings --- engines/tony/custom.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index a3a57dfce9..3e8f0b95e6 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2130,7 +2130,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr CORO_BEGIN_CONTEXT; uint32 nChoice; uint32 *sl; - int i, num; + uint32 i, num; char *string; RMDialogChoice dc; int sel; @@ -2153,7 +2153,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // Se c'e' una sola opzione, la fa automaticamente, e aspetta la prossima scelta if (_ctx->num == 1) { - mpalQueryDialogSelection(_ctx->nChoice, _ctx->sl[0]); + mpalQueryDialogSelectionDWORD(_ctx->nChoice, _ctx->sl[0]); GlobalFree(_ctx->sl); // Wait for the next choice to be made @@ -2192,7 +2192,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr MainHideMouse(); CORO_INVOKE_0(_ctx->dc.Hide); - mpalQueryDialogSelection(_ctx->nChoice, _ctx->sl[_ctx->sel]); + mpalQueryDialogSelectionDWORD(_ctx->nChoice, _ctx->sl[_ctx->sel]); // Chiude la scelta _ctx->dc.Close(); -- cgit v1.2.3 From 28c58a7f56ada6e4c72fcddc92fc4d5a1b181224 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 13 May 2012 00:58:59 +1000 Subject: TONY: Fix unsigned comparison warning --- engines/tony/custom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 3e8f0b95e6..b1b660c423 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2145,7 +2145,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // Wait until a choice is selected mpalQueryDialogWaitForChoice(&_ctx->nChoice); - while (_ctx->nChoice != -1) { + while (_ctx->nChoice != (uint32)-1) { // Si fa dare la lista di opzioni e le conta _ctx->sl = mpalQueryDialogSelectList(_ctx->nChoice); for (_ctx->num = 0; _ctx->sl[_ctx->num] != 0; _ctx->num++) -- cgit v1.2.3 From 35143eae094b713524ef677412befdc4c766df04 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 13 May 2012 19:06:08 +1000 Subject: TONY: Converted SendTonyMessage msg field from a pointer back to an object instance --- engines/tony/custom.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index b1b660c423..bda65fcf67 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -379,7 +379,7 @@ VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) { DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX, uint32 nY, uint32) { CORO_BEGIN_CONTEXT; - RMMessage *msg; + RMMessage msg; int i; int curOffset; VoiceHeader *curVoc; @@ -393,9 +393,8 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX if (bSkipIdle) return; - _ctx->msg = new RMMessage(dwMessage); - if (!_ctx->msg->IsValid()) { - delete _ctx->msg; + _ctx->msg.Load(dwMessage); + if (!_ctx->msg.IsValid()) { return; } @@ -424,7 +423,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX if (!bStaticTalk) nTonyNextTalkType = Tony->TALK_NORMAL; } else { - if (_ctx->msg->NumPeriods() > 1) + if (_ctx->msg.NumPeriods() > 1) CORO_INVOKE_1(Tony->StartTalk, Tony->TALK_FIANCHI); else CORO_INVOKE_1(Tony->StartTalk, Tony->TALK_NORMAL); @@ -435,17 +434,17 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX bTonyIsSpeaking = true; - for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !bSkipIdle; _ctx->i++) { + for (_ctx->i = 0; _ctx->i < _ctx->msg.NumPeriods() && !bSkipIdle; _ctx->i++) { _ctx->text.SetInput(Input); // Allineamento - _ctx->text.SetAlignType(RMText::HCENTER,RMText::VBOTTOM); + _ctx->text.SetAlignType(RMText::HCENTER, RMText::VBOTTOM); // Colore _ctx->text.SetColor(0,255,0); // Scrive il testo - _ctx->text.WriteText((*_ctx->msg)[_ctx->i],0); + _ctx->text.WriteText(_ctx->msg[_ctx->i], 0); // Setta la posizione if (nX == 0 && nY == 0) @@ -494,7 +493,6 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX curBackText->Show(); CORO_INVOKE_0(Tony->EndTalk); - delete _ctx->msg; CORO_END_CODE; } @@ -2207,9 +2205,6 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr } - - - /* * Sync tra idle e mpal */ -- cgit v1.2.3 From 546f47ddcee07b5bd7ecad5f25f4bb022944e234 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 13 May 2012 22:34:40 +1000 Subject: TONY: Beginnings of refactoring Globals into their own class --- engines/tony/custom.cpp | 1476 +++++++++++++++++++++-------------------------- 1 file changed, 653 insertions(+), 823 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index bda65fcf67..168c2d38cd 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -62,54 +62,6 @@ namespace Tony { -extern bool bPatIrqFreeze; - -RMTony *Tony; -RMPointer *Pointer; -RMGameBoxes *Boxes; -RMLocation *Loc; -RMInventory *Inventory; -RMInput *Input; - -uint32 (*LoadLocation)(int, RMPoint, RMPoint start); -void (*UnloadLocation)(CORO_PARAM, bool bDoOnExit, uint32 *result); -void (*LinkGraphicTask)(RMGfxTask *task); -void (*Freeze)(void); -void (*Unfreeze)(void); -void (*WaitFrame)(CORO_PARAM); -void (*PlayMusic)(int nChannel, const char *fileName, int nFX, bool bLoop, int nSync); -void (*WaitWipeEnd)(CORO_PARAM); -void (*CloseWipe)(void); -void (*InitWipe)(int type); -void (*EnableGUI)(void); -void (*DisableGUI)(void); -void (*SetPalesati)(bool bpal); - -uint32 dwTonyNumTexts = 0; -bool bTonyInTexts = false; -bool bStaticTalk = false; -RMTony::TALKTYPE nTonyNextTalkType; - -RMPoint StartLocPos[256]; -OSystem::MutexRef cs[10]; -OSystem::MutexRef vdb; -HANDLE mut[10]; - -bool bSkipIdle = false; -uint32 hSkipIdle; - -int lastMusic = 0, lastTappeto = 0; - -int tappeti[200]; - -#define T_GRILLI 1 -#define T_GRILLIOV 2 -#define T_GRILLIVENTO 3 -#define T_GRILLIVENTO1 4 -#define T_VENTO 5 -#define T_MARE 6 -#define T_MAREMETA 7 - const char *tappetiFile[] = { "None", "1.ADP", // Grilli.WAV @@ -121,140 +73,139 @@ const char *tappetiFile[] = { "6.ADP" // Mare1.WAV metà volume }; -struct CharacterStruct { - uint32 code; - RMItem *item; - byte r, g, b; - int talkpattern; - int standpattern; - int starttalkpattern, endtalkpattern; - int numtexts; - - void Save(Common::OutSaveFile *f) { - f->writeUint32LE(code); - f->writeUint32LE(0); - f->writeByte(r); - f->writeByte(g); - f->writeByte(b); - f->writeUint32LE(talkpattern); - f->writeUint32LE(standpattern); - f->writeUint32LE(starttalkpattern); - f->writeUint32LE(endtalkpattern); - f->writeUint32LE(numtexts); - } - void Load(Common::InSaveFile *f) { - code = f->readUint32LE(); - f->readUint32LE(); - item = NULL; - r = f->readByte(); - g = f->readByte(); - b = f->readByte(); - talkpattern = f->readUint32LE(); - standpattern = f->readUint32LE(); - starttalkpattern = f->readUint32LE(); - endtalkpattern = f->readUint32LE(); - numtexts = f->readUint32LE(); - } -}; -CharacterStruct Character[16]; - -struct MCharacterStruct { - uint32 code; - RMItem *item; - byte r, g, b; - int x, y; - int numtalks[10]; - int curgroup; - int numtexts; - bool bInTexts; - int curTalk; - bool bAlwaysBack; - - void Save(Common::OutSaveFile *f) { - f->writeUint32LE(code); - f->writeUint32LE(0); - f->writeByte(r); - f->writeByte(g); - f->writeByte(b); - f->writeUint32LE(x); - f->writeUint32LE(y); - for (int i = 0; i < 10; ++i) - f->writeUint32LE(numtalks[i]); - f->writeUint32LE(curgroup); - f->writeUint32LE(numtexts); - f->writeByte(bInTexts); - f->writeUint32LE(curTalk); - f->writeByte(bAlwaysBack); - } - void Load(Common::InSaveFile *f) { - code = f->readUint32LE(); - f->readUint32LE(); - item = NULL; - r = f->readByte(); - g = f->readByte(); - b = f->readByte(); - x = f->readUint32LE(); - y = f->readUint32LE(); - for (int i = 0; i < 10; ++i) - numtalks[i] = f->readUint32LE(); - curgroup = f->readUint32LE(); - numtexts = f->readUint32LE(); - bInTexts = f->readByte(); - curTalk = f->readUint32LE(); - bAlwaysBack = f->readByte(); - } +struct MusicFileEntry { + const char *name; + int sync; }; -MCharacterStruct MCharacter[10]; +const MusicFileEntry musicFiles[] = { +/* + { "PREGAME1.ADP", 0 }, { "SONO1.ADP", 0 }, + { "SONO2.ADP", 0 }, { "SONO3.ADP", 0 }, + { "CADUTA.ADP",0 }, { "RISVEGLIO.ADP", 0 }, + { "BACKGROUND.ADP", 0 }, { "PREGAME3.ADP", 0 }, + { "BARBUTA1.ADP", 2450 }, { "BARBUTA2.ADP", 0 }, +*/ + { "00.ADP", 0 }, { "01.ADP", 0 }, + { "02.ADP", 0 }, { "03.ADP", 0 }, + { "04.ADP",0 }, { "05.ADP", 0 }, + { "06.ADP", 0 }, { "07.ADP", 0 }, + { "08.ADP", 2450 }, { "09.ADP", 0 }, -bool IsMChar[16]; +/* + { "BARBUTA3.ADP", 0 }, { "15-RUFUS.ADP", 0 }, + { "20-MAMMA.ADP", 0 }, { "32-MAMMARADIO.ADP", 0 }, + { "24-TUNNELOV-MIDI.ADP", 0 }, { "34-RAZZO.ADP", 0 }, + { "27-ZUCC1.ADP", 0 }, { "BEAST.ADP", 0 }, + { "22-MORTIMER.ADP", 0 }, { "25-PUB-OVATTATO.ADP", 0 }, +*/ + { "10.ADP", 0 }, { "11.ADP", 0 }, + { "12.ADP", 0 }, { "13.ADP", 0 }, + { "14.ADP", 0 }, { "15.ADP", 0 }, + { "16.ADP", 0 }, { "17.ADP", 0 }, + { "18.ADP", 0 }, { "19.ADP", 0 }, +/* + { "25-PUB.ADP", 0 }, { "ALBERGO.ADP", 0 }, + { "37.ADP", 0 }, { "26-PIRAT.ADP", 0 }, + { "LORENZBACK.ADP", 0 }, { "LORENZ3.ADP", 0 }, + { "CASTLE.ADP", 0 }, { "53-BACKR.ADP", 0 }, + { "16-SMIL1.ADP", 1670 }, { "16-SMIL2.ADP", 0 }, +*/ + { "20.ADP", 0 }, { "21.ADP", 0 }, + { "22.ADP", 0 }, { "23.ADP", 0 }, + { "24.ADP", 0 }, { "25.ADP", 0 }, + { "26.ADP", 0 }, { "27.ADP", 0 }, + { "28.ADP", 1670 }, { "29.ADP", 0 }, +/* + { "16-SMILE.ADP", 0 }, { "16-DIALOG2.ADP", 0 }, + { "07-SHAKE1.ADP", 2900 }, { "07-SHAKE2.ADP", 0 }, + { "07-SHAKE3.ADP", 0 }, { "46-BEEE.ADP", 0 }, + { "434748.ADP", 0 }, { "TORRE.ADP", 0 }, + { "50-DRAGO.ADP", 0 }, { "56-OPERA.ADP", 0 }, +*/ + { "30.ADP", 0 }, { "31.ADP", 0 }, + { "32.ADP", 2900 }, { "33.ADP", 0 }, + { "34.ADP", 0 }, { "35.ADP", 0 }, + { "36.ADP", 0 }, { "37.ADP", 0 }, + { "38.ADP", 0 }, { "39.ADP", 0 }, +/* + { "FLAUTARP.ADP", 0 }, { "01-2001.ADP", 1920 }, + { "02-INTROPANORAMICA.ADP", 1560 }, { "03-PANORAMICA.ADP", 1920 }, + { "04-INTERNI.ADP", 1920 }, { "05-CADEPIUMA.ADP", 1920 }, + { "06-SCENDESCALE.ADP", 1920 }, { "07-THRILL.ADP", 1920 }, + { "08-CADUTAZUCCA.ADP", 1920 }, { "09-PIUMAALEGGIA.ADP", 1920 }, +*/ + { "40.ADP", 0 }, { "41.ADP", 1920 }, + { "42.ADP", 1560 }, { "43.ADP", 1920 }, + { "44.ADP", 1920 }, { "45.ADP", 1920 }, + { "46.ADP", 1920 }, { "47.ADP", 1920 }, + { "48.ADP", 1920 }, { "49.ADP", 1920 }, -bool bAlwaysDisplay; +/* + { "10-JACKZUCCONA.ADP", 1920 }, { "11-JACKIMPRECAALLAGRANDELUNA.ADP", 1920 }, + { "12-GRANDELUNALOGO.ADP", 1920 }, { "60-BACKGROUND.ADP", 0 }, + { "TONYSTAR.ADP", 0 }, { "FUNNY.ADP", 0 }, + { "60-INIZIODIALOGO.ADP", 0 }, { "60-DIALOGO.ADP", 0 }, + { "60-JACKFELICE.ADP", 0 }, { "24-TONYVIOLENTATO.ADP", 0 } +*/ -RMPoint saveTonyPos; -int saveTonyLoc; + { "50.ADP", 1920 }, { "51.ADP", 1920 }, + { "52.ADP", 1920 }, { "53.ADP", 0 }, + { "54.ADP", 0 }, { "55.ADP", 0 }, + { "56.ADP", 0 }, { "57.ADP", 0 }, + { "58.ADP", 0 }, { "59.ADP", 0 } -RMTextDialog *curBackText = NULL; -bool bTonyIsSpeaking = false; +}; -int curChangedHotspot = 0; -struct ChangedHotspotStruct { - uint32 dwCode; - uint32 nX, nY; +const char *staccFileNames[] = { +/* + "05-MUCCA.ADP", "06-HALOW.ADP", + "LETTERAINIZIO.ADP", "LETTERAPAURA.ADP", + "LETTERAFINE.ADP", "PREGAME2.ADP", + "07-TIMOT.ADP", "15-SHOTRUFUS.ADP", + "15-SHOTTONY.ADP", "27-ZUCC2.ADP", +*/ + "S00.ADP", "S01.ADP", + "S02.ADP", "S03.ADP", + "S04.ADP", "S05.ADP", + "S06.ADP", "S07.ADP", + "S08.ADP", "S09.ADP", - void Save(Common::OutSaveFile *f) { - f->writeUint32LE(dwCode); - f->writeUint32LE(nX); - f->writeUint32LE(nY); - } - void Load(Common::InSaveFile *f) { - dwCode = f->readUint32LE(); - nX = f->readUint32LE(); - nY = f->readUint32LE(); - } +/* + "53-DLOGO.ADP", "16-DIALOG1.ADP", + "TORRE1.ADP", "GARG1.ADP", + "LORENZ1.ADP", "24-FIGHT.ADP", + "08-MACBETH-PREPARA.ADP", "08-MACBETH-RECITA.ADP", + "GATTO1.ADP" +*/ + "S10.ADP", "S11.ADP", + "S12.ADP", "S13.ADP", + "S14.ADP", "S15.ADP", + "S16.ADP", "S17.ADP", + "S18.ADP" }; -ChangedHotspotStruct ChangedHotspot[256]; + void ReapplyChangedHotspot(void) { int i; - for (i = 0; iGetItemFromCode(ChangedHotspot[i].dwCode)->ChangeHotspot(RMPoint(ChangedHotspot[i].nX, ChangedHotspot[i].nY)); + for (i = 0; i < GLOBALS.curChangedHotspot; i++) + GLOBALS.Loc->GetItemFromCode(GLOBALS.ChangedHotspot[i].dwCode)->ChangeHotspot(RMPoint(GLOBALS.ChangedHotspot[i].nX, GLOBALS.ChangedHotspot[i].nY)); } void SaveChangedHotspot(Common::OutSaveFile *f) { - f->writeByte(curChangedHotspot); - if (curChangedHotspot > 0) { - for (int i = 0; i < curChangedHotspot; ++i) - ChangedHotspot[i].Save(f); + f->writeByte(GLOBALS.curChangedHotspot); + if (GLOBALS.curChangedHotspot > 0) { + for (int i = 0; i < GLOBALS.curChangedHotspot; ++i) + GLOBALS.ChangedHotspot[i].Save(f); } } void LoadChangedHotspot(Common::InSaveFile *f) { - curChangedHotspot = f->readByte(); + GLOBALS.curChangedHotspot = f->readByte(); - if (curChangedHotspot > 0) { - for (int i = 0; i < curChangedHotspot; ++i) - ChangedHotspot[i].Load(f); + if (GLOBALS.curChangedHotspot > 0) { + for (int i = 0; i < GLOBALS.curChangedHotspot; ++i) + GLOBALS.ChangedHotspot[i].Load(f); } } @@ -271,51 +222,51 @@ void LoadChangedHotspot(Common::InSaveFile *f) { void MCharResetCodes(void) { for (int i = 0; i < 10; i++) - MCharacter[i].item = Loc->GetItemFromCode(MCharacter[i].code); + GLOBALS.MCharacter[i].item = GLOBALS.Loc->GetItemFromCode(GLOBALS.MCharacter[i].code); for (int i = 0; i < 10; i++) - Character[i].item = Loc->GetItemFromCode(Character[i].code); + GLOBALS.Character[i].item = GLOBALS.Loc->GetItemFromCode(GLOBALS.Character[i].code); } void CharsSaveAll(Common::OutSaveFile *f) { for (int i = 0; i < 10; i++) { - f->writeByte(IsMChar[i]); - if (IsMChar[i]) { - MCharacter[i].Save(f); + f->writeByte(GLOBALS.IsMChar[i]); + if (GLOBALS.IsMChar[i]) { + GLOBALS.MCharacter[i].Save(f); } else { - Character[i].Save(f); + GLOBALS.Character[i].Save(f); } } } void CharsLoadAll(Common::InSaveFile *f) { for (int i = 0; i < 10; i++) { - IsMChar[i] = f->readByte(); - if (IsMChar[i]) - MCharacter[i].Load(f); + GLOBALS.IsMChar[i] = f->readByte(); + if (GLOBALS.IsMChar[i]) + GLOBALS.MCharacter[i].Load(f); else - Character[i].Load(f); + GLOBALS.Character[i].Load(f); } } DECLARE_CUSTOM_FUNCTION(FaceToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->SetPattern(Tony->PAT_STANDDOWN); + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_STANDDOWN); } DECLARE_CUSTOM_FUNCTION(BackToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->SetPattern(Tony->PAT_STANDUP); + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_STANDUP); } DECLARE_CUSTOM_FUNCTION(LeftToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->SetPattern(Tony->PAT_STANDLEFT); + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_STANDLEFT); } DECLARE_CUSTOM_FUNCTION(RightToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->SetPattern(Tony->PAT_STANDRIGHT); + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_STANDRIGHT); } DECLARE_CUSTOM_FUNCTION(TonySetPalesati)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { - SetPalesati(bStatus); + GLOBALS.SetPalesati(bStatus); } DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint32) { @@ -325,37 +276,37 @@ DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint CORO_BEGIN_CODE(_ctx); - if (!bSkipIdle) + if (!GLOBALS.bSkipIdle) CORO_INVOKE_1(CoroScheduler.sleep, dwTime); CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(SetAlwaysDisplay)(CORO_PARAM, uint32 val, uint32, uint32, uint32) { - bAlwaysDisplay = (val != 0); + GLOBALS.bAlwaysDisplay = (val != 0); } DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32, uint32) { switch (dwPointer) { case 1: - Pointer->SetSpecialPointer(Pointer->PTR_FRECCIASU); + GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIASU); break; case 2: - Pointer->SetSpecialPointer(Pointer->PTR_FRECCIAGIU); + GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIAGIU); break; case 3: - Pointer->SetSpecialPointer(Pointer->PTR_FRECCIASINISTRA); + GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIASINISTRA); break; case 4: - Pointer->SetSpecialPointer(Pointer->PTR_FRECCIADESTRA); + GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIADESTRA); break; case 5: - Pointer->SetSpecialPointer(Pointer->PTR_FRECCIAMAPPA); + GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIAMAPPA); break; default: - Pointer->SetSpecialPointer(Pointer->PTR_NONE); + GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_NONE); break; } } @@ -391,7 +342,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->curOffset = 0; - if (bSkipIdle) return; + if (GLOBALS.bSkipIdle) return; _ctx->msg.Load(dwMessage); if (!_ctx->msg.IsValid()) { @@ -405,7 +356,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->curOffset = _ctx->curVoc->offset; // PRIMA VOLTA PREALLOCA - g_system->lockMutex(vdb); + g_system->lockMutex(GLOBALS.vdb); //fseek(_vm->m_vdbFP, _ctx->curOffset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curOffset); _vm->_theSound.CreateSfx(&_ctx->voice); @@ -414,28 +365,28 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->curOffset = _vm->_vdbFP.pos(); _ctx->voice->SetLoop(false); - g_system->unlockMutex(vdb); + g_system->unlockMutex(GLOBALS.vdb); } - if (nTonyNextTalkType != Tony->TALK_NORMAL) { - CORO_INVOKE_1(Tony->StartTalk, nTonyNextTalkType); + if (GLOBALS.nTonyNextTalkType != GLOBALS.Tony->TALK_NORMAL) { + CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.nTonyNextTalkType); - if (!bStaticTalk) - nTonyNextTalkType = Tony->TALK_NORMAL; + if (!GLOBALS.bStaticTalk) + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; } else { if (_ctx->msg.NumPeriods() > 1) - CORO_INVOKE_1(Tony->StartTalk, Tony->TALK_FIANCHI); + CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.Tony->TALK_FIANCHI); else - CORO_INVOKE_1(Tony->StartTalk, Tony->TALK_NORMAL); + CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.Tony->TALK_NORMAL); } - if (curBackText) - CORO_INVOKE_0(curBackText->Hide); + if (GLOBALS.curBackText) + CORO_INVOKE_0(GLOBALS.curBackText->Hide); - bTonyIsSpeaking = true; + GLOBALS.bTonyIsSpeaking = true; - for (_ctx->i = 0; _ctx->i < _ctx->msg.NumPeriods() && !bSkipIdle; _ctx->i++) { - _ctx->text.SetInput(Input); + for (_ctx->i = 0; _ctx->i < _ctx->msg.NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { + _ctx->text.SetInput(GLOBALS.Input); // Allineamento _ctx->text.SetAlignType(RMText::HCENTER, RMText::VBOTTOM); @@ -448,22 +399,22 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX // Setta la posizione if (nX == 0 && nY == 0) - _ctx->text.SetPosition(Tony->Position() - RMPoint(0, 130) - Loc->ScrollPosition()); + _ctx->text.SetPosition(GLOBALS.Tony->Position() - RMPoint(0, 130) - GLOBALS.Loc->ScrollPosition()); else - _ctx->text.SetPosition(RMPoint(nX, nY) - Loc->ScrollPosition()); + _ctx->text.SetPosition(RMPoint(nX, nY) - GLOBALS.Loc->ScrollPosition()); // Setta l'always display - if (bAlwaysDisplay) { _ctx->text.SetAlwaysDisplay(); _ctx->text.ForceTime(); } + if (GLOBALS.bAlwaysDisplay) { _ctx->text.SetAlwaysDisplay(); _ctx->text.ForceTime(); } // Registra il testo - LinkGraphicTask(&_ctx->text); + GLOBALS.LinkGraphicTask(&_ctx->text); if (_ctx->curVoc) { if (_ctx->i == 0) { _ctx->voice->Play(); _ctx->text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } else { - g_system->lockMutex(vdb); + g_system->lockMutex(GLOBALS.vdb); // fseek(_vm->m_vdbFP, _ctx->curOffset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curOffset); _vm->_theSound.CreateSfx(&_ctx->voice); @@ -473,12 +424,12 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->voice->SetLoop(false); _ctx->voice->Play(); _ctx->text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); - g_system->unlockMutex(vdb); + g_system->unlockMutex(GLOBALS.vdb); } } // Aspetta la fine della visualizzazione - _ctx->text.SetCustomSkipHandle(hSkipIdle); + _ctx->text.SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text.WaitForEndDisplay); if (_ctx->curVoc) { @@ -488,17 +439,17 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX } } - bTonyIsSpeaking = false; - if (curBackText) - curBackText->Show(); + GLOBALS.bTonyIsSpeaking = false; + if (GLOBALS.curBackText) + GLOBALS.curBackText->Show(); - CORO_INVOKE_0(Tony->EndTalk); + CORO_INVOKE_0(GLOBALS.Tony->EndTalk); CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(ChangeBoxStatus)(CORO_PARAM, uint32 nLoc, uint32 nBox, uint32 nStatus, uint32) { - Boxes->ChangeBoxStatus(nLoc,nBox,nStatus); + GLOBALS.Boxes->ChangeBoxStatus(nLoc, nBox, nStatus); } @@ -509,15 +460,15 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, ui CORO_BEGIN_CODE(_ctx); - Freeze(); + GLOBALS.Freeze(); - curChangedHotspot = 0; + GLOBALS.curChangedHotspot = 0; if (bUseStartPos != 0) - LoadLocation(nLoc, RMPoint(tX, tY), StartLocPos[nLoc]); + GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), GLOBALS.StartLocPos[nLoc]); else - LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); + GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); - Unfreeze(); + GLOBALS.Unfreeze(); _ctx->h = mpalQueryDoAction(0, nLoc, 0); // On Enter? @@ -528,9 +479,6 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, ui } -RMPoint SFM_pt; -int SFM_nLoc; - DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) { CORO_BEGIN_CONTEXT; RMMessage *msg; @@ -543,18 +491,18 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 _ctx->msg = new RMMessage(nMsg); - SFM_nLoc = Loc->TEMPGetNumLoc(); - SFM_pt = Tony->Position(); + GLOBALS.SFM_nLoc = GLOBALS.Loc->TEMPGetNumLoc(); + GLOBALS.SFM_pt = GLOBALS.Tony->Position(); - if (bSkipIdle) + if (GLOBALS.bSkipIdle) return; - CORO_INVOKE_2(UnloadLocation, false, NULL); - Tony->Hide(); - Unfreeze(); + CORO_INVOKE_2(GLOBALS.UnloadLocation, false, NULL); + GLOBALS.Tony->Hide(); + GLOBALS.Unfreeze(); - for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !bSkipIdle; _ctx->i++) { - _ctx->text.SetInput(Input); + for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { + _ctx->text.SetInput(GLOBALS.Input); // Allineamento _ctx->text.SetAlignType(RMText::HCENTER,RMText::VCENTER); @@ -578,11 +526,11 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 _ctx->text.ForceTime(); // Registra il testo - LinkGraphicTask(&_ctx->clear); - LinkGraphicTask(&_ctx->text); + GLOBALS.LinkGraphicTask(&_ctx->clear); + GLOBALS.LinkGraphicTask(&_ctx->text); // Aspetta la fine della visualizzazione - _ctx->text.SetCustomSkipHandle(hSkipIdle); + _ctx->text.SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text.WaitForEndDisplay); } @@ -599,19 +547,19 @@ DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) CORO_BEGIN_CODE(_ctx); - LinkGraphicTask(&_ctx->clear); + GLOBALS.LinkGraphicTask(&_ctx->clear); - CORO_INVOKE_0(WaitFrame); + CORO_INVOKE_0(GLOBALS.WaitFrame); CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) { - Freeze(); - LoadLocation(SFM_nLoc,RMPoint(SFM_pt.x,SFM_pt.y),RMPoint(-1,-1)); + GLOBALS.Freeze(); + GLOBALS.LoadLocation(GLOBALS.SFM_nLoc,RMPoint(GLOBALS.SFM_pt.x,GLOBALS.SFM_pt.y),RMPoint(-1,-1)); if (!bNotEnableTony) - Tony->Show(); - Unfreeze(); + GLOBALS.Tony->Show(); + GLOBALS.Unfreeze(); MCharResetCodes(); ReapplyChangedHotspot(); @@ -630,10 +578,8 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMessage)(CORO_PARAM, uint32 nMsg, uint32 n CORO_END_CODE; } -bool bNoOcchioDiBue = false; - DECLARE_CUSTOM_FUNCTION(NoOcchioDiBue)(CORO_PARAM, uint32, uint32, uint32, uint32) { - bNoOcchioDiBue = true; + GLOBALS.bNoOcchioDiBue = true; } DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -642,16 +588,16 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 CORO_BEGIN_CODE(_ctx); - if (!bNoOcchioDiBue) { - InitWipe(1); - CORO_INVOKE_0(WaitWipeEnd); + if (!GLOBALS.bNoOcchioDiBue) { + GLOBALS.InitWipe(1); + CORO_INVOKE_0(GLOBALS.WaitWipeEnd); } _vm->StopMusic(4); // On Exit e lascia freezzato - CORO_INVOKE_2(UnloadLocation, true, NULL); - Unfreeze(); + CORO_INVOKE_2(GLOBALS.UnloadLocation, true, NULL); + GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -664,45 +610,45 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint CORO_BEGIN_CODE(_ctx); - if (!bNoOcchioDiBue) { - InitWipe(1); - CORO_INVOKE_0(WaitWipeEnd); + if (!GLOBALS.bNoOcchioDiBue) { + GLOBALS.InitWipe(1); + CORO_INVOKE_0(GLOBALS.WaitWipeEnd); } - if (lastTappeto != tappeti[nLoc]) { + if (GLOBALS.lastTappeto != GLOBALS.tappeti[nLoc]) { _vm->StopMusic(4); } // On Exit e lascia freezzato - CORO_INVOKE_2(UnloadLocation, true, NULL); + CORO_INVOKE_2(GLOBALS.UnloadLocation, true, NULL); - curChangedHotspot = 0; + GLOBALS.curChangedHotspot = 0; if (bUseStartPos != 0) - LoadLocation(nLoc, RMPoint(tX, tY), StartLocPos[nLoc]); + GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), GLOBALS.StartLocPos[nLoc]); else - LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); + GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); - if (lastTappeto != tappeti[nLoc]) { - lastTappeto = tappeti[nLoc]; - if (lastTappeto != 0) - _vm->PlayMusic(4, tappetiFile[lastTappeto], 0, true, 2000); + if (GLOBALS.lastTappeto != GLOBALS.tappeti[nLoc]) { + GLOBALS.lastTappeto = GLOBALS.tappeti[nLoc]; + if (GLOBALS.lastTappeto != 0) + _vm->PlayMusic(4, tappetiFile[GLOBALS.lastTappeto], 0, true, 2000); } - if (!bNoOcchioDiBue) { - InitWipe(2); + if (!GLOBALS.bNoOcchioDiBue) { + GLOBALS.InitWipe(2); } - Unfreeze(); + GLOBALS.Unfreeze(); _ctx->h = mpalQueryDoAction(0, nLoc, 0); - if (!bNoOcchioDiBue) { - CORO_INVOKE_0(WaitWipeEnd); - CloseWipe(); + if (!GLOBALS.bNoOcchioDiBue) { + CORO_INVOKE_0(GLOBALS.WaitWipeEnd); + GLOBALS.CloseWipe(); } - bNoOcchioDiBue = false; + GLOBALS.bNoOcchioDiBue = false; // On Enter? if (_ctx->h != CORO_INVALID_PID_VALUE) @@ -712,12 +658,12 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint } DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(CORO_PARAM, uint32 nLoc, uint32 lX, uint32 lY, uint32) { - StartLocPos[nLoc].Set(lX,lY); + GLOBALS.StartLocPos[nLoc].Set(lX,lY); } DECLARE_CUSTOM_FUNCTION(SaveTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) { - saveTonyPos = Tony->Position(); - saveTonyLoc = Loc->TEMPGetNumLoc(); + GLOBALS.saveTonyPos = GLOBALS.Tony->Position(); + GLOBALS.saveTonyLoc = GLOBALS.Loc->TEMPGetNumLoc(); } DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -726,7 +672,7 @@ DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_4(ChangeLocation, saveTonyLoc, saveTonyPos.x, saveTonyPos.y, 0); + CORO_INVOKE_4(ChangeLocation, GLOBALS.saveTonyLoc, GLOBALS.saveTonyPos.x, GLOBALS.saveTonyPos.y, 0); MCharResetCodes(); @@ -744,16 +690,16 @@ DECLARE_CUSTOM_FUNCTION(EnableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) } DECLARE_CUSTOM_FUNCTION(StopTony)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->StopNoAction(coroParam); + GLOBALS.Tony->StopNoAction(coroParam); } DECLARE_CUSTOM_FUNCTION(CustEnableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) { - EnableGUI(); + GLOBALS.EnableGUI(); } DECLARE_CUSTOM_FUNCTION(CustDisableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) { - DisableGUI(); + GLOBALS.DisableGUI(); } @@ -764,12 +710,12 @@ void TonyGenericTake1(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); - Freeze(); - Tony->Take(nDirection, 0); - Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Tony->Take(nDirection, 0); + GLOBALS.Unfreeze(); - if (!bSkipIdle) - CORO_INVOKE_0(Tony->WaitForEndPattern); + if (!GLOBALS.bSkipIdle) + CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); CORO_END_CODE; } @@ -780,16 +726,16 @@ void TonyGenericTake2(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); - Freeze(); - Tony->Take(nDirection, 1); - Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Tony->Take(nDirection, 1); + GLOBALS.Unfreeze(); - if (!bSkipIdle) - CORO_INVOKE_0(Tony->WaitForEndPattern); + if (!GLOBALS.bSkipIdle) + CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); - Freeze(); - Tony->Take(nDirection,2); - Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Tony->Take(nDirection,2); + GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -800,12 +746,12 @@ void TonyGenericPut1(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); - Freeze(); - Tony->Put(nDirection, 0); - Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Tony->Put(nDirection, 0); + GLOBALS.Unfreeze(); - if (!bSkipIdle) - CORO_INVOKE_0(Tony->WaitForEndPattern); + if (!GLOBALS.bSkipIdle) + CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); CORO_END_CODE; } @@ -816,16 +762,16 @@ void TonyGenericPut2(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); - Freeze(); - Tony->Put(nDirection,1); - Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Tony->Put(nDirection,1); + GLOBALS.Unfreeze(); - if (!bSkipIdle) - CORO_INVOKE_0(Tony->WaitForEndPattern); + if (!GLOBALS.bSkipIdle) + CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); - Freeze(); - Tony->Put(nDirection,2); - Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Tony->Put(nDirection,2); + GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -890,9 +836,9 @@ DECLARE_CUSTOM_FUNCTION(TonyPutDown2)(CORO_PARAM, uint32, uint32, uint32, uint32 DECLARE_CUSTOM_FUNCTION(TonyPerTerra)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { if (dwParte == 0) - Tony->SetPattern(Tony->PAT_PERTERRALEFT); + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_PERTERRALEFT); else - Tony->SetPattern(Tony->PAT_PERTERRARIGHT); + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_PERTERRARIGHT); } DECLARE_CUSTOM_FUNCTION(TonySiRialza)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { @@ -902,18 +848,18 @@ DECLARE_CUSTOM_FUNCTION(TonySiRialza)(CORO_PARAM, uint32 dwParte, uint32, uint32 CORO_BEGIN_CODE(_ctx); if (dwParte == 0) - Tony->SetPattern(Tony->PAT_SIRIALZALEFT); + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SIRIALZALEFT); else - Tony->SetPattern(Tony->PAT_SIRIALZARIGHT); + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SIRIALZARIGHT); - if (!bSkipIdle) - CORO_INVOKE_0(Tony->WaitForEndPattern); + if (!GLOBALS.bSkipIdle) + CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(TonyPastorella)(CORO_PARAM, uint32 bIsPast, uint32, uint32, uint32) { - Tony->SetPastorella(bIsPast); + GLOBALS.Tony->SetPastorella(bIsPast); } DECLARE_CUSTOM_FUNCTION(TonyFischietto)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -922,104 +868,104 @@ DECLARE_CUSTOM_FUNCTION(TonyFischietto)(CORO_PARAM, uint32, uint32, uint32, uint CORO_BEGIN_CODE(_ctx); - Tony->SetPattern(Tony->PAT_FISCHIETTORIGHT); - if (!bSkipIdle) - CORO_INVOKE_0(Tony->WaitForEndPattern); + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_FISCHIETTORIGHT); + if (!GLOBALS.bSkipIdle) + CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); - Tony->SetPattern(Tony->PAT_STANDRIGHT); + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_STANDRIGHT); CORO_END_CODE; } void TonySetNumTexts(uint32 dwText) { - dwTonyNumTexts=dwText; - bTonyInTexts = false; + GLOBALS.dwTonyNumTexts = dwText; + GLOBALS.bTonyInTexts = false; } DECLARE_CUSTOM_FUNCTION(TonyRide)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_RIDE; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_RIDE; } DECLARE_CUSTOM_FUNCTION(TonyRidacchia)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_RIDE2; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_RIDE2; } DECLARE_CUSTOM_FUNCTION(TonyFianchi)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_FIANCHI; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_FIANCHI; } DECLARE_CUSTOM_FUNCTION(TonyCanta)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_CANTA; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CANTA; } DECLARE_CUSTOM_FUNCTION(TonySiIndica)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_SIINDICA; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_SIINDICA; } DECLARE_CUSTOM_FUNCTION(TonySpaventatoConMani)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_SPAVENTATO; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_SPAVENTATO; } DECLARE_CUSTOM_FUNCTION(TonySpaventatoSenzaMani)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_SPAVENTATO2; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_SPAVENTATO2; } DECLARE_CUSTOM_FUNCTION(TonyConMartello)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_CONMARTELLO; - Tony->SetPattern(Tony->PAT_CONMARTELLO); + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONMARTELLO; + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_CONMARTELLO); } DECLARE_CUSTOM_FUNCTION(TonyConBicchiere)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_CONBICCHIERE; - Tony->SetPattern(Tony->PAT_CONBICCHIERE); + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONBICCHIERE; + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_CONBICCHIERE); } DECLARE_CUSTOM_FUNCTION(TonyConVerme)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_CONVERME; - Tony->SetPattern(Tony->PAT_CONVERME); + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONVERME; + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_CONVERME); } DECLARE_CUSTOM_FUNCTION(TonyConCorda)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_CONCORDA; - Tony->SetPattern(Tony->PAT_CONCORDA); + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCORDA; + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_CONCORDA); } DECLARE_CUSTOM_FUNCTION(TonyConSegretaria)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_CONSEGRETARIA; - Tony->SetPattern(Tony->PAT_CONSEGRETARIA); + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONSEGRETARIA; + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_CONSEGRETARIA); } DECLARE_CUSTOM_FUNCTION(TonyConConiglioANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_CONCONIGLIO; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCONIGLIO; } DECLARE_CUSTOM_FUNCTION(TonyConRicettaANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_CONRICETTA; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONRICETTA; } DECLARE_CUSTOM_FUNCTION(TonyConCarteANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_CONCARTE; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCARTE; } DECLARE_CUSTOM_FUNCTION(TonyConPupazzoANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_CONPUPAZZO; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONPUPAZZO; } DECLARE_CUSTOM_FUNCTION(TonyConPupazzoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -1028,9 +974,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConPupazzoStart)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - nTonyNextTalkType = Tony->TALK_CONPUPAZZOSTATIC; - bStaticTalk = true; - CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONPUPAZZOSTATIC); + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONPUPAZZOSTATIC; + GLOBALS.bStaticTalk = true; + CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONPUPAZZOSTATIC); CORO_END_CODE; } @@ -1041,9 +987,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConPupazzoEnd)(CORO_PARAM, uint32, uint32, uint32, u CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONPUPAZZOSTATIC); - bStaticTalk = false; - nTonyNextTalkType = Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONPUPAZZOSTATIC); + GLOBALS.bStaticTalk = false; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; CORO_END_CODE; } @@ -1054,9 +1000,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConConiglioStart)(CORO_PARAM, uint32, uint32, uint32 CORO_BEGIN_CODE(_ctx); - nTonyNextTalkType = Tony->TALK_CONCONIGLIOSTATIC; - bStaticTalk = true; - CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONCONIGLIOSTATIC); + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCONIGLIOSTATIC; + GLOBALS.bStaticTalk = true; + CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONCONIGLIOSTATIC); CORO_END_CODE; } @@ -1067,9 +1013,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConConiglioEnd)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONCONIGLIOSTATIC); - bStaticTalk = false; - nTonyNextTalkType = Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONCONIGLIOSTATIC); + GLOBALS.bStaticTalk = false; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; CORO_END_CODE; } @@ -1080,9 +1026,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConRicettaStart)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - nTonyNextTalkType = Tony->TALK_CONRICETTASTATIC; - bStaticTalk = true; - CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONRICETTASTATIC); + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONRICETTASTATIC; + GLOBALS.bStaticTalk = true; + CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONRICETTASTATIC); CORO_END_CODE; } @@ -1093,9 +1039,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConRicettaEnd)(CORO_PARAM, uint32, uint32, uint32, u CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONRICETTASTATIC); - bStaticTalk = false; - nTonyNextTalkType = Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONRICETTASTATIC); + GLOBALS.bStaticTalk = false; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; CORO_END_CODE; } @@ -1106,9 +1052,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConCarteStart)(CORO_PARAM, uint32, uint32, uint32, u CORO_BEGIN_CODE(_ctx); - nTonyNextTalkType = Tony->TALK_CONCARTESTATIC; - bStaticTalk = true; - CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONCARTESTATIC); + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCARTESTATIC; + GLOBALS.bStaticTalk = true; + CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONCARTESTATIC); CORO_END_CODE; } @@ -1119,9 +1065,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConCarteEnd)(CORO_PARAM, uint32, uint32, uint32, uin CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONCARTESTATIC); - bStaticTalk = false; - nTonyNextTalkType = Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONCARTESTATIC); + GLOBALS.bStaticTalk = false; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; CORO_END_CODE; } @@ -1132,9 +1078,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoStart)(CORO_PARAM, uint32, uint32, uint32 CORO_BEGIN_CODE(_ctx); - nTonyNextTalkType = Tony->TALK_CONTACCUINOSTATIC; - bStaticTalk = true; - CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONTACCUINOSTATIC); + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONTACCUINOSTATIC; + GLOBALS.bStaticTalk = true; + CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONTACCUINOSTATIC); CORO_END_CODE; } @@ -1145,9 +1091,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoEnd)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONTACCUINOSTATIC); - bStaticTalk = false; - nTonyNextTalkType = Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONTACCUINOSTATIC); + GLOBALS.bStaticTalk = false; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; CORO_END_CODE; } @@ -1158,9 +1104,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConMegafonoStart)(CORO_PARAM, uint32, uint32, uint32 CORO_BEGIN_CODE(_ctx); - nTonyNextTalkType = Tony->TALK_CONMEGAFONOSTATIC; - bStaticTalk = true; - CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONMEGAFONOSTATIC); + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONMEGAFONOSTATIC; + GLOBALS.bStaticTalk = true; + CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONMEGAFONOSTATIC); CORO_END_CODE; } @@ -1171,9 +1117,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConMegafonoEnd)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONMEGAFONOSTATIC); - bStaticTalk = false; - nTonyNextTalkType = Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONMEGAFONOSTATIC); + GLOBALS.bStaticTalk = false; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; CORO_END_CODE; } @@ -1184,9 +1130,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConBarbaStart)(CORO_PARAM, uint32, uint32, uint32, u CORO_BEGIN_CODE(_ctx); - nTonyNextTalkType = Tony->TALK_CONBARBASTATIC; - bStaticTalk = true; - CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_CONBARBASTATIC); + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONBARBASTATIC; + GLOBALS.bStaticTalk = true; + CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_CONBARBASTATIC); CORO_END_CODE; } @@ -1197,9 +1143,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConBarbaEnd)(CORO_PARAM, uint32, uint32, uint32, uin CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_CONBARBASTATIC); - bStaticTalk = false; - nTonyNextTalkType = Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_CONBARBASTATIC); + GLOBALS.bStaticTalk = false; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; CORO_END_CODE; } @@ -1210,9 +1156,9 @@ DECLARE_CUSTOM_FUNCTION(TonySpaventatoStart)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - nTonyNextTalkType = Tony->TALK_SPAVENTATOSTATIC; - bStaticTalk = true; - CORO_INVOKE_1(Tony->StartStatic, Tony->TALK_SPAVENTATOSTATIC); + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_SPAVENTATOSTATIC; + GLOBALS.bStaticTalk = true; + CORO_INVOKE_1(GLOBALS.Tony->StartStatic, GLOBALS.Tony->TALK_SPAVENTATOSTATIC); CORO_END_CODE; } @@ -1223,9 +1169,9 @@ DECLARE_CUSTOM_FUNCTION(TonySpaventatoEnd)(CORO_PARAM, uint32, uint32, uint32, u CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(Tony->EndStatic, Tony->TALK_SPAVENTATOSTATIC); - bStaticTalk = false; - nTonyNextTalkType = Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS.Tony->EndStatic, GLOBALS.Tony->TALK_SPAVENTATOSTATIC); + GLOBALS.bStaticTalk = false; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; CORO_END_CODE; } @@ -1233,7 +1179,7 @@ DECLARE_CUSTOM_FUNCTION(TonySpaventatoEnd)(CORO_PARAM, uint32, uint32, uint32, u DECLARE_CUSTOM_FUNCTION(TonySchifato)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_SCHIFATO; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_SCHIFATO; } DECLARE_CUSTOM_FUNCTION(TonySniffaLeft)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -1242,8 +1188,8 @@ DECLARE_CUSTOM_FUNCTION(TonySniffaLeft)(CORO_PARAM, uint32, uint32, uint32, uint CORO_BEGIN_CODE(_ctx); - Tony->SetPattern(Tony->PAT_SNIFFA_LEFT); - CORO_INVOKE_0(Tony->WaitForEndPattern); + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SNIFFA_LEFT); + CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); CORO_INVOKE_4(LeftToMe, 0, 0, 0, 0); CORO_END_CODE; @@ -1255,8 +1201,8 @@ DECLARE_CUSTOM_FUNCTION(TonySniffaRight)(CORO_PARAM, uint32, uint32, uint32, uin CORO_BEGIN_CODE(_ctx); - Tony->SetPattern(Tony->PAT_SNIFFA_RIGHT); - CORO_INVOKE_0(Tony->WaitForEndPattern); + GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SNIFFA_RIGHT); + CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); CORO_INVOKE_4(RightToMe, 0, 0, 0, 0); CORO_END_CODE; @@ -1264,48 +1210,48 @@ DECLARE_CUSTOM_FUNCTION(TonySniffaRight)(CORO_PARAM, uint32, uint32, uint32, uin DECLARE_CUSTOM_FUNCTION(TonyNaah)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - nTonyNextTalkType = Tony->TALK_NAAH; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NAAH; } DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(CORO_PARAM, uint32 nPos, uint32, uint32, uint32) { switch (nPos) { case 1: - nTonyNextTalkType = Tony->TALK_MACBETH1; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH1; break; case 2: - nTonyNextTalkType = Tony->TALK_MACBETH2; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH2; break; case 3: - nTonyNextTalkType = Tony->TALK_MACBETH3; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH3; break; case 4: - nTonyNextTalkType = Tony->TALK_MACBETH4; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH4; break; case 5: - nTonyNextTalkType = Tony->TALK_MACBETH5; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH5; break; case 6: - nTonyNextTalkType = Tony->TALK_MACBETH6; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH6; break; case 7: - nTonyNextTalkType = Tony->TALK_MACBETH7; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH7; break; case 8: - nTonyNextTalkType = Tony->TALK_MACBETH8; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH8; break; case 9: - nTonyNextTalkType = Tony->TALK_MACBETH9; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH9; break; } } DECLARE_CUSTOM_FUNCTION(EnableTony)(CORO_PARAM, uint32, uint32, uint32, uint32) { - Tony->Show(); + GLOBALS.Tony->Show(); } DECLARE_CUSTOM_FUNCTION(DisableTony)(CORO_PARAM, uint32 bShowOmbra, uint32, uint32, uint32) { - Tony->Hide(bShowOmbra); + GLOBALS.Tony->Hide(bShowOmbra); } DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uint32, uint32) { @@ -1315,17 +1261,17 @@ DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uin CORO_BEGIN_CODE(_ctx); - _ctx->item = Loc->GetItemFromCode(nItem); + _ctx->item = GLOBALS.Loc->GetItemFromCode(nItem); - if (!bSkipIdle && _ctx->item != NULL) - CORO_INVOKE_1(_ctx->item->WaitForEndPattern, hSkipIdle); + if (!GLOBALS.bSkipIdle && _ctx->item != NULL) + CORO_INVOKE_1(_ctx->item->WaitForEndPattern, GLOBALS.hSkipIdle); CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(SetTonyPosition)(CORO_PARAM, uint32 nX, uint32 nY, uint32 nLoc, uint32) { - 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) { @@ -1334,16 +1280,16 @@ DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint3 CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(Tony->Move, RMPoint(nX, nY)); + CORO_INVOKE_1(GLOBALS.Tony->Move, RMPoint(nX, nY)); - if (!bSkipIdle) - CORO_INVOKE_0(Tony->WaitForEndMovement); + if (!GLOBALS.bSkipIdle) + CORO_INVOKE_0(GLOBALS.Tony->WaitForEndMovement); CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(MoveTony)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) { - 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) { @@ -1358,9 +1304,9 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 _ctx->lx = (int32)nX; _ctx->ly = (int32)nY; - _ctx->pt = Loc->ScrollPosition(); + _ctx->pt = GLOBALS.Loc->ScrollPosition(); - while ((_ctx->lx != 0 || _ctx->ly != 0) && !bSkipIdle) { + while ((_ctx->lx != 0 || _ctx->ly != 0) && !GLOBALS.bSkipIdle) { if (_ctx->lx > 0) { _ctx->lx -= (int32)sX; if (_ctx->lx < 0) _ctx->lx = 0; _ctx->pt.Offset((int32)sX, 0); @@ -1377,12 +1323,12 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 _ctx->pt.Offset(0, -(int32)sY); } - CORO_INVOKE_0(WaitFrame); + CORO_INVOKE_0(GLOBALS.WaitFrame); - Freeze(); - Loc->SetScrollPosition(_ctx->pt); - Tony->SetScrollPosition(_ctx->pt); - Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Loc->SetScrollPosition(_ctx->pt); + GLOBALS.Tony->SetScrollPosition(_ctx->pt); + GLOBALS.Unfreeze(); } CORO_END_CODE; @@ -1410,7 +1356,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui _ctx->stepX = sX; _ctx->stepY = sY; - _ctx->startpt = Loc->ScrollPosition(); + _ctx->startpt = GLOBALS.Loc->ScrollPosition(); _ctx->dwStartTime = _vm->GetTime(); @@ -1419,7 +1365,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui else _ctx->dwTotalTime = _ctx->dimy * (1000 / 35) / sY; - while ((_ctx->lx != 0 || _ctx->ly != 0) && !bSkipIdle) { + while ((_ctx->lx != 0 || _ctx->ly != 0) && !GLOBALS.bSkipIdle) { _ctx->dwCurTime = _vm->GetTime() - _ctx->dwStartTime; if (_ctx->dwCurTime > _ctx->dwTotalTime) break; @@ -1459,12 +1405,12 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui _ctx->pt.Offset(0,-sY); } */ - CORO_INVOKE_0(WaitFrame); + CORO_INVOKE_0(GLOBALS.WaitFrame); - Freeze(); - Loc->SetScrollPosition(_ctx->pt); - Tony->SetScrollPosition(_ctx->pt); - Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Loc->SetScrollPosition(_ctx->pt); + GLOBALS.Tony->SetScrollPosition(_ctx->pt); + GLOBALS.Unfreeze(); } @@ -1482,10 +1428,10 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui _ctx->pt.y = _ctx->startpt.y - _ctx->dimy; } - Freeze(); - Loc->SetScrollPosition(_ctx->pt); - Tony->SetScrollPosition(_ctx->pt); - Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Loc->SetScrollPosition(_ctx->pt); + GLOBALS.Tony->SetScrollPosition(_ctx->pt); + GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -1494,21 +1440,21 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uint32 nY, uint32) { int i; - for (i = 0; i < curChangedHotspot; i++) - if (ChangedHotspot[i].dwCode == dwCode) { - ChangedHotspot[i].nX=nX; - ChangedHotspot[i].nY=nY; + for (i = 0; i < GLOBALS.curChangedHotspot; i++) + if (GLOBALS.ChangedHotspot[i].dwCode == dwCode) { + GLOBALS.ChangedHotspot[i].nX=nX; + GLOBALS.ChangedHotspot[i].nY=nY; break; } - if (i == curChangedHotspot) { - ChangedHotspot[i].dwCode=dwCode; - ChangedHotspot[i].nX=nX; - ChangedHotspot[i].nY=nY; - curChangedHotspot++; + if (i == GLOBALS.curChangedHotspot) { + GLOBALS.ChangedHotspot[i].dwCode=dwCode; + GLOBALS.ChangedHotspot[i].nX=nX; + GLOBALS.ChangedHotspot[i].nY=nY; + GLOBALS.curChangedHotspot++; } - Loc->GetItemFromCode(dwCode)->ChangeHotspot(RMPoint(nX, nY)); + GLOBALS.Loc->GetItemFromCode(dwCode)->ChangeHotspot(RMPoint(nX, nY)); } @@ -1535,12 +1481,12 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32 _ctx->diry = 1; while (_vm->GetTime() < _ctx->curTime + nScosse) { - CORO_INVOKE_0(WaitFrame); + CORO_INVOKE_0(GLOBALS.WaitFrame); - Freeze(); - Loc->SetFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); - Tony->SetFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); - Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Loc->SetFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); + GLOBALS.Tony->SetFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); + GLOBALS.Unfreeze(); _ctx->i = _vm->_randomSource.getRandomNumber(2); @@ -1550,10 +1496,10 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32 _ctx->diry = -_ctx->diry; } - Freeze(); - Loc->SetFixedScroll(RMPoint(0, 0)); - Tony->SetFixedScroll(RMPoint(0, 0)); - Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Loc->SetFixedScroll(RMPoint(0, 0)); + GLOBALS.Tony->SetFixedScroll(RMPoint(0, 0)); + GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -1566,36 +1512,36 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32 DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { assert(nChar < 16); - Character[nChar].code = nCode; - Character[nChar].item = Loc->GetItemFromCode(nCode); - Character[nChar].r = 255; - Character[nChar].g = 255; - Character[nChar].b = 255; - Character[nChar].talkpattern = 0; - Character[nChar].starttalkpattern = 0; - Character[nChar].endtalkpattern = 0; - Character[nChar].standpattern = 0; + GLOBALS.Character[nChar].code = nCode; + GLOBALS.Character[nChar].item = GLOBALS.Loc->GetItemFromCode(nCode); + GLOBALS.Character[nChar].r = 255; + GLOBALS.Character[nChar].g = 255; + GLOBALS.Character[nChar].b = 255; + GLOBALS.Character[nChar].talkpattern = 0; + GLOBALS.Character[nChar].starttalkpattern = 0; + GLOBALS.Character[nChar].endtalkpattern = 0; + GLOBALS.Character[nChar].standpattern = 0; - IsMChar[nChar] = false; + GLOBALS.IsMChar[nChar] = false; } DECLARE_CUSTOM_FUNCTION(CharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) { assert(nChar<16); - Character[nChar].r = r; - Character[nChar].g = g; - Character[nChar].b = b; + GLOBALS.Character[nChar].r = r; + GLOBALS.Character[nChar].g = g; + GLOBALS.Character[nChar].b = b; } DECLARE_CUSTOM_FUNCTION(CharSetTalkPattern)(CORO_PARAM, uint32 nChar, uint32 tp, uint32 sp, uint32) { assert(nChar<16); - Character[nChar].talkpattern = tp; - Character[nChar].standpattern = sp; + GLOBALS.Character[nChar].talkpattern = tp; + GLOBALS.Character[nChar].standpattern = sp; } DECLARE_CUSTOM_FUNCTION(CharSetStartEndTalkPattern)(CORO_PARAM, uint32 nChar, uint32 sp, uint32 ep, uint32) { assert(nChar<16); - Character[nChar].starttalkpattern=sp; - Character[nChar].endtalkpattern=ep; + GLOBALS.Character[nChar].starttalkpattern=sp; + GLOBALS.Character[nChar].endtalkpattern=ep; } DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32) { @@ -1615,40 +1561,40 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->curOffset = 0; assert(nChar < 16); - _ctx->pt = Character[nChar].item->CalculatePos() - RMPoint(-60, 20) - Loc->ScrollPosition(); + _ctx->pt = GLOBALS.Character[nChar].item->CalculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->ScrollPosition(); - if (Character[nChar].starttalkpattern != 0) { - Freeze(); - Character[nChar].item->SetPattern(Character[nChar].starttalkpattern); - Unfreeze(); + if (GLOBALS.Character[nChar].starttalkpattern != 0) { + GLOBALS.Freeze(); + GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].starttalkpattern); + GLOBALS.Unfreeze(); - CORO_INVOKE_0(Character[nChar].item->WaitForEndPattern); + CORO_INVOKE_0(GLOBALS.Character[nChar].item->WaitForEndPattern); } - Freeze(); - Character[nChar].item->SetPattern(Character[nChar].talkpattern); - Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].talkpattern); + GLOBALS.Unfreeze(); _ctx->curVoc = SearchVoiceHeader(0, dwMessage); _ctx->voice = NULL; if (_ctx->curVoc) { // Si posiziona all'interno del database delle voci all'inizio della prima // fseek(_vm->m_vdbFP, _ctx->curVoc->offset, SEEK_SET); - g_system->lockMutex(vdb); + g_system->lockMutex(GLOBALS.vdb); _vm->_vdbFP.seek(_ctx->curVoc->offset); _ctx->curOffset = _ctx->curVoc->offset; - g_system->unlockMutex(vdb); + g_system->unlockMutex(GLOBALS.vdb); } - for (_ctx->i = 0; _ctx->i<_ctx->msg->NumPeriods() && !bSkipIdle; _ctx->i++) { + for (_ctx->i = 0; _ctx->i<_ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { if (bIsBack) { - curBackText = _ctx->text = new RMTextDialogScrolling(Loc); - if (bTonyIsSpeaking) - CORO_INVOKE_0(curBackText->Hide); + GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); + if (GLOBALS.bTonyIsSpeaking) + CORO_INVOKE_0(GLOBALS.curBackText->Hide); } else _ctx->text = new RMTextDialog; - _ctx->text->SetInput(Input); + _ctx->text->SetInput(GLOBALS.Input); // Skipping _ctx->text->SetSkipStatus(!bIsBack); @@ -1657,7 +1603,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); // Colore - _ctx->text->SetColor(Character[nChar].r,Character[nChar].g,Character[nChar].b); + _ctx->text->SetColor(GLOBALS.Character[nChar].r,GLOBALS.Character[nChar].g,GLOBALS.Character[nChar].b); // Scrive il testo _ctx->text->WriteText((*_ctx->msg)[_ctx->i],0); @@ -1666,13 +1612,13 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->text->SetPosition(_ctx->pt); // Setta l'always display - if (bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } + if (GLOBALS.bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } // Registra il testo - LinkGraphicTask(_ctx->text); + GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { - g_system->lockMutex(vdb); + g_system->lockMutex(GLOBALS.vdb); _vm->_theSound.CreateSfx(&_ctx->voice); _vm->_vdbFP.seek(_ctx->curOffset); _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); @@ -1681,11 +1627,11 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->voice->Play(); _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); _ctx->curOffset = _vm->_vdbFP.pos(); - g_system->unlockMutex(vdb); + g_system->unlockMutex(GLOBALS.vdb); } // Aspetta la fine della visualizzazione - _ctx->text->SetCustomSkipHandle(hSkipIdle); + _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); if (_ctx->curVoc) { @@ -1695,83 +1641,81 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess } - curBackText=NULL; + GLOBALS.curBackText = NULL; delete _ctx->text; } - if (Character[nChar].endtalkpattern != 0) { - Freeze(); - Character[nChar].item->SetPattern(Character[nChar].endtalkpattern); - Unfreeze(); - CORO_INVOKE_0(Character[nChar].item->WaitForEndPattern); + if (GLOBALS.Character[nChar].endtalkpattern != 0) { + GLOBALS.Freeze(); + GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].endtalkpattern); + GLOBALS.Unfreeze(); + CORO_INVOKE_0(GLOBALS.Character[nChar].item->WaitForEndPattern); } - Freeze(); - Character[nChar].item->SetPattern(Character[nChar].standpattern); - Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].standpattern); + GLOBALS.Unfreeze(); delete _ctx->msg; CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(AddInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { - Inventory->AddItem(dwCode); + GLOBALS.Inventory->AddItem(dwCode); } DECLARE_CUSTOM_FUNCTION(RemoveInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { - Inventory->RemoveItem(dwCode); + GLOBALS.Inventory->RemoveItem(dwCode); } DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32 dwStatus, uint32, uint32) { - Inventory->ChangeItemStatus(dwCode,dwStatus); + GLOBALS.Inventory->ChangeItemStatus(dwCode,dwStatus); } - - /* * Mastri Personaggi */ DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { assert(nChar < 10); - MCharacter[nChar].code=nCode; + GLOBALS.MCharacter[nChar].code=nCode; if (nCode== 0) - MCharacter[nChar].item=NULL; + GLOBALS.MCharacter[nChar].item=NULL; else - MCharacter[nChar].item=Loc->GetItemFromCode(nCode); - MCharacter[nChar].r=255; - MCharacter[nChar].g=255; - MCharacter[nChar].b=255; - MCharacter[nChar].x=-1; - MCharacter[nChar].y=-1; - MCharacter[nChar].bAlwaysBack = 0; + GLOBALS.MCharacter[nChar].item=GLOBALS.Loc->GetItemFromCode(nCode); + GLOBALS.MCharacter[nChar].r=255; + GLOBALS.MCharacter[nChar].g=255; + GLOBALS.MCharacter[nChar].b=255; + GLOBALS.MCharacter[nChar].x=-1; + GLOBALS.MCharacter[nChar].y=-1; + GLOBALS.MCharacter[nChar].bAlwaysBack = 0; for (int i = 0; i < 10; i++) - MCharacter[nChar].numtalks[i] = 1; + GLOBALS.MCharacter[nChar].numtalks[i] = 1; - MCharacter[nChar].curgroup = 0; + GLOBALS.MCharacter[nChar].curgroup = 0; - IsMChar[nChar] = true; + GLOBALS.IsMChar[nChar] = true; } DECLARE_CUSTOM_FUNCTION(MCharResetCode)(CORO_PARAM, uint32 nChar, uint32, uint32, uint32) { - MCharacter[nChar].item=Loc->GetItemFromCode(MCharacter[nChar].code); + GLOBALS.MCharacter[nChar].item=GLOBALS.Loc->GetItemFromCode(GLOBALS.MCharacter[nChar].code); } DECLARE_CUSTOM_FUNCTION(MCharSetPosition)(CORO_PARAM, uint32 nChar, uint32 nX, uint32 nY, uint32) { assert(nChar < 10); - MCharacter[nChar].x=nX; - MCharacter[nChar].y=nY; + GLOBALS.MCharacter[nChar].x=nX; + GLOBALS.MCharacter[nChar].y=nY; } DECLARE_CUSTOM_FUNCTION(MCharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) { assert(nChar < 10); - MCharacter[nChar].r=r; - MCharacter[nChar].g=g; - MCharacter[nChar].b=b; + GLOBALS.MCharacter[nChar].r=r; + GLOBALS.MCharacter[nChar].g=g; + GLOBALS.MCharacter[nChar].b=b; } @@ -1779,7 +1723,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSetNumTalksInGroup)(CORO_PARAM, uint32 nChar, uint3 assert(nChar < 10); assert(nGroup < 10); - MCharacter[nChar].numtalks[nGroup]=nTalks; + GLOBALS.MCharacter[nChar].numtalks[nGroup]=nTalks; } @@ -1788,20 +1732,20 @@ DECLARE_CUSTOM_FUNCTION(MCharSetCurrentGroup)(CORO_PARAM, uint32 nChar, uint32 n assert(nChar < 10); assert(nGroup < 10); - MCharacter[nChar].curgroup = nGroup; + GLOBALS.MCharacter[nChar].curgroup = nGroup; } DECLARE_CUSTOM_FUNCTION(MCharSetNumTexts)(CORO_PARAM, uint32 nChar, uint32 nTexts, uint32, uint32) { assert(nChar < 10); - MCharacter[nChar].numtexts=nTexts-1; - MCharacter[nChar].bInTexts = false; + GLOBALS.MCharacter[nChar].numtexts=nTexts-1; + GLOBALS.MCharacter[nChar].bInTexts = false; } DECLARE_CUSTOM_FUNCTION(MCharSetAlwaysBack)(CORO_PARAM, uint32 nChar, uint32 bAlwaysBack, uint32, uint32) { assert(nChar < 10); - MCharacter[nChar].bAlwaysBack=bAlwaysBack; + GLOBALS.MCharacter[nChar].bAlwaysBack=bAlwaysBack; } @@ -1825,21 +1769,21 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes assert(nChar < 10); - bIsBack |= MCharacter[nChar].bAlwaysBack ? 1 : 0; + bIsBack |= GLOBALS.MCharacter[nChar].bAlwaysBack ? 1 : 0; // Calcola la posizione del testo in base al frame corrente - if (MCharacter[nChar].x==-1) - _ctx->pt=MCharacter[nChar].item->CalculatePos()-RMPoint(-60,20)-Loc->ScrollPosition(); + if (GLOBALS.MCharacter[nChar].x==-1) + _ctx->pt=GLOBALS.MCharacter[nChar].item->CalculatePos()-RMPoint(-60,20)-GLOBALS.Loc->ScrollPosition(); else - _ctx->pt=RMPoint(MCharacter[nChar].x,MCharacter[nChar].y); + _ctx->pt=RMPoint(GLOBALS.MCharacter[nChar].x,GLOBALS.MCharacter[nChar].y); // Parametro per le azioni speciali: random tra le parlate - _ctx->parm = (MCharacter[nChar].curgroup * 10) + _vm->_randomSource.getRandomNumber( - MCharacter[nChar].numtalks[MCharacter[nChar].curgroup] - 1) + 1; + _ctx->parm = (GLOBALS.MCharacter[nChar].curgroup * 10) + _vm->_randomSource.getRandomNumber( + GLOBALS.MCharacter[nChar].numtalks[GLOBALS.MCharacter[nChar].curgroup] - 1) + 1; // Cerca di eseguire la funzione custom per inizializzare la parlata - if (MCharacter[nChar].item) { - _ctx->h = mpalQueryDoAction(30, MCharacter[nChar].item->MpalCode(), _ctx->parm); + if (GLOBALS.MCharacter[nChar].item) { + _ctx->h = mpalQueryDoAction(30, GLOBALS.MCharacter[nChar].item->MpalCode(), _ctx->parm); if (_ctx->h != CORO_INVALID_PID_VALUE) { CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); } @@ -1849,24 +1793,24 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->voice = NULL; if (_ctx->curVoc) { // Si posiziona all'interno del database delle voci all'inizio della prima - g_system->lockMutex(vdb); + g_system->lockMutex(GLOBALS.vdb); // fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curVoc->offset); _ctx->curOffset = _ctx->curVoc->offset; - g_system->unlockMutex(vdb); + g_system->unlockMutex(GLOBALS.vdb); } - for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !bSkipIdle; _ctx->i++) { + for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { // Crea l'oggetto diverso se è back o no if (bIsBack) { - curBackText=_ctx->text = new RMTextDialogScrolling(Loc); - if (bTonyIsSpeaking) - CORO_INVOKE_0(curBackText->Hide); + GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); + if (GLOBALS.bTonyIsSpeaking) + CORO_INVOKE_0(GLOBALS.curBackText->Hide); } else _ctx->text = new RMTextDialog; - _ctx->text->SetInput(Input); + _ctx->text->SetInput(GLOBALS.Input); // Skipping _ctx->text->SetSkipStatus(!bIsBack); @@ -1875,7 +1819,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); // Colore - _ctx->text->SetColor(MCharacter[nChar].r,MCharacter[nChar].g,MCharacter[nChar].b); + _ctx->text->SetColor(GLOBALS.MCharacter[nChar].r,GLOBALS.MCharacter[nChar].g,GLOBALS.MCharacter[nChar].b); // Scrive il testo _ctx->text->WriteText((*_ctx->msg)[_ctx->i], nFont); @@ -1884,13 +1828,13 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->text->SetPosition(_ctx->pt); // Setta l'always display - if (bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } + if (GLOBALS.bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } // Registra il testo - LinkGraphicTask(_ctx->text); + GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { - g_system->lockMutex(vdb); + g_system->lockMutex(GLOBALS.vdb); _vm->_theSound.CreateSfx(&_ctx->voice); _vm->_vdbFP.seek(_ctx->curOffset); _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); @@ -1899,11 +1843,11 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->voice->Play(); _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); _ctx->curOffset = _vm->_vdbFP.pos(); - g_system->unlockMutex(vdb); + g_system->unlockMutex(GLOBALS.vdb); } // Aspetta la fine della visualizzazione - _ctx->text->SetCustomSkipHandle(hSkipIdle); + _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); if (_ctx->curVoc) { @@ -1912,15 +1856,15 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->voice = NULL; } - curBackText = NULL; + GLOBALS.curBackText = NULL; delete _ctx->text; delete _ctx->msg; } // Cerca di eseguire la funzione custom per chiudere la parlata - if (MCharacter[nChar].item) { - _ctx->h = mpalQueryDoAction(31, MCharacter[nChar].item->MpalCode(), _ctx->parm); + if (GLOBALS.MCharacter[nChar].item) { + _ctx->h = mpalQueryDoAction(31, GLOBALS.MCharacter[nChar].item->MpalCode(), _ctx->parm); if (_ctx->h != CORO_INVALID_PID_VALUE) CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); } @@ -1957,7 +1901,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg // La SendDialogMessage può andare in background se è un personaggio in MCHAR settato // con la SetAlwaysBack - if (nPers != 0 && IsMChar[nPers] && MCharacter[nPers].bAlwaysBack) + if (nPers != 0 && GLOBALS.IsMChar[nPers] && GLOBALS.MCharacter[nPers].bAlwaysBack) _ctx->bIsBack = true; _ctx->curVoc = SearchVoiceHeader(curDialog, nMsg); @@ -1965,14 +1909,14 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (_ctx->curVoc) { // Si posiziona all'interno del database delle voci all'inizio della prima - g_system->lockMutex(vdb); + g_system->lockMutex(GLOBALS.vdb); // fseek(_vm->m_vdbFP, _ctx->curVoc->offset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curVoc->offset); _vm->_theSound.CreateSfx(&_ctx->voice); _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); _ctx->voice->SetLoop(false); if (_ctx->bIsBack) _ctx->voice->SetVolume(55); - g_system->unlockMutex(vdb); + g_system->unlockMutex(GLOBALS.vdb); } _ctx->string = mpalQueryDialogPeriod(nMsg); @@ -1980,89 +1924,89 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (nPers == 0) { _ctx->text = new RMTextDialog; _ctx->text->SetColor(0,255,0); - _ctx->text->SetPosition(Tony->Position()-RMPoint(0,130)-Loc->ScrollPosition()); + _ctx->text->SetPosition(GLOBALS.Tony->Position()-RMPoint(0,130)-GLOBALS.Loc->ScrollPosition()); _ctx->text->WriteText(_ctx->string,0); - if (dwTonyNumTexts > 0) { - if (!bTonyInTexts) { - if (nTonyNextTalkType != Tony->TALK_NORMAL) { - CORO_INVOKE_1(Tony->StartTalk, nTonyNextTalkType); - if (!bStaticTalk) - nTonyNextTalkType = Tony->TALK_NORMAL; + if (GLOBALS.dwTonyNumTexts > 0) { + if (!GLOBALS.bTonyInTexts) { + if (GLOBALS.nTonyNextTalkType != GLOBALS.Tony->TALK_NORMAL) { + CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.nTonyNextTalkType); + if (!GLOBALS.bStaticTalk) + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; } else - CORO_INVOKE_1(Tony->StartTalk, Tony->TALK_NORMAL); + CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.Tony->TALK_NORMAL); - bTonyInTexts = true; + GLOBALS.bTonyInTexts = true; } - dwTonyNumTexts--; + GLOBALS.dwTonyNumTexts--; } else { - CORO_INVOKE_1(Tony->StartTalk, nTonyNextTalkType); - if (!bStaticTalk) - nTonyNextTalkType = Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.nTonyNextTalkType); + if (!GLOBALS.bStaticTalk) + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; } - } else if (!IsMChar[nPers]) { + } else if (!GLOBALS.IsMChar[nPers]) { _ctx->text = new RMTextDialog; - _ctx->pt = Character[nPers].item->CalculatePos() - RMPoint(-60, 20) - Loc->ScrollPosition(); + _ctx->pt = GLOBALS.Character[nPers].item->CalculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->ScrollPosition(); - if (Character[nPers].starttalkpattern != 0) { - Freeze(); - Character[nPers].item->SetPattern(Character[nPers].starttalkpattern); - Unfreeze(); - CORO_INVOKE_0(Character[nPers].item->WaitForEndPattern); + if (GLOBALS.Character[nPers].starttalkpattern != 0) { + GLOBALS.Freeze(); + GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].starttalkpattern); + GLOBALS.Unfreeze(); + CORO_INVOKE_0(GLOBALS.Character[nPers].item->WaitForEndPattern); } - Character[nPers].item->SetPattern(Character[nPers].talkpattern); + GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].talkpattern); - _ctx->text->SetColor(Character[nPers].r, Character[nPers].g,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->SetPosition(_ctx->pt); } else { - if (MCharacter[nPers].x == -1) - _ctx->pt = MCharacter[nPers].item->CalculatePos() - RMPoint(-60, 20) - Loc->ScrollPosition(); + if (GLOBALS.MCharacter[nPers].x == -1) + _ctx->pt = GLOBALS.MCharacter[nPers].item->CalculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->ScrollPosition(); else - _ctx->pt = RMPoint(MCharacter[nPers].x, MCharacter[nPers].y); + _ctx->pt = RMPoint(GLOBALS.MCharacter[nPers].x, GLOBALS.MCharacter[nPers].y); // Parametro per le azioni speciali: random tra le parlate - _ctx->parm = (MCharacter[nPers].curgroup * 10) + _vm->_randomSource.getRandomNumber( - MCharacter[nPers].numtalks[MCharacter[nPers].curgroup] - 1) + 1; + _ctx->parm = (GLOBALS.MCharacter[nPers].curgroup * 10) + _vm->_randomSource.getRandomNumber( + GLOBALS.MCharacter[nPers].numtalks[GLOBALS.MCharacter[nPers].curgroup] - 1) + 1; - if (MCharacter[nPers].numtexts != 0 && MCharacter[nPers].bInTexts) { - MCharacter[nPers].numtexts--; + if (GLOBALS.MCharacter[nPers].numtexts != 0 && GLOBALS.MCharacter[nPers].bInTexts) { + GLOBALS.MCharacter[nPers].numtexts--; } else { // Cerca di eseguire la funzione custom per inizializzare la parlata - _ctx->h = mpalQueryDoAction(30, MCharacter[nPers].item->MpalCode(), _ctx->parm); + _ctx->h = mpalQueryDoAction(30, GLOBALS.MCharacter[nPers].item->MpalCode(), _ctx->parm); if (_ctx->h != CORO_INVALID_PID_VALUE) CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); - MCharacter[nPers].curTalk = _ctx->parm; + GLOBALS.MCharacter[nPers].curTalk = _ctx->parm; - if (MCharacter[nPers].numtexts != 0) { - MCharacter[nPers].bInTexts = true; - MCharacter[nPers].numtexts--; + if (GLOBALS.MCharacter[nPers].numtexts != 0) { + GLOBALS.MCharacter[nPers].bInTexts = true; + GLOBALS.MCharacter[nPers].numtexts--; } } - if (MCharacter[nPers].bAlwaysBack) { - _ctx->text = curBackText = new RMTextDialogScrolling(Loc); - if (bTonyIsSpeaking) - CORO_INVOKE_0(curBackText->Hide); + if (GLOBALS.MCharacter[nPers].bAlwaysBack) { + _ctx->text = GLOBALS.curBackText = new RMTextDialogScrolling(GLOBALS.Loc); + if (GLOBALS.bTonyIsSpeaking) + CORO_INVOKE_0(GLOBALS.curBackText->Hide); _ctx->bIsBack = true; } else _ctx->text = new RMTextDialog; - _ctx->text->SetSkipStatus(!MCharacter[nPers].bAlwaysBack); - _ctx->text->SetColor(MCharacter[nPers].r,MCharacter[nPers].g,MCharacter[nPers].b); + _ctx->text->SetSkipStatus(!GLOBALS.MCharacter[nPers].bAlwaysBack); + _ctx->text->SetColor(GLOBALS.MCharacter[nPers].r,GLOBALS.MCharacter[nPers].g,GLOBALS.MCharacter[nPers].b); _ctx->text->WriteText(_ctx->string,0); _ctx->text->SetPosition(_ctx->pt); } - if (!bSkipIdle) { - _ctx->text->SetInput(Input); - if (bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } + if (!GLOBALS.bSkipIdle) { + _ctx->text->SetInput(GLOBALS.Input); + if (GLOBALS.bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } _ctx->text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); - LinkGraphicTask(_ctx->text); + GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { _ctx->voice->Play(); @@ -2070,7 +2014,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg } // Aspetta la fine della visualizzazione - _ctx->text->SetCustomSkipHandle(hSkipIdle); + _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); } @@ -2081,36 +2025,36 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg } if (nPers != 0) { - if (!IsMChar[nPers]) { - if (Character[nPers].endtalkpattern != 0) { - Freeze(); - Character[nPers].item->SetPattern(Character[nPers].endtalkpattern); - Unfreeze(); - CORO_INVOKE_0(Character[nPers].item->WaitForEndPattern); + if (!GLOBALS.IsMChar[nPers]) { + if (GLOBALS.Character[nPers].endtalkpattern != 0) { + GLOBALS.Freeze(); + GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].endtalkpattern); + GLOBALS.Unfreeze(); + CORO_INVOKE_0(GLOBALS.Character[nPers].item->WaitForEndPattern); } - Character[nPers].item->SetPattern(Character[nPers].standpattern); + GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].standpattern); delete _ctx->text; } else { - if ((MCharacter[nPers].bInTexts && MCharacter[nPers].numtexts== 0) || !MCharacter[nPers].bInTexts) { + if ((GLOBALS.MCharacter[nPers].bInTexts && GLOBALS.MCharacter[nPers].numtexts== 0) || !GLOBALS.MCharacter[nPers].bInTexts) { // Cerca di eseguire la funzione custom per chiudere la parlata - MCharacter[nPers].curTalk = (MCharacter[nPers].curTalk%10) + MCharacter[nPers].curgroup*10; - _ctx->h = mpalQueryDoAction(31,MCharacter[nPers].item->MpalCode(),MCharacter[nPers].curTalk); + 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); if (_ctx->h != CORO_INVALID_PID_VALUE) CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); - MCharacter[nPers].bInTexts = false; - MCharacter[nPers].numtexts = 0; + GLOBALS.MCharacter[nPers].bInTexts = false; + GLOBALS.MCharacter[nPers].numtexts = 0; } - curBackText = NULL; + GLOBALS.curBackText = NULL; delete _ctx->text; } } else { - if ((dwTonyNumTexts== 0 && bTonyInTexts) || !bTonyInTexts) { - CORO_INVOKE_0(Tony->EndTalk); - dwTonyNumTexts = 0; - bTonyInTexts = false; + if ((GLOBALS.dwTonyNumTexts== 0 && GLOBALS.bTonyInTexts) || !GLOBALS.bTonyInTexts) { + CORO_INVOKE_0(GLOBALS.Tony->EndTalk); + GLOBALS.dwTonyNumTexts = 0; + GLOBALS.bTonyInTexts = false; } delete _ctx->text; @@ -2172,18 +2116,18 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr } // Attiva l'oggetto - LinkGraphicTask(&_ctx->dc); + GLOBALS.LinkGraphicTask(&_ctx->dc); CORO_INVOKE_0(_ctx->dc.Show); // Disegna il puntatore - Pointer->SetSpecialPointer(Pointer->PTR_NONE); + GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_NONE); MainShowMouse(); - while (!(Input->MouseLeftClicked() && ((_ctx->sel = _ctx->dc.GetSelection()) != -1))) { - CORO_INVOKE_0(WaitFrame); - Freeze(); - CORO_INVOKE_1(_ctx->dc.DoFrame, Input->MousePos()); - Unfreeze(); + while (!(GLOBALS.Input->MouseLeftClicked() && ((_ctx->sel = _ctx->dc.GetSelection()) != -1))) { + CORO_INVOKE_0(GLOBALS.WaitFrame); + GLOBALS.Freeze(); + CORO_INVOKE_1(_ctx->dc.DoFrame, GLOBALS.Input->MousePos()); + GLOBALS.Unfreeze(); } // Nascondi il puntatore @@ -2243,10 +2187,6 @@ DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32 * */ -int curSonoriz = 0; - -bool bFadeOutStop; - void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) { CORO_BEGIN_CONTEXT; int i; @@ -2286,14 +2226,14 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { debug("Start FadeOut Music"); - for (_ctx->i = 16; _ctx->i > 0 && !bFadeOutStop; _ctx->i--) { + for (_ctx->i = 16; _ctx->i > 0 && !GLOBALS.bFadeOutStop; _ctx->i--) { if (_ctx->i * 4 < _ctx->startVolume) _vm->SetMusicVolume(nChannel, _ctx->i * 4); CORO_INVOKE_1(CoroScheduler.sleep, 100); } - if (!bFadeOutStop) + if (!GLOBALS.bFadeOutStop) _vm->SetMusicVolume(nChannel, 0); // Se è uno stacchetto ferma tutto @@ -2308,16 +2248,16 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { } DECLARE_CUSTOM_FUNCTION(FadeInSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - CoroScheduler.createProcess(ThreadFadeInMusic, &curSonoriz, sizeof(int)); + CoroScheduler.createProcess(ThreadFadeInMusic, &GLOBALS.curSonoriz, sizeof(int)); } DECLARE_CUSTOM_FUNCTION(FadeOutSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - bFadeOutStop = false; - CoroScheduler.createProcess(ThreadFadeOutMusic, &curSonoriz, sizeof(int)); + GLOBALS.bFadeOutStop = false; + CoroScheduler.createProcess(ThreadFadeOutMusic, &GLOBALS.curSonoriz, sizeof(int)); } DECLARE_CUSTOM_FUNCTION(FadeOutStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { - bFadeOutStop = false; + GLOBALS.bFadeOutStop = false; int channel = 2; CoroScheduler.createProcess(ThreadFadeOutMusic, &channel, sizeof(int)); } @@ -2328,7 +2268,7 @@ DECLARE_CUSTOM_FUNCTION(FadeInStacchetto)(CORO_PARAM, uint32, uint32, uint32, ui } DECLARE_CUSTOM_FUNCTION(StopSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->StopMusic(curSonoriz); + _vm->StopMusic(GLOBALS.curSonoriz); } DECLARE_CUSTOM_FUNCTION(StopStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -2336,12 +2276,12 @@ DECLARE_CUSTOM_FUNCTION(StopStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint } DECLARE_CUSTOM_FUNCTION(MuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->SetMusicVolume(curSonoriz, 0); + _vm->SetMusicVolume(GLOBALS.curSonoriz, 0); } DECLARE_CUSTOM_FUNCTION(DemuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - bFadeOutStop = true; - _vm->SetMusicVolume(curSonoriz, 64); + GLOBALS.bFadeOutStop = true; + _vm->SetMusicVolume(GLOBALS.curSonoriz, 64); } DECLARE_CUSTOM_FUNCTION(MuteStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -2352,135 +2292,26 @@ DECLARE_CUSTOM_FUNCTION(DemuteStacchetto)(CORO_PARAM, uint32, uint32, uint32, ui _vm->SetMusicVolume(2, 64); } -struct MusicFileEntry { - const char *name; - int sync; -}; -const MusicFileEntry musicFiles[] = { -/* - { "PREGAME1.ADP", 0 }, { "SONO1.ADP", 0 }, - { "SONO2.ADP", 0 }, { "SONO3.ADP", 0 }, - { "CADUTA.ADP",0 }, { "RISVEGLIO.ADP", 0 }, - { "BACKGROUND.ADP", 0 }, { "PREGAME3.ADP", 0 }, - { "BARBUTA1.ADP", 2450 }, { "BARBUTA2.ADP", 0 }, -*/ - { "00.ADP", 0 }, { "01.ADP", 0 }, - { "02.ADP", 0 }, { "03.ADP", 0 }, - { "04.ADP",0 }, { "05.ADP", 0 }, - { "06.ADP", 0 }, { "07.ADP", 0 }, - { "08.ADP", 2450 }, { "09.ADP", 0 }, - -/* - { "BARBUTA3.ADP", 0 }, { "15-RUFUS.ADP", 0 }, - { "20-MAMMA.ADP", 0 }, { "32-MAMMARADIO.ADP", 0 }, - { "24-TUNNELOV-MIDI.ADP", 0 }, { "34-RAZZO.ADP", 0 }, - { "27-ZUCC1.ADP", 0 }, { "BEAST.ADP", 0 }, - { "22-MORTIMER.ADP", 0 }, { "25-PUB-OVATTATO.ADP", 0 }, -*/ - { "10.ADP", 0 }, { "11.ADP", 0 }, - { "12.ADP", 0 }, { "13.ADP", 0 }, - { "14.ADP", 0 }, { "15.ADP", 0 }, - { "16.ADP", 0 }, { "17.ADP", 0 }, - { "18.ADP", 0 }, { "19.ADP", 0 }, -/* - { "25-PUB.ADP", 0 }, { "ALBERGO.ADP", 0 }, - { "37.ADP", 0 }, { "26-PIRAT.ADP", 0 }, - { "LORENZBACK.ADP", 0 }, { "LORENZ3.ADP", 0 }, - { "CASTLE.ADP", 0 }, { "53-BACKR.ADP", 0 }, - { "16-SMIL1.ADP", 1670 }, { "16-SMIL2.ADP", 0 }, -*/ - { "20.ADP", 0 }, { "21.ADP", 0 }, - { "22.ADP", 0 }, { "23.ADP", 0 }, - { "24.ADP", 0 }, { "25.ADP", 0 }, - { "26.ADP", 0 }, { "27.ADP", 0 }, - { "28.ADP", 1670 }, { "29.ADP", 0 }, -/* - { "16-SMILE.ADP", 0 }, { "16-DIALOG2.ADP", 0 }, - { "07-SHAKE1.ADP", 2900 }, { "07-SHAKE2.ADP", 0 }, - { "07-SHAKE3.ADP", 0 }, { "46-BEEE.ADP", 0 }, - { "434748.ADP", 0 }, { "TORRE.ADP", 0 }, - { "50-DRAGO.ADP", 0 }, { "56-OPERA.ADP", 0 }, -*/ - { "30.ADP", 0 }, { "31.ADP", 0 }, - { "32.ADP", 2900 }, { "33.ADP", 0 }, - { "34.ADP", 0 }, { "35.ADP", 0 }, - { "36.ADP", 0 }, { "37.ADP", 0 }, - { "38.ADP", 0 }, { "39.ADP", 0 }, -/* - { "FLAUTARP.ADP", 0 }, { "01-2001.ADP", 1920 }, - { "02-INTROPANORAMICA.ADP", 1560 }, { "03-PANORAMICA.ADP", 1920 }, - { "04-INTERNI.ADP", 1920 }, { "05-CADEPIUMA.ADP", 1920 }, - { "06-SCENDESCALE.ADP", 1920 }, { "07-THRILL.ADP", 1920 }, - { "08-CADUTAZUCCA.ADP", 1920 }, { "09-PIUMAALEGGIA.ADP", 1920 }, -*/ - { "40.ADP", 0 }, { "41.ADP", 1920 }, - { "42.ADP", 1560 }, { "43.ADP", 1920 }, - { "44.ADP", 1920 }, { "45.ADP", 1920 }, - { "46.ADP", 1920 }, { "47.ADP", 1920 }, - { "48.ADP", 1920 }, { "49.ADP", 1920 }, - -/* - { "10-JACKZUCCONA.ADP", 1920 }, { "11-JACKIMPRECAALLAGRANDELUNA.ADP", 1920 }, - { "12-GRANDELUNALOGO.ADP", 1920 }, { "60-BACKGROUND.ADP", 0 }, - { "TONYSTAR.ADP", 0 }, { "FUNNY.ADP", 0 }, - { "60-INIZIODIALOGO.ADP", 0 }, { "60-DIALOGO.ADP", 0 }, - { "60-JACKFELICE.ADP", 0 }, { "24-TONYVIOLENTATO.ADP", 0 } -*/ - { "50.ADP", 1920 }, { "51.ADP", 1920 }, - { "52.ADP", 1920 }, { "53.ADP", 0 }, - { "54.ADP", 0 }, { "55.ADP", 0 }, - { "56.ADP", 0 }, { "57.ADP", 0 }, - { "58.ADP", 0 }, { "59.ADP", 0 } -}; - - -const char *staccFileNames[] = { -/* - "05-MUCCA.ADP", "06-HALOW.ADP", - "LETTERAINIZIO.ADP", "LETTERAPAURA.ADP", - "LETTERAFINE.ADP", "PREGAME2.ADP", - "07-TIMOT.ADP", "15-SHOTRUFUS.ADP", - "15-SHOTTONY.ADP", "27-ZUCC2.ADP", -*/ - "S00.ADP", "S01.ADP", - "S02.ADP", "S03.ADP", - "S04.ADP", "S05.ADP", - "S06.ADP", "S07.ADP", - "S08.ADP", "S09.ADP", - -/* - "53-DLOGO.ADP", "16-DIALOG1.ADP", - "TORRE1.ADP", "GARG1.ADP", - "LORENZ1.ADP", "24-FIGHT.ADP", - "08-MACBETH-PREPARA.ADP", "08-MACBETH-RECITA.ADP", - "GATTO1.ADP" -*/ - "S10.ADP", "S11.ADP", - "S12.ADP", "S13.ADP", - "S14.ADP", "S15.ADP", - "S16.ADP", "S17.ADP", - "S18.ADP" -}; void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int nSync = 0) { if (nSync == 0) nSync = 2000; debug("Start CustPlayMusic"); - PlayMusic(nChannel, mFN, nFX, bLoop, nSync); + GLOBALS.PlayMusic(nChannel, mFN, nFX, bLoop, nSync); debug("End CustPlayMusic"); } DECLARE_CUSTOM_FUNCTION(PlaySonoriz)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) { if (nFX == 0 || nFX == 1 || nFX==2) { debug("PlaySonoriz stop fadeout"); - bFadeOutStop = true; + GLOBALS.bFadeOutStop = true; } - lastMusic = nMusic; - CustPlayMusic(curSonoriz, musicFiles[nMusic].name, nFX, bNoLoop ? false : true, musicFiles[nMusic].sync); + GLOBALS.lastMusic = nMusic; + CustPlayMusic(GLOBALS.curSonoriz, musicFiles[nMusic].name, nFX, bNoLoop ? false : true, musicFiles[nMusic].sync); } DECLARE_CUSTOM_FUNCTION(PlayStacchetto)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) { @@ -2489,9 +2320,9 @@ DECLARE_CUSTOM_FUNCTION(PlayStacchetto)(CORO_PARAM, uint32 nMusic, uint32 nFX, u DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) { if (nItem== 0) { - Tony->PlaySfx(nSFX); + GLOBALS.Tony->PlaySfx(nSFX); } else { - RMItem *item = Loc->GetItemFromCode(nItem); + RMItem *item = GLOBALS.Loc->GetItemFromCode(nItem); if (item) item->PlaySfx(nSFX); } @@ -2504,22 +2335,22 @@ void RestoreMusic(CORO_PARAM) { CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_4(PlaySonoriz, lastMusic, 0, 0, 0); + CORO_INVOKE_4(PlaySonoriz, GLOBALS.lastMusic, 0, 0, 0); - if (lastTappeto != 0) - CustPlayMusic(4, tappetiFile[lastTappeto], 0, true); + if (GLOBALS.lastTappeto != 0) + CustPlayMusic(4, tappetiFile[GLOBALS.lastTappeto], 0, true); CORO_END_CODE; } void SaveMusic(Common::OutSaveFile *f) { - f->writeByte(lastMusic); - f->writeByte(lastTappeto); + f->writeByte(GLOBALS.lastMusic); + f->writeByte(GLOBALS.lastTappeto); } void LoadMusic(Common::InSaveFile *f) { - lastMusic = f->readByte(); - lastTappeto = f->readByte(); + GLOBALS.lastMusic = f->readByte(); + GLOBALS.lastTappeto = f->readByte(); } @@ -2553,17 +2384,17 @@ DECLARE_CUSTOM_FUNCTION(StacchettoFadeEnd)(CORO_PARAM, uint32 nStacc, uint32 bLo DECLARE_CUSTOM_FUNCTION(MustSkipIdleStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { - bSkipIdle = true; - CoroScheduler.setEvent(hSkipIdle); + GLOBALS.bSkipIdle = true; + CoroScheduler.setEvent(GLOBALS.hSkipIdle); } DECLARE_CUSTOM_FUNCTION(MustSkipIdleEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { - bSkipIdle = false; - CoroScheduler.resetEvent(hSkipIdle); + GLOBALS.bSkipIdle = false; + CoroScheduler.resetEvent(GLOBALS.hSkipIdle); } DECLARE_CUSTOM_FUNCTION(PatIrqFreeze)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { - bPatIrqFreeze = bStatus; + GLOBALS.bPatIrqFreeze = bStatus; } DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -2572,9 +2403,9 @@ DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, ui CORO_BEGIN_CODE(_ctx); - Freeze(); + GLOBALS.Freeze(); CORO_INVOKE_0(_vm->OpenInitLoadMenu); - Unfreeze(); + GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -2585,9 +2416,9 @@ DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uin CORO_BEGIN_CODE(_ctx); - Freeze(); + GLOBALS.Freeze(); CORO_INVOKE_0(_vm->OpenInitOptions); - Unfreeze(); + GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -2610,7 +2441,7 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 _ctx->text = new RMTextDialog[_ctx->msg->NumPeriods()]; for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods(); _ctx->i++) { - _ctx->text[_ctx->i].SetInput(Input); + _ctx->text[_ctx->i].SetInput(GLOBALS.Input); // Alignment if ((*_ctx->msg)[_ctx->i][0] == '@') { @@ -2633,14 +2464,14 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 _ctx->text[_ctx->i].SetCustomSkipHandle(_ctx->hDisable); // Registra il testo - LinkGraphicTask(&_ctx->text[_ctx->i]); + GLOBALS.LinkGraphicTask(&_ctx->text[_ctx->i]); } _ctx->startTime = _vm->GetTime(); while (_ctx->startTime + dwTime * 1000 > _vm->GetTime()) { - CORO_INVOKE_0(WaitFrame); - if (Input->MouseLeftClicked() || Input->MouseRightClicked()) + CORO_INVOKE_0(GLOBALS.WaitFrame); + if (GLOBALS.Input->MouseLeftClicked() || GLOBALS.Input->MouseRightClicked()) break; if (_vm->GetEngine()->GetInput().GetAsyncKeyState(Common::KEYCODE_TAB)) break; @@ -2648,8 +2479,8 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 CoroScheduler.setEvent(_ctx->hDisable); - CORO_INVOKE_0(WaitFrame); - CORO_INVOKE_0(WaitFrame); + CORO_INVOKE_0(GLOBALS.WaitFrame); + CORO_INVOKE_0(GLOBALS.WaitFrame); delete[] _ctx->text; delete _ctx->msg; @@ -2809,77 +2640,76 @@ BEGIN_CUSTOM_FUNCTION_MAP() END_CUSTOM_FUNCTION_MAP() void SetupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation *loc, RMInventory *inv, RMInput *input) { - Tony = tony; - Pointer = ptr; - Boxes = box; - Loc = loc; - Inventory = inv; - Input = input; - - LoadLocation = MainLoadLocation; - UnloadLocation = MainUnloadLocation; - LinkGraphicTask = MainLinkGraphicTask; - Freeze = MainFreeze; - Unfreeze = MainUnfreeze; - WaitFrame = MainWaitFrame; - PlayMusic = MainPlayMusic; - InitWipe = MainInitWipe; - CloseWipe = MainCloseWipe; - WaitWipeEnd = MainWaitWipeEnd; - DisableGUI = MainDisableGUI; - EnableGUI = MainEnableGUI; - SetPalesati = MainSetPalesati; - - vdb = g_system->createMutex(); - - bAlwaysDisplay = false; + GLOBALS.Tony = tony; + GLOBALS.Pointer = ptr; + GLOBALS.Boxes = box; + GLOBALS.Loc = loc; + GLOBALS.Inventory = inv; + GLOBALS.Input = input; + + GLOBALS.LoadLocation = MainLoadLocation; + GLOBALS.UnloadLocation = MainUnloadLocation; + GLOBALS.LinkGraphicTask = MainLinkGraphicTask; + GLOBALS.Freeze = MainFreeze; + GLOBALS.Unfreeze = MainUnfreeze; + GLOBALS.WaitFrame = MainWaitFrame; + GLOBALS.PlayMusic = MainPlayMusic; + GLOBALS.InitWipe = MainInitWipe; + GLOBALS.CloseWipe = MainCloseWipe; + GLOBALS.WaitWipeEnd = MainWaitWipeEnd; + GLOBALS.DisableGUI = MainDisableGUI; + GLOBALS.EnableGUI = MainEnableGUI; + GLOBALS.SetPalesati = MainSetPalesati; + + GLOBALS.vdb = g_system->createMutex(); + + GLOBALS.bAlwaysDisplay = false; int i; - for (i = 0;i < 10; i++) +/* for (i = 0;i < 10; i++) cs[i] = g_system->createMutex(); -/* for (i = 0;i < 10; i++) mut[i] = CreateMutex(NULL, false, NULL); */ for (i = 0; i < 200; i++) - tappeti[i] = 0; - - tappeti[6] = T_GRILLI; - tappeti[7] = T_GRILLI; - tappeti[8] = T_GRILLIOV; - tappeti[10] = T_GRILLI; - tappeti[12] = T_GRILLI; - tappeti[13] = T_GRILLIOV; - tappeti[15] = T_GRILLI; - tappeti[16] = T_GRILLIVENTO; - tappeti[18] = T_GRILLI; - tappeti[19] = T_GRILLIVENTO; - tappeti[20] = T_GRILLI; - tappeti[23] = T_GRILLI; - tappeti[26] = T_MAREMETA; - tappeti[27] = T_GRILLI; - tappeti[28] = T_GRILLIVENTO; - tappeti[31] = T_GRILLI; - tappeti[33] = T_MARE; - tappeti[35] = T_MARE; - tappeti[36] = T_GRILLI; - tappeti[37] = T_GRILLI; - tappeti[40] = T_GRILLI; - tappeti[41] = T_GRILLI; - tappeti[42] = T_GRILLI; - tappeti[45] = T_GRILLI; - tappeti[51] = T_GRILLI; - tappeti[52] = T_GRILLIVENTO1; - tappeti[53] = T_GRILLI; - tappeti[54] = T_GRILLI; - tappeti[57] = T_VENTO; - tappeti[58] = T_VENTO; - tappeti[60] = T_VENTO; + GLOBALS.tappeti[i] = 0; + + GLOBALS.tappeti[6] = T_GRILLI; + GLOBALS.tappeti[7] = T_GRILLI; + GLOBALS.tappeti[8] = T_GRILLIOV; + GLOBALS.tappeti[10] = T_GRILLI; + GLOBALS.tappeti[12] = T_GRILLI; + GLOBALS.tappeti[13] = T_GRILLIOV; + GLOBALS.tappeti[15] = T_GRILLI; + GLOBALS.tappeti[16] = T_GRILLIVENTO; + GLOBALS.tappeti[18] = T_GRILLI; + GLOBALS.tappeti[19] = T_GRILLIVENTO; + GLOBALS.tappeti[20] = T_GRILLI; + GLOBALS.tappeti[23] = T_GRILLI; + GLOBALS.tappeti[26] = T_MAREMETA; + GLOBALS.tappeti[27] = T_GRILLI; + GLOBALS.tappeti[28] = T_GRILLIVENTO; + GLOBALS.tappeti[31] = T_GRILLI; + GLOBALS.tappeti[33] = T_MARE; + GLOBALS.tappeti[35] = T_MARE; + GLOBALS.tappeti[36] = T_GRILLI; + GLOBALS.tappeti[37] = T_GRILLI; + GLOBALS.tappeti[40] = T_GRILLI; + GLOBALS.tappeti[41] = T_GRILLI; + GLOBALS.tappeti[42] = T_GRILLI; + GLOBALS.tappeti[45] = T_GRILLI; + GLOBALS.tappeti[51] = T_GRILLI; + GLOBALS.tappeti[52] = T_GRILLIVENTO1; + GLOBALS.tappeti[53] = T_GRILLI; + GLOBALS.tappeti[54] = T_GRILLI; + GLOBALS.tappeti[57] = T_VENTO; + GLOBALS.tappeti[58] = T_VENTO; + GLOBALS.tappeti[60] = T_VENTO; // Crea l'evento per skippare le idle - hSkipIdle = CoroScheduler.createEvent(true, false); + GLOBALS.hSkipIdle = CoroScheduler.createEvent(true, false); } } // end of namespace Tony -- cgit v1.2.3 From 099fe1e9e62ada666a312e08d7dca5cd2083de0b Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 14 May 2012 07:43:50 +0200 Subject: TONY: Remove original header --- engines/tony/custom.cpp | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 168c2d38cd..c84aa63edb 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -20,31 +20,11 @@ * * */ -/************************************************************************** - * ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ * - * Nayma Software srl * - * e -= We create much MORE than ALL =- * - * u- z$$$c '. ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ * - * .d" d$$$$$b "b. * - * .z$* d$$$$$$$L ^*$c. * - * #$$$. $$$$$$$$$ .$$$" Project: Roasted Moths........ * - * ^*$b 4$$$$$$$$$F .d$*" * - * ^$$. 4$$$$$$$$$F .$P" Module: Custom.CPP........... * - * *$. '$$$$$$$$$ 4$P 4 * - * J *$ "$$$$$$$" $P r Author: Giovanni Bajo........ * - * z$ '$$$P*4c.*$$$*.z@*R$$$ $. * - * z$" "" #$F^ "" '$c Desc: Custom functions..... * - * z$$beu .ue=" $ "=e.. .zed$$c ..................... * - * "#$e z$*" . `. ^*Nc e$"" ..................... * - * "$$". .r" ^4. .^$$" ..................... * - * ^.@*"6L=\ebu^+C$"*b." * - * "**$. "c 4$$$ J" J$P*" OS: [ ] DOS [X] WIN95 [ ] PORT * - * ^"--.^ 9$" .--"" COMP: [ ] WATCOM [X] VISUAL C++ * - * " [ ] EIFFEL [ ] GCC/GXX/DJGPP * - * * - * This source code is Copyright (C) Nayma Software. ALL RIGHTS RESERVED * - * * - ************************************************************************** + +/* + * This code is based on original Tony Tough source code + * + * Copyright (c) 1997-2003 Nayma Software */ #include "common/system.h" -- cgit v1.2.3 From 8f4694a80c92b20d76a69c46dc43d1a990ec82c6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 14 May 2012 20:20:58 +1000 Subject: TONY: Fixed suspicious casting --- engines/tony/custom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index c84aa63edb..0392fc409d 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1326,8 +1326,8 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui CORO_BEGIN_CODE(_ctx); // Prende le coordinate di quanto scrollare - _ctx->lx=*((int*)&nX); - _ctx->ly=*((int*)&nY); + _ctx->lx = (int32)nX; + _ctx->ly = (int32)nY; _ctx->dimx = _ctx->lx; _ctx->dimy = _ctx->ly; if (_ctx->lx < 0) _ctx->dimx = -_ctx->lx; -- cgit v1.2.3 From 47ddb2ff339ed21d5cc518b8851961b097169652 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 14 May 2012 21:06:03 +1000 Subject: TONY: Replace stubs for TakeOwnership/ReleaseOwnership with actual implementation --- engines/tony/custom.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 0392fc409d..d6e7fdd2ee 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2134,15 +2134,12 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr */ DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { -// EnterCriticalSection(&cs[num]); -// WaitForSingleObject(mut[num],CORO_INFINITE); - warning("TODO: TakeOwnership"); + CoroScheduler.waitForSingleObject(coroParam, GLOBALS.mut[num], CORO_INFINITE); } DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { -// LeaveCriticalSection(&cs[num]); -// g_system->unlockMutex(mut[num]); - warning("TODO: ReleaseOwnership"); + CoroScheduler.pulseEvent(GLOBALS.mut[num]); + warning("TODO: Validate that the use of events in TakeOwnership/ReleaseOwnership match original"); } @@ -2646,11 +2643,9 @@ void SetupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation GLOBALS.bAlwaysDisplay = false; int i; -/* for (i = 0;i < 10; i++) - cs[i] = g_system->createMutex(); for (i = 0;i < 10; i++) - mut[i] = CreateMutex(NULL, false, NULL); -*/ + GLOBALS.mut[i] = CoroScheduler.createEvent(false, false); + for (i = 0; i < 200; i++) GLOBALS.tappeti[i] = 0; -- cgit v1.2.3 From 88762667b52e4b904c56ecc94bf304c1a91e9feb Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 14 May 2012 21:29:27 +0200 Subject: TONY: Fix some formatting --- engines/tony/custom.cpp | 1008 +++++++++++++++++++++++------------------------ 1 file changed, 488 insertions(+), 520 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index d6e7fdd2ee..d38f840011 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -44,120 +44,60 @@ namespace Tony { const char *tappetiFile[] = { "None", - "1.ADP", // Grilli.WAV - "2.ADP", // Grilli-Ovattati.WAV - "3.ADP", // Grilli-Vento.WAV - "3.ADP", // Grilli-Vento1.WAV - "5.ADP", // Vento1.WAV - "4.ADP", // Mare1.WAV - "6.ADP" // Mare1.WAV metà volume + "1.ADP", // Grilli.WAV + "2.ADP", // Grilli-Ovattati.WAV + "3.ADP", // Grilli-Vento.WAV + "3.ADP", // Grilli-Vento1.WAV + "5.ADP", // Vento1.WAV + "4.ADP", // Mare1.WAV + "6.ADP" // Mare1.WAV metà volume }; struct MusicFileEntry { const char *name; int sync; }; -const MusicFileEntry musicFiles[] = { -/* - { "PREGAME1.ADP", 0 }, { "SONO1.ADP", 0 }, - { "SONO2.ADP", 0 }, { "SONO3.ADP", 0 }, - { "CADUTA.ADP",0 }, { "RISVEGLIO.ADP", 0 }, - { "BACKGROUND.ADP", 0 }, { "PREGAME3.ADP", 0 }, - { "BARBUTA1.ADP", 2450 }, { "BARBUTA2.ADP", 0 }, -*/ - { "00.ADP", 0 }, { "01.ADP", 0 }, - { "02.ADP", 0 }, { "03.ADP", 0 }, - { "04.ADP",0 }, { "05.ADP", 0 }, - { "06.ADP", 0 }, { "07.ADP", 0 }, - { "08.ADP", 2450 }, { "09.ADP", 0 }, - -/* - { "BARBUTA3.ADP", 0 }, { "15-RUFUS.ADP", 0 }, - { "20-MAMMA.ADP", 0 }, { "32-MAMMARADIO.ADP", 0 }, - { "24-TUNNELOV-MIDI.ADP", 0 }, { "34-RAZZO.ADP", 0 }, - { "27-ZUCC1.ADP", 0 }, { "BEAST.ADP", 0 }, - { "22-MORTIMER.ADP", 0 }, { "25-PUB-OVATTATO.ADP", 0 }, -*/ - { "10.ADP", 0 }, { "11.ADP", 0 }, - { "12.ADP", 0 }, { "13.ADP", 0 }, - { "14.ADP", 0 }, { "15.ADP", 0 }, - { "16.ADP", 0 }, { "17.ADP", 0 }, - { "18.ADP", 0 }, { "19.ADP", 0 }, -/* - { "25-PUB.ADP", 0 }, { "ALBERGO.ADP", 0 }, - { "37.ADP", 0 }, { "26-PIRAT.ADP", 0 }, - { "LORENZBACK.ADP", 0 }, { "LORENZ3.ADP", 0 }, - { "CASTLE.ADP", 0 }, { "53-BACKR.ADP", 0 }, - { "16-SMIL1.ADP", 1670 }, { "16-SMIL2.ADP", 0 }, -*/ - { "20.ADP", 0 }, { "21.ADP", 0 }, - { "22.ADP", 0 }, { "23.ADP", 0 }, - { "24.ADP", 0 }, { "25.ADP", 0 }, - { "26.ADP", 0 }, { "27.ADP", 0 }, - { "28.ADP", 1670 }, { "29.ADP", 0 }, -/* - { "16-SMILE.ADP", 0 }, { "16-DIALOG2.ADP", 0 }, - { "07-SHAKE1.ADP", 2900 }, { "07-SHAKE2.ADP", 0 }, - { "07-SHAKE3.ADP", 0 }, { "46-BEEE.ADP", 0 }, - { "434748.ADP", 0 }, { "TORRE.ADP", 0 }, - { "50-DRAGO.ADP", 0 }, { "56-OPERA.ADP", 0 }, -*/ - { "30.ADP", 0 }, { "31.ADP", 0 }, - { "32.ADP", 2900 }, { "33.ADP", 0 }, - { "34.ADP", 0 }, { "35.ADP", 0 }, - { "36.ADP", 0 }, { "37.ADP", 0 }, - { "38.ADP", 0 }, { "39.ADP", 0 }, -/* - { "FLAUTARP.ADP", 0 }, { "01-2001.ADP", 1920 }, - { "02-INTROPANORAMICA.ADP", 1560 }, { "03-PANORAMICA.ADP", 1920 }, - { "04-INTERNI.ADP", 1920 }, { "05-CADEPIUMA.ADP", 1920 }, - { "06-SCENDESCALE.ADP", 1920 }, { "07-THRILL.ADP", 1920 }, - { "08-CADUTAZUCCA.ADP", 1920 }, { "09-PIUMAALEGGIA.ADP", 1920 }, -*/ - { "40.ADP", 0 }, { "41.ADP", 1920 }, - { "42.ADP", 1560 }, { "43.ADP", 1920 }, - { "44.ADP", 1920 }, { "45.ADP", 1920 }, - { "46.ADP", 1920 }, { "47.ADP", 1920 }, - { "48.ADP", 1920 }, { "49.ADP", 1920 }, - -/* - { "10-JACKZUCCONA.ADP", 1920 }, { "11-JACKIMPRECAALLAGRANDELUNA.ADP", 1920 }, - { "12-GRANDELUNALOGO.ADP", 1920 }, { "60-BACKGROUND.ADP", 0 }, - { "TONYSTAR.ADP", 0 }, { "FUNNY.ADP", 0 }, - { "60-INIZIODIALOGO.ADP", 0 }, { "60-DIALOGO.ADP", 0 }, - { "60-JACKFELICE.ADP", 0 }, { "24-TONYVIOLENTATO.ADP", 0 } -*/ - - { "50.ADP", 1920 }, { "51.ADP", 1920 }, - { "52.ADP", 1920 }, { "53.ADP", 0 }, - { "54.ADP", 0 }, { "55.ADP", 0 }, - { "56.ADP", 0 }, { "57.ADP", 0 }, - { "58.ADP", 0 }, { "59.ADP", 0 } +const MusicFileEntry musicFiles[] = { + {"00.ADP", 0}, {"01.ADP", 0}, + {"02.ADP", 0}, {"03.ADP", 0}, + {"04.ADP", 0}, {"05.ADP", 0}, + {"06.ADP", 0}, {"07.ADP", 0}, + {"08.ADP", 2450}, {"09.ADP", 0}, + {"10.ADP", 0}, {"11.ADP", 0}, + {"12.ADP", 0}, {"13.ADP", 0}, + {"14.ADP", 0}, {"15.ADP", 0}, + {"16.ADP", 0}, {"17.ADP", 0}, + {"18.ADP", 0}, {"19.ADP", 0}, + {"20.ADP", 0}, {"21.ADP", 0}, + {"22.ADP", 0}, {"23.ADP", 0}, + {"24.ADP", 0}, {"25.ADP", 0}, + {"26.ADP", 0}, {"27.ADP", 0}, + {"28.ADP", 1670}, {"29.ADP", 0}, + {"30.ADP", 0}, {"31.ADP", 0}, + {"32.ADP", 2900}, {"33.ADP", 0}, + {"34.ADP", 0}, {"35.ADP", 0}, + {"36.ADP", 0}, {"37.ADP", 0}, + {"38.ADP", 0}, {"39.ADP", 0}, + {"40.ADP", 0}, {"41.ADP", 1920}, + {"42.ADP", 1560}, {"43.ADP", 1920}, + {"44.ADP", 1920}, {"45.ADP", 1920}, + {"46.ADP", 1920}, {"47.ADP", 1920}, + {"48.ADP", 1920}, {"49.ADP", 1920}, + {"50.ADP", 1920}, {"51.ADP", 1920}, + {"52.ADP", 1920}, {"53.ADP", 0}, + {"54.ADP", 0}, {"55.ADP", 0}, + {"56.ADP", 0}, {"57.ADP", 0}, + {"58.ADP", 0}, {"59.ADP", 0} }; -const char *staccFileNames[] = { -/* - "05-MUCCA.ADP", "06-HALOW.ADP", - "LETTERAINIZIO.ADP", "LETTERAPAURA.ADP", - "LETTERAFINE.ADP", "PREGAME2.ADP", - "07-TIMOT.ADP", "15-SHOTRUFUS.ADP", - "15-SHOTTONY.ADP", "27-ZUCC2.ADP", -*/ - "S00.ADP", "S01.ADP", - "S02.ADP", "S03.ADP", +const char *staccFileNames[] = { + "S00.ADP", "S01.ADP", + "S02.ADP", "S03.ADP", "S04.ADP", "S05.ADP", "S06.ADP", "S07.ADP", "S08.ADP", "S09.ADP", - -/* - "53-DLOGO.ADP", "16-DIALOG1.ADP", - "TORRE1.ADP", "GARG1.ADP", - "LORENZ1.ADP", "24-FIGHT.ADP", - "08-MACBETH-PREPARA.ADP", "08-MACBETH-RECITA.ADP", - "GATTO1.ADP" -*/ "S10.ADP", "S11.ADP", "S12.ADP", "S13.ADP", "S14.ADP", "S15.ADP", @@ -169,7 +109,7 @@ const char *staccFileNames[] = { void ReapplyChangedHotspot(void) { int 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) { @@ -182,7 +122,7 @@ void SaveChangedHotspot(Common::OutSaveFile *f) { void LoadChangedHotspot(Common::InSaveFile *f) { GLOBALS.curChangedHotspot = f->readByte(); - + if (GLOBALS.curChangedHotspot > 0) { for (int i = 0; i < GLOBALS.curChangedHotspot; ++i) GLOBALS.ChangedHotspot[i].Load(f); @@ -191,13 +131,13 @@ void LoadChangedHotspot(Common::InSaveFile *f) { /* - Classi richieste per le funzioni custom! + Classi richieste per le funzioni custom! - Tony (per muoverlo) -> si puo' fare tramite MPAL l'animazione? Penso proprio di sì + Tony (per muoverlo) -> si puo' fare tramite MPAL l'animazione? Penso proprio di sì - SendMessage -> Direi che basta theEngine.SendMessage() - ChangeLocation -> theEngine.ChangeLocation() - AddInventory -> theEngine.AddInventory() + SendMessage -> Direi che basta theEngine.SendMessage() + ChangeLocation -> theEngine.ChangeLocation() + AddInventory -> theEngine.AddInventory() */ void MCharResetCodes(void) { @@ -246,12 +186,12 @@ DECLARE_CUSTOM_FUNCTION(RightToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(TonySetPalesati)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { - GLOBALS.SetPalesati(bStatus); + GLOBALS.SetPalesati(bStatus); } DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; - int i; + int i; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -269,25 +209,25 @@ DECLARE_CUSTOM_FUNCTION(SetAlwaysDisplay)(CORO_PARAM, uint32 val, uint32, uint32 DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32, uint32) { switch (dwPointer) { - case 1: - GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIASU); - break; - case 2: - GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIAGIU); - break; - case 3: - GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIASINISTRA); - break; - case 4: - GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIADESTRA); - break; - case 5: - GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIAMAPPA); - break; + case 1: + GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIASU); + break; + case 2: + GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIAGIU); + break; + case 3: + GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIASINISTRA); + break; + case 4: + GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIADESTRA); + break; + case 5: + GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIAMAPPA); + break; - default: - GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_NONE); - break; + default: + GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_NONE); + break; } } @@ -296,7 +236,7 @@ VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) { int code; code = (codehi << 16) | codelo; - + if (_vm->_voices.size() == 0) return NULL; @@ -310,12 +250,12 @@ VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) { DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX, uint32 nY, uint32) { CORO_BEGIN_CONTEXT; - RMMessage msg; - int i; - int curOffset; - VoiceHeader *curVoc; - FPSFX *voice; - RMTextDialog text; + RMMessage msg; + int i; + int curOffset; + VoiceHeader *curVoc; + FPSFX *voice; + RMTextDialog text; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -337,11 +277,11 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX // PRIMA VOLTA PREALLOCA g_system->lockMutex(GLOBALS.vdb); - //fseek(_vm->m_vdbFP, _ctx->curOffset, SEEK_SET); + // fseek(_vm->m_vdbFP, _ctx->curOffset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curOffset); _vm->_theSound.CreateSfx(&_ctx->voice); _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); -// _ctx->curOffset = ftell(_vm->m_vdbFP); + // _ctx->curOffset = ftell(_vm->m_vdbFP); _ctx->curOffset = _vm->_vdbFP.pos(); _ctx->voice->SetLoop(false); @@ -367,12 +307,12 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX for (_ctx->i = 0; _ctx->i < _ctx->msg.NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { _ctx->text.SetInput(GLOBALS.Input); - + // Allineamento _ctx->text.SetAlignType(RMText::HCENTER, RMText::VBOTTOM); - + // Colore - _ctx->text.SetColor(0,255,0); + _ctx->text.SetColor(0, 255, 0); // Scrive il testo _ctx->text.WriteText(_ctx->msg[_ctx->i], 0); @@ -384,7 +324,10 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->text.SetPosition(RMPoint(nX, nY) - GLOBALS.Loc->ScrollPosition()); // Setta l'always display - if (GLOBALS.bAlwaysDisplay) { _ctx->text.SetAlwaysDisplay(); _ctx->text.ForceTime(); } + if (GLOBALS.bAlwaysDisplay) { + _ctx->text.SetAlwaysDisplay(); + _ctx->text.ForceTime(); + } // Registra il testo GLOBALS.LinkGraphicTask(&_ctx->text); @@ -395,11 +338,11 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } else { g_system->lockMutex(GLOBALS.vdb); - // fseek(_vm->m_vdbFP, _ctx->curOffset, SEEK_SET); + // fseek(_vm->m_vdbFP, _ctx->curOffset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curOffset); _vm->_theSound.CreateSfx(&_ctx->voice); _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); - // _ctx->curOffset = ftell(_vm->m_vdbFP); + // _ctx->curOffset = ftell(_vm->m_vdbFP); _ctx->curOffset = _vm->_vdbFP.pos(); _ctx->voice->SetLoop(false); _ctx->voice->Play(); @@ -408,14 +351,14 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX } } - // Aspetta la fine della visualizzazione + // Aspetta la fine della visualizzazione _ctx->text.SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text.WaitForEndDisplay); if (_ctx->curVoc) { _ctx->voice->Stop(); _ctx->voice->Release(); - _ctx->voice=NULL; + _ctx->voice = NULL; } } @@ -435,7 +378,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeBoxStatus)(CORO_PARAM, uint32 nLoc, uint32 nBox, u DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { CORO_BEGIN_CONTEXT; - uint32 h; + uint32 h; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -461,20 +404,20 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, ui DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) { CORO_BEGIN_CONTEXT; - RMMessage *msg; - RMGfxClearTask clear; - int i; - RMTextDialog text; + RMMessage *msg; + RMGfxClearTask clear; + int i; + RMTextDialog text; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); _ctx->msg = new RMMessage(nMsg); - + GLOBALS.SFM_nLoc = GLOBALS.Loc->TEMPGetNumLoc(); GLOBALS.SFM_pt = GLOBALS.Tony->Position(); - - if (GLOBALS.bSkipIdle) + + if (GLOBALS.bSkipIdle) return; CORO_INVOKE_2(GLOBALS.UnloadLocation, false, NULL); @@ -485,13 +428,13 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 _ctx->text.SetInput(GLOBALS.Input); // Allineamento - _ctx->text.SetAlignType(RMText::HCENTER,RMText::VCENTER); - - // Forza il testo a scomparire a tempo + _ctx->text.SetAlignType(RMText::HCENTER, RMText::VCENTER); + + // Forza il testo a scomparire a tempo _ctx->text.ForceTime(); // Colore - _ctx->text.SetColor(255,255,255); + _ctx->text.SetColor(255, 255, 255); // Scrive il testo if (nFont == 0) @@ -509,7 +452,7 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 GLOBALS.LinkGraphicTask(&_ctx->clear); GLOBALS.LinkGraphicTask(&_ctx->text); - // Aspetta la fine della visualizzazione + // Aspetta la fine della visualizzazione _ctx->text.SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text.WaitForEndDisplay); } @@ -521,14 +464,14 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; - char buf[256]; - RMGfxClearTask clear; + char buf[256]; + RMGfxClearTask clear; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); GLOBALS.LinkGraphicTask(&_ctx->clear); - + CORO_INVOKE_0(GLOBALS.WaitFrame); CORO_END_CODE; @@ -536,7 +479,7 @@ DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) { 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) GLOBALS.Tony->Show(); GLOBALS.Unfreeze(); @@ -569,8 +512,8 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 CORO_BEGIN_CODE(_ctx); if (!GLOBALS.bNoOcchioDiBue) { - GLOBALS.InitWipe(1); - CORO_INVOKE_0(GLOBALS.WaitWipeEnd); + GLOBALS.InitWipe(1); + CORO_INVOKE_0(GLOBALS.WaitWipeEnd); } _vm->StopMusic(4); @@ -585,7 +528,7 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { CORO_BEGIN_CONTEXT; - uint32 h; + uint32 h; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -598,7 +541,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint if (GLOBALS.lastTappeto != GLOBALS.tappeti[nLoc]) { _vm->StopMusic(4); } - + // On Exit e lascia freezzato CORO_INVOKE_2(GLOBALS.UnloadLocation, true, NULL); @@ -615,16 +558,16 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint } if (!GLOBALS.bNoOcchioDiBue) { - GLOBALS.InitWipe(2); + GLOBALS.InitWipe(2); } - + GLOBALS.Unfreeze(); _ctx->h = mpalQueryDoAction(0, nLoc, 0); if (!GLOBALS.bNoOcchioDiBue) { - CORO_INVOKE_0(GLOBALS.WaitWipeEnd); + CORO_INVOKE_0(GLOBALS.WaitWipeEnd); GLOBALS.CloseWipe(); } @@ -638,7 +581,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint } 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) { @@ -653,7 +596,7 @@ DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); CORO_INVOKE_4(ChangeLocation, GLOBALS.saveTonyLoc, GLOBALS.saveTonyPos.x, GLOBALS.saveTonyPos.y, 0); - + MCharResetCodes(); CORO_END_CODE; @@ -675,7 +618,7 @@ DECLARE_CUSTOM_FUNCTION(StopTony)(CORO_PARAM, uint32, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(CustEnableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) { - GLOBALS.EnableGUI(); + GLOBALS.EnableGUI(); } DECLARE_CUSTOM_FUNCTION(CustDisableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -693,7 +636,7 @@ void TonyGenericTake1(CORO_PARAM, uint32 nDirection) { GLOBALS.Freeze(); GLOBALS.Tony->Take(nDirection, 0); GLOBALS.Unfreeze(); - + if (!GLOBALS.bSkipIdle) CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); @@ -714,7 +657,7 @@ void TonyGenericTake2(CORO_PARAM, uint32 nDirection) { CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); GLOBALS.Freeze(); - GLOBALS.Tony->Take(nDirection,2); + GLOBALS.Tony->Take(nDirection, 2); GLOBALS.Unfreeze(); CORO_END_CODE; @@ -729,7 +672,7 @@ void TonyGenericPut1(CORO_PARAM, uint32 nDirection) { GLOBALS.Freeze(); GLOBALS.Tony->Put(nDirection, 0); GLOBALS.Unfreeze(); - + if (!GLOBALS.bSkipIdle) CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); @@ -743,14 +686,14 @@ void TonyGenericPut2(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); GLOBALS.Freeze(); - GLOBALS.Tony->Put(nDirection,1); + GLOBALS.Tony->Put(nDirection, 1); GLOBALS.Unfreeze(); if (!GLOBALS.bSkipIdle) CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); GLOBALS.Freeze(); - GLOBALS.Tony->Put(nDirection,2); + GLOBALS.Tony->Put(nDirection, 2); GLOBALS.Unfreeze(); CORO_END_CODE; @@ -831,7 +774,7 @@ DECLARE_CUSTOM_FUNCTION(TonySiRialza)(CORO_PARAM, uint32 dwParte, uint32, uint32 GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SIRIALZALEFT); else GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SIRIALZARIGHT); - + if (!GLOBALS.bSkipIdle) CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); @@ -839,7 +782,7 @@ DECLARE_CUSTOM_FUNCTION(TonySiRialza)(CORO_PARAM, uint32 dwParte, 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) { @@ -1189,7 +1132,7 @@ DECLARE_CUSTOM_FUNCTION(TonySniffaRight)(CORO_PARAM, uint32, uint32, uint32, uin } DECLARE_CUSTOM_FUNCTION(TonyNaah)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); + TonySetNumTexts(dwText); GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NAAH; } @@ -1236,15 +1179,15 @@ DECLARE_CUSTOM_FUNCTION(DisableTony)(CORO_PARAM, uint32 bShowOmbra, uint32, uint DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; - RMItem *item; + RMItem *item; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); _ctx->item = GLOBALS.Loc->GetItemFromCode(nItem); - + 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; } @@ -1261,7 +1204,7 @@ DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint3 CORO_BEGIN_CODE(_ctx); CORO_INVOKE_1(GLOBALS.Tony->Move, RMPoint(nX, nY)); - + if (!GLOBALS.bSkipIdle) CORO_INVOKE_0(GLOBALS.Tony->WaitForEndMovement); @@ -1274,8 +1217,8 @@ DECLARE_CUSTOM_FUNCTION(MoveTony)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) { CORO_BEGIN_CONTEXT; - int lx, ly; - RMPoint pt; + int lx, ly; + RMPoint pt; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -1285,21 +1228,25 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 _ctx->ly = (int32)nY; _ctx->pt = GLOBALS.Loc->ScrollPosition(); - + while ((_ctx->lx != 0 || _ctx->ly != 0) && !GLOBALS.bSkipIdle) { if (_ctx->lx > 0) { - _ctx->lx -= (int32)sX; if (_ctx->lx < 0) _ctx->lx = 0; + _ctx->lx -= (int32)sX; + if (_ctx->lx < 0) _ctx->lx = 0; _ctx->pt.Offset((int32)sX, 0); } else if (_ctx->lx < 0) { - _ctx->lx += (int32)sX; if (_ctx->lx > 0) _ctx->lx = 0; + _ctx->lx += (int32)sX; + if (_ctx->lx > 0) _ctx->lx = 0; _ctx->pt.Offset(-(int32)sX, 0); } if (_ctx->ly > 0) { - _ctx->ly -= sY; if (_ctx->ly < 0) _ctx->ly = 0; + _ctx->ly -= sY; + if (_ctx->ly < 0) _ctx->ly = 0; _ctx->pt.Offset(0, sY); } else if (_ctx->ly < 0) { - _ctx->ly += sY; if (_ctx->ly > 0) _ctx->ly = 0; + _ctx->ly += sY; + if (_ctx->ly > 0) _ctx->ly = 0; _ctx->pt.Offset(0, -(int32)sY); } @@ -1316,11 +1263,11 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) { CORO_BEGIN_CONTEXT; - int lx, ly; - RMPoint pt, startpt; - uint32 dwStartTime, dwCurTime, dwTotalTime; - uint32 stepX, stepY; - int dimx, dimy; + int lx, ly; + RMPoint pt, startpt; + uint32 dwStartTime, dwCurTime, dwTotalTime; + uint32 stepX, stepY; + int dimx, dimy; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -1330,16 +1277,19 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui _ctx->ly = (int32)nY; _ctx->dimx = _ctx->lx; _ctx->dimy = _ctx->ly; - if (_ctx->lx < 0) _ctx->dimx = -_ctx->lx; - if (_ctx->ly < 0) _ctx->dimy = -_ctx->ly; + if (_ctx->lx < 0) + _ctx->dimx = -_ctx->lx; + + if (_ctx->ly < 0) + _ctx->dimy = -_ctx->ly; _ctx->stepX = sX; _ctx->stepY = sY; _ctx->startpt = GLOBALS.Loc->ScrollPosition(); - + _ctx->dwStartTime = _vm->GetTime(); - + if (sX) _ctx->dwTotalTime = _ctx->dimx * (1000 / 35) / sX; else @@ -1351,7 +1301,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui break; _ctx->pt = _ctx->startpt; - + if (sX) { if (_ctx->lx > 0) _ctx->pt.x += (_ctx->dimx * _ctx->dwCurTime) / _ctx->dwTotalTime; @@ -1359,30 +1309,41 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui _ctx->pt.x -= (_ctx->dimx * _ctx->dwCurTime) / _ctx->dwTotalTime; } else { if (_ctx->ly > 0) - _ctx->pt.y += (_ctx->dimy*_ctx->dwCurTime) / _ctx->dwTotalTime; + _ctx->pt.y += (_ctx->dimy * _ctx->dwCurTime) / _ctx->dwTotalTime; else - _ctx->pt.y -= (_ctx->dimy*_ctx->dwCurTime) / _ctx->dwTotalTime; + _ctx->pt.y -= (_ctx->dimy * _ctx->dwCurTime) / _ctx->dwTotalTime; } -/* +/* sX = _ctx->stepX * (_ctx->dwCurTime-dwLastTime) / (1000 / 35); sY = _ctx->stepY * (_ctx->dwCurTime-dwLastTime) / (1000 / 35); if (_ctx->lx > 0) { - _ctx->lx-=sX; if (_ctx->lx < 0) _ctx->lx = 0; - _ctx->pt.Offset(sX,0); + _ctx->lx -= sX; + if (_ctx->lx < 0) + _ctx->lx = 0; + _ctx->pt.Offset(sX, 0); } else if (_ctx->lx < 0) { - _ctx->lx+=sX; if (_ctx->lx > 0) _ctx->lx = 0; - _ctx->pt.Offset(-sX,0); + _ctx->lx += sX; + + if (_ctx->lx > 0) + _ctx->lx = 0; + + _ctx->pt.Offset(-sX, 0); } if (_ctx->ly > 0) { - _ctx->ly-=sY; if (_ctx->ly<0) _ctx->ly = 0; - _ctx->pt.Offset(0,sY); - } else if (_ctx->ly<0) { - _ctx->ly+=sY; if (_ctx->ly > 0) _ctx->ly = 0; - _ctx->pt.Offset(0,-sY); + _ctx->ly -= sY; + if (_ctx->ly < 0) + _ctx->ly = 0; + _ctx->pt.Offset(0, sY); + } else if (_ctx->ly < 0) { + _ctx->ly += sY; + if (_ctx->ly > 0) + _ctx->ly = 0; + + _ctx->pt.Offset(0, -sY); } */ CORO_INVOKE_0(GLOBALS.WaitFrame); @@ -1422,15 +1383,15 @@ DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uin for (i = 0; i < GLOBALS.curChangedHotspot; i++) if (GLOBALS.ChangedHotspot[i].dwCode == dwCode) { - GLOBALS.ChangedHotspot[i].nX=nX; - GLOBALS.ChangedHotspot[i].nY=nY; + GLOBALS.ChangedHotspot[i].nX = nX; + GLOBALS.ChangedHotspot[i].nY = nY; break; } if (i == GLOBALS.curChangedHotspot) { - GLOBALS.ChangedHotspot[i].dwCode=dwCode; - GLOBALS.ChangedHotspot[i].nX=nX; - GLOBALS.ChangedHotspot[i].nY=nY; + GLOBALS.ChangedHotspot[i].dwCode = dwCode; + GLOBALS.ChangedHotspot[i].nX = nX; + GLOBALS.ChangedHotspot[i].nY = nY; GLOBALS.curChangedHotspot++; } @@ -1448,15 +1409,15 @@ DECLARE_CUSTOM_FUNCTION(Abort)(CORO_PARAM, uint32, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; - uint32 i; - uint32 curTime; - int dirx,diry; + uint32 i; + uint32 curTime; + int dirx, diry; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); _ctx->curTime = _vm->GetTime(); - + _ctx->dirx = 1; _ctx->diry = 1; @@ -1480,14 +1441,14 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32 GLOBALS.Loc->SetFixedScroll(RMPoint(0, 0)); GLOBALS.Tony->SetFixedScroll(RMPoint(0, 0)); GLOBALS.Unfreeze(); - + CORO_END_CODE; } /* - * Personaggi + * Personaggi */ DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { @@ -1496,7 +1457,7 @@ DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uin GLOBALS.Character[nChar].item = GLOBALS.Loc->GetItemFromCode(nCode); GLOBALS.Character[nChar].r = 255; GLOBALS.Character[nChar].g = 255; - GLOBALS.Character[nChar].b = 255; + GLOBALS.Character[nChar].b = 255; GLOBALS.Character[nChar].talkpattern = 0; GLOBALS.Character[nChar].starttalkpattern = 0; GLOBALS.Character[nChar].endtalkpattern = 0; @@ -1506,33 +1467,33 @@ DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uin } DECLARE_CUSTOM_FUNCTION(CharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) { - assert(nChar<16); + assert(nChar < 16); GLOBALS.Character[nChar].r = r; GLOBALS.Character[nChar].g = g; GLOBALS.Character[nChar].b = b; } DECLARE_CUSTOM_FUNCTION(CharSetTalkPattern)(CORO_PARAM, uint32 nChar, uint32 tp, uint32 sp, uint32) { - assert(nChar<16); + assert(nChar < 16); GLOBALS.Character[nChar].talkpattern = tp; GLOBALS.Character[nChar].standpattern = sp; } DECLARE_CUSTOM_FUNCTION(CharSetStartEndTalkPattern)(CORO_PARAM, uint32 nChar, uint32 sp, uint32 ep, uint32) { - assert(nChar<16); - GLOBALS.Character[nChar].starttalkpattern=sp; - GLOBALS.Character[nChar].endtalkpattern=ep; + assert(nChar < 16); + GLOBALS.Character[nChar].starttalkpattern = sp; + GLOBALS.Character[nChar].endtalkpattern = ep; } DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32) { CORO_BEGIN_CONTEXT; - RMMessage *msg; - int i; - RMPoint pt; - RMTextDialog *text; - int curOffset; - VoiceHeader *curVoc; - FPSFX *voice; + RMMessage *msg; + int i; + RMPoint pt; + RMTextDialog *text; + int curOffset; + VoiceHeader *curVoc; + FPSFX *voice; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -1542,16 +1503,16 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess assert(nChar < 16); _ctx->pt = GLOBALS.Character[nChar].item->CalculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->ScrollPosition(); - + if (GLOBALS.Character[nChar].starttalkpattern != 0) { GLOBALS.Freeze(); GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].starttalkpattern); GLOBALS.Unfreeze(); - + CORO_INVOKE_0(GLOBALS.Character[nChar].item->WaitForEndPattern); } - GLOBALS.Freeze(); + GLOBALS.Freeze(); GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].talkpattern); GLOBALS.Unfreeze(); @@ -1559,14 +1520,14 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->voice = NULL; if (_ctx->curVoc) { // Si posiziona all'interno del database delle voci all'inizio della prima -// fseek(_vm->m_vdbFP, _ctx->curVoc->offset, SEEK_SET); + // fseek(_vm->m_vdbFP, _ctx->curVoc->offset, SEEK_SET); g_system->lockMutex(GLOBALS.vdb); _vm->_vdbFP.seek(_ctx->curVoc->offset); _ctx->curOffset = _ctx->curVoc->offset; g_system->unlockMutex(GLOBALS.vdb); } - 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) { GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); if (GLOBALS.bTonyIsSpeaking) @@ -1578,21 +1539,24 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess // Skipping _ctx->text->SetSkipStatus(!bIsBack); - + // Allineamento - _ctx->text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); - + _ctx->text->SetAlignType(RMText::HCENTER, RMText::VBOTTOM); + // Colore - _ctx->text->SetColor(GLOBALS.Character[nChar].r,GLOBALS.Character[nChar].g,GLOBALS.Character[nChar].b); + _ctx->text->SetColor(GLOBALS.Character[nChar].r, GLOBALS.Character[nChar].g, GLOBALS.Character[nChar].b); // Scrive il testo - _ctx->text->WriteText((*_ctx->msg)[_ctx->i],0); + _ctx->text->WriteText((*_ctx->msg)[_ctx->i], 0); // Setta la posizione _ctx->text->SetPosition(_ctx->pt); // Setta l'always display - if (GLOBALS.bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } + if (GLOBALS.bAlwaysDisplay) { + _ctx->text->SetAlwaysDisplay(); + _ctx->text->ForceTime(); + } // Registra il testo GLOBALS.LinkGraphicTask(_ctx->text); @@ -1610,14 +1574,14 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess g_system->unlockMutex(GLOBALS.vdb); } - // Aspetta la fine della visualizzazione + // Aspetta la fine della visualizzazione _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); if (_ctx->curVoc) { _ctx->voice->Stop(); _ctx->voice->Release(); - _ctx->voice=NULL; + _ctx->voice = NULL; } @@ -1630,7 +1594,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].endtalkpattern); GLOBALS.Unfreeze(); CORO_INVOKE_0(GLOBALS.Character[nChar].item->WaitForEndPattern); - } + } GLOBALS.Freeze(); GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].standpattern); @@ -1641,7 +1605,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess } DECLARE_CUSTOM_FUNCTION(AddInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { - GLOBALS.Inventory->AddItem(dwCode); + GLOBALS.Inventory->AddItem(dwCode); } DECLARE_CUSTOM_FUNCTION(RemoveInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { @@ -1649,67 +1613,66 @@ DECLARE_CUSTOM_FUNCTION(RemoveInventory)(CORO_PARAM, uint32 dwCode, uint32, uint } DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32 dwStatus, uint32, uint32) { - GLOBALS.Inventory->ChangeItemStatus(dwCode,dwStatus); + GLOBALS.Inventory->ChangeItemStatus(dwCode, dwStatus); } /* - * Mastri Personaggi + * Mastri Personaggi */ DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { assert(nChar < 10); - GLOBALS.MCharacter[nChar].code=nCode; - if (nCode== 0) - GLOBALS.MCharacter[nChar].item=NULL; + GLOBALS.MCharacter[nChar].code = nCode; + if (nCode == 0) + GLOBALS.MCharacter[nChar].item = NULL; else - GLOBALS.MCharacter[nChar].item=GLOBALS.Loc->GetItemFromCode(nCode); - GLOBALS.MCharacter[nChar].r=255; - GLOBALS.MCharacter[nChar].g=255; - GLOBALS.MCharacter[nChar].b=255; - GLOBALS.MCharacter[nChar].x=-1; - GLOBALS.MCharacter[nChar].y=-1; + GLOBALS.MCharacter[nChar].item = GLOBALS.Loc->GetItemFromCode(nCode); + GLOBALS.MCharacter[nChar].r = 255; + GLOBALS.MCharacter[nChar].g = 255; + GLOBALS.MCharacter[nChar].b = 255; + GLOBALS.MCharacter[nChar].x = -1; + GLOBALS.MCharacter[nChar].y = -1; GLOBALS.MCharacter[nChar].bAlwaysBack = 0; for (int i = 0; i < 10; i++) GLOBALS.MCharacter[nChar].numtalks[i] = 1; GLOBALS.MCharacter[nChar].curgroup = 0; - + GLOBALS.IsMChar[nChar] = true; } 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); } DECLARE_CUSTOM_FUNCTION(MCharSetPosition)(CORO_PARAM, uint32 nChar, uint32 nX, uint32 nY, uint32) { assert(nChar < 10); - GLOBALS.MCharacter[nChar].x=nX; - GLOBALS.MCharacter[nChar].y=nY; + GLOBALS.MCharacter[nChar].x = nX; + GLOBALS.MCharacter[nChar].y = nY; } DECLARE_CUSTOM_FUNCTION(MCharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) { assert(nChar < 10); - GLOBALS.MCharacter[nChar].r=r; - GLOBALS.MCharacter[nChar].g=g; - GLOBALS.MCharacter[nChar].b=b; + GLOBALS.MCharacter[nChar].r = r; + GLOBALS.MCharacter[nChar].g = g; + GLOBALS.MCharacter[nChar].b = b; } DECLARE_CUSTOM_FUNCTION(MCharSetNumTalksInGroup)(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32 nTalks, uint32) { - assert(nChar < 10); + assert(nChar < 10); assert(nGroup < 10); - GLOBALS.MCharacter[nChar].numtalks[nGroup]=nTalks; + GLOBALS.MCharacter[nChar].numtalks[nGroup] = nTalks; } -DECLARE_CUSTOM_FUNCTION(MCharSetCurrentGroup)(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32, uint32) -{ - assert(nChar < 10); +DECLARE_CUSTOM_FUNCTION(MCharSetCurrentGroup)(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32, uint32) { + assert(nChar < 10); assert(nGroup < 10); GLOBALS.MCharacter[nChar].curgroup = nGroup; @@ -1718,28 +1681,28 @@ DECLARE_CUSTOM_FUNCTION(MCharSetCurrentGroup)(CORO_PARAM, uint32 nChar, uint32 n DECLARE_CUSTOM_FUNCTION(MCharSetNumTexts)(CORO_PARAM, uint32 nChar, uint32 nTexts, uint32, uint32) { assert(nChar < 10); - GLOBALS.MCharacter[nChar].numtexts=nTexts-1; + GLOBALS.MCharacter[nChar].numtexts = nTexts - 1; GLOBALS.MCharacter[nChar].bInTexts = false; } DECLARE_CUSTOM_FUNCTION(MCharSetAlwaysBack)(CORO_PARAM, uint32 nChar, uint32 bAlwaysBack, uint32, uint32) { assert(nChar < 10); - GLOBALS.MCharacter[nChar].bAlwaysBack=bAlwaysBack; + GLOBALS.MCharacter[nChar].bAlwaysBack = bAlwaysBack; } DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32 nFont) { CORO_BEGIN_CONTEXT; - RMMessage *msg; - int i; - int parm; - RMPoint pt; - uint32 h; - RMTextDialog *text; - int curOffset; - VoiceHeader *curVoc; - FPSFX *voice; + RMMessage *msg; + int i; + int parm; + RMPoint pt; + uint32 h; + RMTextDialog *text; + int curOffset; + VoiceHeader *curVoc; + FPSFX *voice; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -1752,14 +1715,14 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes bIsBack |= GLOBALS.MCharacter[nChar].bAlwaysBack ? 1 : 0; // Calcola la posizione del testo in base al frame corrente - if (GLOBALS.MCharacter[nChar].x==-1) - _ctx->pt=GLOBALS.MCharacter[nChar].item->CalculatePos()-RMPoint(-60,20)-GLOBALS.Loc->ScrollPosition(); + if (GLOBALS.MCharacter[nChar].x == -1) + _ctx->pt = GLOBALS.MCharacter[nChar].item->CalculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->ScrollPosition(); else - _ctx->pt=RMPoint(GLOBALS.MCharacter[nChar].x,GLOBALS.MCharacter[nChar].y); - + _ctx->pt = RMPoint(GLOBALS.MCharacter[nChar].x, GLOBALS.MCharacter[nChar].y); + // Parametro per le azioni speciali: random tra le parlate _ctx->parm = (GLOBALS.MCharacter[nChar].curgroup * 10) + _vm->_randomSource.getRandomNumber( - GLOBALS.MCharacter[nChar].numtalks[GLOBALS.MCharacter[nChar].curgroup] - 1) + 1; + GLOBALS.MCharacter[nChar].numtalks[GLOBALS.MCharacter[nChar].curgroup] - 1) + 1; // Cerca di eseguire la funzione custom per inizializzare la parlata if (GLOBALS.MCharacter[nChar].item) { @@ -1774,7 +1737,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes if (_ctx->curVoc) { // Si posiziona all'interno del database delle voci all'inizio della prima g_system->lockMutex(GLOBALS.vdb); - // fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); + // fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curVoc->offset); _ctx->curOffset = _ctx->curVoc->offset; g_system->unlockMutex(GLOBALS.vdb); @@ -1786,20 +1749,19 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); if (GLOBALS.bTonyIsSpeaking) CORO_INVOKE_0(GLOBALS.curBackText->Hide); - } - else + } else _ctx->text = new RMTextDialog; _ctx->text->SetInput(GLOBALS.Input); // Skipping _ctx->text->SetSkipStatus(!bIsBack); - + // Allineamento - _ctx->text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); - + _ctx->text->SetAlignType(RMText::HCENTER, RMText::VBOTTOM); + // Colore - _ctx->text->SetColor(GLOBALS.MCharacter[nChar].r,GLOBALS.MCharacter[nChar].g,GLOBALS.MCharacter[nChar].b); + _ctx->text->SetColor(GLOBALS.MCharacter[nChar].r, GLOBALS.MCharacter[nChar].g, GLOBALS.MCharacter[nChar].b); // Scrive il testo _ctx->text->WriteText((*_ctx->msg)[_ctx->i], nFont); @@ -1808,7 +1770,10 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->text->SetPosition(_ctx->pt); // Setta l'always display - if (GLOBALS.bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } + if (GLOBALS.bAlwaysDisplay) { + _ctx->text->SetAlwaysDisplay(); + _ctx->text->ForceTime(); + } // Registra il testo GLOBALS.LinkGraphicTask(_ctx->text); @@ -1826,7 +1791,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes g_system->unlockMutex(GLOBALS.vdb); } - // Aspetta la fine della visualizzazione + // Aspetta la fine della visualizzazione _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); @@ -1836,7 +1801,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->voice = NULL; } - GLOBALS.curBackText = NULL; + GLOBALS.curBackText = NULL; delete _ctx->text; delete _ctx->msg; } @@ -1858,21 +1823,21 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes /* - * Dialoghi + * Dialoghi */ int curDialog; DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg, uint32, uint32) { CORO_BEGIN_CONTEXT; - LPSTR string; - RMTextDialog *text; - int parm; - uint32 h; - bool bIsBack; - VoiceHeader *curVoc; - FPSFX *voice; - RMPoint pt; + LPSTR string; + RMTextDialog *text; + int parm; + uint32 h; + bool bIsBack; + VoiceHeader *curVoc; + FPSFX *voice; + RMPoint pt; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -1881,7 +1846,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg // La SendDialogMessage può andare in background se è un personaggio in MCHAR settato // con la SetAlwaysBack - if (nPers != 0 && GLOBALS.IsMChar[nPers] && GLOBALS.MCharacter[nPers].bAlwaysBack) + if (nPers != 0 && GLOBALS.IsMChar[nPers] && GLOBALS.MCharacter[nPers].bAlwaysBack) _ctx->bIsBack = true; _ctx->curVoc = SearchVoiceHeader(curDialog, nMsg); @@ -1890,7 +1855,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (_ctx->curVoc) { // Si posiziona all'interno del database delle voci all'inizio della prima g_system->lockMutex(GLOBALS.vdb); -// fseek(_vm->m_vdbFP, _ctx->curVoc->offset, SEEK_SET); + // fseek(_vm->m_vdbFP, _ctx->curVoc->offset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curVoc->offset); _vm->_theSound.CreateSfx(&_ctx->voice); _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); @@ -1903,12 +1868,12 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (nPers == 0) { _ctx->text = new RMTextDialog; - _ctx->text->SetColor(0,255,0); - _ctx->text->SetPosition(GLOBALS.Tony->Position()-RMPoint(0,130)-GLOBALS.Loc->ScrollPosition()); - _ctx->text->WriteText(_ctx->string,0); + _ctx->text->SetColor(0, 255, 0); + _ctx->text->SetPosition(GLOBALS.Tony->Position() - RMPoint(0, 130) - GLOBALS.Loc->ScrollPosition()); + _ctx->text->WriteText(_ctx->string, 0); if (GLOBALS.dwTonyNumTexts > 0) { - if (!GLOBALS.bTonyInTexts) { + if (!GLOBALS.bTonyInTexts) { if (GLOBALS.nTonyNextTalkType != GLOBALS.Tony->TALK_NORMAL) { CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.nTonyNextTalkType); if (!GLOBALS.bStaticTalk) @@ -1930,15 +1895,15 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->pt = GLOBALS.Character[nPers].item->CalculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->ScrollPosition(); if (GLOBALS.Character[nPers].starttalkpattern != 0) { - GLOBALS.Freeze(); - GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].starttalkpattern); - GLOBALS.Unfreeze(); + GLOBALS.Freeze(); + GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].starttalkpattern); + GLOBALS.Unfreeze(); CORO_INVOKE_0(GLOBALS.Character[nPers].item->WaitForEndPattern); - } + } 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->SetPosition(_ctx->pt); } else { @@ -1949,7 +1914,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg // Parametro per le azioni speciali: random tra le parlate _ctx->parm = (GLOBALS.MCharacter[nPers].curgroup * 10) + _vm->_randomSource.getRandomNumber( - GLOBALS.MCharacter[nPers].numtalks[GLOBALS.MCharacter[nPers].curgroup] - 1) + 1; + GLOBALS.MCharacter[nPers].numtalks[GLOBALS.MCharacter[nPers].curgroup] - 1) + 1; if (GLOBALS.MCharacter[nPers].numtexts != 0 && GLOBALS.MCharacter[nPers].bInTexts) { GLOBALS.MCharacter[nPers].numtexts--; @@ -1960,7 +1925,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); GLOBALS.MCharacter[nPers].curTalk = _ctx->parm; - + if (GLOBALS.MCharacter[nPers].numtexts != 0) { GLOBALS.MCharacter[nPers].bInTexts = true; GLOBALS.MCharacter[nPers].numtexts--; @@ -1977,15 +1942,18 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->text = new RMTextDialog; _ctx->text->SetSkipStatus(!GLOBALS.MCharacter[nPers].bAlwaysBack); - _ctx->text->SetColor(GLOBALS.MCharacter[nPers].r,GLOBALS.MCharacter[nPers].g,GLOBALS.MCharacter[nPers].b); - _ctx->text->WriteText(_ctx->string,0); + _ctx->text->SetColor(GLOBALS.MCharacter[nPers].r, GLOBALS.MCharacter[nPers].g, GLOBALS.MCharacter[nPers].b); + _ctx->text->WriteText(_ctx->string, 0); _ctx->text->SetPosition(_ctx->pt); } if (!GLOBALS.bSkipIdle) { _ctx->text->SetInput(GLOBALS.Input); - if (GLOBALS.bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } - _ctx->text->SetAlignType(RMText::HCENTER,RMText::VBOTTOM); + if (GLOBALS.bAlwaysDisplay) { + _ctx->text->SetAlwaysDisplay(); + _ctx->text->ForceTime(); + } + _ctx->text->SetAlignType(RMText::HCENTER, RMText::VBOTTOM); GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { @@ -1993,7 +1961,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } - // Aspetta la fine della visualizzazione + // Aspetta la fine della visualizzazione _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); } @@ -2001,25 +1969,25 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (_ctx->curVoc) { _ctx->voice->Stop(); _ctx->voice->Release(); - _ctx->voice=NULL; + _ctx->voice = NULL; } if (nPers != 0) { if (!GLOBALS.IsMChar[nPers]) { - if (GLOBALS.Character[nPers].endtalkpattern != 0) { + if (GLOBALS.Character[nPers].endtalkpattern != 0) { GLOBALS.Freeze(); GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].endtalkpattern); GLOBALS.Unfreeze(); CORO_INVOKE_0(GLOBALS.Character[nPers].item->WaitForEndPattern); - } - + } + GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].standpattern); delete _ctx->text; } 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) { // Cerca di eseguire la funzione custom per chiudere la parlata - 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); + 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); if (_ctx->h != CORO_INVALID_PID_VALUE) CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); @@ -2031,7 +1999,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg delete _ctx->text; } } else { - if ((GLOBALS.dwTonyNumTexts== 0 && GLOBALS.bTonyInTexts) || !GLOBALS.bTonyInTexts) { + if ((GLOBALS.dwTonyNumTexts == 0 && GLOBALS.bTonyInTexts) || !GLOBALS.bTonyInTexts) { CORO_INVOKE_0(GLOBALS.Tony->EndTalk); GLOBALS.dwTonyNumTexts = 0; GLOBALS.bTonyInTexts = false; @@ -2050,24 +2018,24 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGroup, uint32, uint32) { CORO_BEGIN_CONTEXT; - uint32 nChoice; - uint32 *sl; - uint32 i, num; - char *string; - RMDialogChoice dc; - int sel; + uint32 nChoice; + uint32 *sl; + uint32 i, num; + char *string; + RMDialogChoice dc; + int sel; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); curDialog = nDialog; - + // Call MPAL to start the dialog mpalQueryDoDialog(nDialog, nStartGroup); // Wait until a choice is selected mpalQueryDialogWaitForChoice(&_ctx->nChoice); - while (_ctx->nChoice != (uint32)-1) { + while (_ctx->nChoice != (uint32) - 1) { // Si fa dare la lista di opzioni e le conta _ctx->sl = mpalQueryDialogSelectList(_ctx->nChoice); for (_ctx->num = 0; _ctx->sl[_ctx->num] != 0; _ctx->num++) @@ -2082,7 +2050,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr mpalQueryDialogWaitForChoice(&_ctx->nChoice); continue; } - + // Crea una scelta per il dialogo _ctx->dc.Init(); _ctx->dc.SetNumChoices(_ctx->num); @@ -2102,17 +2070,17 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // Disegna il puntatore GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_NONE); MainShowMouse(); - + while (!(GLOBALS.Input->MouseLeftClicked() && ((_ctx->sel = _ctx->dc.GetSelection()) != -1))) { CORO_INVOKE_0(GLOBALS.WaitFrame); GLOBALS.Freeze(); CORO_INVOKE_1(_ctx->dc.DoFrame, GLOBALS.Input->MousePos()); GLOBALS.Unfreeze(); - } + } // Nascondi il puntatore MainHideMouse(); - + CORO_INVOKE_0(_ctx->dc.Hide); mpalQueryDialogSelectionDWORD(_ctx->nChoice, _ctx->sl[_ctx->sel]); @@ -2130,7 +2098,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr /* - * Sync tra idle e mpal + * Sync tra idle e mpal */ DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { @@ -2138,7 +2106,7 @@ DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, u } DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { - CoroScheduler.pulseEvent(GLOBALS.mut[num]); + CoroScheduler.pulseEvent(GLOBALS.mut[num]); warning("TODO: Validate that the use of events in TakeOwnership/ReleaseOwnership match original"); } @@ -2153,20 +2121,20 @@ DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32 /* - * Musica + * Musica * ------ * * Effetti di fade supportati: * * nFX = 0 - La nuova musica si sostituisce a quella vecchia * nFX=1 - La nuova musica si interfade con quella vecchia - * nFX=2 - La nuova musica subentra a tempo con quella vecchia + * nFX=2 - La nuova musica subentra a tempo con quella vecchia * */ void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) { CORO_BEGIN_CONTEXT; - int i; + int i; CORO_END_CONTEXT(_ctx); int nChannel = *(const int *)nMusic; @@ -2183,7 +2151,7 @@ void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) { _vm->SetMusicVolume(nChannel, 64); debug("End FadeIn Music"); - + CORO_KILL_SELF(); CORO_END_CODE; @@ -2191,8 +2159,8 @@ void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) { void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { CORO_BEGIN_CONTEXT; - int i; - int startVolume; + int i; + int startVolume; CORO_END_CONTEXT(_ctx); int nChannel = *(const int *)nMusic; @@ -2209,7 +2177,7 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { CORO_INVOKE_1(CoroScheduler.sleep, 100); } - + if (!GLOBALS.bFadeOutStop) _vm->SetMusicVolume(nChannel, 0); @@ -2282,21 +2250,21 @@ void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int } DECLARE_CUSTOM_FUNCTION(PlaySonoriz)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) { - if (nFX == 0 || nFX == 1 || nFX==2) { + if (nFX == 0 || nFX == 1 || nFX == 2) { debug("PlaySonoriz stop fadeout"); GLOBALS.bFadeOutStop = true; } - + GLOBALS.lastMusic = nMusic; CustPlayMusic(GLOBALS.curSonoriz, musicFiles[nMusic].name, nFX, bNoLoop ? false : true, musicFiles[nMusic].sync); } DECLARE_CUSTOM_FUNCTION(PlayStacchetto)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) { - CustPlayMusic(2,staccFileNames[nMusic],nFX,bLoop); + CustPlayMusic(2, staccFileNames[nMusic], nFX, bLoop); } DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) { - if (nItem== 0) { + if (nItem == 0) { GLOBALS.Tony->PlaySfx(nSFX); } else { RMItem *item = GLOBALS.Loc->GetItemFromCode(nItem); @@ -2340,7 +2308,7 @@ DECLARE_CUSTOM_FUNCTION(StacchettoFadeStart)(CORO_PARAM, uint32 nStacc, uint32 b CORO_INVOKE_4(FadeOutSonoriz, 0, 0, 0, 0); CORO_INVOKE_4(MuteStacchetto, 0, 0, 0, 0); CORO_INVOKE_4(PlayStacchetto, nStacc, 0, bLoop, 0); - CORO_INVOKE_4(FadeInStacchetto, 0, 0, 0, 0); + CORO_INVOKE_4(FadeInStacchetto, 0, 0, 0, 0); CORO_END_CODE; } @@ -2403,21 +2371,21 @@ DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uin DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint32, uint32) { CORO_BEGIN_CONTEXT; - RMMessage *msg; - RMTextDialog *text; - uint32 hDisable; - int i; - uint32 startTime; + RMMessage *msg; + RMTextDialog *text; + uint32 hDisable; + int i; + uint32 startTime; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); _ctx->msg = new RMMessage(nMsg); _ctx->hDisable = CoroScheduler.createEvent(true, false); - + _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); // Alignment @@ -2426,24 +2394,24 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 _ctx->text[_ctx->i].WriteText(&(*_ctx->msg)[_ctx->i][1], 3); _ctx->text[_ctx->i].SetPosition(RMPoint(414, 70 + _ctx->i * 26)); // 70 } else { - _ctx->text[_ctx->i].SetAlignType(RMText::HLEFT,RMText::VTOP); + _ctx->text[_ctx->i].SetAlignType(RMText::HLEFT, RMText::VTOP); _ctx->text[_ctx->i].WriteText((*_ctx->msg)[_ctx->i], 3); _ctx->text[_ctx->i].SetPosition(RMPoint(260, 70 + _ctx->i * 26)); } - - + + // Setta la posizione _ctx->text[_ctx->i].SetAlwaysDisplay(); _ctx->text[_ctx->i].SetForcedTime(dwTime * 1000); _ctx->text[_ctx->i].SetNoTab(); - // Aspetta la fine della visualizzazione + // Aspetta la fine della visualizzazione _ctx->text[_ctx->i].SetCustomSkipHandle(_ctx->hDisable); // Registra il testo GLOBALS.LinkGraphicTask(&_ctx->text[_ctx->i]); } - + _ctx->startTime = _vm->GetTime(); while (_ctx->startTime + dwTime * 1000 > _vm->GetTime()) { @@ -2469,155 +2437,155 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 BEGIN_CUSTOM_FUNCTION_MAP() - ASSIGN( 1, CustLoadLocation) - ASSIGN( 2, MySleep) - ASSIGN( 3, SetPointer) - ASSIGN( 5, MoveTony) - ASSIGN( 6, FaceToMe) - ASSIGN( 7, BackToMe) - ASSIGN( 8, LeftToMe) - ASSIGN( 9, RightToMe) - ASSIGN( 10, SendTonyMessage) - ASSIGN( 11, ChangeBoxStatus) - ASSIGN( 12, ChangeLocation) - ASSIGN( 13, DisableTony) - ASSIGN( 14, EnableTony) - ASSIGN( 15, WaitForPatternEnd) - ASSIGN( 16, SetLocStartPosition) - ASSIGN( 17, ScrollLocation) - ASSIGN( 18, MoveTonyAndWait) - ASSIGN( 19, ChangeHotspot) - ASSIGN( 20, AddInventory) - ASSIGN( 21, RemoveInventory) - ASSIGN( 22, ChangeInventoryStatus) - ASSIGN( 23, SetTonyPosition) - ASSIGN( 24, SendFullscreenMessage) - ASSIGN( 25, SaveTonyPosition) - ASSIGN( 26, RestoreTonyPosition) - ASSIGN( 27, DisableInput) - ASSIGN( 28, EnableInput) - ASSIGN( 29, StopTony) - - ASSIGN( 30, TonyTakeUp1) - ASSIGN( 31, TonyTakeMid1) - ASSIGN( 32, TonyTakeDown1) - ASSIGN( 33, TonyTakeUp2) - ASSIGN( 34, TonyTakeMid2) - ASSIGN( 35, TonyTakeDown2) - - ASSIGN( 72, TonyPutUp1) - ASSIGN( 73, TonyPutMid1) - ASSIGN( 74, TonyPutDown1) - ASSIGN( 75, TonyPutUp2) - ASSIGN( 76, TonyPutMid2) - ASSIGN( 77, TonyPutDown2) - - ASSIGN( 36, TonyPerTerra) - ASSIGN( 37, TonySiRialza) - ASSIGN( 38, TonyPastorella) - ASSIGN( 39, TonyFischietto) - - ASSIGN( 40, TonyRide) - ASSIGN( 41, TonyFianchi) - ASSIGN( 42, TonyCanta) - ASSIGN( 43, TonySiIndica) - ASSIGN( 44, TonySpaventatoConMani) - ASSIGN( 49, TonySpaventatoSenzaMani) - ASSIGN( 45, TonyConBicchiere) - ASSIGN( 46, TonyConVerme) - ASSIGN( 47, TonyConMartello) - ASSIGN( 48, TonyConCorda) - ASSIGN( 90, TonyConConiglioANIM) - ASSIGN( 91, TonyConRicettaANIM) - ASSIGN( 92, TonyConCarteANIM) - ASSIGN( 93, TonyConPupazzoANIM) - ASSIGN( 94, TonyConPupazzoStart) - ASSIGN( 95, TonyConPupazzoEnd) - ASSIGN( 96, TonyConConiglioStart) - ASSIGN( 97, TonyConConiglioEnd) - ASSIGN( 98, TonyConRicettaStart) - ASSIGN( 99, TonyConRicettaEnd) - ASSIGN(100, TonyConCarteStart) - ASSIGN(101, TonyConCarteEnd) - ASSIGN(102, TonyConTaccuinoStart) - ASSIGN(103, TonyConTaccuinoEnd) - ASSIGN(104, TonyConMegafonoStart) - ASSIGN(105, TonyConMegafonoEnd) - ASSIGN(106, TonyConBarbaStart) - ASSIGN(107, TonyConBarbaEnd) - ASSIGN(108, TonyRidacchia) - ASSIGN(109, TonySchifato) - ASSIGN(110, TonyNaah) - ASSIGN(111, TonyMacbeth) - ASSIGN(112, TonySniffaLeft) - ASSIGN(113, TonySniffaRight) - ASSIGN(114, TonySpaventatoStart) - ASSIGN(115, TonySpaventatoEnd) - ASSIGN(116, TonyConSegretaria) - - ASSIGN( 50, CharSetCode) - ASSIGN( 51, CharSetColor) - ASSIGN( 52, CharSetTalkPattern) - ASSIGN( 53, CharSendMessage) - ASSIGN( 54, CharSetStartEndTalkPattern) - - ASSIGN( 60, MCharSetCode) - ASSIGN( 61, MCharSetColor) - ASSIGN( 62, MCharSetCurrentGroup) - ASSIGN( 63, MCharSetNumTalksInGroup) - ASSIGN( 64, MCharSetNumTexts) - ASSIGN( 65, MCharSendMessage) - ASSIGN( 66, MCharSetPosition) - ASSIGN( 67, MCharSetAlwaysBack) - ASSIGN( 68, MCharResetCode) - - ASSIGN( 70, StartDialog) - ASSIGN( 71, SendDialogMessage) - - ASSIGN( 80, TakeOwnership) - ASSIGN( 81, ReleaseOwnership) - - ASSIGN( 86, PlaySonoriz) - ASSIGN( 87, PlayStacchetto) - ASSIGN( 88, FadeInSonoriz) - ASSIGN( 89, FadeOutSonoriz) - ASSIGN(123, FadeInStacchetto) - ASSIGN(124, FadeOutStacchetto) - ASSIGN(125, MuteSonoriz) - ASSIGN(126, DemuteSonoriz) - ASSIGN(127, MuteStacchetto) - ASSIGN(128, DemuteStacchetto) - ASSIGN( 84, StopSonoriz) - ASSIGN( 85, StopStacchetto) - ASSIGN( 83, PlayItemSfx) - ASSIGN(129, StacchettoFadeStart) - ASSIGN(130, StacchettoFadeEnd) - - ASSIGN(120, TremaSchermo) - ASSIGN(121, AutoSave) - ASSIGN(122, Abort) - ASSIGN(131, NoOcchioDiBue) - ASSIGN(132, SendFullscreenMsgStart) - ASSIGN(133, SendFullscreenMsgEnd) - ASSIGN(134, CustEnableGUI) - ASSIGN(135, CustDisableGUI) - ASSIGN(136, ClearScreen) - ASSIGN(137, PatIrqFreeze) - ASSIGN(138, TonySetPalesati) - ASSIGN(139, OpenInitLoadMenu) - ASSIGN(140, OpenInitOptions) - ASSIGN(141, SyncScrollLocation) - ASSIGN(142, CloseLocation) - ASSIGN(143, SetAlwaysDisplay) - ASSIGN(144, DoCredits) - - ASSIGN( 200, MustSkipIdleStart); - ASSIGN( 201, MustSkipIdleEnd); +ASSIGN(1, CustLoadLocation) +ASSIGN(2, MySleep) +ASSIGN(3, SetPointer) +ASSIGN(5, MoveTony) +ASSIGN(6, FaceToMe) +ASSIGN(7, BackToMe) +ASSIGN(8, LeftToMe) +ASSIGN(9, RightToMe) +ASSIGN(10, SendTonyMessage) +ASSIGN(11, ChangeBoxStatus) +ASSIGN(12, ChangeLocation) +ASSIGN(13, DisableTony) +ASSIGN(14, EnableTony) +ASSIGN(15, WaitForPatternEnd) +ASSIGN(16, SetLocStartPosition) +ASSIGN(17, ScrollLocation) +ASSIGN(18, MoveTonyAndWait) +ASSIGN(19, ChangeHotspot) +ASSIGN(20, AddInventory) +ASSIGN(21, RemoveInventory) +ASSIGN(22, ChangeInventoryStatus) +ASSIGN(23, SetTonyPosition) +ASSIGN(24, SendFullscreenMessage) +ASSIGN(25, SaveTonyPosition) +ASSIGN(26, RestoreTonyPosition) +ASSIGN(27, DisableInput) +ASSIGN(28, EnableInput) +ASSIGN(29, StopTony) + +ASSIGN(30, TonyTakeUp1) +ASSIGN(31, TonyTakeMid1) +ASSIGN(32, TonyTakeDown1) +ASSIGN(33, TonyTakeUp2) +ASSIGN(34, TonyTakeMid2) +ASSIGN(35, TonyTakeDown2) + +ASSIGN(72, TonyPutUp1) +ASSIGN(73, TonyPutMid1) +ASSIGN(74, TonyPutDown1) +ASSIGN(75, TonyPutUp2) +ASSIGN(76, TonyPutMid2) +ASSIGN(77, TonyPutDown2) + +ASSIGN(36, TonyPerTerra) +ASSIGN(37, TonySiRialza) +ASSIGN(38, TonyPastorella) +ASSIGN(39, TonyFischietto) + +ASSIGN(40, TonyRide) +ASSIGN(41, TonyFianchi) +ASSIGN(42, TonyCanta) +ASSIGN(43, TonySiIndica) +ASSIGN(44, TonySpaventatoConMani) +ASSIGN(49, TonySpaventatoSenzaMani) +ASSIGN(45, TonyConBicchiere) +ASSIGN(46, TonyConVerme) +ASSIGN(47, TonyConMartello) +ASSIGN(48, TonyConCorda) +ASSIGN(90, TonyConConiglioANIM) +ASSIGN(91, TonyConRicettaANIM) +ASSIGN(92, TonyConCarteANIM) +ASSIGN(93, TonyConPupazzoANIM) +ASSIGN(94, TonyConPupazzoStart) +ASSIGN(95, TonyConPupazzoEnd) +ASSIGN(96, TonyConConiglioStart) +ASSIGN(97, TonyConConiglioEnd) +ASSIGN(98, TonyConRicettaStart) +ASSIGN(99, TonyConRicettaEnd) +ASSIGN(100, TonyConCarteStart) +ASSIGN(101, TonyConCarteEnd) +ASSIGN(102, TonyConTaccuinoStart) +ASSIGN(103, TonyConTaccuinoEnd) +ASSIGN(104, TonyConMegafonoStart) +ASSIGN(105, TonyConMegafonoEnd) +ASSIGN(106, TonyConBarbaStart) +ASSIGN(107, TonyConBarbaEnd) +ASSIGN(108, TonyRidacchia) +ASSIGN(109, TonySchifato) +ASSIGN(110, TonyNaah) +ASSIGN(111, TonyMacbeth) +ASSIGN(112, TonySniffaLeft) +ASSIGN(113, TonySniffaRight) +ASSIGN(114, TonySpaventatoStart) +ASSIGN(115, TonySpaventatoEnd) +ASSIGN(116, TonyConSegretaria) + +ASSIGN(50, CharSetCode) +ASSIGN(51, CharSetColor) +ASSIGN(52, CharSetTalkPattern) +ASSIGN(53, CharSendMessage) +ASSIGN(54, CharSetStartEndTalkPattern) + +ASSIGN(60, MCharSetCode) +ASSIGN(61, MCharSetColor) +ASSIGN(62, MCharSetCurrentGroup) +ASSIGN(63, MCharSetNumTalksInGroup) +ASSIGN(64, MCharSetNumTexts) +ASSIGN(65, MCharSendMessage) +ASSIGN(66, MCharSetPosition) +ASSIGN(67, MCharSetAlwaysBack) +ASSIGN(68, MCharResetCode) + +ASSIGN(70, StartDialog) +ASSIGN(71, SendDialogMessage) + +ASSIGN(80, TakeOwnership) +ASSIGN(81, ReleaseOwnership) + +ASSIGN(86, PlaySonoriz) +ASSIGN(87, PlayStacchetto) +ASSIGN(88, FadeInSonoriz) +ASSIGN(89, FadeOutSonoriz) +ASSIGN(123, FadeInStacchetto) +ASSIGN(124, FadeOutStacchetto) +ASSIGN(125, MuteSonoriz) +ASSIGN(126, DemuteSonoriz) +ASSIGN(127, MuteStacchetto) +ASSIGN(128, DemuteStacchetto) +ASSIGN(84, StopSonoriz) +ASSIGN(85, StopStacchetto) +ASSIGN(83, PlayItemSfx) +ASSIGN(129, StacchettoFadeStart) +ASSIGN(130, StacchettoFadeEnd) + +ASSIGN(120, TremaSchermo) +ASSIGN(121, AutoSave) +ASSIGN(122, Abort) +ASSIGN(131, NoOcchioDiBue) +ASSIGN(132, SendFullscreenMsgStart) +ASSIGN(133, SendFullscreenMsgEnd) +ASSIGN(134, CustEnableGUI) +ASSIGN(135, CustDisableGUI) +ASSIGN(136, ClearScreen) +ASSIGN(137, PatIrqFreeze) +ASSIGN(138, TonySetPalesati) +ASSIGN(139, OpenInitLoadMenu) +ASSIGN(140, OpenInitOptions) +ASSIGN(141, SyncScrollLocation) +ASSIGN(142, CloseLocation) +ASSIGN(143, SetAlwaysDisplay) +ASSIGN(144, DoCredits) + +ASSIGN(200, MustSkipIdleStart); +ASSIGN(201, MustSkipIdleEnd); END_CUSTOM_FUNCTION_MAP() void SetupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation *loc, RMInventory *inv, RMInput *input) { - GLOBALS.Tony = tony; + GLOBALS.Tony = tony; GLOBALS.Pointer = ptr; GLOBALS.Boxes = box; GLOBALS.Loc = loc; @@ -2643,7 +2611,7 @@ void SetupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation GLOBALS.bAlwaysDisplay = false; int i; - for (i = 0;i < 10; i++) + for (i = 0; i < 10; i++) GLOBALS.mut[i] = CoroScheduler.createEvent(false, false); for (i = 0; i < 200; i++) -- cgit v1.2.3 From 316ca0021bbf9629ae5cd592f28f8b30b24a2b00 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 20 May 2012 15:45:18 +1000 Subject: TONY: Converting Italian comments to English and formatting --- engines/tony/custom.cpp | 147 ++++++++++++++++++++++++------------------------ 1 file changed, 73 insertions(+), 74 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index d38f840011..4b3c533a92 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -130,14 +130,14 @@ void LoadChangedHotspot(Common::InSaveFile *f) { } -/* - Classi richieste per le funzioni custom! - - Tony (per muoverlo) -> si puo' fare tramite MPAL l'animazione? Penso proprio di sì - - SendMessage -> Direi che basta theEngine.SendMessage() - ChangeLocation -> theEngine.ChangeLocation() - AddInventory -> theEngine.AddInventory() +/** + * @defgroup Classes required for custom functions + * + * Tony (To Move him) -> You can do MPAL through the animation? I really think so + * + * SendMessage -> I'd say just theEngine.SendMessage() + * ChangeLocation -> theEngine.ChangeLocation() + * AddInventory -> theEngine.AddInventory() */ void MCharResetCodes(void) { @@ -272,10 +272,10 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->curVoc = SearchVoiceHeader(0, dwMessage); _ctx->voice = NULL; if (_ctx->curVoc) { - // Si posiziona all'interno del database delle voci all'inizio della prima + // Is positioned within the database of entries beginning at the first _ctx->curOffset = _ctx->curVoc->offset; - // PRIMA VOLTA PREALLOCA + // First time allocation g_system->lockMutex(GLOBALS.vdb); // fseek(_vm->m_vdbFP, _ctx->curOffset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curOffset); @@ -308,28 +308,28 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX for (_ctx->i = 0; _ctx->i < _ctx->msg.NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { _ctx->text.SetInput(GLOBALS.Input); - // Allineamento + // Alignment _ctx->text.SetAlignType(RMText::HCENTER, RMText::VBOTTOM); - // Colore + // Colour _ctx->text.SetColor(0, 255, 0); - // Scrive il testo + // Writes the text _ctx->text.WriteText(_ctx->msg[_ctx->i], 0); - // Setta la posizione + // Set the position if (nX == 0 && nY == 0) _ctx->text.SetPosition(GLOBALS.Tony->Position() - RMPoint(0, 130) - GLOBALS.Loc->ScrollPosition()); else _ctx->text.SetPosition(RMPoint(nX, nY) - GLOBALS.Loc->ScrollPosition()); - // Setta l'always display + // Handling for always display if (GLOBALS.bAlwaysDisplay) { _ctx->text.SetAlwaysDisplay(); _ctx->text.ForceTime(); } - // Registra il testo + // Record the text GLOBALS.LinkGraphicTask(&_ctx->text); if (_ctx->curVoc) { @@ -351,7 +351,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX } } - // Aspetta la fine della visualizzazione + // Wait for the end of the display _ctx->text.SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text.WaitForEndDisplay); @@ -427,32 +427,32 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { _ctx->text.SetInput(GLOBALS.Input); - // Allineamento + // Alignment _ctx->text.SetAlignType(RMText::HCENTER, RMText::VCENTER); - // Forza il testo a scomparire a tempo + // Forces the text to disappear in time _ctx->text.ForceTime(); - // Colore + // Colour _ctx->text.SetColor(255, 255, 255); - // Scrive il testo + // Write the text if (nFont == 0) _ctx->text.WriteText((*_ctx->msg)[_ctx->i], 1); else if (nFont == 1) _ctx->text.WriteText((*_ctx->msg)[_ctx->i], 0); - // Setta la posizione + // Set the position _ctx->text.SetPosition(RMPoint(320, 240)); _ctx->text.SetAlwaysDisplay(); _ctx->text.ForceTime(); - // Registra il testo + // Record the text GLOBALS.LinkGraphicTask(&_ctx->clear); GLOBALS.LinkGraphicTask(&_ctx->text); - // Aspetta la fine della visualizzazione + // Wait for the end of display _ctx->text.SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text.WaitForEndDisplay); } @@ -1223,7 +1223,7 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 CORO_BEGIN_CODE(_ctx); - // Prende le coordinate di quanto scrollare + // Take the scroll coordinates _ctx->lx = (int32)nX; _ctx->ly = (int32)nY; @@ -1272,7 +1272,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui CORO_BEGIN_CODE(_ctx); - // Prende le coordinate di quanto scrollare + // Take the scroll coordinates _ctx->lx = (int32)nX; _ctx->ly = (int32)nY; _ctx->dimx = _ctx->lx; @@ -1356,7 +1356,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui } - // Setta la posizione finale + // Set the position finale if (sX) { if (_ctx->lx > 0) _ctx->pt.x = _ctx->startpt.x + _ctx->dimx; @@ -1519,7 +1519,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->curVoc = SearchVoiceHeader(0, dwMessage); _ctx->voice = NULL; if (_ctx->curVoc) { - // Si posiziona all'interno del database delle voci all'inizio della prima + // Position within the database of entries, beginning at the first // fseek(_vm->m_vdbFP, _ctx->curVoc->offset, SEEK_SET); g_system->lockMutex(GLOBALS.vdb); _vm->_vdbFP.seek(_ctx->curVoc->offset); @@ -1540,25 +1540,25 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess // Skipping _ctx->text->SetSkipStatus(!bIsBack); - // Allineamento + // Alignment _ctx->text->SetAlignType(RMText::HCENTER, RMText::VBOTTOM); - // Colore + // Colour _ctx->text->SetColor(GLOBALS.Character[nChar].r, GLOBALS.Character[nChar].g, GLOBALS.Character[nChar].b); - // Scrive il testo + // Write the text _ctx->text->WriteText((*_ctx->msg)[_ctx->i], 0); - // Setta la posizione + // Set the position _ctx->text->SetPosition(_ctx->pt); - // Setta l'always display + // Set the always display if (GLOBALS.bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } - // Registra il testo + // Record the text GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { @@ -1574,7 +1574,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess g_system->unlockMutex(GLOBALS.vdb); } - // Aspetta la fine della visualizzazione + // Wait for the end of display _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); @@ -1618,7 +1618,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32 /* - * Mastri Personaggi + * Master Characters */ DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { @@ -1714,17 +1714,17 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes bIsBack |= GLOBALS.MCharacter[nChar].bAlwaysBack ? 1 : 0; - // Calcola la posizione del testo in base al frame corrente + // Calculates the position of the text according to the current frame if (GLOBALS.MCharacter[nChar].x == -1) _ctx->pt = GLOBALS.MCharacter[nChar].item->CalculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->ScrollPosition(); else _ctx->pt = RMPoint(GLOBALS.MCharacter[nChar].x, GLOBALS.MCharacter[nChar].y); - // Parametro per le azioni speciali: random tra le parlate + // Parameter for special actions: random between the spoken _ctx->parm = (GLOBALS.MCharacter[nChar].curgroup * 10) + _vm->_randomSource.getRandomNumber( GLOBALS.MCharacter[nChar].numtalks[GLOBALS.MCharacter[nChar].curgroup] - 1) + 1; - // Cerca di eseguire la funzione custom per inizializzare la parlata + // Try to run the custom function to initialise the speech if (GLOBALS.MCharacter[nChar].item) { _ctx->h = mpalQueryDoAction(30, GLOBALS.MCharacter[nChar].item->MpalCode(), _ctx->parm); if (_ctx->h != CORO_INVALID_PID_VALUE) { @@ -1735,7 +1735,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->curVoc = SearchVoiceHeader(0, dwMessage); _ctx->voice = NULL; if (_ctx->curVoc) { - // Si posiziona all'interno del database delle voci all'inizio della prima + // Position within the database of entries, beginning at the first g_system->lockMutex(GLOBALS.vdb); // fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curVoc->offset); @@ -1744,7 +1744,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes } for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { - // Crea l'oggetto diverso se è back o no + // Create a different object depending on whether it's background or not if (bIsBack) { GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); if (GLOBALS.bTonyIsSpeaking) @@ -1757,25 +1757,25 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes // Skipping _ctx->text->SetSkipStatus(!bIsBack); - // Allineamento + // Alignment _ctx->text->SetAlignType(RMText::HCENTER, RMText::VBOTTOM); - // Colore + // Colour _ctx->text->SetColor(GLOBALS.MCharacter[nChar].r, GLOBALS.MCharacter[nChar].g, GLOBALS.MCharacter[nChar].b); - // Scrive il testo + // Write the text _ctx->text->WriteText((*_ctx->msg)[_ctx->i], nFont); - // Setta la posizione + // Set the position _ctx->text->SetPosition(_ctx->pt); - // Setta l'always display + // Set the always display if (GLOBALS.bAlwaysDisplay) { _ctx->text->SetAlwaysDisplay(); _ctx->text->ForceTime(); } - // Registra il testo + // Record the text GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { @@ -1791,7 +1791,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes g_system->unlockMutex(GLOBALS.vdb); } - // Aspetta la fine della visualizzazione + // Wait for the end of display _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); @@ -1807,7 +1807,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes } - // Cerca di eseguire la funzione custom per chiudere la parlata + // Try to run the custom function to close the speech if (GLOBALS.MCharacter[nChar].item) { _ctx->h = mpalQueryDoAction(31, GLOBALS.MCharacter[nChar].item->MpalCode(), _ctx->parm); if (_ctx->h != CORO_INVALID_PID_VALUE) @@ -1844,8 +1844,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->bIsBack = false; - // La SendDialogMessage può andare in background se è un personaggio in MCHAR settato - // con la SetAlwaysBack + // The SendDialogMessage can go in the background if it is a character if (nPers != 0 && GLOBALS.IsMChar[nPers] && GLOBALS.MCharacter[nPers].bAlwaysBack) _ctx->bIsBack = true; @@ -1853,7 +1852,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->voice = NULL; if (_ctx->curVoc) { - // Si posiziona all'interno del database delle voci all'inizio della prima + // Position within the database of entries, beginning at the first g_system->lockMutex(GLOBALS.vdb); // fseek(_vm->m_vdbFP, _ctx->curVoc->offset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curVoc->offset); @@ -1912,14 +1911,14 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg else _ctx->pt = RMPoint(GLOBALS.MCharacter[nPers].x, GLOBALS.MCharacter[nPers].y); - // Parametro per le azioni speciali: random tra le parlate + // Parameter for special actions. Random between the spoken. _ctx->parm = (GLOBALS.MCharacter[nPers].curgroup * 10) + _vm->_randomSource.getRandomNumber( GLOBALS.MCharacter[nPers].numtalks[GLOBALS.MCharacter[nPers].curgroup] - 1) + 1; if (GLOBALS.MCharacter[nPers].numtexts != 0 && GLOBALS.MCharacter[nPers].bInTexts) { GLOBALS.MCharacter[nPers].numtexts--; } else { - // Cerca di eseguire la funzione custom per inizializzare la parlata + // Try to run the custom function to initialise the speech _ctx->h = mpalQueryDoAction(30, GLOBALS.MCharacter[nPers].item->MpalCode(), _ctx->parm); if (_ctx->h != CORO_INVALID_PID_VALUE) CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); @@ -1961,7 +1960,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } - // Aspetta la fine della visualizzazione + // Wait for the end of display _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); } @@ -1985,7 +1984,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg delete _ctx->text; } else { if ((GLOBALS.MCharacter[nPers].bInTexts && GLOBALS.MCharacter[nPers].numtexts == 0) || !GLOBALS.MCharacter[nPers].bInTexts) { - // Cerca di eseguire la funzione custom per chiudere la parlata + // Try to run the custom function to close the speech 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); if (_ctx->h != CORO_INVALID_PID_VALUE) @@ -2036,12 +2035,12 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // Wait until a choice is selected mpalQueryDialogWaitForChoice(&_ctx->nChoice); while (_ctx->nChoice != (uint32) - 1) { - // Si fa dare la lista di opzioni e le conta + // Get the list of options _ctx->sl = mpalQueryDialogSelectList(_ctx->nChoice); for (_ctx->num = 0; _ctx->sl[_ctx->num] != 0; _ctx->num++) ; - // Se c'e' una sola opzione, la fa automaticamente, e aspetta la prossima scelta + // If there is only one option, do it automatically, and wait for the next choice if (_ctx->num == 1) { mpalQueryDialogSelectionDWORD(_ctx->nChoice, _ctx->sl[0]); GlobalFree(_ctx->sl); @@ -2051,11 +2050,11 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr continue; } - // Crea una scelta per il dialogo + // Making a choice for dialog _ctx->dc.Init(); _ctx->dc.SetNumChoices(_ctx->num); - // Scrive tutte le possibili opzioni + // Writeall the possible options for (_ctx->i = 0; _ctx->i < _ctx->num; _ctx->i++) { _ctx->string = mpalQueryDialogPeriod(_ctx->sl[_ctx->i]); assert(_ctx->string != NULL); @@ -2063,11 +2062,11 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr GlobalFree(_ctx->string); } - // Attiva l'oggetto + // Activate the object GLOBALS.LinkGraphicTask(&_ctx->dc); CORO_INVOKE_0(_ctx->dc.Show); - // Disegna il puntatore + // Draw the pointer GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_NONE); MainShowMouse(); @@ -2078,13 +2077,13 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr GLOBALS.Unfreeze(); } - // Nascondi il puntatore + // Hide the pointer MainHideMouse(); CORO_INVOKE_0(_ctx->dc.Hide); mpalQueryDialogSelectionDWORD(_ctx->nChoice, _ctx->sl[_ctx->sel]); - // Chiude la scelta + // Closes the choice _ctx->dc.Close(); GlobalFree(_ctx->sl); @@ -2098,7 +2097,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr /* - * Sync tra idle e mpal + * Sync between idle and mpal */ DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { @@ -2124,11 +2123,11 @@ DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32 * Musica * ------ * - * Effetti di fade supportati: + * Fadeout effects supposed: * - * nFX = 0 - La nuova musica si sostituisce a quella vecchia - * nFX=1 - La nuova musica si interfade con quella vecchia - * nFX=2 - La nuova musica subentra a tempo con quella vecchia + * nFX = 0 - The new music replaces the old one + * nFX=1 - The new music interfades with the old one + * nFX=2 - The new music takes over in time from the old * */ @@ -2181,7 +2180,7 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { if (!GLOBALS.bFadeOutStop) _vm->SetMusicVolume(nChannel, 0); - // Se è uno stacchetto ferma tutto + // If there is a stacchetto, stop all if (nChannel == 2) _vm->StopMusic(2); @@ -2400,15 +2399,15 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 } - // Setta la posizione + // Set the position _ctx->text[_ctx->i].SetAlwaysDisplay(); _ctx->text[_ctx->i].SetForcedTime(dwTime * 1000); _ctx->text[_ctx->i].SetNoTab(); - // Aspetta la fine della visualizzazione + // Wait for the end of display _ctx->text[_ctx->i].SetCustomSkipHandle(_ctx->hDisable); - // Registra il testo + // Record the text GLOBALS.LinkGraphicTask(&_ctx->text[_ctx->i]); } @@ -2651,7 +2650,7 @@ void SetupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation - // Crea l'evento per skippare le idle + // Create an event for the idle skipping GLOBALS.hSkipIdle = CoroScheduler.createEvent(true, false); } -- cgit v1.2.3 From 8322da03c04d7994601973364599081447a7ccde Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 20 May 2012 16:03:09 +1000 Subject: TONY: Converting Italian comments to English --- engines/tony/custom.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 4b3c533a92..254fab91da 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -139,7 +139,6 @@ void LoadChangedHotspot(Common::InSaveFile *f) { * ChangeLocation -> theEngine.ChangeLocation() * AddInventory -> theEngine.AddInventory() */ - void MCharResetCodes(void) { for (int i = 0; i < 10; i++) GLOBALS.MCharacter[i].item = GLOBALS.Loc->GetItemFromCode(GLOBALS.MCharacter[i].code); -- cgit v1.2.3 From 7da213cd32b702ad8f4d0a10020eae10666a64ff Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 20 May 2012 16:34:38 +1000 Subject: TONY: Removal of code that was commented out in the original source --- engines/tony/custom.cpp | 47 ++++++----------------------------------------- 1 file changed, 6 insertions(+), 41 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 254fab91da..0127494007 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -276,11 +276,10 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX // First time allocation g_system->lockMutex(GLOBALS.vdb); - // fseek(_vm->m_vdbFP, _ctx->curOffset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curOffset); _vm->_theSound.CreateSfx(&_ctx->voice); + _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); - // _ctx->curOffset = ftell(_vm->m_vdbFP); _ctx->curOffset = _vm->_vdbFP.pos(); _ctx->voice->SetLoop(false); @@ -337,11 +336,10 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } else { g_system->lockMutex(GLOBALS.vdb); - // fseek(_vm->m_vdbFP, _ctx->curOffset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curOffset); _vm->_theSound.CreateSfx(&_ctx->voice); _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); - // _ctx->curOffset = ftell(_vm->m_vdbFP); + _ctx->curOffset = _vm->_vdbFP.pos(); _ctx->voice->SetLoop(false); _ctx->voice->Play(); @@ -517,7 +515,7 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 _vm->StopMusic(4); - // On Exit e lascia freezzato + // On exit, unload and unfreeze CORO_INVOKE_2(GLOBALS.UnloadLocation, true, NULL); GLOBALS.Unfreeze(); @@ -541,7 +539,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint _vm->StopMusic(4); } - // On Exit e lascia freezzato + // On exit, unfreeze CORO_INVOKE_2(GLOBALS.UnloadLocation, true, NULL); GLOBALS.curChangedHotspot = 0; @@ -1314,37 +1312,6 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui } -/* - sX = _ctx->stepX * (_ctx->dwCurTime-dwLastTime) / (1000 / 35); - sY = _ctx->stepY * (_ctx->dwCurTime-dwLastTime) / (1000 / 35); - - if (_ctx->lx > 0) { - _ctx->lx -= sX; - if (_ctx->lx < 0) - _ctx->lx = 0; - _ctx->pt.Offset(sX, 0); - } else if (_ctx->lx < 0) { - _ctx->lx += sX; - - if (_ctx->lx > 0) - _ctx->lx = 0; - - _ctx->pt.Offset(-sX, 0); - } - - if (_ctx->ly > 0) { - _ctx->ly -= sY; - if (_ctx->ly < 0) - _ctx->ly = 0; - _ctx->pt.Offset(0, sY); - } else if (_ctx->ly < 0) { - _ctx->ly += sY; - if (_ctx->ly > 0) - _ctx->ly = 0; - - _ctx->pt.Offset(0, -sY); - } -*/ CORO_INVOKE_0(GLOBALS.WaitFrame); GLOBALS.Freeze(); @@ -1519,7 +1486,6 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->voice = NULL; if (_ctx->curVoc) { // Position within the database of entries, beginning at the first - // fseek(_vm->m_vdbFP, _ctx->curVoc->offset, SEEK_SET); g_system->lockMutex(GLOBALS.vdb); _vm->_vdbFP.seek(_ctx->curVoc->offset); _ctx->curOffset = _ctx->curVoc->offset; @@ -1853,7 +1819,6 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (_ctx->curVoc) { // Position within the database of entries, beginning at the first g_system->lockMutex(GLOBALS.vdb); - // fseek(_vm->m_vdbFP, _ctx->curVoc->offset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curVoc->offset); _vm->_theSound.CreateSfx(&_ctx->voice); _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); @@ -2119,8 +2084,8 @@ DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32 /* - * Musica - * ------ + * Music + * ----- * * Fadeout effects supposed: * -- cgit v1.2.3 From 75a0b0c6296af6600ce1a4e585fb7c5b9a0ea203 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 23 May 2012 00:19:46 +0200 Subject: TONY: Some more code formatting --- engines/tony/custom.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 0127494007..a6381e0937 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2073,16 +2073,6 @@ DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32 warning("TODO: Validate that the use of events in TakeOwnership/ReleaseOwnership match original"); } - - - - - - - - - - /* * Music * ----- -- cgit v1.2.3 From 6ecd71270da3e3ddaadf181e37a17419c74cdef2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 2 Jun 2012 11:07:56 +1000 Subject: TONY: Removed redundant vdb mutex --- engines/tony/custom.cpp | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index a6381e0937..03c6405d2e 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -275,7 +275,6 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->curOffset = _ctx->curVoc->offset; // First time allocation - g_system->lockMutex(GLOBALS.vdb); _vm->_vdbFP.seek(_ctx->curOffset); _vm->_theSound.CreateSfx(&_ctx->voice); @@ -283,7 +282,6 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->curOffset = _vm->_vdbFP.pos(); _ctx->voice->SetLoop(false); - g_system->unlockMutex(GLOBALS.vdb); } if (GLOBALS.nTonyNextTalkType != GLOBALS.Tony->TALK_NORMAL) { @@ -335,7 +333,6 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->voice->Play(); _ctx->text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } else { - g_system->lockMutex(GLOBALS.vdb); _vm->_vdbFP.seek(_ctx->curOffset); _vm->_theSound.CreateSfx(&_ctx->voice); _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); @@ -344,7 +341,6 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->voice->SetLoop(false); _ctx->voice->Play(); _ctx->text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); - g_system->unlockMutex(GLOBALS.vdb); } } @@ -1486,10 +1482,8 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->voice = NULL; if (_ctx->curVoc) { // Position within the database of entries, beginning at the first - g_system->lockMutex(GLOBALS.vdb); _vm->_vdbFP.seek(_ctx->curVoc->offset); _ctx->curOffset = _ctx->curVoc->offset; - g_system->unlockMutex(GLOBALS.vdb); } for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { @@ -1527,7 +1521,6 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { - g_system->lockMutex(GLOBALS.vdb); _vm->_theSound.CreateSfx(&_ctx->voice); _vm->_vdbFP.seek(_ctx->curOffset); _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); @@ -1536,7 +1529,6 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->voice->Play(); _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); _ctx->curOffset = _vm->_vdbFP.pos(); - g_system->unlockMutex(GLOBALS.vdb); } // Wait for the end of display @@ -1701,11 +1693,9 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->voice = NULL; if (_ctx->curVoc) { // Position within the database of entries, beginning at the first - g_system->lockMutex(GLOBALS.vdb); // fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); _vm->_vdbFP.seek(_ctx->curVoc->offset); _ctx->curOffset = _ctx->curVoc->offset; - g_system->unlockMutex(GLOBALS.vdb); } for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { @@ -1744,7 +1734,6 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { - g_system->lockMutex(GLOBALS.vdb); _vm->_theSound.CreateSfx(&_ctx->voice); _vm->_vdbFP.seek(_ctx->curOffset); _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); @@ -1753,7 +1742,6 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->voice->Play(); _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); _ctx->curOffset = _vm->_vdbFP.pos(); - g_system->unlockMutex(GLOBALS.vdb); } // Wait for the end of display @@ -1818,13 +1806,11 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (_ctx->curVoc) { // Position within the database of entries, beginning at the first - g_system->lockMutex(GLOBALS.vdb); _vm->_vdbFP.seek(_ctx->curVoc->offset); _vm->_theSound.CreateSfx(&_ctx->voice); _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); _ctx->voice->SetLoop(false); if (_ctx->bIsBack) _ctx->voice->SetVolume(55); - g_system->unlockMutex(GLOBALS.vdb); } _ctx->string = mpalQueryDialogPeriod(nMsg); @@ -2559,8 +2545,6 @@ void SetupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation GLOBALS.EnableGUI = MainEnableGUI; GLOBALS.SetPalesati = MainSetPalesati; - GLOBALS.vdb = g_system->createMutex(); - GLOBALS.bAlwaysDisplay = false; int i; -- cgit v1.2.3 From a850eabf07bd5c620a7329529f464deb4930a127 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 2 Jun 2012 17:40:01 +1000 Subject: TONY: Fix memory leak when game exited whilst credits are active --- engines/tony/custom.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 03c6405d2e..96b78d0e83 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2315,6 +2315,12 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 uint32 hDisable; int i; uint32 startTime; + + ~CoroContextTag() { + delete msg; + delete[] text; + } + CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -2368,6 +2374,8 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 delete[] _ctx->text; delete _ctx->msg; + _ctx->text = NULL; + _ctx->msg = NULL; CORO_END_CODE; } -- cgit v1.2.3 From a1f6f8ceb19d65619dfd8e2477bffad773ba49ba Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 4 Jun 2012 23:45:36 +0200 Subject: TONY: Rename variables and functions in tony.h --- engines/tony/custom.cpp | 70 ++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 96b78d0e83..47089f3214 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -240,7 +240,7 @@ VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) { return NULL; for (i = 0; i < _vm->_voices.size(); i++) - if (_vm->_voices[i].code == code) + if (_vm->_voices[i]._code == code) return &_vm->_voices[i]; return NULL; @@ -272,7 +272,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->voice = NULL; if (_ctx->curVoc) { // Is positioned within the database of entries beginning at the first - _ctx->curOffset = _ctx->curVoc->offset; + _ctx->curOffset = _ctx->curVoc->_offset; // First time allocation _vm->_vdbFP.seek(_ctx->curOffset); @@ -509,7 +509,7 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 CORO_INVOKE_0(GLOBALS.WaitWipeEnd); } - _vm->StopMusic(4); + _vm->stopMusic(4); // On exit, unload and unfreeze CORO_INVOKE_2(GLOBALS.UnloadLocation, true, NULL); @@ -532,7 +532,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint } if (GLOBALS.lastTappeto != GLOBALS.tappeti[nLoc]) { - _vm->StopMusic(4); + _vm->stopMusic(4); } // On exit, unfreeze @@ -547,7 +547,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint if (GLOBALS.lastTappeto != GLOBALS.tappeti[nLoc]) { GLOBALS.lastTappeto = GLOBALS.tappeti[nLoc]; if (GLOBALS.lastTappeto != 0) - _vm->PlayMusic(4, tappetiFile[GLOBALS.lastTappeto], 0, true, 2000); + _vm->playMusic(4, tappetiFile[GLOBALS.lastTappeto], 0, true, 2000); } if (!GLOBALS.bNoOcchioDiBue) { @@ -1281,7 +1281,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui _ctx->startpt = GLOBALS.Loc->ScrollPosition(); - _ctx->dwStartTime = _vm->GetTime(); + _ctx->dwStartTime = _vm->getTime(); if (sX) _ctx->dwTotalTime = _ctx->dimx * (1000 / 35) / sX; @@ -1289,7 +1289,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui _ctx->dwTotalTime = _ctx->dimy * (1000 / 35) / sY; while ((_ctx->lx != 0 || _ctx->ly != 0) && !GLOBALS.bSkipIdle) { - _ctx->dwCurTime = _vm->GetTime() - _ctx->dwStartTime; + _ctx->dwCurTime = _vm->getTime() - _ctx->dwStartTime; if (_ctx->dwCurTime > _ctx->dwTotalTime) break; @@ -1362,11 +1362,11 @@ DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uin DECLARE_CUSTOM_FUNCTION(AutoSave)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->AutoSave(coroParam); + _vm->autoSave(coroParam); } -DECLARE_CUSTOM_FUNCTION(Abort)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->Abort(); +DECLARE_CUSTOM_FUNCTION(AbortGame)(CORO_PARAM, uint32, uint32, uint32, uint32) { + _vm->abortGame(); } DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) { @@ -1378,12 +1378,12 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32 CORO_BEGIN_CODE(_ctx); - _ctx->curTime = _vm->GetTime(); + _ctx->curTime = _vm->getTime(); _ctx->dirx = 1; _ctx->diry = 1; - while (_vm->GetTime() < _ctx->curTime + nScosse) { + while (_vm->getTime() < _ctx->curTime + nScosse) { CORO_INVOKE_0(GLOBALS.WaitFrame); GLOBALS.Freeze(); @@ -1482,8 +1482,8 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->voice = NULL; if (_ctx->curVoc) { // Position within the database of entries, beginning at the first - _vm->_vdbFP.seek(_ctx->curVoc->offset); - _ctx->curOffset = _ctx->curVoc->offset; + _vm->_vdbFP.seek(_ctx->curVoc->_offset); + _ctx->curOffset = _ctx->curVoc->_offset; } for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { @@ -1694,8 +1694,8 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes if (_ctx->curVoc) { // Position within the database of entries, beginning at the first // fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); - _vm->_vdbFP.seek(_ctx->curVoc->offset); - _ctx->curOffset = _ctx->curVoc->offset; + _vm->_vdbFP.seek(_ctx->curVoc->_offset); + _ctx->curOffset = _ctx->curVoc->_offset; } for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { @@ -1806,7 +1806,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (_ctx->curVoc) { // Position within the database of entries, beginning at the first - _vm->_vdbFP.seek(_ctx->curVoc->offset); + _vm->_vdbFP.seek(_ctx->curVoc->_offset); _vm->_theSound.CreateSfx(&_ctx->voice); _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); _ctx->voice->SetLoop(false); @@ -2083,11 +2083,11 @@ void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) { debug("Start FadeIn Music"); for (_ctx->i = 0; _ctx->i < 16; _ctx->i++) { - _vm->SetMusicVolume(nChannel, _ctx->i * 4); + _vm->setMusicVolume(nChannel, _ctx->i * 4); CORO_INVOKE_1(CoroScheduler.sleep, 100); } - _vm->SetMusicVolume(nChannel, 64); + _vm->setMusicVolume(nChannel, 64); debug("End FadeIn Music"); @@ -2106,23 +2106,23 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { CORO_BEGIN_CODE(_ctx); - _ctx->startVolume = _vm->GetMusicVolume(nChannel); + _ctx->startVolume = _vm->getMusicVolume(nChannel); debug("Start FadeOut Music"); for (_ctx->i = 16; _ctx->i > 0 && !GLOBALS.bFadeOutStop; _ctx->i--) { if (_ctx->i * 4 < _ctx->startVolume) - _vm->SetMusicVolume(nChannel, _ctx->i * 4); + _vm->setMusicVolume(nChannel, _ctx->i * 4); CORO_INVOKE_1(CoroScheduler.sleep, 100); } if (!GLOBALS.bFadeOutStop) - _vm->SetMusicVolume(nChannel, 0); + _vm->setMusicVolume(nChannel, 0); // If there is a stacchetto, stop all if (nChannel == 2) - _vm->StopMusic(2); + _vm->stopMusic(2); debug("End FadeOut Music"); @@ -2152,28 +2152,28 @@ DECLARE_CUSTOM_FUNCTION(FadeInStacchetto)(CORO_PARAM, uint32, uint32, uint32, ui } DECLARE_CUSTOM_FUNCTION(StopSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->StopMusic(GLOBALS.curSonoriz); + _vm->stopMusic(GLOBALS.curSonoriz); } DECLARE_CUSTOM_FUNCTION(StopStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->StopMusic(2); + _vm->stopMusic(2); } DECLARE_CUSTOM_FUNCTION(MuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->SetMusicVolume(GLOBALS.curSonoriz, 0); + _vm->setMusicVolume(GLOBALS.curSonoriz, 0); } DECLARE_CUSTOM_FUNCTION(DemuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS.bFadeOutStop = true; - _vm->SetMusicVolume(GLOBALS.curSonoriz, 64); + _vm->setMusicVolume(GLOBALS.curSonoriz, 64); } DECLARE_CUSTOM_FUNCTION(MuteStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->SetMusicVolume(2, 0); + _vm->setMusicVolume(2, 0); } DECLARE_CUSTOM_FUNCTION(DemuteStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->SetMusicVolume(2, 64); + _vm->setMusicVolume(2, 64); } @@ -2288,7 +2288,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, ui CORO_BEGIN_CODE(_ctx); GLOBALS.Freeze(); - CORO_INVOKE_0(_vm->OpenInitLoadMenu); + CORO_INVOKE_0(_vm->openInitLoadMenu); GLOBALS.Unfreeze(); CORO_END_CODE; @@ -2301,7 +2301,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uin CORO_BEGIN_CODE(_ctx); GLOBALS.Freeze(); - CORO_INVOKE_0(_vm->OpenInitOptions); + CORO_INVOKE_0(_vm->openInitOptions); GLOBALS.Unfreeze(); CORO_END_CODE; @@ -2357,13 +2357,13 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 GLOBALS.LinkGraphicTask(&_ctx->text[_ctx->i]); } - _ctx->startTime = _vm->GetTime(); + _ctx->startTime = _vm->getTime(); - while (_ctx->startTime + dwTime * 1000 > _vm->GetTime()) { + while (_ctx->startTime + dwTime * 1000 > _vm->getTime()) { CORO_INVOKE_0(GLOBALS.WaitFrame); if (GLOBALS.Input->MouseLeftClicked() || GLOBALS.Input->MouseRightClicked()) break; - if (_vm->GetEngine()->GetInput().GetAsyncKeyState(Common::KEYCODE_TAB)) + if (_vm->getEngine()->GetInput().GetAsyncKeyState(Common::KEYCODE_TAB)) break; } @@ -2510,7 +2510,7 @@ ASSIGN(130, StacchettoFadeEnd) ASSIGN(120, TremaSchermo) ASSIGN(121, AutoSave) -ASSIGN(122, Abort) +ASSIGN(122, AbortGame) ASSIGN(131, NoOcchioDiBue) ASSIGN(132, SendFullscreenMsgStart) ASSIGN(133, SendFullscreenMsgEnd) -- cgit v1.2.3 From 014330a538244b0e33bcf230cc5e84c28977f096 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 5 Jun 2012 00:02:15 +0200 Subject: TONY: Rename variables and functions in input.h --- engines/tony/custom.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 47089f3214..1ed7c8b5a6 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2020,10 +2020,10 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_NONE); MainShowMouse(); - while (!(GLOBALS.Input->MouseLeftClicked() && ((_ctx->sel = _ctx->dc.GetSelection()) != -1))) { + while (!(GLOBALS.Input->mouseLeftClicked() && ((_ctx->sel = _ctx->dc.GetSelection()) != -1))) { CORO_INVOKE_0(GLOBALS.WaitFrame); GLOBALS.Freeze(); - CORO_INVOKE_1(_ctx->dc.DoFrame, GLOBALS.Input->MousePos()); + CORO_INVOKE_1(_ctx->dc.DoFrame, GLOBALS.Input->mousePos()); GLOBALS.Unfreeze(); } @@ -2361,9 +2361,9 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 while (_ctx->startTime + dwTime * 1000 > _vm->getTime()) { CORO_INVOKE_0(GLOBALS.WaitFrame); - if (GLOBALS.Input->MouseLeftClicked() || GLOBALS.Input->MouseRightClicked()) + if (GLOBALS.Input->mouseLeftClicked() || GLOBALS.Input->mouseRightClicked()) break; - if (_vm->getEngine()->GetInput().GetAsyncKeyState(Common::KEYCODE_TAB)) + if (_vm->getEngine()->GetInput().getAsyncKeyState(Common::KEYCODE_TAB)) break; } -- cgit v1.2.3 From a5cb751f7ab82a089207025810e3aaa0f0748dbd Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 5 Jun 2012 01:04:53 +0200 Subject: TONY: Rename variables and functions in gfxengine.h --- engines/tony/custom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 1ed7c8b5a6..59de6909dc 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2363,7 +2363,7 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 CORO_INVOKE_0(GLOBALS.WaitFrame); if (GLOBALS.Input->mouseLeftClicked() || GLOBALS.Input->mouseRightClicked()) break; - if (_vm->getEngine()->GetInput().getAsyncKeyState(Common::KEYCODE_TAB)) + if (_vm->getEngine()->getInput().getAsyncKeyState(Common::KEYCODE_TAB)) break; } @@ -2531,7 +2531,7 @@ ASSIGN(201, MustSkipIdleEnd); END_CUSTOM_FUNCTION_MAP() -void SetupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation *loc, RMInventory *inv, RMInput *input) { +void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation *loc, RMInventory *inv, RMInput *input) { GLOBALS.Tony = tony; GLOBALS.Pointer = ptr; GLOBALS.Boxes = box; -- cgit v1.2.3 From 93cba6d88049d73b965143130a1f7751e3dc79db Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 5 Jun 2012 01:15:25 +0200 Subject: TONY: Rename variables and functions in adv.h --- engines/tony/custom.cpp | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 59de6909dc..579532d9bc 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -595,21 +595,18 @@ DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32, CORO_END_CODE; } - DECLARE_CUSTOM_FUNCTION(DisableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) { - MainDisableInput(); + mainDisableInput(); } - DECLARE_CUSTOM_FUNCTION(EnableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) { - MainEnableInput(); + mainEnableInput(); } DECLARE_CUSTOM_FUNCTION(StopTony)(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS.Tony->StopNoAction(coroParam); } - DECLARE_CUSTOM_FUNCTION(CustEnableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS.EnableGUI(); } @@ -2018,7 +2015,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // Draw the pointer GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_NONE); - MainShowMouse(); + mainShowMouse(); while (!(GLOBALS.Input->mouseLeftClicked() && ((_ctx->sel = _ctx->dc.GetSelection()) != -1))) { CORO_INVOKE_0(GLOBALS.WaitFrame); @@ -2028,7 +2025,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr } // Hide the pointer - MainHideMouse(); + mainHideMouse(); CORO_INVOKE_0(_ctx->dc.Hide); mpalQueryDialogSelectionDWORD(_ctx->nChoice, _ctx->sl[_ctx->sel]); @@ -2539,19 +2536,19 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation GLOBALS.Inventory = inv; GLOBALS.Input = input; - GLOBALS.LoadLocation = MainLoadLocation; - GLOBALS.UnloadLocation = MainUnloadLocation; - GLOBALS.LinkGraphicTask = MainLinkGraphicTask; - GLOBALS.Freeze = MainFreeze; - GLOBALS.Unfreeze = MainUnfreeze; - GLOBALS.WaitFrame = MainWaitFrame; - GLOBALS.PlayMusic = MainPlayMusic; - GLOBALS.InitWipe = MainInitWipe; - GLOBALS.CloseWipe = MainCloseWipe; - GLOBALS.WaitWipeEnd = MainWaitWipeEnd; - GLOBALS.DisableGUI = MainDisableGUI; - GLOBALS.EnableGUI = MainEnableGUI; - GLOBALS.SetPalesati = MainSetPalesati; + GLOBALS.LoadLocation = mainLoadLocation; + GLOBALS.UnloadLocation = mainUnloadLocation; + GLOBALS.LinkGraphicTask = mainLinkGraphicTask; + GLOBALS.Freeze = mainFreeze; + GLOBALS.Unfreeze = mainUnfreeze; + GLOBALS.WaitFrame = mainWaitFrame; + GLOBALS.PlayMusic = mainPlayMusic; + GLOBALS.InitWipe = mainInitWipe; + GLOBALS.CloseWipe = mainCloseWipe; + GLOBALS.WaitWipeEnd = mainWaitWipeEnd; + GLOBALS.DisableGUI = mainDisableGUI; + GLOBALS.EnableGUI = mainEnableGUI; + GLOBALS.SetPalesati = mainSetPalesati; GLOBALS.bAlwaysDisplay = false; int i; -- cgit v1.2.3 From 23c95d7014ee9875bb1b55c696d0245d7f114ba8 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 5 Jun 2012 08:39:55 +0200 Subject: TONY: Some more renaming --- engines/tony/custom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 579532d9bc..8092109ef5 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1998,7 +1998,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr } // Making a choice for dialog - _ctx->dc.Init(); + _ctx->dc.init(); _ctx->dc.SetNumChoices(_ctx->num); // Writeall the possible options -- cgit v1.2.3 From 334dc91e279d01b264ae7454f39faa557a250428 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 6 Jun 2012 01:37:06 +0200 Subject: TONY: Rename variables and functions in game.h --- engines/tony/custom.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 8092109ef5..24caaa1e29 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -209,23 +209,23 @@ DECLARE_CUSTOM_FUNCTION(SetAlwaysDisplay)(CORO_PARAM, uint32 val, uint32, uint32 DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32, uint32) { switch (dwPointer) { case 1: - GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIASU); + GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_FRECCIASU); break; case 2: - GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIAGIU); + GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_FRECCIAGIU); break; case 3: - GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIASINISTRA); + GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_FRECCIASINISTRA); break; case 4: - GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIADESTRA); + GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_FRECCIADESTRA); break; case 5: - GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_FRECCIAMAPPA); + GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_FRECCIAMAPPA); break; default: - GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_NONE); + GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_NONE); break; } } @@ -2014,7 +2014,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr CORO_INVOKE_0(_ctx->dc.Show); // Draw the pointer - GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_NONE); + GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_NONE); mainShowMouse(); while (!(GLOBALS.Input->mouseLeftClicked() && ((_ctx->sel = _ctx->dc.GetSelection()) != -1))) { -- cgit v1.2.3 From f1ac5d5acdbc0349850377619d8056be22871b42 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 6 Jun 2012 08:04:33 +0200 Subject: TONY: More renaming --- engines/tony/custom.cpp | 170 ++++++++++++++++++++++++------------------------ 1 file changed, 85 insertions(+), 85 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 24caaa1e29..84bafc2cd1 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -297,32 +297,32 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX } if (GLOBALS.curBackText) - CORO_INVOKE_0(GLOBALS.curBackText->Hide); + CORO_INVOKE_0(GLOBALS.curBackText->hide); GLOBALS.bTonyIsSpeaking = true; for (_ctx->i = 0; _ctx->i < _ctx->msg.NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { - _ctx->text.SetInput(GLOBALS.Input); + _ctx->text.setInput(GLOBALS.Input); // Alignment - _ctx->text.SetAlignType(RMText::HCENTER, RMText::VBOTTOM); + _ctx->text.setAlignType(RMText::HCENTER, RMText::VBOTTOM); // Colour - _ctx->text.SetColor(0, 255, 0); + _ctx->text.setColor(0, 255, 0); // Writes the text - _ctx->text.WriteText(_ctx->msg[_ctx->i], 0); + _ctx->text.writeText(_ctx->msg[_ctx->i], 0); // Set the position 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 - _ctx->text.SetPosition(RMPoint(nX, nY) - GLOBALS.Loc->ScrollPosition()); + _ctx->text.setPosition(RMPoint(nX, nY) - GLOBALS.Loc->ScrollPosition()); // Handling for always display if (GLOBALS.bAlwaysDisplay) { - _ctx->text.SetAlwaysDisplay(); - _ctx->text.ForceTime(); + _ctx->text.setAlwaysDisplay(); + _ctx->text.forceTime(); } // Record the text @@ -331,7 +331,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX if (_ctx->curVoc) { if (_ctx->i == 0) { _ctx->voice->Play(); - _ctx->text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text.setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } else { _vm->_vdbFP.seek(_ctx->curOffset); _vm->_theSound.CreateSfx(&_ctx->voice); @@ -340,13 +340,13 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->curOffset = _vm->_vdbFP.pos(); _ctx->voice->SetLoop(false); _ctx->voice->Play(); - _ctx->text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text.setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } } // Wait for the end of the display - _ctx->text.SetCustomSkipHandle(GLOBALS.hSkipIdle); - CORO_INVOKE_0(_ctx->text.WaitForEndDisplay); + _ctx->text.setCustomSkipHandle(GLOBALS.hSkipIdle); + CORO_INVOKE_0(_ctx->text.waitForEndDisplay); if (_ctx->curVoc) { _ctx->voice->Stop(); @@ -357,7 +357,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX GLOBALS.bTonyIsSpeaking = false; if (GLOBALS.curBackText) - GLOBALS.curBackText->Show(); + GLOBALS.curBackText->show(); CORO_INVOKE_0(GLOBALS.Tony->EndTalk); @@ -418,36 +418,36 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 GLOBALS.Unfreeze(); for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { - _ctx->text.SetInput(GLOBALS.Input); + _ctx->text.setInput(GLOBALS.Input); // Alignment - _ctx->text.SetAlignType(RMText::HCENTER, RMText::VCENTER); + _ctx->text.setAlignType(RMText::HCENTER, RMText::VCENTER); // Forces the text to disappear in time - _ctx->text.ForceTime(); + _ctx->text.forceTime(); // Colour - _ctx->text.SetColor(255, 255, 255); + _ctx->text.setColor(255, 255, 255); // Write the text if (nFont == 0) - _ctx->text.WriteText((*_ctx->msg)[_ctx->i], 1); + _ctx->text.writeText((*_ctx->msg)[_ctx->i], 1); else if (nFont == 1) - _ctx->text.WriteText((*_ctx->msg)[_ctx->i], 0); + _ctx->text.writeText((*_ctx->msg)[_ctx->i], 0); // Set the position - _ctx->text.SetPosition(RMPoint(320, 240)); + _ctx->text.setPosition(RMPoint(320, 240)); - _ctx->text.SetAlwaysDisplay(); - _ctx->text.ForceTime(); + _ctx->text.setAlwaysDisplay(); + _ctx->text.forceTime(); // Record the text GLOBALS.LinkGraphicTask(&_ctx->clear); GLOBALS.LinkGraphicTask(&_ctx->text); // Wait for the end of display - _ctx->text.SetCustomSkipHandle(GLOBALS.hSkipIdle); - CORO_INVOKE_0(_ctx->text.WaitForEndDisplay); + _ctx->text.setCustomSkipHandle(GLOBALS.hSkipIdle); + CORO_INVOKE_0(_ctx->text.waitForEndDisplay); } delete _ctx->msg; @@ -1487,31 +1487,31 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess if (bIsBack) { GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); if (GLOBALS.bTonyIsSpeaking) - CORO_INVOKE_0(GLOBALS.curBackText->Hide); + CORO_INVOKE_0(GLOBALS.curBackText->hide); } else _ctx->text = new RMTextDialog; - _ctx->text->SetInput(GLOBALS.Input); + _ctx->text->setInput(GLOBALS.Input); // Skipping - _ctx->text->SetSkipStatus(!bIsBack); + _ctx->text->setSkipStatus(!bIsBack); // Alignment - _ctx->text->SetAlignType(RMText::HCENTER, RMText::VBOTTOM); + _ctx->text->setAlignType(RMText::HCENTER, RMText::VBOTTOM); // Colour - _ctx->text->SetColor(GLOBALS.Character[nChar].r, GLOBALS.Character[nChar].g, GLOBALS.Character[nChar].b); + _ctx->text->setColor(GLOBALS.Character[nChar].r, GLOBALS.Character[nChar].g, GLOBALS.Character[nChar].b); // Write the text - _ctx->text->WriteText((*_ctx->msg)[_ctx->i], 0); + _ctx->text->writeText((*_ctx->msg)[_ctx->i], 0); // Set the position - _ctx->text->SetPosition(_ctx->pt); + _ctx->text->setPosition(_ctx->pt); // Set the always display if (GLOBALS.bAlwaysDisplay) { - _ctx->text->SetAlwaysDisplay(); - _ctx->text->ForceTime(); + _ctx->text->setAlwaysDisplay(); + _ctx->text->forceTime(); } // Record the text @@ -1524,13 +1524,13 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->voice->SetLoop(false); if (bIsBack) _ctx->voice->SetVolume(55); _ctx->voice->Play(); - _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text->setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); _ctx->curOffset = _vm->_vdbFP.pos(); } // Wait for the end of display - _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); - CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); + _ctx->text->setCustomSkipHandle(GLOBALS.hSkipIdle); + CORO_INVOKE_0(_ctx->text->waitForEndDisplay); if (_ctx->curVoc) { _ctx->voice->Stop(); @@ -1700,31 +1700,31 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes if (bIsBack) { GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); if (GLOBALS.bTonyIsSpeaking) - CORO_INVOKE_0(GLOBALS.curBackText->Hide); + CORO_INVOKE_0(GLOBALS.curBackText->hide); } else _ctx->text = new RMTextDialog; - _ctx->text->SetInput(GLOBALS.Input); + _ctx->text->setInput(GLOBALS.Input); // Skipping - _ctx->text->SetSkipStatus(!bIsBack); + _ctx->text->setSkipStatus(!bIsBack); // Alignment - _ctx->text->SetAlignType(RMText::HCENTER, RMText::VBOTTOM); + _ctx->text->setAlignType(RMText::HCENTER, RMText::VBOTTOM); // Colour - _ctx->text->SetColor(GLOBALS.MCharacter[nChar].r, GLOBALS.MCharacter[nChar].g, GLOBALS.MCharacter[nChar].b); + _ctx->text->setColor(GLOBALS.MCharacter[nChar].r, GLOBALS.MCharacter[nChar].g, GLOBALS.MCharacter[nChar].b); // Write the text - _ctx->text->WriteText((*_ctx->msg)[_ctx->i], nFont); + _ctx->text->writeText((*_ctx->msg)[_ctx->i], nFont); // Set the position - _ctx->text->SetPosition(_ctx->pt); + _ctx->text->setPosition(_ctx->pt); // Set the always display if (GLOBALS.bAlwaysDisplay) { - _ctx->text->SetAlwaysDisplay(); - _ctx->text->ForceTime(); + _ctx->text->setAlwaysDisplay(); + _ctx->text->forceTime(); } // Record the text @@ -1737,13 +1737,13 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->voice->SetLoop(false); if (bIsBack) _ctx->voice->SetVolume(55); _ctx->voice->Play(); - _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text->setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); _ctx->curOffset = _vm->_vdbFP.pos(); } // Wait for the end of display - _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); - CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); + _ctx->text->setCustomSkipHandle(GLOBALS.hSkipIdle); + CORO_INVOKE_0(_ctx->text->waitForEndDisplay); if (_ctx->curVoc) { _ctx->voice->Stop(); @@ -1814,9 +1814,9 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (nPers == 0) { _ctx->text = new RMTextDialog; - _ctx->text->SetColor(0, 255, 0); - _ctx->text->SetPosition(GLOBALS.Tony->Position() - RMPoint(0, 130) - GLOBALS.Loc->ScrollPosition()); - _ctx->text->WriteText(_ctx->string, 0); + _ctx->text->setColor(0, 255, 0); + _ctx->text->setPosition(GLOBALS.Tony->Position() - RMPoint(0, 130) - GLOBALS.Loc->ScrollPosition()); + _ctx->text->writeText(_ctx->string, 0); if (GLOBALS.dwTonyNumTexts > 0) { if (!GLOBALS.bTonyInTexts) { @@ -1849,9 +1849,9 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg 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->WriteText(_ctx->string, 0); - _ctx->text->SetPosition(_ctx->pt); + _ctx->text->setColor(GLOBALS.Character[nPers].r, GLOBALS.Character[nPers].g, GLOBALS.Character[nPers].b); + _ctx->text->writeText(_ctx->string, 0); + _ctx->text->setPosition(_ctx->pt); } else { if (GLOBALS.MCharacter[nPers].x == -1) _ctx->pt = GLOBALS.MCharacter[nPers].item->CalculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->ScrollPosition(); @@ -1881,35 +1881,35 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (GLOBALS.MCharacter[nPers].bAlwaysBack) { _ctx->text = GLOBALS.curBackText = new RMTextDialogScrolling(GLOBALS.Loc); if (GLOBALS.bTonyIsSpeaking) - CORO_INVOKE_0(GLOBALS.curBackText->Hide); + CORO_INVOKE_0(GLOBALS.curBackText->hide); _ctx->bIsBack = true; } else _ctx->text = new RMTextDialog; - _ctx->text->SetSkipStatus(!GLOBALS.MCharacter[nPers].bAlwaysBack); - _ctx->text->SetColor(GLOBALS.MCharacter[nPers].r, GLOBALS.MCharacter[nPers].g, GLOBALS.MCharacter[nPers].b); - _ctx->text->WriteText(_ctx->string, 0); - _ctx->text->SetPosition(_ctx->pt); + _ctx->text->setSkipStatus(!GLOBALS.MCharacter[nPers].bAlwaysBack); + _ctx->text->setColor(GLOBALS.MCharacter[nPers].r, GLOBALS.MCharacter[nPers].g, GLOBALS.MCharacter[nPers].b); + _ctx->text->writeText(_ctx->string, 0); + _ctx->text->setPosition(_ctx->pt); } if (!GLOBALS.bSkipIdle) { - _ctx->text->SetInput(GLOBALS.Input); + _ctx->text->setInput(GLOBALS.Input); if (GLOBALS.bAlwaysDisplay) { - _ctx->text->SetAlwaysDisplay(); - _ctx->text->ForceTime(); + _ctx->text->setAlwaysDisplay(); + _ctx->text->forceTime(); } - _ctx->text->SetAlignType(RMText::HCENTER, RMText::VBOTTOM); + _ctx->text->setAlignType(RMText::HCENTER, RMText::VBOTTOM); GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { _ctx->voice->Play(); - _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text->setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } // Wait for the end of display - _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); - CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); + _ctx->text->setCustomSkipHandle(GLOBALS.hSkipIdle); + CORO_INVOKE_0(_ctx->text->waitForEndDisplay); } if (_ctx->curVoc) { @@ -1999,39 +1999,39 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // Making a choice for dialog _ctx->dc.init(); - _ctx->dc.SetNumChoices(_ctx->num); + _ctx->dc.setNumChoices(_ctx->num); // Writeall the possible options for (_ctx->i = 0; _ctx->i < _ctx->num; _ctx->i++) { _ctx->string = mpalQueryDialogPeriod(_ctx->sl[_ctx->i]); assert(_ctx->string != NULL); - _ctx->dc.AddChoice(_ctx->string); + _ctx->dc.addChoice(_ctx->string); GlobalFree(_ctx->string); } // Activate the object GLOBALS.LinkGraphicTask(&_ctx->dc); - CORO_INVOKE_0(_ctx->dc.Show); + CORO_INVOKE_0(_ctx->dc.show); // Draw the pointer GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_NONE); mainShowMouse(); - while (!(GLOBALS.Input->mouseLeftClicked() && ((_ctx->sel = _ctx->dc.GetSelection()) != -1))) { + while (!(GLOBALS.Input->mouseLeftClicked() && ((_ctx->sel = _ctx->dc.getSelection()) != -1))) { CORO_INVOKE_0(GLOBALS.WaitFrame); GLOBALS.Freeze(); - CORO_INVOKE_1(_ctx->dc.DoFrame, GLOBALS.Input->mousePos()); + CORO_INVOKE_1(_ctx->dc.doFrame, GLOBALS.Input->mousePos()); GLOBALS.Unfreeze(); } // Hide the pointer mainHideMouse(); - CORO_INVOKE_0(_ctx->dc.Hide); + CORO_INVOKE_0(_ctx->dc.hide); mpalQueryDialogSelectionDWORD(_ctx->nChoice, _ctx->sl[_ctx->sel]); // Closes the choice - _ctx->dc.Close(); + _ctx->dc.close(); GlobalFree(_ctx->sl); @@ -2328,27 +2328,27 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 _ctx->text = new RMTextDialog[_ctx->msg->NumPeriods()]; 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 if ((*_ctx->msg)[_ctx->i][0] == '@') { - _ctx->text[_ctx->i].SetAlignType(RMText::HCENTER, RMText::VTOP); - _ctx->text[_ctx->i].WriteText(&(*_ctx->msg)[_ctx->i][1], 3); - _ctx->text[_ctx->i].SetPosition(RMPoint(414, 70 + _ctx->i * 26)); // 70 + _ctx->text[_ctx->i].setAlignType(RMText::HCENTER, RMText::VTOP); + _ctx->text[_ctx->i].writeText(&(*_ctx->msg)[_ctx->i][1], 3); + _ctx->text[_ctx->i].setPosition(RMPoint(414, 70 + _ctx->i * 26)); // 70 } else { - _ctx->text[_ctx->i].SetAlignType(RMText::HLEFT, RMText::VTOP); - _ctx->text[_ctx->i].WriteText((*_ctx->msg)[_ctx->i], 3); - _ctx->text[_ctx->i].SetPosition(RMPoint(260, 70 + _ctx->i * 26)); + _ctx->text[_ctx->i].setAlignType(RMText::HLEFT, RMText::VTOP); + _ctx->text[_ctx->i].writeText((*_ctx->msg)[_ctx->i], 3); + _ctx->text[_ctx->i].setPosition(RMPoint(260, 70 + _ctx->i * 26)); } // Set the position - _ctx->text[_ctx->i].SetAlwaysDisplay(); - _ctx->text[_ctx->i].SetForcedTime(dwTime * 1000); - _ctx->text[_ctx->i].SetNoTab(); + _ctx->text[_ctx->i].setAlwaysDisplay(); + _ctx->text[_ctx->i].setForcedTime(dwTime * 1000); + _ctx->text[_ctx->i].setNoTab(); // Wait for the end of display - _ctx->text[_ctx->i].SetCustomSkipHandle(_ctx->hDisable); + _ctx->text[_ctx->i].setCustomSkipHandle(_ctx->hDisable); // Record the text GLOBALS.LinkGraphicTask(&_ctx->text[_ctx->i]); -- cgit v1.2.3 From 53e38106b73e6ad9e6f725857483bfd35e961326 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 6 Jun 2012 08:31:06 +0200 Subject: TONY: Rename variables and functions in inventory.h That fixes the regression in the credits --- engines/tony/custom.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 84bafc2cd1..2725f2565e 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1559,15 +1559,15 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess } DECLARE_CUSTOM_FUNCTION(AddInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { - GLOBALS.Inventory->AddItem(dwCode); + GLOBALS.Inventory->addItem(dwCode); } DECLARE_CUSTOM_FUNCTION(RemoveInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { - GLOBALS.Inventory->RemoveItem(dwCode); + GLOBALS.Inventory->removeItem(dwCode); } DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32 dwStatus, uint32, uint32) { - GLOBALS.Inventory->ChangeItemStatus(dwCode, dwStatus); + GLOBALS.Inventory->changeItemStatus(dwCode, dwStatus); } -- cgit v1.2.3 From 53bd99ce870ac5bd7f65d1e45641e13070f652d0 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 7 Jun 2012 07:58:01 +0200 Subject: TONY: Rename variables and functions in loc.h and tonychar.h --- engines/tony/custom.cpp | 253 ++++++++++++++++++++++++------------------------ 1 file changed, 124 insertions(+), 129 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 2725f2565e..d42ef94a17 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -109,7 +109,7 @@ const char *staccFileNames[] = { void ReapplyChangedHotspot(void) { int 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) { @@ -141,9 +141,9 @@ void LoadChangedHotspot(Common::InSaveFile *f) { */ void MCharResetCodes(void) { 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++) - 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) { @@ -168,19 +168,19 @@ void CharsLoadAll(Common::InSaveFile *f) { } 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) { - GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_STANDUP); + GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_STANDUP); } 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) { - 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; - _ctx->msg.Load(dwMessage); - if (!_ctx->msg.IsValid()) { + _ctx->msg.load(dwMessage); + if (!_ctx->msg.isValid()) { return; } @@ -285,15 +285,15 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX } 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) GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; } else { - if (_ctx->msg.NumPeriods() > 1) - CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.Tony->TALK_FIANCHI); + if (_ctx->msg.numPeriods() > 1) + CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.Tony->TALK_FIANCHI); else - CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.Tony->TALK_NORMAL); + CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.Tony->TALK_NORMAL); } if (GLOBALS.curBackText) @@ -301,7 +301,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX 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); // Alignment @@ -315,9 +315,9 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX // Set the position 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 - _ctx->text.setPosition(RMPoint(nX, nY) - GLOBALS.Loc->ScrollPosition()); + _ctx->text.setPosition(RMPoint(nX, nY) - GLOBALS.Loc->scrollPosition()); // Handling for always display if (GLOBALS.bAlwaysDisplay) { @@ -359,13 +359,13 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX if (GLOBALS.curBackText) GLOBALS.curBackText->show(); - CORO_INVOKE_0(GLOBALS.Tony->EndTalk); + CORO_INVOKE_0(GLOBALS.Tony->endTalk); CORO_END_CODE; } 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); GLOBALS.SFM_nLoc = GLOBALS.Loc->TEMPGetNumLoc(); - GLOBALS.SFM_pt = GLOBALS.Tony->Position(); + GLOBALS.SFM_pt = GLOBALS.Tony->position(); if (GLOBALS.bSkipIdle) return; CORO_INVOKE_2(GLOBALS.UnloadLocation, false, NULL); - GLOBALS.Tony->Hide(); + GLOBALS.Tony->hide(); 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); // Alignment @@ -474,7 +474,7 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony, GLOBALS.Freeze(); GLOBALS.LoadLocation(GLOBALS.SFM_nLoc, RMPoint(GLOBALS.SFM_pt.x, GLOBALS.SFM_pt.y), RMPoint(-1, -1)); if (!bNotEnableTony) - GLOBALS.Tony->Show(); + GLOBALS.Tony->show(); GLOBALS.Unfreeze(); MCharResetCodes(); @@ -578,7 +578,7 @@ DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(CORO_PARAM, uint32 nLoc, uint32 lX, } 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(); } @@ -604,7 +604,7 @@ DECLARE_CUSTOM_FUNCTION(EnableInput)(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) { @@ -624,11 +624,11 @@ void TonyGenericTake1(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); GLOBALS.Freeze(); - GLOBALS.Tony->Take(nDirection, 0); + GLOBALS.Tony->take(nDirection, 0); GLOBALS.Unfreeze(); if (!GLOBALS.bSkipIdle) - CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); + CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); CORO_END_CODE; } @@ -640,14 +640,14 @@ void TonyGenericTake2(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); GLOBALS.Freeze(); - GLOBALS.Tony->Take(nDirection, 1); + GLOBALS.Tony->take(nDirection, 1); GLOBALS.Unfreeze(); if (!GLOBALS.bSkipIdle) - CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); + CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); GLOBALS.Freeze(); - GLOBALS.Tony->Take(nDirection, 2); + GLOBALS.Tony->take(nDirection, 2); GLOBALS.Unfreeze(); CORO_END_CODE; @@ -660,11 +660,11 @@ void TonyGenericPut1(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); GLOBALS.Freeze(); - GLOBALS.Tony->Put(nDirection, 0); + GLOBALS.Tony->put(nDirection, 0); GLOBALS.Unfreeze(); if (!GLOBALS.bSkipIdle) - CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); + CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); CORO_END_CODE; } @@ -676,14 +676,14 @@ void TonyGenericPut2(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); GLOBALS.Freeze(); - GLOBALS.Tony->Put(nDirection, 1); + GLOBALS.Tony->put(nDirection, 1); GLOBALS.Unfreeze(); if (!GLOBALS.bSkipIdle) - CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); + CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); GLOBALS.Freeze(); - GLOBALS.Tony->Put(nDirection, 2); + GLOBALS.Tony->put(nDirection, 2); GLOBALS.Unfreeze(); 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) { if (dwParte == 0) - GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_PERTERRALEFT); + GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_PERTERRALEFT); 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) { @@ -761,18 +761,18 @@ DECLARE_CUSTOM_FUNCTION(TonySiRialza)(CORO_PARAM, uint32 dwParte, uint32, uint32 CORO_BEGIN_CODE(_ctx); if (dwParte == 0) - GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SIRIALZALEFT); + GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_SIRIALZALEFT); else - GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SIRIALZARIGHT); + GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_SIRIALZARIGHT); if (!GLOBALS.bSkipIdle) - CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); + CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); CORO_END_CODE; } 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) { @@ -781,11 +781,11 @@ DECLARE_CUSTOM_FUNCTION(TonyFischietto)(CORO_PARAM, uint32, uint32, uint32, uint CORO_BEGIN_CODE(_ctx); - GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_FISCHIETTORIGHT); + GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_FISCHIETTORIGHT); 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; } @@ -834,31 +834,31 @@ DECLARE_CUSTOM_FUNCTION(TonySpaventatoSenzaMani)(CORO_PARAM, uint32 dwText, uint DECLARE_CUSTOM_FUNCTION(TonyConMartello)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); 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) { TonySetNumTexts(dwText); 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) { TonySetNumTexts(dwText); 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) { TonySetNumTexts(dwText); 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) { TonySetNumTexts(dwText); 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) { @@ -889,7 +889,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConPupazzoStart)(CORO_PARAM, uint32, uint32, uint32, GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONPUPAZZOSTATIC; 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; } @@ -900,7 +900,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConPupazzoEnd)(CORO_PARAM, uint32, uint32, uint32, u 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.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.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; } @@ -926,7 +926,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConConiglioEnd)(CORO_PARAM, uint32, uint32, uint32, 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.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.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; } @@ -952,7 +952,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConRicettaEnd)(CORO_PARAM, uint32, uint32, uint32, u 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.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.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; } @@ -978,7 +978,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConCarteEnd)(CORO_PARAM, uint32, uint32, uint32, uin 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.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.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; } @@ -1004,7 +1004,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoEnd)(CORO_PARAM, uint32, uint32, uint32, 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.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.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; } @@ -1030,7 +1030,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConMegafonoEnd)(CORO_PARAM, uint32, uint32, uint32, 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.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.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; } @@ -1056,7 +1056,7 @@ DECLARE_CUSTOM_FUNCTION(TonyConBarbaEnd)(CORO_PARAM, uint32, uint32, uint32, uin 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.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.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; } @@ -1082,7 +1082,7 @@ DECLARE_CUSTOM_FUNCTION(TonySpaventatoEnd)(CORO_PARAM, uint32, uint32, uint32, u 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.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; @@ -1101,8 +1101,8 @@ DECLARE_CUSTOM_FUNCTION(TonySniffaLeft)(CORO_PARAM, uint32, uint32, uint32, uint CORO_BEGIN_CODE(_ctx); - GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SNIFFA_LEFT); - CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); + GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_SNIFFA_LEFT); + CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); CORO_INVOKE_4(LeftToMe, 0, 0, 0, 0); CORO_END_CODE; @@ -1114,8 +1114,8 @@ DECLARE_CUSTOM_FUNCTION(TonySniffaRight)(CORO_PARAM, uint32, uint32, uint32, uin CORO_BEGIN_CODE(_ctx); - GLOBALS.Tony->SetPattern(GLOBALS.Tony->PAT_SNIFFA_RIGHT); - CORO_INVOKE_0(GLOBALS.Tony->WaitForEndPattern); + GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_SNIFFA_RIGHT); + CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); CORO_INVOKE_4(RightToMe, 0, 0, 0, 0); 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) { - GLOBALS.Tony->Show(); + GLOBALS.Tony->show(); } 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) { @@ -1174,17 +1174,17 @@ DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uin CORO_BEGIN_CODE(_ctx); - _ctx->item = GLOBALS.Loc->GetItemFromCode(nItem); + _ctx->item = GLOBALS.Loc->getItemFromCode(nItem); 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; } 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) { @@ -1193,16 +1193,16 @@ DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint3 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) - CORO_INVOKE_0(GLOBALS.Tony->WaitForEndMovement); + CORO_INVOKE_0(GLOBALS.Tony->waitForEndMovement); CORO_END_CODE; } 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) { @@ -1217,7 +1217,7 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 _ctx->lx = (int32)nX; _ctx->ly = (int32)nY; - _ctx->pt = GLOBALS.Loc->ScrollPosition(); + _ctx->pt = GLOBALS.Loc->scrollPosition(); while ((_ctx->lx != 0 || _ctx->ly != 0) && !GLOBALS.bSkipIdle) { if (_ctx->lx > 0) { @@ -1243,8 +1243,8 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 CORO_INVOKE_0(GLOBALS.WaitFrame); GLOBALS.Freeze(); - GLOBALS.Loc->SetScrollPosition(_ctx->pt); - GLOBALS.Tony->SetScrollPosition(_ctx->pt); + GLOBALS.Loc->setScrollPosition(_ctx->pt); + GLOBALS.Tony->setScrollPosition(_ctx->pt); GLOBALS.Unfreeze(); } @@ -1276,7 +1276,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui _ctx->stepX = sX; _ctx->stepY = sY; - _ctx->startpt = GLOBALS.Loc->ScrollPosition(); + _ctx->startpt = GLOBALS.Loc->scrollPosition(); _ctx->dwStartTime = _vm->getTime(); @@ -1308,8 +1308,8 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui CORO_INVOKE_0(GLOBALS.WaitFrame); GLOBALS.Freeze(); - GLOBALS.Loc->SetScrollPosition(_ctx->pt); - GLOBALS.Tony->SetScrollPosition(_ctx->pt); + GLOBALS.Loc->setScrollPosition(_ctx->pt); + GLOBALS.Tony->setScrollPosition(_ctx->pt); GLOBALS.Unfreeze(); } @@ -1329,8 +1329,8 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui } GLOBALS.Freeze(); - GLOBALS.Loc->SetScrollPosition(_ctx->pt); - GLOBALS.Tony->SetScrollPosition(_ctx->pt); + GLOBALS.Loc->setScrollPosition(_ctx->pt); + GLOBALS.Tony->setScrollPosition(_ctx->pt); GLOBALS.Unfreeze(); CORO_END_CODE; @@ -1354,7 +1354,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uin 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); GLOBALS.Freeze(); - GLOBALS.Loc->SetFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); - GLOBALS.Tony->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.Unfreeze(); _ctx->i = _vm->_randomSource.getRandomNumber(2); @@ -1397,8 +1397,8 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32 } GLOBALS.Freeze(); - GLOBALS.Loc->SetFixedScroll(RMPoint(0, 0)); - GLOBALS.Tony->SetFixedScroll(RMPoint(0, 0)); + GLOBALS.Loc->setFixedScroll(RMPoint(0, 0)); + GLOBALS.Tony->setFixedScroll(RMPoint(0, 0)); GLOBALS.Unfreeze(); 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) { assert(nChar < 16); 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].g = 255; GLOBALS.Character[nChar].b = 255; @@ -1461,18 +1461,18 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->curOffset = 0; 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) { GLOBALS.Freeze(); - GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].starttalkpattern); + GLOBALS.Character[nChar].item->setPattern(GLOBALS.Character[nChar].starttalkpattern); GLOBALS.Unfreeze(); - CORO_INVOKE_0(GLOBALS.Character[nChar].item->WaitForEndPattern); + CORO_INVOKE_0(GLOBALS.Character[nChar].item->waitForEndPattern); } GLOBALS.Freeze(); - GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].talkpattern); + GLOBALS.Character[nChar].item->setPattern(GLOBALS.Character[nChar].talkpattern); GLOBALS.Unfreeze(); _ctx->curVoc = SearchVoiceHeader(0, dwMessage); @@ -1483,7 +1483,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _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) { GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); if (GLOBALS.bTonyIsSpeaking) @@ -1545,13 +1545,13 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess if (GLOBALS.Character[nChar].endtalkpattern != 0) { GLOBALS.Freeze(); - GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].endtalkpattern); + GLOBALS.Character[nChar].item->setPattern(GLOBALS.Character[nChar].endtalkpattern); GLOBALS.Unfreeze(); - CORO_INVOKE_0(GLOBALS.Character[nChar].item->WaitForEndPattern); + CORO_INVOKE_0(GLOBALS.Character[nChar].item->waitForEndPattern); } GLOBALS.Freeze(); - GLOBALS.Character[nChar].item->SetPattern(GLOBALS.Character[nChar].standpattern); + GLOBALS.Character[nChar].item->setPattern(GLOBALS.Character[nChar].standpattern); GLOBALS.Unfreeze(); delete _ctx->msg; @@ -1581,7 +1581,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, ui if (nCode == 0) GLOBALS.MCharacter[nChar].item = NULL; 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].g = 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) { - 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 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 _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 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) { 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; } - 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 if (bIsBack) { 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 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) 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; } - - - - - /* * Dialoghi */ @@ -1815,46 +1810,46 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (nPers == 0) { _ctx->text = new RMTextDialog; _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); if (GLOBALS.dwTonyNumTexts > 0) { if (!GLOBALS.bTonyInTexts) { 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) GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; } 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.dwTonyNumTexts--; } else { - CORO_INVOKE_1(GLOBALS.Tony->StartTalk, GLOBALS.nTonyNextTalkType); + CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.nTonyNextTalkType); if (!GLOBALS.bStaticTalk) GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; } } else if (!GLOBALS.IsMChar[nPers]) { _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) { GLOBALS.Freeze(); - GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].starttalkpattern); + GLOBALS.Character[nPers].item->setPattern(GLOBALS.Character[nPers].starttalkpattern); 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->writeText(_ctx->string, 0); _ctx->text->setPosition(_ctx->pt); } else { 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 _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--; } else { // 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) 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.Character[nPers].endtalkpattern != 0) { GLOBALS.Freeze(); - GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].endtalkpattern); + GLOBALS.Character[nPers].item->setPattern(GLOBALS.Character[nPers].endtalkpattern); 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; } else { if ((GLOBALS.MCharacter[nPers].bInTexts && GLOBALS.MCharacter[nPers].numtexts == 0) || !GLOBALS.MCharacter[nPers].bInTexts) { // Try to run the custom function to close the speech 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) CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); @@ -1946,7 +1941,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg } } else { if ((GLOBALS.dwTonyNumTexts == 0 && GLOBALS.bTonyInTexts) || !GLOBALS.bTonyInTexts) { - CORO_INVOKE_0(GLOBALS.Tony->EndTalk); + CORO_INVOKE_0(GLOBALS.Tony->endTalk); GLOBALS.dwTonyNumTexts = 0; 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) { if (nItem == 0) { - GLOBALS.Tony->PlaySfx(nSFX); + GLOBALS.Tony->playSfx(nSFX); } else { - RMItem *item = GLOBALS.Loc->GetItemFromCode(nItem); + RMItem *item = GLOBALS.Loc->getItemFromCode(nItem); 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->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); // Alignment -- cgit v1.2.3 From f12ab3e521b01ed2b40e7d517753dd14bc6e6f0f Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 7 Jun 2012 08:42:35 +0200 Subject: TONY: Rename variables and functions in utils.h --- engines/tony/custom.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index d42ef94a17..eaf125c973 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -574,7 +574,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint } 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) { @@ -1223,21 +1223,21 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 if (_ctx->lx > 0) { _ctx->lx -= (int32)sX; if (_ctx->lx < 0) _ctx->lx = 0; - _ctx->pt.Offset((int32)sX, 0); + _ctx->pt.offset((int32)sX, 0); } else if (_ctx->lx < 0) { _ctx->lx += (int32)sX; if (_ctx->lx > 0) _ctx->lx = 0; - _ctx->pt.Offset(-(int32)sX, 0); + _ctx->pt.offset(-(int32)sX, 0); } if (_ctx->ly > 0) { _ctx->ly -= sY; if (_ctx->ly < 0) _ctx->ly = 0; - _ctx->pt.Offset(0, sY); + _ctx->pt.offset(0, sY); } else if (_ctx->ly < 0) { _ctx->ly += sY; if (_ctx->ly > 0) _ctx->ly = 0; - _ctx->pt.Offset(0, -(int32)sY); + _ctx->pt.offset(0, -(int32)sY); } CORO_INVOKE_0(GLOBALS.WaitFrame); -- cgit v1.2.3 From cd15e483ed64274049142a2e6838962d794c3ff5 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 7 Jun 2012 21:14:59 +0200 Subject: TONY: Some more renaming --- engines/tony/custom.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index eaf125c973..a50807822c 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1949,7 +1949,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg delete _ctx->text; } - GlobalFree(_ctx->string); + globalFree(_ctx->string); CORO_END_CODE; } @@ -1985,7 +1985,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // If there is only one option, do it automatically, and wait for the next choice if (_ctx->num == 1) { mpalQueryDialogSelectionDWORD(_ctx->nChoice, _ctx->sl[0]); - GlobalFree(_ctx->sl); + globalFree(_ctx->sl); // Wait for the next choice to be made mpalQueryDialogWaitForChoice(&_ctx->nChoice); @@ -2001,7 +2001,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr _ctx->string = mpalQueryDialogPeriod(_ctx->sl[_ctx->i]); assert(_ctx->string != NULL); _ctx->dc.addChoice(_ctx->string); - GlobalFree(_ctx->string); + globalFree(_ctx->string); } // Activate the object @@ -2028,7 +2028,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // Closes the choice _ctx->dc.close(); - GlobalFree(_ctx->sl); + globalFree(_ctx->sl); // Wait for the next choice to be made mpalQueryDialogWaitForChoice(&_ctx->nChoice); -- cgit v1.2.3 From 1866cbd0fb0d7df1c1a4059e98b5d0f6d851c2d4 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 8 Jun 2012 08:44:14 +0200 Subject: TONY: start renaming globals --- engines/tony/custom.cpp | 304 ++++++++++++++++++++++++------------------------ 1 file changed, 152 insertions(+), 152 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index a50807822c..810e6a9353 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -108,24 +108,24 @@ const char *staccFileNames[] = { void ReapplyChangedHotspot(void) { int 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)); + for (i = 0; i < GLOBALS._curChangedHotspot; i++) + GLOBALS.Loc->getItemFromCode(GLOBALS._changedHotspot[i]._dwCode)->changeHotspot(RMPoint(GLOBALS._changedHotspot[i]._nX, GLOBALS._changedHotspot[i]._nY)); } void SaveChangedHotspot(Common::OutSaveFile *f) { - f->writeByte(GLOBALS.curChangedHotspot); - if (GLOBALS.curChangedHotspot > 0) { - for (int i = 0; i < GLOBALS.curChangedHotspot; ++i) - GLOBALS.ChangedHotspot[i].Save(f); + f->writeByte(GLOBALS._curChangedHotspot); + if (GLOBALS._curChangedHotspot > 0) { + for (int i = 0; i < GLOBALS._curChangedHotspot; ++i) + GLOBALS._changedHotspot[i].save(f); } } void LoadChangedHotspot(Common::InSaveFile *f) { - GLOBALS.curChangedHotspot = f->readByte(); + GLOBALS._curChangedHotspot = f->readByte(); - if (GLOBALS.curChangedHotspot > 0) { - for (int i = 0; i < GLOBALS.curChangedHotspot; ++i) - GLOBALS.ChangedHotspot[i].Load(f); + if (GLOBALS._curChangedHotspot > 0) { + for (int i = 0; i < GLOBALS._curChangedHotspot; ++i) + GLOBALS._changedHotspot[i].load(f); } } @@ -141,29 +141,29 @@ void LoadChangedHotspot(Common::InSaveFile *f) { */ void MCharResetCodes(void) { 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++) - 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) { for (int i = 0; i < 10; i++) { - f->writeByte(GLOBALS.IsMChar[i]); - if (GLOBALS.IsMChar[i]) { - GLOBALS.MCharacter[i].Save(f); + f->writeByte(GLOBALS._isMChar[i]); + if (GLOBALS._isMChar[i]) { + GLOBALS._mCharacter[i].save(f); } else { - GLOBALS.Character[i].Save(f); + GLOBALS._character[i].save(f); } } } void CharsLoadAll(Common::InSaveFile *f) { for (int i = 0; i < 10; i++) { - GLOBALS.IsMChar[i] = f->readByte(); - if (GLOBALS.IsMChar[i]) - GLOBALS.MCharacter[i].Load(f); + GLOBALS._isMChar[i] = f->readByte(); + if (GLOBALS._isMChar[i]) + GLOBALS._mCharacter[i].load(f); else - GLOBALS.Character[i].Load(f); + GLOBALS._character[i].load(f); } } @@ -202,7 +202,7 @@ DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint } DECLARE_CUSTOM_FUNCTION(SetAlwaysDisplay)(CORO_PARAM, uint32 val, uint32, uint32, uint32) { - GLOBALS.bAlwaysDisplay = (val != 0); + GLOBALS._bAlwaysDisplay = (val != 0); } @@ -296,10 +296,10 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.Tony->TALK_NORMAL); } - if (GLOBALS.curBackText) - CORO_INVOKE_0(GLOBALS.curBackText->hide); + if (GLOBALS._curBackText) + CORO_INVOKE_0(GLOBALS._curBackText->hide); - GLOBALS.bTonyIsSpeaking = true; + GLOBALS._bTonyIsSpeaking = true; for (_ctx->i = 0; _ctx->i < _ctx->msg.numPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { _ctx->text.setInput(GLOBALS.Input); @@ -320,7 +320,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->text.setPosition(RMPoint(nX, nY) - GLOBALS.Loc->scrollPosition()); // Handling for always display - if (GLOBALS.bAlwaysDisplay) { + if (GLOBALS._bAlwaysDisplay) { _ctx->text.setAlwaysDisplay(); _ctx->text.forceTime(); } @@ -355,9 +355,9 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX } } - GLOBALS.bTonyIsSpeaking = false; - if (GLOBALS.curBackText) - GLOBALS.curBackText->show(); + GLOBALS._bTonyIsSpeaking = false; + if (GLOBALS._curBackText) + GLOBALS._curBackText->show(); CORO_INVOKE_0(GLOBALS.Tony->endTalk); @@ -378,7 +378,7 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, ui GLOBALS.Freeze(); - GLOBALS.curChangedHotspot = 0; + GLOBALS._curChangedHotspot = 0; if (bUseStartPos != 0) GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), GLOBALS.StartLocPos[nLoc]); else @@ -538,7 +538,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint // On exit, unfreeze CORO_INVOKE_2(GLOBALS.UnloadLocation, true, NULL); - GLOBALS.curChangedHotspot = 0; + GLOBALS._curChangedHotspot = 0; if (bUseStartPos != 0) GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), GLOBALS.StartLocPos[nLoc]); else @@ -578,8 +578,8 @@ DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(CORO_PARAM, uint32 nLoc, uint32 lX, } DECLARE_CUSTOM_FUNCTION(SaveTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) { - GLOBALS.saveTonyPos = GLOBALS.Tony->position(); - GLOBALS.saveTonyLoc = GLOBALS.Loc->TEMPGetNumLoc(); + GLOBALS._saveTonyPos = GLOBALS.Tony->position(); + GLOBALS._saveTonyLoc = GLOBALS.Loc->TEMPGetNumLoc(); } DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -588,7 +588,7 @@ DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_4(ChangeLocation, GLOBALS.saveTonyLoc, GLOBALS.saveTonyPos.x, GLOBALS.saveTonyPos.y, 0); + CORO_INVOKE_4(ChangeLocation, GLOBALS._saveTonyLoc, GLOBALS._saveTonyPos.x, GLOBALS._saveTonyPos.y, 0); MCharResetCodes(); @@ -1340,18 +1340,18 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uint32 nY, uint32) { int i; - for (i = 0; i < GLOBALS.curChangedHotspot; i++) - if (GLOBALS.ChangedHotspot[i].dwCode == dwCode) { - GLOBALS.ChangedHotspot[i].nX = nX; - GLOBALS.ChangedHotspot[i].nY = nY; + for (i = 0; i < GLOBALS._curChangedHotspot; i++) + if (GLOBALS._changedHotspot[i]._dwCode == dwCode) { + GLOBALS._changedHotspot[i]._nX = nX; + GLOBALS._changedHotspot[i]._nY = nY; break; } - if (i == GLOBALS.curChangedHotspot) { - GLOBALS.ChangedHotspot[i].dwCode = dwCode; - GLOBALS.ChangedHotspot[i].nX = nX; - GLOBALS.ChangedHotspot[i].nY = nY; - GLOBALS.curChangedHotspot++; + if (i == GLOBALS._curChangedHotspot) { + GLOBALS._changedHotspot[i]._dwCode = dwCode; + GLOBALS._changedHotspot[i]._nX = nX; + GLOBALS._changedHotspot[i]._nY = nY; + GLOBALS._curChangedHotspot++; } GLOBALS.Loc->getItemFromCode(dwCode)->changeHotspot(RMPoint(nX, nY)); @@ -1412,36 +1412,36 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32 DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { assert(nChar < 16); - GLOBALS.Character[nChar].code = nCode; - GLOBALS.Character[nChar].item = GLOBALS.Loc->getItemFromCode(nCode); - GLOBALS.Character[nChar].r = 255; - GLOBALS.Character[nChar].g = 255; - GLOBALS.Character[nChar].b = 255; - GLOBALS.Character[nChar].talkpattern = 0; - GLOBALS.Character[nChar].starttalkpattern = 0; - GLOBALS.Character[nChar].endtalkpattern = 0; - GLOBALS.Character[nChar].standpattern = 0; + GLOBALS._character[nChar]._code = nCode; + GLOBALS._character[nChar]._item = GLOBALS.Loc->getItemFromCode(nCode); + GLOBALS._character[nChar]._r = 255; + GLOBALS._character[nChar]._g = 255; + GLOBALS._character[nChar]._b = 255; + GLOBALS._character[nChar]._talkPattern = 0; + GLOBALS._character[nChar]._startTalkPattern = 0; + GLOBALS._character[nChar]._endTalkPattern = 0; + GLOBALS._character[nChar]._standPattern = 0; - GLOBALS.IsMChar[nChar] = false; + GLOBALS._isMChar[nChar] = false; } DECLARE_CUSTOM_FUNCTION(CharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) { assert(nChar < 16); - GLOBALS.Character[nChar].r = r; - GLOBALS.Character[nChar].g = g; - GLOBALS.Character[nChar].b = b; + GLOBALS._character[nChar]._r = r; + GLOBALS._character[nChar]._g = g; + GLOBALS._character[nChar]._b = b; } DECLARE_CUSTOM_FUNCTION(CharSetTalkPattern)(CORO_PARAM, uint32 nChar, uint32 tp, uint32 sp, uint32) { assert(nChar < 16); - GLOBALS.Character[nChar].talkpattern = tp; - GLOBALS.Character[nChar].standpattern = sp; + GLOBALS._character[nChar]._talkPattern = tp; + GLOBALS._character[nChar]._standPattern = sp; } DECLARE_CUSTOM_FUNCTION(CharSetStartEndTalkPattern)(CORO_PARAM, uint32 nChar, uint32 sp, uint32 ep, uint32) { assert(nChar < 16); - GLOBALS.Character[nChar].starttalkpattern = sp; - GLOBALS.Character[nChar].endtalkpattern = ep; + GLOBALS._character[nChar]._startTalkPattern = sp; + GLOBALS._character[nChar]._endTalkPattern = ep; } DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32) { @@ -1461,18 +1461,18 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->curOffset = 0; 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.Character[nChar].item->setPattern(GLOBALS.Character[nChar].starttalkpattern); + GLOBALS._character[nChar]._item->setPattern(GLOBALS._character[nChar]._startTalkPattern); GLOBALS.Unfreeze(); - CORO_INVOKE_0(GLOBALS.Character[nChar].item->waitForEndPattern); + CORO_INVOKE_0(GLOBALS._character[nChar]._item->waitForEndPattern); } GLOBALS.Freeze(); - GLOBALS.Character[nChar].item->setPattern(GLOBALS.Character[nChar].talkpattern); + GLOBALS._character[nChar]._item->setPattern(GLOBALS._character[nChar]._talkPattern); GLOBALS.Unfreeze(); _ctx->curVoc = SearchVoiceHeader(0, dwMessage); @@ -1485,9 +1485,9 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess for (_ctx->i = 0; _ctx->i < _ctx->msg->numPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { if (bIsBack) { - GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); - if (GLOBALS.bTonyIsSpeaking) - CORO_INVOKE_0(GLOBALS.curBackText->hide); + GLOBALS._curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); + if (GLOBALS._bTonyIsSpeaking) + CORO_INVOKE_0(GLOBALS._curBackText->hide); } else _ctx->text = new RMTextDialog; @@ -1500,7 +1500,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->text->setAlignType(RMText::HCENTER, RMText::VBOTTOM); // Colour - _ctx->text->setColor(GLOBALS.Character[nChar].r, GLOBALS.Character[nChar].g, GLOBALS.Character[nChar].b); + _ctx->text->setColor(GLOBALS._character[nChar]._r, GLOBALS._character[nChar]._g, GLOBALS._character[nChar]._b); // Write the text _ctx->text->writeText((*_ctx->msg)[_ctx->i], 0); @@ -1509,7 +1509,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->text->setPosition(_ctx->pt); // Set the always display - if (GLOBALS.bAlwaysDisplay) { + if (GLOBALS._bAlwaysDisplay) { _ctx->text->setAlwaysDisplay(); _ctx->text->forceTime(); } @@ -1539,19 +1539,19 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess } - GLOBALS.curBackText = NULL; + GLOBALS._curBackText = NULL; delete _ctx->text; } - if (GLOBALS.Character[nChar].endtalkpattern != 0) { + if (GLOBALS._character[nChar]._endTalkPattern != 0) { GLOBALS.Freeze(); - GLOBALS.Character[nChar].item->setPattern(GLOBALS.Character[nChar].endtalkpattern); + GLOBALS._character[nChar]._item->setPattern(GLOBALS._character[nChar]._endTalkPattern); GLOBALS.Unfreeze(); - CORO_INVOKE_0(GLOBALS.Character[nChar].item->waitForEndPattern); + CORO_INVOKE_0(GLOBALS._character[nChar]._item->waitForEndPattern); } GLOBALS.Freeze(); - GLOBALS.Character[nChar].item->setPattern(GLOBALS.Character[nChar].standpattern); + GLOBALS._character[nChar]._item->setPattern(GLOBALS._character[nChar]._standPattern); GLOBALS.Unfreeze(); delete _ctx->msg; @@ -1577,43 +1577,43 @@ DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32 DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { assert(nChar < 10); - GLOBALS.MCharacter[nChar].code = nCode; + GLOBALS._mCharacter[nChar]._code = nCode; if (nCode == 0) - GLOBALS.MCharacter[nChar].item = NULL; + GLOBALS._mCharacter[nChar]._item = NULL; else - GLOBALS.MCharacter[nChar].item = GLOBALS.Loc->getItemFromCode(nCode); - GLOBALS.MCharacter[nChar].r = 255; - GLOBALS.MCharacter[nChar].g = 255; - GLOBALS.MCharacter[nChar].b = 255; - GLOBALS.MCharacter[nChar].x = -1; - GLOBALS.MCharacter[nChar].y = -1; - GLOBALS.MCharacter[nChar].bAlwaysBack = 0; + GLOBALS._mCharacter[nChar]._item = GLOBALS.Loc->getItemFromCode(nCode); + GLOBALS._mCharacter[nChar]._r = 255; + GLOBALS._mCharacter[nChar]._g = 255; + GLOBALS._mCharacter[nChar]._b = 255; + GLOBALS._mCharacter[nChar]._x = -1; + GLOBALS._mCharacter[nChar]._y = -1; + GLOBALS._mCharacter[nChar]._bAlwaysBack = 0; for (int i = 0; i < 10; i++) - GLOBALS.MCharacter[nChar].numtalks[i] = 1; + GLOBALS._mCharacter[nChar]._numTalks[i] = 1; - GLOBALS.MCharacter[nChar].curgroup = 0; + GLOBALS._mCharacter[nChar]._curGroup = 0; - GLOBALS.IsMChar[nChar] = true; + GLOBALS._isMChar[nChar] = true; } 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); } DECLARE_CUSTOM_FUNCTION(MCharSetPosition)(CORO_PARAM, uint32 nChar, uint32 nX, uint32 nY, uint32) { assert(nChar < 10); - GLOBALS.MCharacter[nChar].x = nX; - GLOBALS.MCharacter[nChar].y = nY; + GLOBALS._mCharacter[nChar]._x = nX; + GLOBALS._mCharacter[nChar]._y = nY; } DECLARE_CUSTOM_FUNCTION(MCharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) { assert(nChar < 10); - GLOBALS.MCharacter[nChar].r = r; - GLOBALS.MCharacter[nChar].g = g; - GLOBALS.MCharacter[nChar].b = b; + GLOBALS._mCharacter[nChar]._r = r; + GLOBALS._mCharacter[nChar]._g = g; + GLOBALS._mCharacter[nChar]._b = b; } @@ -1621,7 +1621,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSetNumTalksInGroup)(CORO_PARAM, uint32 nChar, uint3 assert(nChar < 10); assert(nGroup < 10); - GLOBALS.MCharacter[nChar].numtalks[nGroup] = nTalks; + GLOBALS._mCharacter[nChar]._numTalks[nGroup] = nTalks; } @@ -1629,20 +1629,20 @@ DECLARE_CUSTOM_FUNCTION(MCharSetCurrentGroup)(CORO_PARAM, uint32 nChar, uint32 n assert(nChar < 10); assert(nGroup < 10); - GLOBALS.MCharacter[nChar].curgroup = nGroup; + GLOBALS._mCharacter[nChar]._curGroup = nGroup; } DECLARE_CUSTOM_FUNCTION(MCharSetNumTexts)(CORO_PARAM, uint32 nChar, uint32 nTexts, uint32, uint32) { assert(nChar < 10); - GLOBALS.MCharacter[nChar].numtexts = nTexts - 1; - GLOBALS.MCharacter[nChar].bInTexts = false; + GLOBALS._mCharacter[nChar]._numTexts = nTexts - 1; + GLOBALS._mCharacter[nChar]._bInTexts = false; } DECLARE_CUSTOM_FUNCTION(MCharSetAlwaysBack)(CORO_PARAM, uint32 nChar, uint32 bAlwaysBack, uint32, uint32) { assert(nChar < 10); - GLOBALS.MCharacter[nChar].bAlwaysBack = bAlwaysBack; + GLOBALS._mCharacter[nChar]._bAlwaysBack = bAlwaysBack; } @@ -1666,21 +1666,21 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes assert(nChar < 10); - bIsBack |= GLOBALS.MCharacter[nChar].bAlwaysBack ? 1 : 0; + bIsBack |= GLOBALS._mCharacter[nChar]._bAlwaysBack ? 1 : 0; // Calculates the position of the text according to the current frame - if (GLOBALS.MCharacter[nChar].x == -1) - _ctx->pt = GLOBALS.MCharacter[nChar].item->calculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->scrollPosition(); + if (GLOBALS._mCharacter[nChar]._x == -1) + _ctx->pt = GLOBALS._mCharacter[nChar]._item->calculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->scrollPosition(); else - _ctx->pt = RMPoint(GLOBALS.MCharacter[nChar].x, GLOBALS.MCharacter[nChar].y); + _ctx->pt = RMPoint(GLOBALS._mCharacter[nChar]._x, GLOBALS._mCharacter[nChar]._y); // Parameter for special actions: random between the spoken - _ctx->parm = (GLOBALS.MCharacter[nChar].curgroup * 10) + _vm->_randomSource.getRandomNumber( - GLOBALS.MCharacter[nChar].numtalks[GLOBALS.MCharacter[nChar].curgroup] - 1) + 1; + _ctx->parm = (GLOBALS._mCharacter[nChar]._curGroup * 10) + _vm->_randomSource.getRandomNumber( + GLOBALS._mCharacter[nChar]._numTalks[GLOBALS._mCharacter[nChar]._curGroup] - 1) + 1; // Try to run the custom function to initialise the speech - if (GLOBALS.MCharacter[nChar].item) { - _ctx->h = mpalQueryDoAction(30, GLOBALS.MCharacter[nChar].item->mpalCode(), _ctx->parm); + if (GLOBALS._mCharacter[nChar]._item) { + _ctx->h = mpalQueryDoAction(30, GLOBALS._mCharacter[nChar]._item->mpalCode(), _ctx->parm); if (_ctx->h != CORO_INVALID_PID_VALUE) { CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); } @@ -1698,9 +1698,9 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes 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 if (bIsBack) { - GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); - if (GLOBALS.bTonyIsSpeaking) - CORO_INVOKE_0(GLOBALS.curBackText->hide); + GLOBALS._curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); + if (GLOBALS._bTonyIsSpeaking) + CORO_INVOKE_0(GLOBALS._curBackText->hide); } else _ctx->text = new RMTextDialog; @@ -1713,7 +1713,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->text->setAlignType(RMText::HCENTER, RMText::VBOTTOM); // Colour - _ctx->text->setColor(GLOBALS.MCharacter[nChar].r, GLOBALS.MCharacter[nChar].g, GLOBALS.MCharacter[nChar].b); + _ctx->text->setColor(GLOBALS._mCharacter[nChar]._r, GLOBALS._mCharacter[nChar]._g, GLOBALS._mCharacter[nChar]._b); // Write the text _ctx->text->writeText((*_ctx->msg)[_ctx->i], nFont); @@ -1722,7 +1722,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->text->setPosition(_ctx->pt); // Set the always display - if (GLOBALS.bAlwaysDisplay) { + if (GLOBALS._bAlwaysDisplay) { _ctx->text->setAlwaysDisplay(); _ctx->text->forceTime(); } @@ -1751,15 +1751,15 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->voice = NULL; } - GLOBALS.curBackText = NULL; + GLOBALS._curBackText = NULL; delete _ctx->text; delete _ctx->msg; } // Try to run the custom function to close the speech - if (GLOBALS.MCharacter[nChar].item) { - _ctx->h = mpalQueryDoAction(31, GLOBALS.MCharacter[nChar].item->mpalCode(), _ctx->parm); + if (GLOBALS._mCharacter[nChar]._item) { + _ctx->h = mpalQueryDoAction(31, GLOBALS._mCharacter[nChar]._item->mpalCode(), _ctx->parm); if (_ctx->h != CORO_INVALID_PID_VALUE) CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); } @@ -1790,7 +1790,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->bIsBack = false; // The SendDialogMessage can go in the background if it is a character - if (nPers != 0 && GLOBALS.IsMChar[nPers] && GLOBALS.MCharacter[nPers].bAlwaysBack) + if (nPers != 0 && GLOBALS._isMChar[nPers] && GLOBALS._mCharacter[nPers]._bAlwaysBack) _ctx->bIsBack = true; _ctx->curVoc = SearchVoiceHeader(curDialog, nMsg); @@ -1830,67 +1830,67 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (!GLOBALS.bStaticTalk) GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; } - } else if (!GLOBALS.IsMChar[nPers]) { + } else if (!GLOBALS._isMChar[nPers]) { _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.Character[nPers].item->setPattern(GLOBALS.Character[nPers].starttalkpattern); + GLOBALS._character[nPers]._item->setPattern(GLOBALS._character[nPers]._startTalkPattern); 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->setPosition(_ctx->pt); } else { - if (GLOBALS.MCharacter[nPers].x == -1) - _ctx->pt = GLOBALS.MCharacter[nPers].item->calculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->scrollPosition(); + if (GLOBALS._mCharacter[nPers]._x == -1) + _ctx->pt = GLOBALS._mCharacter[nPers]._item->calculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->scrollPosition(); else - _ctx->pt = RMPoint(GLOBALS.MCharacter[nPers].x, GLOBALS.MCharacter[nPers].y); + _ctx->pt = RMPoint(GLOBALS._mCharacter[nPers]._x, GLOBALS._mCharacter[nPers]._y); // Parameter for special actions. Random between the spoken. - _ctx->parm = (GLOBALS.MCharacter[nPers].curgroup * 10) + _vm->_randomSource.getRandomNumber( - GLOBALS.MCharacter[nPers].numtalks[GLOBALS.MCharacter[nPers].curgroup] - 1) + 1; + _ctx->parm = (GLOBALS._mCharacter[nPers]._curGroup * 10) + _vm->_randomSource.getRandomNumber( + GLOBALS._mCharacter[nPers]._numTalks[GLOBALS._mCharacter[nPers]._curGroup] - 1) + 1; - if (GLOBALS.MCharacter[nPers].numtexts != 0 && GLOBALS.MCharacter[nPers].bInTexts) { - GLOBALS.MCharacter[nPers].numtexts--; + if (GLOBALS._mCharacter[nPers]._numTexts != 0 && GLOBALS._mCharacter[nPers]._bInTexts) { + GLOBALS._mCharacter[nPers]._numTexts--; } else { // 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) CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); - GLOBALS.MCharacter[nPers].curTalk = _ctx->parm; + GLOBALS._mCharacter[nPers]._curTalk = _ctx->parm; - if (GLOBALS.MCharacter[nPers].numtexts != 0) { - GLOBALS.MCharacter[nPers].bInTexts = true; - GLOBALS.MCharacter[nPers].numtexts--; + if (GLOBALS._mCharacter[nPers]._numTexts != 0) { + GLOBALS._mCharacter[nPers]._bInTexts = true; + GLOBALS._mCharacter[nPers]._numTexts--; } } - if (GLOBALS.MCharacter[nPers].bAlwaysBack) { - _ctx->text = GLOBALS.curBackText = new RMTextDialogScrolling(GLOBALS.Loc); - if (GLOBALS.bTonyIsSpeaking) - CORO_INVOKE_0(GLOBALS.curBackText->hide); + if (GLOBALS._mCharacter[nPers]._bAlwaysBack) { + _ctx->text = GLOBALS._curBackText = new RMTextDialogScrolling(GLOBALS.Loc); + if (GLOBALS._bTonyIsSpeaking) + CORO_INVOKE_0(GLOBALS._curBackText->hide); _ctx->bIsBack = true; } else _ctx->text = new RMTextDialog; - _ctx->text->setSkipStatus(!GLOBALS.MCharacter[nPers].bAlwaysBack); - _ctx->text->setColor(GLOBALS.MCharacter[nPers].r, GLOBALS.MCharacter[nPers].g, GLOBALS.MCharacter[nPers].b); + _ctx->text->setSkipStatus(!GLOBALS._mCharacter[nPers]._bAlwaysBack); + _ctx->text->setColor(GLOBALS._mCharacter[nPers]._r, GLOBALS._mCharacter[nPers]._g, GLOBALS._mCharacter[nPers]._b); _ctx->text->writeText(_ctx->string, 0); _ctx->text->setPosition(_ctx->pt); } if (!GLOBALS.bSkipIdle) { _ctx->text->setInput(GLOBALS.Input); - if (GLOBALS.bAlwaysDisplay) { + if (GLOBALS._bAlwaysDisplay) { _ctx->text->setAlwaysDisplay(); _ctx->text->forceTime(); } @@ -1914,29 +1914,29 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg } if (nPers != 0) { - if (!GLOBALS.IsMChar[nPers]) { - if (GLOBALS.Character[nPers].endtalkpattern != 0) { + if (!GLOBALS._isMChar[nPers]) { + if (GLOBALS._character[nPers]._endTalkPattern != 0) { GLOBALS.Freeze(); - GLOBALS.Character[nPers].item->setPattern(GLOBALS.Character[nPers].endtalkpattern); + GLOBALS._character[nPers]._item->setPattern(GLOBALS._character[nPers]._endTalkPattern); 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; } 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 - 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); + 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); if (_ctx->h != CORO_INVALID_PID_VALUE) CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); - GLOBALS.MCharacter[nPers].bInTexts = false; - GLOBALS.MCharacter[nPers].numtexts = 0; + GLOBALS._mCharacter[nPers]._bInTexts = false; + GLOBALS._mCharacter[nPers]._numTexts = 0; } - GLOBALS.curBackText = NULL; + GLOBALS._curBackText = NULL; delete _ctx->text; } } else { @@ -2545,7 +2545,7 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation GLOBALS.EnableGUI = mainEnableGUI; GLOBALS.SetPalesati = mainSetPalesati; - GLOBALS.bAlwaysDisplay = false; + GLOBALS._bAlwaysDisplay = false; int i; for (i = 0; i < 10; i++) -- cgit v1.2.3 From c52aca5ac407c498eb0a287697199a97f7c18bae Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 9 Jun 2012 00:52:38 +0200 Subject: TONY: Rename more globals --- engines/tony/custom.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 810e6a9353..7482ac0db8 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -495,7 +495,7 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMessage)(CORO_PARAM, uint32 nMsg, uint32 n } DECLARE_CUSTOM_FUNCTION(NoOcchioDiBue)(CORO_PARAM, uint32, uint32, uint32, uint32) { - GLOBALS.bNoOcchioDiBue = true; + GLOBALS._bNoOcchioDiBue = true; } DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -504,7 +504,7 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 CORO_BEGIN_CODE(_ctx); - if (!GLOBALS.bNoOcchioDiBue) { + if (!GLOBALS._bNoOcchioDiBue) { GLOBALS.InitWipe(1); CORO_INVOKE_0(GLOBALS.WaitWipeEnd); } @@ -526,7 +526,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint CORO_BEGIN_CODE(_ctx); - if (!GLOBALS.bNoOcchioDiBue) { + if (!GLOBALS._bNoOcchioDiBue) { GLOBALS.InitWipe(1); CORO_INVOKE_0(GLOBALS.WaitWipeEnd); } @@ -550,7 +550,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint _vm->playMusic(4, tappetiFile[GLOBALS.lastTappeto], 0, true, 2000); } - if (!GLOBALS.bNoOcchioDiBue) { + if (!GLOBALS._bNoOcchioDiBue) { GLOBALS.InitWipe(2); } @@ -559,12 +559,12 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint _ctx->h = mpalQueryDoAction(0, nLoc, 0); - if (!GLOBALS.bNoOcchioDiBue) { + if (!GLOBALS._bNoOcchioDiBue) { CORO_INVOKE_0(GLOBALS.WaitWipeEnd); GLOBALS.CloseWipe(); } - GLOBALS.bNoOcchioDiBue = false; + GLOBALS._bNoOcchioDiBue = false; // On Enter? if (_ctx->h != CORO_INVALID_PID_VALUE) @@ -2102,14 +2102,14 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { debug("Start FadeOut Music"); - for (_ctx->i = 16; _ctx->i > 0 && !GLOBALS.bFadeOutStop; _ctx->i--) { + for (_ctx->i = 16; _ctx->i > 0 && !GLOBALS._bFadeOutStop; _ctx->i--) { if (_ctx->i * 4 < _ctx->startVolume) _vm->setMusicVolume(nChannel, _ctx->i * 4); CORO_INVOKE_1(CoroScheduler.sleep, 100); } - if (!GLOBALS.bFadeOutStop) + if (!GLOBALS._bFadeOutStop) _vm->setMusicVolume(nChannel, 0); // If there is a stacchetto, stop all @@ -2124,16 +2124,16 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { } DECLARE_CUSTOM_FUNCTION(FadeInSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - CoroScheduler.createProcess(ThreadFadeInMusic, &GLOBALS.curSonoriz, sizeof(int)); + CoroScheduler.createProcess(ThreadFadeInMusic, &GLOBALS._curSonoriz, sizeof(int)); } DECLARE_CUSTOM_FUNCTION(FadeOutSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - GLOBALS.bFadeOutStop = false; - CoroScheduler.createProcess(ThreadFadeOutMusic, &GLOBALS.curSonoriz, sizeof(int)); + GLOBALS._bFadeOutStop = false; + CoroScheduler.createProcess(ThreadFadeOutMusic, &GLOBALS._curSonoriz, sizeof(int)); } DECLARE_CUSTOM_FUNCTION(FadeOutStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { - GLOBALS.bFadeOutStop = false; + GLOBALS._bFadeOutStop = false; int channel = 2; CoroScheduler.createProcess(ThreadFadeOutMusic, &channel, sizeof(int)); } @@ -2144,7 +2144,7 @@ DECLARE_CUSTOM_FUNCTION(FadeInStacchetto)(CORO_PARAM, uint32, uint32, uint32, ui } DECLARE_CUSTOM_FUNCTION(StopSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->stopMusic(GLOBALS.curSonoriz); + _vm->stopMusic(GLOBALS._curSonoriz); } DECLARE_CUSTOM_FUNCTION(StopStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -2152,12 +2152,12 @@ DECLARE_CUSTOM_FUNCTION(StopStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint } DECLARE_CUSTOM_FUNCTION(MuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->setMusicVolume(GLOBALS.curSonoriz, 0); + _vm->setMusicVolume(GLOBALS._curSonoriz, 0); } DECLARE_CUSTOM_FUNCTION(DemuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - GLOBALS.bFadeOutStop = true; - _vm->setMusicVolume(GLOBALS.curSonoriz, 64); + GLOBALS._bFadeOutStop = true; + _vm->setMusicVolume(GLOBALS._curSonoriz, 64); } DECLARE_CUSTOM_FUNCTION(MuteStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -2183,11 +2183,11 @@ void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int DECLARE_CUSTOM_FUNCTION(PlaySonoriz)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) { if (nFX == 0 || nFX == 1 || nFX == 2) { debug("PlaySonoriz stop fadeout"); - GLOBALS.bFadeOutStop = true; + GLOBALS._bFadeOutStop = true; } GLOBALS.lastMusic = nMusic; - CustPlayMusic(GLOBALS.curSonoriz, musicFiles[nMusic].name, nFX, bNoLoop ? false : true, musicFiles[nMusic].sync); + CustPlayMusic(GLOBALS._curSonoriz, musicFiles[nMusic].name, nFX, bNoLoop ? false : true, musicFiles[nMusic].sync); } DECLARE_CUSTOM_FUNCTION(PlayStacchetto)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) { @@ -2270,7 +2270,7 @@ DECLARE_CUSTOM_FUNCTION(MustSkipIdleEnd)(CORO_PARAM, uint32, uint32, uint32, uin } DECLARE_CUSTOM_FUNCTION(PatIrqFreeze)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { - GLOBALS.bPatIrqFreeze = bStatus; + GLOBALS._bPatIrqFreeze = bStatus; } DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, uint32) { -- cgit v1.2.3 From 10621fded8eee2da03a2a9f93bfa1546bcb7c748 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 9 Jun 2012 17:51:58 +1000 Subject: TONY: Fix some calls from globalFree to globalDestroy --- engines/tony/custom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 7482ac0db8..858479ca7f 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1949,7 +1949,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg delete _ctx->text; } - globalFree(_ctx->string); + globalDestroy(_ctx->string); CORO_END_CODE; } -- cgit v1.2.3 From 7758b1a432fcd31e5e608cb7720225f7a0cc633c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 9 Jun 2012 22:14:38 +1000 Subject: TONY: Fix operation of TakeOwnership/ReleaseOwnership --- engines/tony/custom.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 858479ca7f..6db6d5f858 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2043,12 +2043,25 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr */ DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { - CoroScheduler.waitForSingleObject(coroParam, GLOBALS.mut[num], CORO_INFINITE); + CORO_BEGIN_CONTEXT; + bool expired; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + // The event is operating as a mutex, so if the event is already set, wait until it's reset + do { + CORO_INVOKE_3(CoroScheduler.waitForSingleObject, GLOBALS.mut[num], 0, &_ctx->expired); + } while (!_ctx->expired); + + // Set the event to flag ownership + CoroScheduler.setEvent(GLOBALS.mut[num]); + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { - CoroScheduler.pulseEvent(GLOBALS.mut[num]); - warning("TODO: Validate that the use of events in TakeOwnership/ReleaseOwnership match original"); + CoroScheduler.resetEvent(GLOBALS.mut[num]); } /* -- cgit v1.2.3 From e37319a28753f9b885e7c9d0a0e607d8090ae041 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 10 Jun 2012 17:56:52 +1000 Subject: TONY: Fix data freeing in DialogStart --- engines/tony/custom.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 6db6d5f858..e00db701f3 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1985,7 +1985,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // If there is only one option, do it automatically, and wait for the next choice if (_ctx->num == 1) { mpalQueryDialogSelectionDWORD(_ctx->nChoice, _ctx->sl[0]); - globalFree(_ctx->sl); + globalDestroy(_ctx->sl); // Wait for the next choice to be made mpalQueryDialogWaitForChoice(&_ctx->nChoice); @@ -2001,7 +2001,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr _ctx->string = mpalQueryDialogPeriod(_ctx->sl[_ctx->i]); assert(_ctx->string != NULL); _ctx->dc.addChoice(_ctx->string); - globalFree(_ctx->string); + globalDestroy(_ctx->string); } // Activate the object @@ -2028,7 +2028,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // Closes the choice _ctx->dc.close(); - globalFree(_ctx->sl); + globalDestroy(_ctx->sl); // Wait for the next choice to be made mpalQueryDialogWaitForChoice(&_ctx->nChoice); -- cgit v1.2.3 From f64700b27fa8f083697a16459e8237bf6c48f1dc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 11 Jun 2012 00:24:52 +1000 Subject: TONY: Fixed display of static animations, and some variable renaming --- engines/tony/custom.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index e00db701f3..185fc64e94 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -985,26 +985,26 @@ DECLARE_CUSTOM_FUNCTION(TonyConCarteEnd)(CORO_PARAM, uint32, uint32, uint32, uin CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithNotebookStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONTACCUINOSTATIC; + GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_WITH_NOTEBOOK; GLOBALS.bStaticTalk = true; - CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONTACCUINOSTATIC); + CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_WITH_NOTEBOOK); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyConTaccuinoEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithNotebookEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONTACCUINOSTATIC); + CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_WITH_NOTEBOOK); GLOBALS.bStaticTalk = false; GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; @@ -2459,8 +2459,8 @@ ASSIGN(98, TonyConRicettaStart) ASSIGN(99, TonyConRicettaEnd) ASSIGN(100, TonyConCarteStart) ASSIGN(101, TonyConCarteEnd) -ASSIGN(102, TonyConTaccuinoStart) -ASSIGN(103, TonyConTaccuinoEnd) +ASSIGN(102, TonyWithNotebookStart) +ASSIGN(103, TonyWithNotebookEnd) ASSIGN(104, TonyConMegafonoStart) ASSIGN(105, TonyConMegafonoEnd) ASSIGN(106, TonyConBarbaStart) -- cgit v1.2.3 From 2b02a45ce16960644e1d5e297066f8040cd48cbc Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 10 Jun 2012 22:02:31 +0200 Subject: TONY: Rename variables in globals.h --- engines/tony/custom.cpp | 574 ++++++++++++++++++++++++------------------------ 1 file changed, 287 insertions(+), 287 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 185fc64e94..2e408a01aa 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -109,7 +109,7 @@ const char *staccFileNames[] = { void ReapplyChangedHotspot(void) { int 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) { @@ -141,9 +141,9 @@ void LoadChangedHotspot(Common::InSaveFile *f) { */ void MCharResetCodes(void) { 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++) - 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) { @@ -168,19 +168,19 @@ void CharsLoadAll(Common::InSaveFile *f) { } 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) { - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_STANDUP); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDUP); } 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) { - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_STANDRIGHT); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDRIGHT); } @@ -195,7 +195,7 @@ DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint CORO_BEGIN_CODE(_ctx); - if (!GLOBALS.bSkipIdle) + if (!GLOBALS._bSkipIdle) CORO_INVOKE_1(CoroScheduler.sleep, dwTime); CORO_END_CODE; @@ -209,23 +209,23 @@ DECLARE_CUSTOM_FUNCTION(SetAlwaysDisplay)(CORO_PARAM, uint32 val, uint32, uint32 DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32, uint32) { switch (dwPointer) { case 1: - GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_FRECCIASU); + GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_FRECCIASU); break; case 2: - GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_FRECCIAGIU); + GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_FRECCIAGIU); break; case 3: - GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_FRECCIASINISTRA); + GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_FRECCIASINISTRA); break; case 4: - GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_FRECCIADESTRA); + GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_FRECCIADESTRA); break; case 5: - GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_FRECCIAMAPPA); + GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_FRECCIAMAPPA); break; default: - GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_NONE); + GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_NONE); break; } } @@ -261,12 +261,12 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->curOffset = 0; - if (GLOBALS.bSkipIdle) return; + if (GLOBALS._bSkipIdle) + return; _ctx->msg.load(dwMessage); - if (!_ctx->msg.isValid()) { + if (!_ctx->msg.isValid()) return; - } _ctx->curVoc = SearchVoiceHeader(0, dwMessage); _ctx->voice = NULL; @@ -284,16 +284,16 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->voice->SetLoop(false); } - if (GLOBALS.nTonyNextTalkType != GLOBALS.Tony->TALK_NORMAL) { - CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.nTonyNextTalkType); + if (GLOBALS._nTonyNextTalkType != GLOBALS._tony->TALK_NORMAL) { + CORO_INVOKE_1(GLOBALS._tony->startTalk, GLOBALS._nTonyNextTalkType); - if (!GLOBALS.bStaticTalk) - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; + if (!GLOBALS._bStaticTalk) + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; } else { 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 - CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.Tony->TALK_NORMAL); + CORO_INVOKE_1(GLOBALS._tony->startTalk, GLOBALS._tony->TALK_NORMAL); } if (GLOBALS._curBackText) @@ -301,8 +301,8 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX GLOBALS._bTonyIsSpeaking = true; - for (_ctx->i = 0; _ctx->i < _ctx->msg.numPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { - _ctx->text.setInput(GLOBALS.Input); + for (_ctx->i = 0; _ctx->i < _ctx->msg.numPeriods() && !GLOBALS._bSkipIdle; _ctx->i++) { + _ctx->text.setInput(GLOBALS._input); // Alignment _ctx->text.setAlignType(RMText::HCENTER, RMText::VBOTTOM); @@ -315,9 +315,9 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX // Set the position 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 - _ctx->text.setPosition(RMPoint(nX, nY) - GLOBALS.Loc->scrollPosition()); + _ctx->text.setPosition(RMPoint(nX, nY) - GLOBALS._loc->scrollPosition()); // Handling for always display if (GLOBALS._bAlwaysDisplay) { @@ -345,7 +345,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX } // Wait for the end of the display - _ctx->text.setCustomSkipHandle(GLOBALS.hSkipIdle); + _ctx->text.setCustomSkipHandle(GLOBALS._hSkipIdle); CORO_INVOKE_0(_ctx->text.waitForEndDisplay); if (_ctx->curVoc) { @@ -359,13 +359,13 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX if (GLOBALS._curBackText) GLOBALS._curBackText->show(); - CORO_INVOKE_0(GLOBALS.Tony->endTalk); + CORO_INVOKE_0(GLOBALS._tony->endTalk); CORO_END_CODE; } 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); } @@ -380,7 +380,7 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, ui GLOBALS._curChangedHotspot = 0; if (bUseStartPos != 0) - GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), GLOBALS.StartLocPos[nLoc]); + GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), GLOBALS._startLocPos[nLoc]); else GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); @@ -407,18 +407,18 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 _ctx->msg = new RMMessage(nMsg); - GLOBALS.SFM_nLoc = GLOBALS.Loc->TEMPGetNumLoc(); - GLOBALS.SFM_pt = GLOBALS.Tony->position(); + GLOBALS.SFM_nLoc = GLOBALS._loc->TEMPGetNumLoc(); + GLOBALS.SFM_pt = GLOBALS._tony->position(); - if (GLOBALS.bSkipIdle) + if (GLOBALS._bSkipIdle) return; CORO_INVOKE_2(GLOBALS.UnloadLocation, false, NULL); - GLOBALS.Tony->hide(); + GLOBALS._tony->hide(); GLOBALS.Unfreeze(); - for (_ctx->i = 0; _ctx->i < _ctx->msg->numPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { - _ctx->text.setInput(GLOBALS.Input); + for (_ctx->i = 0; _ctx->i < _ctx->msg->numPeriods() && !GLOBALS._bSkipIdle; _ctx->i++) { + _ctx->text.setInput(GLOBALS._input); // Alignment _ctx->text.setAlignType(RMText::HCENTER, RMText::VCENTER); @@ -446,7 +446,7 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 GLOBALS.LinkGraphicTask(&_ctx->text); // Wait for the end of display - _ctx->text.setCustomSkipHandle(GLOBALS.hSkipIdle); + _ctx->text.setCustomSkipHandle(GLOBALS._hSkipIdle); CORO_INVOKE_0(_ctx->text.waitForEndDisplay); } @@ -474,7 +474,7 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony, GLOBALS.Freeze(); GLOBALS.LoadLocation(GLOBALS.SFM_nLoc, RMPoint(GLOBALS.SFM_pt.x, GLOBALS.SFM_pt.y), RMPoint(-1, -1)); if (!bNotEnableTony) - GLOBALS.Tony->show(); + GLOBALS._tony->show(); GLOBALS.Unfreeze(); MCharResetCodes(); @@ -531,7 +531,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint CORO_INVOKE_0(GLOBALS.WaitWipeEnd); } - if (GLOBALS.lastTappeto != GLOBALS.tappeti[nLoc]) { + if (GLOBALS._lastTappeto != GLOBALS._tappeti[nLoc]) { _vm->stopMusic(4); } @@ -540,14 +540,14 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint GLOBALS._curChangedHotspot = 0; if (bUseStartPos != 0) - GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), GLOBALS.StartLocPos[nLoc]); + GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), GLOBALS._startLocPos[nLoc]); else GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); - if (GLOBALS.lastTappeto != GLOBALS.tappeti[nLoc]) { - GLOBALS.lastTappeto = GLOBALS.tappeti[nLoc]; - if (GLOBALS.lastTappeto != 0) - _vm->playMusic(4, tappetiFile[GLOBALS.lastTappeto], 0, true, 2000); + if (GLOBALS._lastTappeto != GLOBALS._tappeti[nLoc]) { + GLOBALS._lastTappeto = GLOBALS._tappeti[nLoc]; + if (GLOBALS._lastTappeto != 0) + _vm->playMusic(4, tappetiFile[GLOBALS._lastTappeto], 0, true, 2000); } if (!GLOBALS._bNoOcchioDiBue) { @@ -574,12 +574,12 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint } 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) { - GLOBALS._saveTonyPos = GLOBALS.Tony->position(); - GLOBALS._saveTonyLoc = GLOBALS.Loc->TEMPGetNumLoc(); + GLOBALS._saveTonyPos = GLOBALS._tony->position(); + GLOBALS._saveTonyLoc = GLOBALS._loc->TEMPGetNumLoc(); } DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -604,7 +604,7 @@ DECLARE_CUSTOM_FUNCTION(EnableInput)(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) { @@ -624,11 +624,11 @@ void TonyGenericTake1(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); GLOBALS.Freeze(); - GLOBALS.Tony->take(nDirection, 0); + GLOBALS._tony->take(nDirection, 0); GLOBALS.Unfreeze(); - if (!GLOBALS.bSkipIdle) - CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); + if (!GLOBALS._bSkipIdle) + CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); CORO_END_CODE; } @@ -640,14 +640,14 @@ void TonyGenericTake2(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); GLOBALS.Freeze(); - GLOBALS.Tony->take(nDirection, 1); + GLOBALS._tony->take(nDirection, 1); GLOBALS.Unfreeze(); - if (!GLOBALS.bSkipIdle) - CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); + if (!GLOBALS._bSkipIdle) + CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); GLOBALS.Freeze(); - GLOBALS.Tony->take(nDirection, 2); + GLOBALS._tony->take(nDirection, 2); GLOBALS.Unfreeze(); CORO_END_CODE; @@ -660,11 +660,11 @@ void TonyGenericPut1(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); GLOBALS.Freeze(); - GLOBALS.Tony->put(nDirection, 0); + GLOBALS._tony->put(nDirection, 0); GLOBALS.Unfreeze(); - if (!GLOBALS.bSkipIdle) - CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); + if (!GLOBALS._bSkipIdle) + CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); CORO_END_CODE; } @@ -676,14 +676,14 @@ void TonyGenericPut2(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); GLOBALS.Freeze(); - GLOBALS.Tony->put(nDirection, 1); + GLOBALS._tony->put(nDirection, 1); GLOBALS.Unfreeze(); - if (!GLOBALS.bSkipIdle) - CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); + if (!GLOBALS._bSkipIdle) + CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); GLOBALS.Freeze(); - GLOBALS.Tony->put(nDirection, 2); + GLOBALS._tony->put(nDirection, 2); GLOBALS.Unfreeze(); 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) { if (dwParte == 0) - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_PERTERRALEFT); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_PERTERRALEFT); 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) { @@ -761,18 +761,18 @@ DECLARE_CUSTOM_FUNCTION(TonySiRialza)(CORO_PARAM, uint32 dwParte, uint32, uint32 CORO_BEGIN_CODE(_ctx); if (dwParte == 0) - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_SIRIALZALEFT); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SIRIALZALEFT); else - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_SIRIALZARIGHT); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SIRIALZARIGHT); - if (!GLOBALS.bSkipIdle) - CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); + if (!GLOBALS._bSkipIdle) + CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); CORO_END_CODE; } 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) { @@ -781,104 +781,104 @@ DECLARE_CUSTOM_FUNCTION(TonyFischietto)(CORO_PARAM, uint32, uint32, uint32, uint CORO_BEGIN_CODE(_ctx); - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_FISCHIETTORIGHT); - if (!GLOBALS.bSkipIdle) - CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_FISCHIETTORIGHT); + if (!GLOBALS._bSkipIdle) + CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_STANDRIGHT); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDRIGHT); CORO_END_CODE; } void TonySetNumTexts(uint32 dwText) { - GLOBALS.dwTonyNumTexts = dwText; - GLOBALS.bTonyInTexts = false; + GLOBALS._dwTonyNumTexts = dwText; + GLOBALS._bTonyInTexts = false; } DECLARE_CUSTOM_FUNCTION(TonyRide)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_RIDE; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_RIDE; } DECLARE_CUSTOM_FUNCTION(TonyRidacchia)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_RIDE2; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_RIDE2; } DECLARE_CUSTOM_FUNCTION(TonyFianchi)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_FIANCHI; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_FIANCHI; } DECLARE_CUSTOM_FUNCTION(TonyCanta)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CANTA; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CANTA; } DECLARE_CUSTOM_FUNCTION(TonySiIndica)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_SIINDICA; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SIINDICA; } DECLARE_CUSTOM_FUNCTION(TonySpaventatoConMani)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_SPAVENTATO; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SPAVENTATO; } DECLARE_CUSTOM_FUNCTION(TonySpaventatoSenzaMani)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_SPAVENTATO2; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SPAVENTATO2; } DECLARE_CUSTOM_FUNCTION(TonyConMartello)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONMARTELLO; - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_CONMARTELLO); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONMARTELLO; + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_CONMARTELLO); } DECLARE_CUSTOM_FUNCTION(TonyConBicchiere)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONBICCHIERE; - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_CONBICCHIERE); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONBICCHIERE; + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_CONBICCHIERE); } DECLARE_CUSTOM_FUNCTION(TonyConVerme)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONVERME; - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_CONVERME); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONVERME; + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_CONVERME); } DECLARE_CUSTOM_FUNCTION(TonyConCorda)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCORDA; - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_CONCORDA); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONCORDA; + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_CONCORDA); } DECLARE_CUSTOM_FUNCTION(TonyConSegretaria)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONSEGRETARIA; - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_CONSEGRETARIA); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONSEGRETARIA; + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_CONSEGRETARIA); } DECLARE_CUSTOM_FUNCTION(TonyConConiglioANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCONIGLIO; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONCONIGLIO; } DECLARE_CUSTOM_FUNCTION(TonyConRicettaANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONRICETTA; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONRICETTA; } DECLARE_CUSTOM_FUNCTION(TonyConCarteANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCARTE; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONCARTE; } DECLARE_CUSTOM_FUNCTION(TonyConPupazzoANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONPUPAZZO; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONPUPAZZO; } DECLARE_CUSTOM_FUNCTION(TonyConPupazzoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -887,9 +887,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConPupazzoStart)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONPUPAZZOSTATIC; - GLOBALS.bStaticTalk = true; - CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONPUPAZZOSTATIC); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONPUPAZZOSTATIC; + GLOBALS._bStaticTalk = true; + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_CONPUPAZZOSTATIC); CORO_END_CODE; } @@ -900,9 +900,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConPupazzoEnd)(CORO_PARAM, uint32, uint32, uint32, u CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONPUPAZZOSTATIC); - GLOBALS.bStaticTalk = false; - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_CONPUPAZZOSTATIC); + GLOBALS._bStaticTalk = false; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; CORO_END_CODE; } @@ -913,9 +913,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConConiglioStart)(CORO_PARAM, uint32, uint32, uint32 CORO_BEGIN_CODE(_ctx); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCONIGLIOSTATIC; - GLOBALS.bStaticTalk = true; - CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONCONIGLIOSTATIC); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONCONIGLIOSTATIC; + GLOBALS._bStaticTalk = true; + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_CONCONIGLIOSTATIC); CORO_END_CODE; } @@ -926,9 +926,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConConiglioEnd)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONCONIGLIOSTATIC); - GLOBALS.bStaticTalk = false; - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_CONCONIGLIOSTATIC); + GLOBALS._bStaticTalk = false; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; CORO_END_CODE; } @@ -939,9 +939,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConRicettaStart)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONRICETTASTATIC; - GLOBALS.bStaticTalk = true; - CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONRICETTASTATIC); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONRICETTASTATIC; + GLOBALS._bStaticTalk = true; + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_CONRICETTASTATIC); CORO_END_CODE; } @@ -952,9 +952,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConRicettaEnd)(CORO_PARAM, uint32, uint32, uint32, u CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONRICETTASTATIC); - GLOBALS.bStaticTalk = false; - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_CONRICETTASTATIC); + GLOBALS._bStaticTalk = false; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; CORO_END_CODE; } @@ -965,9 +965,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConCarteStart)(CORO_PARAM, uint32, uint32, uint32, u CORO_BEGIN_CODE(_ctx); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONCARTESTATIC; - GLOBALS.bStaticTalk = true; - CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONCARTESTATIC); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONCARTESTATIC; + GLOBALS._bStaticTalk = true; + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_CONCARTESTATIC); CORO_END_CODE; } @@ -978,9 +978,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConCarteEnd)(CORO_PARAM, uint32, uint32, uint32, uin CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONCARTESTATIC); - GLOBALS.bStaticTalk = false; - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_CONCARTESTATIC); + GLOBALS._bStaticTalk = false; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; CORO_END_CODE; } @@ -991,9 +991,9 @@ DECLARE_CUSTOM_FUNCTION(TonyWithNotebookStart)(CORO_PARAM, uint32, uint32, uint3 CORO_BEGIN_CODE(_ctx); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_WITH_NOTEBOOK; - GLOBALS.bStaticTalk = true; - CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_WITH_NOTEBOOK); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITH_NOTEBOOK; + GLOBALS._bStaticTalk = true; + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_WITH_NOTEBOOK); CORO_END_CODE; } @@ -1004,9 +1004,9 @@ DECLARE_CUSTOM_FUNCTION(TonyWithNotebookEnd)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_WITH_NOTEBOOK); - GLOBALS.bStaticTalk = false; - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_WITH_NOTEBOOK); + GLOBALS._bStaticTalk = false; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; CORO_END_CODE; } @@ -1017,9 +1017,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConMegafonoStart)(CORO_PARAM, uint32, uint32, uint32 CORO_BEGIN_CODE(_ctx); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONMEGAFONOSTATIC; - GLOBALS.bStaticTalk = true; - CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONMEGAFONOSTATIC); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONMEGAFONOSTATIC; + GLOBALS._bStaticTalk = true; + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_CONMEGAFONOSTATIC); CORO_END_CODE; } @@ -1030,9 +1030,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConMegafonoEnd)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONMEGAFONOSTATIC); - GLOBALS.bStaticTalk = false; - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_CONMEGAFONOSTATIC); + GLOBALS._bStaticTalk = false; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; CORO_END_CODE; } @@ -1043,9 +1043,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConBarbaStart)(CORO_PARAM, uint32, uint32, uint32, u CORO_BEGIN_CODE(_ctx); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_CONBARBASTATIC; - GLOBALS.bStaticTalk = true; - CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_CONBARBASTATIC); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONBARBASTATIC; + GLOBALS._bStaticTalk = true; + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_CONBARBASTATIC); CORO_END_CODE; } @@ -1056,9 +1056,9 @@ DECLARE_CUSTOM_FUNCTION(TonyConBarbaEnd)(CORO_PARAM, uint32, uint32, uint32, uin CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_CONBARBASTATIC); - GLOBALS.bStaticTalk = false; - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_CONBARBASTATIC); + GLOBALS._bStaticTalk = false; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; CORO_END_CODE; } @@ -1069,9 +1069,9 @@ DECLARE_CUSTOM_FUNCTION(TonySpaventatoStart)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_SPAVENTATOSTATIC; - GLOBALS.bStaticTalk = true; - CORO_INVOKE_1(GLOBALS.Tony->startStatic, GLOBALS.Tony->TALK_SPAVENTATOSTATIC); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SPAVENTATOSTATIC; + GLOBALS._bStaticTalk = true; + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_SPAVENTATOSTATIC); CORO_END_CODE; } @@ -1082,9 +1082,9 @@ DECLARE_CUSTOM_FUNCTION(TonySpaventatoEnd)(CORO_PARAM, uint32, uint32, uint32, u CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS.Tony->endStatic, GLOBALS.Tony->TALK_SPAVENTATOSTATIC); - GLOBALS.bStaticTalk = false; - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_SPAVENTATOSTATIC); + GLOBALS._bStaticTalk = false; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; CORO_END_CODE; } @@ -1092,7 +1092,7 @@ DECLARE_CUSTOM_FUNCTION(TonySpaventatoEnd)(CORO_PARAM, uint32, uint32, uint32, u DECLARE_CUSTOM_FUNCTION(TonySchifato)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_SCHIFATO; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SCHIFATO; } DECLARE_CUSTOM_FUNCTION(TonySniffaLeft)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -1101,8 +1101,8 @@ DECLARE_CUSTOM_FUNCTION(TonySniffaLeft)(CORO_PARAM, uint32, uint32, uint32, uint CORO_BEGIN_CODE(_ctx); - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_SNIFFA_LEFT); - CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SNIFFA_LEFT); + CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); CORO_INVOKE_4(LeftToMe, 0, 0, 0, 0); CORO_END_CODE; @@ -1114,8 +1114,8 @@ DECLARE_CUSTOM_FUNCTION(TonySniffaRight)(CORO_PARAM, uint32, uint32, uint32, uin CORO_BEGIN_CODE(_ctx); - GLOBALS.Tony->setPattern(GLOBALS.Tony->PAT_SNIFFA_RIGHT); - CORO_INVOKE_0(GLOBALS.Tony->waitForEndPattern); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SNIFFA_RIGHT); + CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); CORO_INVOKE_4(RightToMe, 0, 0, 0, 0); CORO_END_CODE; @@ -1123,48 +1123,48 @@ DECLARE_CUSTOM_FUNCTION(TonySniffaRight)(CORO_PARAM, uint32, uint32, uint32, uin DECLARE_CUSTOM_FUNCTION(TonyNaah)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NAAH; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NAAH; } DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(CORO_PARAM, uint32 nPos, uint32, uint32, uint32) { switch (nPos) { case 1: - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH1; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_MACBETH1; break; case 2: - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH2; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_MACBETH2; break; case 3: - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH3; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_MACBETH3; break; case 4: - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH4; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_MACBETH4; break; case 5: - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH5; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_MACBETH5; break; case 6: - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH6; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_MACBETH6; break; case 7: - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH7; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_MACBETH7; break; case 8: - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH8; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_MACBETH8; break; case 9: - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_MACBETH9; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_MACBETH9; break; } } 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) { - GLOBALS.Tony->hide(bShowOmbra); + GLOBALS._tony->hide(bShowOmbra); } 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); - _ctx->item = GLOBALS.Loc->getItemFromCode(nItem); + _ctx->item = GLOBALS._loc->getItemFromCode(nItem); - if (!GLOBALS.bSkipIdle && _ctx->item != NULL) - CORO_INVOKE_1(_ctx->item->waitForEndPattern, GLOBALS.hSkipIdle); + if (!GLOBALS._bSkipIdle && _ctx->item != NULL) + CORO_INVOKE_1(_ctx->item->waitForEndPattern, GLOBALS._hSkipIdle); CORO_END_CODE; } 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) { @@ -1193,16 +1193,16 @@ DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint3 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) - CORO_INVOKE_0(GLOBALS.Tony->waitForEndMovement); + if (!GLOBALS._bSkipIdle) + CORO_INVOKE_0(GLOBALS._tony->waitForEndMovement); CORO_END_CODE; } 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) { @@ -1217,9 +1217,9 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 _ctx->lx = (int32)nX; _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) { _ctx->lx -= (int32)sX; if (_ctx->lx < 0) _ctx->lx = 0; @@ -1243,8 +1243,8 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 CORO_INVOKE_0(GLOBALS.WaitFrame); GLOBALS.Freeze(); - GLOBALS.Loc->setScrollPosition(_ctx->pt); - GLOBALS.Tony->setScrollPosition(_ctx->pt); + GLOBALS._loc->setScrollPosition(_ctx->pt); + GLOBALS._tony->setScrollPosition(_ctx->pt); GLOBALS.Unfreeze(); } @@ -1276,7 +1276,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui _ctx->stepX = sX; _ctx->stepY = sY; - _ctx->startpt = GLOBALS.Loc->scrollPosition(); + _ctx->startpt = GLOBALS._loc->scrollPosition(); _ctx->dwStartTime = _vm->getTime(); @@ -1285,7 +1285,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui else _ctx->dwTotalTime = _ctx->dimy * (1000 / 35) / sY; - while ((_ctx->lx != 0 || _ctx->ly != 0) && !GLOBALS.bSkipIdle) { + while ((_ctx->lx != 0 || _ctx->ly != 0) && !GLOBALS._bSkipIdle) { _ctx->dwCurTime = _vm->getTime() - _ctx->dwStartTime; if (_ctx->dwCurTime > _ctx->dwTotalTime) break; @@ -1308,8 +1308,8 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui CORO_INVOKE_0(GLOBALS.WaitFrame); GLOBALS.Freeze(); - GLOBALS.Loc->setScrollPosition(_ctx->pt); - GLOBALS.Tony->setScrollPosition(_ctx->pt); + GLOBALS._loc->setScrollPosition(_ctx->pt); + GLOBALS._tony->setScrollPosition(_ctx->pt); GLOBALS.Unfreeze(); } @@ -1329,8 +1329,8 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui } GLOBALS.Freeze(); - GLOBALS.Loc->setScrollPosition(_ctx->pt); - GLOBALS.Tony->setScrollPosition(_ctx->pt); + GLOBALS._loc->setScrollPosition(_ctx->pt); + GLOBALS._tony->setScrollPosition(_ctx->pt); GLOBALS.Unfreeze(); CORO_END_CODE; @@ -1354,7 +1354,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uin 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); GLOBALS.Freeze(); - GLOBALS.Loc->setFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); - GLOBALS.Tony->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.Unfreeze(); _ctx->i = _vm->_randomSource.getRandomNumber(2); @@ -1397,8 +1397,8 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32 } GLOBALS.Freeze(); - GLOBALS.Loc->setFixedScroll(RMPoint(0, 0)); - GLOBALS.Tony->setFixedScroll(RMPoint(0, 0)); + GLOBALS._loc->setFixedScroll(RMPoint(0, 0)); + GLOBALS._tony->setFixedScroll(RMPoint(0, 0)); GLOBALS.Unfreeze(); 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) { assert(nChar < 16); 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]._g = 255; GLOBALS._character[nChar]._b = 255; @@ -1461,7 +1461,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->curOffset = 0; 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) { GLOBALS.Freeze(); @@ -1483,15 +1483,15 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _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) { - GLOBALS._curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); + GLOBALS._curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS._loc); if (GLOBALS._bTonyIsSpeaking) CORO_INVOKE_0(GLOBALS._curBackText->hide); } else _ctx->text = new RMTextDialog; - _ctx->text->setInput(GLOBALS.Input); + _ctx->text->setInput(GLOBALS._input); // Skipping _ctx->text->setSkipStatus(!bIsBack); @@ -1529,7 +1529,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess } // Wait for the end of display - _ctx->text->setCustomSkipHandle(GLOBALS.hSkipIdle); + _ctx->text->setCustomSkipHandle(GLOBALS._hSkipIdle); CORO_INVOKE_0(_ctx->text->waitForEndDisplay); if (_ctx->curVoc) { @@ -1559,15 +1559,15 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess } DECLARE_CUSTOM_FUNCTION(AddInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { - GLOBALS.Inventory->addItem(dwCode); + GLOBALS._inventory->addItem(dwCode); } DECLARE_CUSTOM_FUNCTION(RemoveInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { - GLOBALS.Inventory->removeItem(dwCode); + GLOBALS._inventory->removeItem(dwCode); } DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32 dwStatus, uint32, uint32) { - GLOBALS.Inventory->changeItemStatus(dwCode, dwStatus); + GLOBALS._inventory->changeItemStatus(dwCode, dwStatus); } @@ -1581,7 +1581,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, ui if (nCode == 0) GLOBALS._mCharacter[nChar]._item = NULL; 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]._g = 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) { - 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 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 _ctx->pt = RMPoint(GLOBALS._mCharacter[nChar]._x, GLOBALS._mCharacter[nChar]._y); @@ -1695,16 +1695,16 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _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 if (bIsBack) { - GLOBALS._curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); + GLOBALS._curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS._loc); if (GLOBALS._bTonyIsSpeaking) CORO_INVOKE_0(GLOBALS._curBackText->hide); } else _ctx->text = new RMTextDialog; - _ctx->text->setInput(GLOBALS.Input); + _ctx->text->setInput(GLOBALS._input); // Skipping _ctx->text->setSkipStatus(!bIsBack); @@ -1742,7 +1742,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes } // Wait for the end of display - _ctx->text->setCustomSkipHandle(GLOBALS.hSkipIdle); + _ctx->text->setCustomSkipHandle(GLOBALS._hSkipIdle); CORO_INVOKE_0(_ctx->text->waitForEndDisplay); if (_ctx->curVoc) { @@ -1810,30 +1810,30 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (nPers == 0) { _ctx->text = new RMTextDialog; _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); - if (GLOBALS.dwTonyNumTexts > 0) { - if (!GLOBALS.bTonyInTexts) { - if (GLOBALS.nTonyNextTalkType != GLOBALS.Tony->TALK_NORMAL) { - CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.nTonyNextTalkType); - if (!GLOBALS.bStaticTalk) - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; + if (GLOBALS._dwTonyNumTexts > 0) { + if (!GLOBALS._bTonyInTexts) { + if (GLOBALS._nTonyNextTalkType != GLOBALS._tony->TALK_NORMAL) { + CORO_INVOKE_1(GLOBALS._tony->startTalk, GLOBALS._nTonyNextTalkType); + if (!GLOBALS._bStaticTalk) + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; } 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 { - CORO_INVOKE_1(GLOBALS.Tony->startTalk, GLOBALS.nTonyNextTalkType); - if (!GLOBALS.bStaticTalk) - GLOBALS.nTonyNextTalkType = GLOBALS.Tony->TALK_NORMAL; + CORO_INVOKE_1(GLOBALS._tony->startTalk, GLOBALS._nTonyNextTalkType); + if (!GLOBALS._bStaticTalk) + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; } } else if (!GLOBALS._isMChar[nPers]) { _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) { GLOBALS.Freeze(); @@ -1849,7 +1849,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->text->setPosition(_ctx->pt); } else { 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 _ctx->pt = RMPoint(GLOBALS._mCharacter[nPers]._x, GLOBALS._mCharacter[nPers]._y); @@ -1874,7 +1874,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg } if (GLOBALS._mCharacter[nPers]._bAlwaysBack) { - _ctx->text = GLOBALS._curBackText = new RMTextDialogScrolling(GLOBALS.Loc); + _ctx->text = GLOBALS._curBackText = new RMTextDialogScrolling(GLOBALS._loc); if (GLOBALS._bTonyIsSpeaking) CORO_INVOKE_0(GLOBALS._curBackText->hide); @@ -1888,8 +1888,8 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->text->setPosition(_ctx->pt); } - if (!GLOBALS.bSkipIdle) { - _ctx->text->setInput(GLOBALS.Input); + if (!GLOBALS._bSkipIdle) { + _ctx->text->setInput(GLOBALS._input); if (GLOBALS._bAlwaysDisplay) { _ctx->text->setAlwaysDisplay(); _ctx->text->forceTime(); @@ -1903,7 +1903,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg } // Wait for the end of display - _ctx->text->setCustomSkipHandle(GLOBALS.hSkipIdle); + _ctx->text->setCustomSkipHandle(GLOBALS._hSkipIdle); CORO_INVOKE_0(_ctx->text->waitForEndDisplay); } @@ -1940,10 +1940,10 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg delete _ctx->text; } } else { - if ((GLOBALS.dwTonyNumTexts == 0 && GLOBALS.bTonyInTexts) || !GLOBALS.bTonyInTexts) { - CORO_INVOKE_0(GLOBALS.Tony->endTalk); - GLOBALS.dwTonyNumTexts = 0; - GLOBALS.bTonyInTexts = false; + if ((GLOBALS._dwTonyNumTexts == 0 && GLOBALS._bTonyInTexts) || !GLOBALS._bTonyInTexts) { + CORO_INVOKE_0(GLOBALS._tony->endTalk); + GLOBALS._dwTonyNumTexts = 0; + GLOBALS._bTonyInTexts = false; } delete _ctx->text; @@ -2009,13 +2009,13 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr CORO_INVOKE_0(_ctx->dc.show); // Draw the pointer - GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_NONE); + GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_NONE); mainShowMouse(); - while (!(GLOBALS.Input->mouseLeftClicked() && ((_ctx->sel = _ctx->dc.getSelection()) != -1))) { + while (!(GLOBALS._input->mouseLeftClicked() && ((_ctx->sel = _ctx->dc.getSelection()) != -1))) { CORO_INVOKE_0(GLOBALS.WaitFrame); GLOBALS.Freeze(); - CORO_INVOKE_1(_ctx->dc.doFrame, GLOBALS.Input->mousePos()); + CORO_INVOKE_1(_ctx->dc.doFrame, GLOBALS._input->mousePos()); GLOBALS.Unfreeze(); } @@ -2051,17 +2051,17 @@ DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, u // The event is operating as a mutex, so if the event is already set, wait until it's reset do { - CORO_INVOKE_3(CoroScheduler.waitForSingleObject, GLOBALS.mut[num], 0, &_ctx->expired); + CORO_INVOKE_3(CoroScheduler.waitForSingleObject, GLOBALS._mut[num], 0, &_ctx->expired); } while (!_ctx->expired); // Set the event to flag ownership - CoroScheduler.setEvent(GLOBALS.mut[num]); + CoroScheduler.setEvent(GLOBALS._mut[num]); CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { - CoroScheduler.resetEvent(GLOBALS.mut[num]); + CoroScheduler.resetEvent(GLOBALS._mut[num]); } /* @@ -2199,7 +2199,7 @@ DECLARE_CUSTOM_FUNCTION(PlaySonoriz)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint GLOBALS._bFadeOutStop = true; } - GLOBALS.lastMusic = nMusic; + GLOBALS._lastMusic = nMusic; CustPlayMusic(GLOBALS._curSonoriz, musicFiles[nMusic].name, nFX, bNoLoop ? false : true, musicFiles[nMusic].sync); } @@ -2209,9 +2209,9 @@ DECLARE_CUSTOM_FUNCTION(PlayStacchetto)(CORO_PARAM, uint32 nMusic, uint32 nFX, u DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) { if (nItem == 0) { - GLOBALS.Tony->playSfx(nSFX); + GLOBALS._tony->playSfx(nSFX); } else { - RMItem *item = GLOBALS.Loc->getItemFromCode(nItem); + RMItem *item = GLOBALS._loc->getItemFromCode(nItem); if (item) item->playSfx(nSFX); } @@ -2224,22 +2224,22 @@ void RestoreMusic(CORO_PARAM) { CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_4(PlaySonoriz, GLOBALS.lastMusic, 0, 0, 0); + CORO_INVOKE_4(PlaySonoriz, GLOBALS._lastMusic, 0, 0, 0); - if (GLOBALS.lastTappeto != 0) - CustPlayMusic(4, tappetiFile[GLOBALS.lastTappeto], 0, true); + if (GLOBALS._lastTappeto != 0) + CustPlayMusic(4, tappetiFile[GLOBALS._lastTappeto], 0, true); CORO_END_CODE; } void SaveMusic(Common::OutSaveFile *f) { - f->writeByte(GLOBALS.lastMusic); - f->writeByte(GLOBALS.lastTappeto); + f->writeByte(GLOBALS._lastMusic); + f->writeByte(GLOBALS._lastTappeto); } void LoadMusic(Common::InSaveFile *f) { - GLOBALS.lastMusic = f->readByte(); - GLOBALS.lastTappeto = f->readByte(); + GLOBALS._lastMusic = f->readByte(); + GLOBALS._lastTappeto = f->readByte(); } @@ -2273,13 +2273,13 @@ DECLARE_CUSTOM_FUNCTION(StacchettoFadeEnd)(CORO_PARAM, uint32 nStacc, uint32 bLo DECLARE_CUSTOM_FUNCTION(MustSkipIdleStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { - GLOBALS.bSkipIdle = true; - CoroScheduler.setEvent(GLOBALS.hSkipIdle); + GLOBALS._bSkipIdle = true; + CoroScheduler.setEvent(GLOBALS._hSkipIdle); } DECLARE_CUSTOM_FUNCTION(MustSkipIdleEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { - GLOBALS.bSkipIdle = false; - CoroScheduler.resetEvent(GLOBALS.hSkipIdle); + GLOBALS._bSkipIdle = false; + CoroScheduler.resetEvent(GLOBALS._hSkipIdle); } DECLARE_CUSTOM_FUNCTION(PatIrqFreeze)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { @@ -2336,7 +2336,7 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 _ctx->text = new RMTextDialog[_ctx->msg->numPeriods()]; 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 if ((*_ctx->msg)[_ctx->i][0] == '@') { @@ -2366,7 +2366,7 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 while (_ctx->startTime + dwTime * 1000 > _vm->getTime()) { CORO_INVOKE_0(GLOBALS.WaitFrame); - if (GLOBALS.Input->mouseLeftClicked() || GLOBALS.Input->mouseRightClicked()) + if (GLOBALS._input->mouseLeftClicked() || GLOBALS._input->mouseRightClicked()) break; if (_vm->getEngine()->getInput().getAsyncKeyState(Common::KEYCODE_TAB)) break; @@ -2537,12 +2537,12 @@ ASSIGN(201, MustSkipIdleEnd); END_CUSTOM_FUNCTION_MAP() void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation *loc, RMInventory *inv, RMInput *input) { - GLOBALS.Tony = tony; - GLOBALS.Pointer = ptr; - GLOBALS.Boxes = box; - GLOBALS.Loc = loc; - GLOBALS.Inventory = inv; - GLOBALS.Input = input; + GLOBALS._tony = tony; + GLOBALS._pointer = ptr; + GLOBALS._boxes = box; + GLOBALS._loc = loc; + GLOBALS._inventory = inv; + GLOBALS._input = input; GLOBALS.LoadLocation = mainLoadLocation; GLOBALS.UnloadLocation = mainUnloadLocation; @@ -2562,47 +2562,47 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation int i; for (i = 0; i < 10; i++) - GLOBALS.mut[i] = CoroScheduler.createEvent(false, false); + GLOBALS._mut[i] = CoroScheduler.createEvent(false, false); for (i = 0; i < 200; i++) - GLOBALS.tappeti[i] = 0; - - GLOBALS.tappeti[6] = T_GRILLI; - GLOBALS.tappeti[7] = T_GRILLI; - GLOBALS.tappeti[8] = T_GRILLIOV; - GLOBALS.tappeti[10] = T_GRILLI; - GLOBALS.tappeti[12] = T_GRILLI; - GLOBALS.tappeti[13] = T_GRILLIOV; - GLOBALS.tappeti[15] = T_GRILLI; - GLOBALS.tappeti[16] = T_GRILLIVENTO; - GLOBALS.tappeti[18] = T_GRILLI; - GLOBALS.tappeti[19] = T_GRILLIVENTO; - GLOBALS.tappeti[20] = T_GRILLI; - GLOBALS.tappeti[23] = T_GRILLI; - GLOBALS.tappeti[26] = T_MAREMETA; - GLOBALS.tappeti[27] = T_GRILLI; - GLOBALS.tappeti[28] = T_GRILLIVENTO; - GLOBALS.tappeti[31] = T_GRILLI; - GLOBALS.tappeti[33] = T_MARE; - GLOBALS.tappeti[35] = T_MARE; - GLOBALS.tappeti[36] = T_GRILLI; - GLOBALS.tappeti[37] = T_GRILLI; - GLOBALS.tappeti[40] = T_GRILLI; - GLOBALS.tappeti[41] = T_GRILLI; - GLOBALS.tappeti[42] = T_GRILLI; - GLOBALS.tappeti[45] = T_GRILLI; - GLOBALS.tappeti[51] = T_GRILLI; - GLOBALS.tappeti[52] = T_GRILLIVENTO1; - GLOBALS.tappeti[53] = T_GRILLI; - GLOBALS.tappeti[54] = T_GRILLI; - GLOBALS.tappeti[57] = T_VENTO; - GLOBALS.tappeti[58] = T_VENTO; - GLOBALS.tappeti[60] = T_VENTO; + GLOBALS._tappeti[i] = 0; + + GLOBALS._tappeti[6] = T_GRILLI; + GLOBALS._tappeti[7] = T_GRILLI; + GLOBALS._tappeti[8] = T_GRILLIOV; + GLOBALS._tappeti[10] = T_GRILLI; + GLOBALS._tappeti[12] = T_GRILLI; + GLOBALS._tappeti[13] = T_GRILLIOV; + GLOBALS._tappeti[15] = T_GRILLI; + GLOBALS._tappeti[16] = T_GRILLIVENTO; + GLOBALS._tappeti[18] = T_GRILLI; + GLOBALS._tappeti[19] = T_GRILLIVENTO; + GLOBALS._tappeti[20] = T_GRILLI; + GLOBALS._tappeti[23] = T_GRILLI; + GLOBALS._tappeti[26] = T_MAREMETA; + GLOBALS._tappeti[27] = T_GRILLI; + GLOBALS._tappeti[28] = T_GRILLIVENTO; + GLOBALS._tappeti[31] = T_GRILLI; + GLOBALS._tappeti[33] = T_MARE; + GLOBALS._tappeti[35] = T_MARE; + GLOBALS._tappeti[36] = T_GRILLI; + GLOBALS._tappeti[37] = T_GRILLI; + GLOBALS._tappeti[40] = T_GRILLI; + GLOBALS._tappeti[41] = T_GRILLI; + GLOBALS._tappeti[42] = T_GRILLI; + GLOBALS._tappeti[45] = T_GRILLI; + GLOBALS._tappeti[51] = T_GRILLI; + GLOBALS._tappeti[52] = T_GRILLIVENTO1; + GLOBALS._tappeti[53] = T_GRILLI; + GLOBALS._tappeti[54] = T_GRILLI; + GLOBALS._tappeti[57] = T_VENTO; + GLOBALS._tappeti[58] = T_VENTO; + GLOBALS._tappeti[60] = T_VENTO; // Create an event for the idle skipping - GLOBALS.hSkipIdle = CoroScheduler.createEvent(true, false); + GLOBALS._hSkipIdle = CoroScheduler.createEvent(true, false); } } // end of namespace Tony -- cgit v1.2.3 From d20fb7480eaccb59b11e3a5ba02b1a2b60619aaf Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 11 Jun 2012 19:22:41 +1000 Subject: TONY: Fix crash in the Tunnel Of Love --- engines/tony/custom.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 2e408a01aa..6627cd6c39 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -467,6 +467,11 @@ DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) CORO_INVOKE_0(GLOBALS.WaitFrame); + // WORKAROUND: This fixes a bug in the original source where the linked clear task + // didn't have time to be drawn and removed from the draw list before the method + // ended, thus remaining in the draw list and causing a later crash + CORO_INVOKE_0(GLOBALS.WaitFrame); + CORO_END_CODE; } -- cgit v1.2.3 From 02c8ccebcb20aa904dba3151d65a7b4fa67998fe Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 11 Jun 2012 20:24:25 +0200 Subject: TONY: Rename variables in utils.h --- engines/tony/custom.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 6627cd6c39..0cf40e5a14 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -477,7 +477,7 @@ DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) { 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) GLOBALS._tony->show(); GLOBALS.Unfreeze(); @@ -593,7 +593,7 @@ DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32, CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_4(ChangeLocation, GLOBALS._saveTonyLoc, GLOBALS._saveTonyPos.x, GLOBALS._saveTonyPos.y, 0); + CORO_INVOKE_4(ChangeLocation, GLOBALS._saveTonyLoc, GLOBALS._saveTonyPos._x, GLOBALS._saveTonyPos._y, 0); MCharResetCodes(); @@ -1299,14 +1299,14 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui if (sX) { if (_ctx->lx > 0) - _ctx->pt.x += (_ctx->dimx * _ctx->dwCurTime) / _ctx->dwTotalTime; + _ctx->pt._x += (_ctx->dimx * _ctx->dwCurTime) / _ctx->dwTotalTime; else - _ctx->pt.x -= (_ctx->dimx * _ctx->dwCurTime) / _ctx->dwTotalTime; + _ctx->pt._x -= (_ctx->dimx * _ctx->dwCurTime) / _ctx->dwTotalTime; } else { if (_ctx->ly > 0) - _ctx->pt.y += (_ctx->dimy * _ctx->dwCurTime) / _ctx->dwTotalTime; + _ctx->pt._y += (_ctx->dimy * _ctx->dwCurTime) / _ctx->dwTotalTime; else - _ctx->pt.y -= (_ctx->dimy * _ctx->dwCurTime) / _ctx->dwTotalTime; + _ctx->pt._y -= (_ctx->dimy * _ctx->dwCurTime) / _ctx->dwTotalTime; } @@ -1323,14 +1323,14 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui // Set the position finale if (sX) { if (_ctx->lx > 0) - _ctx->pt.x = _ctx->startpt.x + _ctx->dimx; + _ctx->pt._x = _ctx->startpt._x + _ctx->dimx; else - _ctx->pt.x = _ctx->startpt.x - _ctx->dimx; + _ctx->pt._x = _ctx->startpt._x - _ctx->dimx; } else { if (_ctx->ly > 0) - _ctx->pt.y = _ctx->startpt.y + _ctx->dimy; + _ctx->pt._y = _ctx->startpt._y + _ctx->dimy; else - _ctx->pt.y = _ctx->startpt.y - _ctx->dimy; + _ctx->pt._y = _ctx->startpt._y - _ctx->dimy; } GLOBALS.Freeze(); @@ -1345,12 +1345,13 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uint32 nY, uint32) { int i; - for (i = 0; i < GLOBALS._curChangedHotspot; i++) + for (i = 0; i < GLOBALS._curChangedHotspot; i++) { if (GLOBALS._changedHotspot[i]._dwCode == dwCode) { GLOBALS._changedHotspot[i]._nX = nX; GLOBALS._changedHotspot[i]._nY = nY; break; } + } if (i == GLOBALS._curChangedHotspot) { GLOBALS._changedHotspot[i]._dwCode = dwCode; -- cgit v1.2.3 From 985602a72d52acdb99599eaddbed7f7b9fce01ce Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 12 Jun 2012 00:07:50 +0200 Subject: TONY: Rename some Italian into English --- engines/tony/custom.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 0cf40e5a14..964e506099 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -184,8 +184,8 @@ DECLARE_CUSTOM_FUNCTION(RightToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { } -DECLARE_CUSTOM_FUNCTION(TonySetPalesati)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { - GLOBALS.SetPalesati(bStatus); +DECLARE_CUSTOM_FUNCTION(TonySetPerorate)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { + GLOBALS.SetPerorate(bStatus); } DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint32) { @@ -2529,7 +2529,7 @@ ASSIGN(134, CustEnableGUI) ASSIGN(135, CustDisableGUI) ASSIGN(136, ClearScreen) ASSIGN(137, PatIrqFreeze) -ASSIGN(138, TonySetPalesati) +ASSIGN(138, TonySetPerorate) ASSIGN(139, OpenInitLoadMenu) ASSIGN(140, OpenInitOptions) ASSIGN(141, SyncScrollLocation) @@ -2562,7 +2562,7 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation GLOBALS.WaitWipeEnd = mainWaitWipeEnd; GLOBALS.DisableGUI = mainDisableGUI; GLOBALS.EnableGUI = mainEnableGUI; - GLOBALS.SetPalesati = mainSetPalesati; + GLOBALS.SetPerorate = mainSetPerorate; GLOBALS._bAlwaysDisplay = false; int i; -- cgit v1.2.3 From 876d47e17d84912dbcf3e2f29339b2a792d92e95 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 12 Jun 2012 21:42:46 +0200 Subject: TONY: Translate Italian enums --- engines/tony/custom.cpp | 176 ++++++++++++++++++++++++------------------------ 1 file changed, 88 insertions(+), 88 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 964e506099..81fa5c7ad4 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -786,7 +786,7 @@ DECLARE_CUSTOM_FUNCTION(TonyFischietto)(CORO_PARAM, uint32, uint32, uint32, uint CORO_BEGIN_CODE(_ctx); - GLOBALS._tony->setPattern(GLOBALS._tony->PAT_FISCHIETTORIGHT); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WHISTLERIGHT); if (!GLOBALS._bSkipIdle) CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); @@ -826,164 +826,164 @@ DECLARE_CUSTOM_FUNCTION(TonySiIndica)(CORO_PARAM, uint32 dwText, uint32, uint32, GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SIINDICA; } -DECLARE_CUSTOM_FUNCTION(TonySpaventatoConMani)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyScaredWithHands)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SPAVENTATO; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SCARED; } -DECLARE_CUSTOM_FUNCTION(TonySpaventatoSenzaMani)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyScaredWithoutHands)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SPAVENTATO2; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SCARED2; } -DECLARE_CUSTOM_FUNCTION(TonyConMartello)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithHammer)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONMARTELLO; - GLOBALS._tony->setPattern(GLOBALS._tony->PAT_CONMARTELLO); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHHAMMER; + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHHAMMER); } -DECLARE_CUSTOM_FUNCTION(TonyConBicchiere)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithGlasses)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONBICCHIERE; - GLOBALS._tony->setPattern(GLOBALS._tony->PAT_CONBICCHIERE); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHGLASSES; + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHGLASSES); } -DECLARE_CUSTOM_FUNCTION(TonyConVerme)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithWorm)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONVERME; - GLOBALS._tony->setPattern(GLOBALS._tony->PAT_CONVERME); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHWORM; + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHWORM); } -DECLARE_CUSTOM_FUNCTION(TonyConCorda)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithRope)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONCORDA; - GLOBALS._tony->setPattern(GLOBALS._tony->PAT_CONCORDA); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHROPE; + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHROPE); } -DECLARE_CUSTOM_FUNCTION(TonyConSegretaria)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithSecretary)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONSEGRETARIA; - GLOBALS._tony->setPattern(GLOBALS._tony->PAT_CONSEGRETARIA); + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHSECRETARY; + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHSECRETARY); } -DECLARE_CUSTOM_FUNCTION(TonyConConiglioANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithRabbitANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONCONIGLIO; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHRABBIT; } -DECLARE_CUSTOM_FUNCTION(TonyConRicettaANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithRecipeANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONRICETTA; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHRECIPE; } -DECLARE_CUSTOM_FUNCTION(TonyConCarteANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithCardsANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONCARTE; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHCARDS; } -DECLARE_CUSTOM_FUNCTION(TonyConPupazzoANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONPUPAZZO; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHSNOWMAN; } -DECLARE_CUSTOM_FUNCTION(TonyConPupazzoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONPUPAZZOSTATIC; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHSNOWMANSTATIC; GLOBALS._bStaticTalk = true; - CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_CONPUPAZZOSTATIC); + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_WITHSNOWMANSTATIC); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyConPupazzoEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_CONPUPAZZOSTATIC); + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_WITHSNOWMANSTATIC); GLOBALS._bStaticTalk = false; GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyConConiglioStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithRabbitStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONCONIGLIOSTATIC; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHRABBITSTATIC; GLOBALS._bStaticTalk = true; - CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_CONCONIGLIOSTATIC); + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_WITHRABBITSTATIC); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyConConiglioEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithRabbitEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_CONCONIGLIOSTATIC); + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_WITHRABBITSTATIC); GLOBALS._bStaticTalk = false; GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyConRicettaStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithRecipeStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONRICETTASTATIC; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHRECIPESTATIC; GLOBALS._bStaticTalk = true; - CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_CONRICETTASTATIC); + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_WITHRECIPESTATIC); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyConRicettaEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithRecipeEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_CONRICETTASTATIC); + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_WITHRECIPESTATIC); GLOBALS._bStaticTalk = false; GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyConCarteStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithCardsStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONCARTESTATIC; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHCARDSSTATIC; GLOBALS._bStaticTalk = true; - CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_CONCARTESTATIC); + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_WITHCARDSSTATIC); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyConCarteEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithCardsEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_CONCARTESTATIC); + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_WITHCARDSSTATIC); GLOBALS._bStaticTalk = false; GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; @@ -1016,78 +1016,78 @@ DECLARE_CUSTOM_FUNCTION(TonyWithNotebookEnd)(CORO_PARAM, uint32, uint32, uint32, CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyConMegafonoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONMEGAFONOSTATIC; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHMEGAPHONESTATIC; GLOBALS._bStaticTalk = true; - CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_CONMEGAFONOSTATIC); + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_WITHMEGAPHONESTATIC); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyConMegafonoEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_CONMEGAFONOSTATIC); + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_WITHMEGAPHONESTATIC); GLOBALS._bStaticTalk = false; GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyConBarbaStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithBeardStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CONBARBASTATIC; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHBEARDSTATIC; GLOBALS._bStaticTalk = true; - CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_CONBARBASTATIC); + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_WITHBEARDSTATIC); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyConBarbaEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWithBeardEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_CONBARBASTATIC); + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_WITHBEARDSTATIC); GLOBALS._bStaticTalk = false; GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonySpaventatoStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyScaredStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SPAVENTATOSTATIC; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SCAREDSTATIC; GLOBALS._bStaticTalk = true; - CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_SPAVENTATOSTATIC); + CORO_INVOKE_1(GLOBALS._tony->startStatic, GLOBALS._tony->TALK_SCAREDSTATIC); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonySpaventatoEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyScaredEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_SPAVENTATOSTATIC); + CORO_INVOKE_1(GLOBALS._tony->endStatic, GLOBALS._tony->TALK_SCAREDSTATIC); GLOBALS._bStaticTalk = false; GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; @@ -2447,39 +2447,39 @@ ASSIGN(40, TonyRide) ASSIGN(41, TonyFianchi) ASSIGN(42, TonyCanta) ASSIGN(43, TonySiIndica) -ASSIGN(44, TonySpaventatoConMani) -ASSIGN(49, TonySpaventatoSenzaMani) -ASSIGN(45, TonyConBicchiere) -ASSIGN(46, TonyConVerme) -ASSIGN(47, TonyConMartello) -ASSIGN(48, TonyConCorda) -ASSIGN(90, TonyConConiglioANIM) -ASSIGN(91, TonyConRicettaANIM) -ASSIGN(92, TonyConCarteANIM) -ASSIGN(93, TonyConPupazzoANIM) -ASSIGN(94, TonyConPupazzoStart) -ASSIGN(95, TonyConPupazzoEnd) -ASSIGN(96, TonyConConiglioStart) -ASSIGN(97, TonyConConiglioEnd) -ASSIGN(98, TonyConRicettaStart) -ASSIGN(99, TonyConRicettaEnd) -ASSIGN(100, TonyConCarteStart) -ASSIGN(101, TonyConCarteEnd) +ASSIGN(44, TonyScaredWithHands) +ASSIGN(49, TonyScaredWithoutHands) +ASSIGN(45, TonyWithGlasses) +ASSIGN(46, TonyWithWorm) +ASSIGN(47, TonyWithHammer) +ASSIGN(48, TonyWithRope) +ASSIGN(90, TonyWithRabbitANIM) +ASSIGN(91, TonyWithRecipeANIM) +ASSIGN(92, TonyWithCardsANIM) +ASSIGN(93, TonyWithSnowmanANIM) +ASSIGN(94, TonyWithSnowmanStart) +ASSIGN(95, TonyWithSnowmanEnd) +ASSIGN(96, TonyWithRabbitStart) +ASSIGN(97, TonyWithRabbitEnd) +ASSIGN(98, TonyWithRecipeStart) +ASSIGN(99, TonyWithRecipeEnd) +ASSIGN(100, TonyWithCardsStart) +ASSIGN(101, TonyWithCardsEnd) ASSIGN(102, TonyWithNotebookStart) ASSIGN(103, TonyWithNotebookEnd) -ASSIGN(104, TonyConMegafonoStart) -ASSIGN(105, TonyConMegafonoEnd) -ASSIGN(106, TonyConBarbaStart) -ASSIGN(107, TonyConBarbaEnd) +ASSIGN(104, TonyWithMegaphoneStart) +ASSIGN(105, TonyWithMegaphoneEnd) +ASSIGN(106, TonyWithBeardStart) +ASSIGN(107, TonyWithBeardEnd) ASSIGN(108, TonyRidacchia) ASSIGN(109, TonySchifato) ASSIGN(110, TonyNaah) ASSIGN(111, TonyMacbeth) ASSIGN(112, TonySniffaLeft) ASSIGN(113, TonySniffaRight) -ASSIGN(114, TonySpaventatoStart) -ASSIGN(115, TonySpaventatoEnd) -ASSIGN(116, TonyConSegretaria) +ASSIGN(114, TonyScaredStart) +ASSIGN(115, TonyScaredEnd) +ASSIGN(116, TonyWithSecretary) ASSIGN(50, CharSetCode) ASSIGN(51, CharSetColor) -- cgit v1.2.3 From 5bafab9ad629595a1d270b60b2a91bd04dc1b7b9 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 13 Jun 2012 08:00:37 +0200 Subject: TONY: Translate some more Italian --- engines/tony/custom.cpp | 136 ++++++++++++++++++++++++------------------------ 1 file changed, 68 insertions(+), 68 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 81fa5c7ad4..eea134e442 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -752,23 +752,23 @@ DECLARE_CUSTOM_FUNCTION(TonyPutDown2)(CORO_PARAM, uint32, uint32, uint32, uint32 } -DECLARE_CUSTOM_FUNCTION(TonyPerTerra)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyOnTheFloor)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { if (dwParte == 0) - GLOBALS._tony->setPattern(GLOBALS._tony->PAT_PERTERRALEFT); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_ONTHEFLOORLEFT); else - GLOBALS._tony->setPattern(GLOBALS._tony->PAT_PERTERRARIGHT); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_ONTHEFLOORRIGHT); } -DECLARE_CUSTOM_FUNCTION(TonySiRialza)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyGetUp)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); if (dwParte == 0) - GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SIRIALZALEFT); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_GETUPLEFT); else - GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SIRIALZARIGHT); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_GETUPRIGHT); if (!GLOBALS._bSkipIdle) CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); @@ -776,11 +776,11 @@ DECLARE_CUSTOM_FUNCTION(TonySiRialza)(CORO_PARAM, uint32 dwParte, uint32, uint32 CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyPastorella)(CORO_PARAM, uint32 bIsPast, uint32, uint32, uint32) { - GLOBALS._tony->setPastorella(bIsPast); +DECLARE_CUSTOM_FUNCTION(TonyShepherdess)(CORO_PARAM, uint32 bIsPast, uint32, uint32, uint32) { + GLOBALS._tony->setShepherdess(bIsPast); } -DECLARE_CUSTOM_FUNCTION(TonyFischietto)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyWhistle)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -806,7 +806,7 @@ DECLARE_CUSTOM_FUNCTION(TonyRide)(CORO_PARAM, uint32 dwText, uint32, uint32, uin GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_RIDE; } -DECLARE_CUSTOM_FUNCTION(TonyRidacchia)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyGiggle)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_RIDE2; } @@ -816,14 +816,14 @@ DECLARE_CUSTOM_FUNCTION(TonyFianchi)(CORO_PARAM, uint32 dwText, uint32, uint32, GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_FIANCHI; } -DECLARE_CUSTOM_FUNCTION(TonyCanta)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySing)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_CANTA; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SING; } -DECLARE_CUSTOM_FUNCTION(TonySiIndica)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyIndicate)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SIINDICA; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_INDICATE; } DECLARE_CUSTOM_FUNCTION(TonyScaredWithHands)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { @@ -1095,31 +1095,31 @@ DECLARE_CUSTOM_FUNCTION(TonyScaredEnd)(CORO_PARAM, uint32, uint32, uint32, uint3 } -DECLARE_CUSTOM_FUNCTION(TonySchifato)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyDisgusted)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SCHIFATO; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_DISGUSTED; } -DECLARE_CUSTOM_FUNCTION(TonySniffaLeft)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySniffLeft)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SNIFFA_LEFT); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SNIFF_LEFT); CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); CORO_INVOKE_4(LeftToMe, 0, 0, 0, 0); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonySniffaRight)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySniffRight)(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SNIFFA_RIGHT); + GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SNIFF_RIGHT); CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); CORO_INVOKE_4(RightToMe, 0, 0, 0, 0); @@ -1168,8 +1168,8 @@ DECLARE_CUSTOM_FUNCTION(EnableTony)(CORO_PARAM, uint32, uint32, uint32, uint32) GLOBALS._tony->show(); } -DECLARE_CUSTOM_FUNCTION(DisableTony)(CORO_PARAM, uint32 bShowOmbra, uint32, uint32, uint32) { - GLOBALS._tony->hide(bShowOmbra); +DECLARE_CUSTOM_FUNCTION(DisableTony)(CORO_PARAM, uint32 bShowShadow, uint32, uint32, uint32) { + GLOBALS._tony->hide(bShowShadow); } DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uint32, uint32) { @@ -2438,63 +2438,63 @@ ASSIGN(75, TonyPutUp2) ASSIGN(76, TonyPutMid2) ASSIGN(77, TonyPutDown2) -ASSIGN(36, TonyPerTerra) -ASSIGN(37, TonySiRialza) -ASSIGN(38, TonyPastorella) -ASSIGN(39, TonyFischietto) +ASSIGN(36, TonyOnTheFloor) +ASSIGN(37, TonyGetUp) +ASSIGN(38, TonyShepherdess) +ASSIGN(39, TonyWhistle) ASSIGN(40, TonyRide) ASSIGN(41, TonyFianchi) -ASSIGN(42, TonyCanta) -ASSIGN(43, TonySiIndica) -ASSIGN(44, TonyScaredWithHands) -ASSIGN(49, TonyScaredWithoutHands) -ASSIGN(45, TonyWithGlasses) -ASSIGN(46, TonyWithWorm) -ASSIGN(47, TonyWithHammer) -ASSIGN(48, TonyWithRope) -ASSIGN(90, TonyWithRabbitANIM) -ASSIGN(91, TonyWithRecipeANIM) -ASSIGN(92, TonyWithCardsANIM) -ASSIGN(93, TonyWithSnowmanANIM) -ASSIGN(94, TonyWithSnowmanStart) -ASSIGN(95, TonyWithSnowmanEnd) -ASSIGN(96, TonyWithRabbitStart) -ASSIGN(97, TonyWithRabbitEnd) -ASSIGN(98, TonyWithRecipeStart) -ASSIGN(99, TonyWithRecipeEnd) -ASSIGN(100, TonyWithCardsStart) -ASSIGN(101, TonyWithCardsEnd) -ASSIGN(102, TonyWithNotebookStart) -ASSIGN(103, TonyWithNotebookEnd) -ASSIGN(104, TonyWithMegaphoneStart) -ASSIGN(105, TonyWithMegaphoneEnd) -ASSIGN(106, TonyWithBeardStart) -ASSIGN(107, TonyWithBeardEnd) -ASSIGN(108, TonyRidacchia) -ASSIGN(109, TonySchifato) -ASSIGN(110, TonyNaah) -ASSIGN(111, TonyMacbeth) -ASSIGN(112, TonySniffaLeft) -ASSIGN(113, TonySniffaRight) -ASSIGN(114, TonyScaredStart) -ASSIGN(115, TonyScaredEnd) -ASSIGN(116, TonyWithSecretary) +ASSIGN(42, TonySing) +ASSIGN(43, TonyIndicate) +ASSIGN(44, TonyScaredWithHands) +ASSIGN(49, TonyScaredWithoutHands) +ASSIGN(45, TonyWithGlasses) +ASSIGN(46, TonyWithWorm) +ASSIGN(47, TonyWithHammer) +ASSIGN(48, TonyWithRope) +ASSIGN(90, TonyWithRabbitANIM) +ASSIGN(91, TonyWithRecipeANIM) +ASSIGN(92, TonyWithCardsANIM) +ASSIGN(93, TonyWithSnowmanANIM) +ASSIGN(94, TonyWithSnowmanStart) +ASSIGN(95, TonyWithSnowmanEnd) +ASSIGN(96, TonyWithRabbitStart) +ASSIGN(97, TonyWithRabbitEnd) +ASSIGN(98, TonyWithRecipeStart) +ASSIGN(99, TonyWithRecipeEnd) +ASSIGN(100, TonyWithCardsStart) +ASSIGN(101, TonyWithCardsEnd) +ASSIGN(102, TonyWithNotebookStart) +ASSIGN(103, TonyWithNotebookEnd) +ASSIGN(104, TonyWithMegaphoneStart) +ASSIGN(105, TonyWithMegaphoneEnd) +ASSIGN(106, TonyWithBeardStart) +ASSIGN(107, TonyWithBeardEnd) +ASSIGN(108, TonyGiggle) +ASSIGN(109, TonyDisgusted) +ASSIGN(110, TonyNaah) +ASSIGN(111, TonyMacbeth) +ASSIGN(112, TonySniffLeft) +ASSIGN(113, TonySniffRight) +ASSIGN(114, TonyScaredStart) +ASSIGN(115, TonyScaredEnd) +ASSIGN(116, TonyWithSecretary) ASSIGN(50, CharSetCode) -ASSIGN(51, CharSetColor) +ASSIGN(51, CharSetColor) ASSIGN(52, CharSetTalkPattern) ASSIGN(53, CharSendMessage) ASSIGN(54, CharSetStartEndTalkPattern) ASSIGN(60, MCharSetCode) ASSIGN(61, MCharSetColor) -ASSIGN(62, MCharSetCurrentGroup) -ASSIGN(63, MCharSetNumTalksInGroup) -ASSIGN(64, MCharSetNumTexts) -ASSIGN(65, MCharSendMessage) -ASSIGN(66, MCharSetPosition) -ASSIGN(67, MCharSetAlwaysBack) +ASSIGN(62, MCharSetCurrentGroup) +ASSIGN(63, MCharSetNumTalksInGroup) +ASSIGN(64, MCharSetNumTexts) +ASSIGN(65, MCharSendMessage) +ASSIGN(66, MCharSetPosition) +ASSIGN(67, MCharSetAlwaysBack) ASSIGN(68, MCharResetCode) ASSIGN(70, StartDialog) -- cgit v1.2.3 From 638b06660141677421aa7a342a606b0e4e593389 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 16 Jun 2012 11:09:08 +0200 Subject: TONY: Translate some Italian terms, rename enums --- engines/tony/custom.cpp | 420 ++++++++++++++++++++++++------------------------ 1 file changed, 208 insertions(+), 212 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index eea134e442..9acdc84932 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -92,7 +92,7 @@ const MusicFileEntry musicFiles[] = { }; -const char *staccFileNames[] = { +const char *jingleFileNames[] = { "S00.ADP", "S01.ADP", "S02.ADP", "S03.ADP", "S04.ADP", "S05.ADP", @@ -499,8 +499,8 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMessage)(CORO_PARAM, uint32 nMsg, uint32 n CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(NoOcchioDiBue)(CORO_PARAM, uint32, uint32, uint32, uint32) { - GLOBALS._bNoOcchioDiBue = true; +DECLARE_CUSTOM_FUNCTION(NoBullsEye)(CORO_PARAM, uint32, uint32, uint32, uint32) { + GLOBALS._bNoBullsEye = true; } DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -509,7 +509,7 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 CORO_BEGIN_CODE(_ctx); - if (!GLOBALS._bNoOcchioDiBue) { + if (!GLOBALS._bNoBullsEye) { GLOBALS.InitWipe(1); CORO_INVOKE_0(GLOBALS.WaitWipeEnd); } @@ -531,7 +531,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint CORO_BEGIN_CODE(_ctx); - if (!GLOBALS._bNoOcchioDiBue) { + if (!GLOBALS._bNoBullsEye) { GLOBALS.InitWipe(1); CORO_INVOKE_0(GLOBALS.WaitWipeEnd); } @@ -555,7 +555,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint _vm->playMusic(4, tappetiFile[GLOBALS._lastTappeto], 0, true, 2000); } - if (!GLOBALS._bNoOcchioDiBue) { + if (!GLOBALS._bNoBullsEye) { GLOBALS.InitWipe(2); } @@ -564,12 +564,12 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint _ctx->h = mpalQueryDoAction(0, nLoc, 0); - if (!GLOBALS._bNoOcchioDiBue) { + if (!GLOBALS._bNoBullsEye) { CORO_INVOKE_0(GLOBALS.WaitWipeEnd); GLOBALS.CloseWipe(); } - GLOBALS._bNoOcchioDiBue = false; + GLOBALS._bNoBullsEye = false; // On Enter? if (_ctx->h != CORO_INVALID_PID_VALUE) @@ -1372,7 +1372,7 @@ DECLARE_CUSTOM_FUNCTION(AbortGame)(CORO_PARAM, uint32, uint32, uint32, uint32) { _vm->abortGame(); } -DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; uint32 i; uint32 curTime; @@ -2131,7 +2131,7 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { if (!GLOBALS._bFadeOutStop) _vm->setMusicVolume(nChannel, 0); - // If there is a stacchetto, stop all + // If a jingle is played, stop it if (nChannel == 2) _vm->stopMusic(2); @@ -2142,55 +2142,51 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(FadeInSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - CoroScheduler.createProcess(ThreadFadeInMusic, &GLOBALS._curSonoriz, sizeof(int)); +DECLARE_CUSTOM_FUNCTION(FadeInSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) { + CoroScheduler.createProcess(ThreadFadeInMusic, &GLOBALS._curSoundEffect, sizeof(int)); } -DECLARE_CUSTOM_FUNCTION(FadeOutSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(FadeOutSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._bFadeOutStop = false; - CoroScheduler.createProcess(ThreadFadeOutMusic, &GLOBALS._curSonoriz, sizeof(int)); + CoroScheduler.createProcess(ThreadFadeOutMusic, &GLOBALS._curSoundEffect, sizeof(int)); } -DECLARE_CUSTOM_FUNCTION(FadeOutStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(FadeOutJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._bFadeOutStop = false; int channel = 2; CoroScheduler.createProcess(ThreadFadeOutMusic, &channel, sizeof(int)); } -DECLARE_CUSTOM_FUNCTION(FadeInStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(FadeInJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) { int channel = 2; CoroScheduler.createProcess(ThreadFadeInMusic, &channel, sizeof(int)); } -DECLARE_CUSTOM_FUNCTION(StopSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->stopMusic(GLOBALS._curSonoriz); +DECLARE_CUSTOM_FUNCTION(StopSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) { + _vm->stopMusic(GLOBALS._curSoundEffect); } -DECLARE_CUSTOM_FUNCTION(StopStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(StopJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) { _vm->stopMusic(2); } -DECLARE_CUSTOM_FUNCTION(MuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->setMusicVolume(GLOBALS._curSonoriz, 0); +DECLARE_CUSTOM_FUNCTION(MuteSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) { + _vm->setMusicVolume(GLOBALS._curSoundEffect, 0); } -DECLARE_CUSTOM_FUNCTION(DemuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(DemuteSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._bFadeOutStop = true; - _vm->setMusicVolume(GLOBALS._curSonoriz, 64); + _vm->setMusicVolume(GLOBALS._curSoundEffect, 64); } -DECLARE_CUSTOM_FUNCTION(MuteStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(MuteJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) { _vm->setMusicVolume(2, 0); } -DECLARE_CUSTOM_FUNCTION(DemuteStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(DemuteJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) { _vm->setMusicVolume(2, 64); } - - - - void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int nSync = 0) { if (nSync == 0) nSync = 2000; @@ -2199,18 +2195,18 @@ void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int debug("End CustPlayMusic"); } -DECLARE_CUSTOM_FUNCTION(PlaySonoriz)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) { +DECLARE_CUSTOM_FUNCTION(PlaySoundEffect)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) { if (nFX == 0 || nFX == 1 || nFX == 2) { - debug("PlaySonoriz stop fadeout"); + debug("PlaySoundEffect stop fadeout"); GLOBALS._bFadeOutStop = true; } GLOBALS._lastMusic = nMusic; - CustPlayMusic(GLOBALS._curSonoriz, musicFiles[nMusic].name, nFX, bNoLoop ? false : true, musicFiles[nMusic].sync); + CustPlayMusic(GLOBALS._curSoundEffect, musicFiles[nMusic].name, nFX, bNoLoop ? false : true, musicFiles[nMusic].sync); } -DECLARE_CUSTOM_FUNCTION(PlayStacchetto)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) { - CustPlayMusic(2, staccFileNames[nMusic], nFX, bLoop); +DECLARE_CUSTOM_FUNCTION(PlayJingle)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) { + CustPlayMusic(2, jingleFileNames[nMusic], nFX, bLoop); } DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) { @@ -2230,7 +2226,7 @@ void RestoreMusic(CORO_PARAM) { CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_4(PlaySonoriz, GLOBALS._lastMusic, 0, 0, 0); + CORO_INVOKE_4(PlaySoundEffect, GLOBALS._lastMusic, 0, 0, 0); if (GLOBALS._lastTappeto != 0) CustPlayMusic(4, tappetiFile[GLOBALS._lastTappeto], 0, true); @@ -2249,28 +2245,28 @@ void LoadMusic(Common::InSaveFile *f) { } -DECLARE_CUSTOM_FUNCTION(StacchettoFadeStart)(CORO_PARAM, uint32 nStacc, uint32 bLoop, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(JingleFadeStart)(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_4(FadeOutSonoriz, 0, 0, 0, 0); - CORO_INVOKE_4(MuteStacchetto, 0, 0, 0, 0); - CORO_INVOKE_4(PlayStacchetto, nStacc, 0, bLoop, 0); - CORO_INVOKE_4(FadeInStacchetto, 0, 0, 0, 0); + CORO_INVOKE_4(FadeOutSoundEffect, 0, 0, 0, 0); + CORO_INVOKE_4(MuteJingle, 0, 0, 0, 0); + CORO_INVOKE_4(PlayJingle, nJingle, 0, bLoop, 0); + CORO_INVOKE_4(FadeInJingle, 0, 0, 0, 0); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(StacchettoFadeEnd)(CORO_PARAM, uint32 nStacc, uint32 bLoop, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(JingleFadeEnd)(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_4(FadeOutStacchetto, 0, 0, 0, 0); - CORO_INVOKE_4(FadeInSonoriz, 0, 0, 0, 0); + CORO_INVOKE_4(FadeOutJingle, 0, 0, 0, 0); + CORO_INVOKE_4(FadeInSoundEffect, 0, 0, 0, 0); CORO_END_CODE; } @@ -2396,146 +2392,146 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 BEGIN_CUSTOM_FUNCTION_MAP() ASSIGN(1, CustLoadLocation) -ASSIGN(2, MySleep) +ASSIGN(2, MySleep) ASSIGN(3, SetPointer) ASSIGN(5, MoveTony) -ASSIGN(6, FaceToMe) -ASSIGN(7, BackToMe) -ASSIGN(8, LeftToMe) -ASSIGN(9, RightToMe) -ASSIGN(10, SendTonyMessage) -ASSIGN(11, ChangeBoxStatus) -ASSIGN(12, ChangeLocation) -ASSIGN(13, DisableTony) -ASSIGN(14, EnableTony) -ASSIGN(15, WaitForPatternEnd) -ASSIGN(16, SetLocStartPosition) -ASSIGN(17, ScrollLocation) -ASSIGN(18, MoveTonyAndWait) -ASSIGN(19, ChangeHotspot) -ASSIGN(20, AddInventory) -ASSIGN(21, RemoveInventory) -ASSIGN(22, ChangeInventoryStatus) -ASSIGN(23, SetTonyPosition) -ASSIGN(24, SendFullscreenMessage) -ASSIGN(25, SaveTonyPosition) -ASSIGN(26, RestoreTonyPosition) -ASSIGN(27, DisableInput) -ASSIGN(28, EnableInput) -ASSIGN(29, StopTony) - -ASSIGN(30, TonyTakeUp1) -ASSIGN(31, TonyTakeMid1) -ASSIGN(32, TonyTakeDown1) -ASSIGN(33, TonyTakeUp2) -ASSIGN(34, TonyTakeMid2) -ASSIGN(35, TonyTakeDown2) - -ASSIGN(72, TonyPutUp1) -ASSIGN(73, TonyPutMid1) -ASSIGN(74, TonyPutDown1) -ASSIGN(75, TonyPutUp2) -ASSIGN(76, TonyPutMid2) -ASSIGN(77, TonyPutDown2) - -ASSIGN(36, TonyOnTheFloor) -ASSIGN(37, TonyGetUp) -ASSIGN(38, TonyShepherdess) -ASSIGN(39, TonyWhistle) - -ASSIGN(40, TonyRide) -ASSIGN(41, TonyFianchi) -ASSIGN(42, TonySing) -ASSIGN(43, TonyIndicate) -ASSIGN(44, TonyScaredWithHands) -ASSIGN(49, TonyScaredWithoutHands) -ASSIGN(45, TonyWithGlasses) -ASSIGN(46, TonyWithWorm) -ASSIGN(47, TonyWithHammer) -ASSIGN(48, TonyWithRope) -ASSIGN(90, TonyWithRabbitANIM) -ASSIGN(91, TonyWithRecipeANIM) -ASSIGN(92, TonyWithCardsANIM) -ASSIGN(93, TonyWithSnowmanANIM) -ASSIGN(94, TonyWithSnowmanStart) -ASSIGN(95, TonyWithSnowmanEnd) -ASSIGN(96, TonyWithRabbitStart) -ASSIGN(97, TonyWithRabbitEnd) -ASSIGN(98, TonyWithRecipeStart) -ASSIGN(99, TonyWithRecipeEnd) -ASSIGN(100, TonyWithCardsStart) -ASSIGN(101, TonyWithCardsEnd) -ASSIGN(102, TonyWithNotebookStart) -ASSIGN(103, TonyWithNotebookEnd) -ASSIGN(104, TonyWithMegaphoneStart) -ASSIGN(105, TonyWithMegaphoneEnd) -ASSIGN(106, TonyWithBeardStart) -ASSIGN(107, TonyWithBeardEnd) -ASSIGN(108, TonyGiggle) -ASSIGN(109, TonyDisgusted) -ASSIGN(110, TonyNaah) -ASSIGN(111, TonyMacbeth) -ASSIGN(112, TonySniffLeft) -ASSIGN(113, TonySniffRight) -ASSIGN(114, TonyScaredStart) -ASSIGN(115, TonyScaredEnd) -ASSIGN(116, TonyWithSecretary) - -ASSIGN(50, CharSetCode) -ASSIGN(51, CharSetColor) -ASSIGN(52, CharSetTalkPattern) -ASSIGN(53, CharSendMessage) -ASSIGN(54, CharSetStartEndTalkPattern) - -ASSIGN(60, MCharSetCode) -ASSIGN(61, MCharSetColor) -ASSIGN(62, MCharSetCurrentGroup) -ASSIGN(63, MCharSetNumTalksInGroup) -ASSIGN(64, MCharSetNumTexts) -ASSIGN(65, MCharSendMessage) -ASSIGN(66, MCharSetPosition) -ASSIGN(67, MCharSetAlwaysBack) -ASSIGN(68, MCharResetCode) - -ASSIGN(70, StartDialog) -ASSIGN(71, SendDialogMessage) - -ASSIGN(80, TakeOwnership) -ASSIGN(81, ReleaseOwnership) - -ASSIGN(86, PlaySonoriz) -ASSIGN(87, PlayStacchetto) -ASSIGN(88, FadeInSonoriz) -ASSIGN(89, FadeOutSonoriz) -ASSIGN(123, FadeInStacchetto) -ASSIGN(124, FadeOutStacchetto) -ASSIGN(125, MuteSonoriz) -ASSIGN(126, DemuteSonoriz) -ASSIGN(127, MuteStacchetto) -ASSIGN(128, DemuteStacchetto) -ASSIGN(84, StopSonoriz) -ASSIGN(85, StopStacchetto) -ASSIGN(83, PlayItemSfx) -ASSIGN(129, StacchettoFadeStart) -ASSIGN(130, StacchettoFadeEnd) - -ASSIGN(120, TremaSchermo) -ASSIGN(121, AutoSave) -ASSIGN(122, AbortGame) -ASSIGN(131, NoOcchioDiBue) -ASSIGN(132, SendFullscreenMsgStart) -ASSIGN(133, SendFullscreenMsgEnd) -ASSIGN(134, CustEnableGUI) -ASSIGN(135, CustDisableGUI) -ASSIGN(136, ClearScreen) -ASSIGN(137, PatIrqFreeze) -ASSIGN(138, TonySetPerorate) -ASSIGN(139, OpenInitLoadMenu) -ASSIGN(140, OpenInitOptions) -ASSIGN(141, SyncScrollLocation) -ASSIGN(142, CloseLocation) -ASSIGN(143, SetAlwaysDisplay) -ASSIGN(144, DoCredits) +ASSIGN(6, FaceToMe) +ASSIGN(7, BackToMe) +ASSIGN(8, LeftToMe) +ASSIGN(9, RightToMe) +ASSIGN(10, SendTonyMessage) +ASSIGN(11, ChangeBoxStatus) +ASSIGN(12, ChangeLocation) +ASSIGN(13, DisableTony) +ASSIGN(14, EnableTony) +ASSIGN(15, WaitForPatternEnd) +ASSIGN(16, SetLocStartPosition) +ASSIGN(17, ScrollLocation) +ASSIGN(18, MoveTonyAndWait) +ASSIGN(19, ChangeHotspot) +ASSIGN(20, AddInventory) +ASSIGN(21, RemoveInventory) +ASSIGN(22, ChangeInventoryStatus) +ASSIGN(23, SetTonyPosition) +ASSIGN(24, SendFullscreenMessage) +ASSIGN(25, SaveTonyPosition) +ASSIGN(26, RestoreTonyPosition) +ASSIGN(27, DisableInput) +ASSIGN(28, EnableInput) +ASSIGN(29, StopTony) + +ASSIGN(30, TonyTakeUp1) +ASSIGN(31, TonyTakeMid1) +ASSIGN(32, TonyTakeDown1) +ASSIGN(33, TonyTakeUp2) +ASSIGN(34, TonyTakeMid2) +ASSIGN(35, TonyTakeDown2) + +ASSIGN(72, TonyPutUp1) +ASSIGN(73, TonyPutMid1) +ASSIGN(74, TonyPutDown1) +ASSIGN(75, TonyPutUp2) +ASSIGN(76, TonyPutMid2) +ASSIGN(77, TonyPutDown2) + +ASSIGN(36, TonyOnTheFloor) +ASSIGN(37, TonyGetUp) +ASSIGN(38, TonyShepherdess) +ASSIGN(39, TonyWhistle) + +ASSIGN(40, TonyRide) +ASSIGN(41, TonyFianchi) +ASSIGN(42, TonySing) +ASSIGN(43, TonyIndicate) +ASSIGN(44, TonyScaredWithHands) +ASSIGN(49, TonyScaredWithoutHands) +ASSIGN(45, TonyWithGlasses) +ASSIGN(46, TonyWithWorm) +ASSIGN(47, TonyWithHammer) +ASSIGN(48, TonyWithRope) +ASSIGN(90, TonyWithRabbitANIM) +ASSIGN(91, TonyWithRecipeANIM) +ASSIGN(92, TonyWithCardsANIM) +ASSIGN(93, TonyWithSnowmanANIM) +ASSIGN(94, TonyWithSnowmanStart) +ASSIGN(95, TonyWithSnowmanEnd) +ASSIGN(96, TonyWithRabbitStart) +ASSIGN(97, TonyWithRabbitEnd) +ASSIGN(98, TonyWithRecipeStart) +ASSIGN(99, TonyWithRecipeEnd) +ASSIGN(100, TonyWithCardsStart) +ASSIGN(101, TonyWithCardsEnd) +ASSIGN(102, TonyWithNotebookStart) +ASSIGN(103, TonyWithNotebookEnd) +ASSIGN(104, TonyWithMegaphoneStart) +ASSIGN(105, TonyWithMegaphoneEnd) +ASSIGN(106, TonyWithBeardStart) +ASSIGN(107, TonyWithBeardEnd) +ASSIGN(108, TonyGiggle) +ASSIGN(109, TonyDisgusted) +ASSIGN(110, TonyNaah) +ASSIGN(111, TonyMacbeth) +ASSIGN(112, TonySniffLeft) +ASSIGN(113, TonySniffRight) +ASSIGN(114, TonyScaredStart) +ASSIGN(115, TonyScaredEnd) +ASSIGN(116, TonyWithSecretary) + +ASSIGN(50, CharSetCode) +ASSIGN(51, CharSetColor) +ASSIGN(52, CharSetTalkPattern) +ASSIGN(53, CharSendMessage) +ASSIGN(54, CharSetStartEndTalkPattern) + +ASSIGN(60, MCharSetCode) +ASSIGN(61, MCharSetColor) +ASSIGN(62, MCharSetCurrentGroup) +ASSIGN(63, MCharSetNumTalksInGroup) +ASSIGN(64, MCharSetNumTexts) +ASSIGN(65, MCharSendMessage) +ASSIGN(66, MCharSetPosition) +ASSIGN(67, MCharSetAlwaysBack) +ASSIGN(68, MCharResetCode) + +ASSIGN(70, StartDialog) +ASSIGN(71, SendDialogMessage) + +ASSIGN(80, TakeOwnership) +ASSIGN(81, ReleaseOwnership) + +ASSIGN(86, PlaySoundEffect) +ASSIGN(87, PlayJingle) +ASSIGN(88, FadeInSoundEffect) +ASSIGN(89, FadeOutSoundEffect) +ASSIGN(123, FadeInJingle) +ASSIGN(124, FadeOutJingle) +ASSIGN(125, MuteSoundEffect) +ASSIGN(126, DemuteSoundEffect) +ASSIGN(127, MuteJingle) +ASSIGN(128, DemuteJingle) +ASSIGN(84, StopSoundEffect) +ASSIGN(85, StopJingle) +ASSIGN(83, PlayItemSfx) +ASSIGN(129, JingleFadeStart) +ASSIGN(130, JingleFadeEnd) + +ASSIGN(120, ShakeScreen) +ASSIGN(121, AutoSave) +ASSIGN(122, AbortGame) +ASSIGN(131, NoBullsEye) +ASSIGN(132, SendFullscreenMsgStart) +ASSIGN(133, SendFullscreenMsgEnd) +ASSIGN(134, CustEnableGUI) +ASSIGN(135, CustDisableGUI) +ASSIGN(136, ClearScreen) +ASSIGN(137, PatIrqFreeze) +ASSIGN(138, TonySetPerorate) +ASSIGN(139, OpenInitLoadMenu) +ASSIGN(140, OpenInitOptions) +ASSIGN(141, SyncScrollLocation) +ASSIGN(142, CloseLocation) +ASSIGN(143, SetAlwaysDisplay) +ASSIGN(144, DoCredits) ASSIGN(200, MustSkipIdleStart); ASSIGN(201, MustSkipIdleEnd); @@ -2573,37 +2569,37 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation for (i = 0; i < 200; i++) GLOBALS._tappeti[i] = 0; - GLOBALS._tappeti[6] = T_GRILLI; - GLOBALS._tappeti[7] = T_GRILLI; - GLOBALS._tappeti[8] = T_GRILLIOV; - GLOBALS._tappeti[10] = T_GRILLI; - GLOBALS._tappeti[12] = T_GRILLI; - GLOBALS._tappeti[13] = T_GRILLIOV; - GLOBALS._tappeti[15] = T_GRILLI; - GLOBALS._tappeti[16] = T_GRILLIVENTO; - GLOBALS._tappeti[18] = T_GRILLI; - GLOBALS._tappeti[19] = T_GRILLIVENTO; - GLOBALS._tappeti[20] = T_GRILLI; - GLOBALS._tappeti[23] = T_GRILLI; - GLOBALS._tappeti[26] = T_MAREMETA; - GLOBALS._tappeti[27] = T_GRILLI; - GLOBALS._tappeti[28] = T_GRILLIVENTO; - GLOBALS._tappeti[31] = T_GRILLI; - GLOBALS._tappeti[33] = T_MARE; - GLOBALS._tappeti[35] = T_MARE; - GLOBALS._tappeti[36] = T_GRILLI; - GLOBALS._tappeti[37] = T_GRILLI; - GLOBALS._tappeti[40] = T_GRILLI; - GLOBALS._tappeti[41] = T_GRILLI; - GLOBALS._tappeti[42] = T_GRILLI; - GLOBALS._tappeti[45] = T_GRILLI; - GLOBALS._tappeti[51] = T_GRILLI; - GLOBALS._tappeti[52] = T_GRILLIVENTO1; - GLOBALS._tappeti[53] = T_GRILLI; - GLOBALS._tappeti[54] = T_GRILLI; - GLOBALS._tappeti[57] = T_VENTO; - GLOBALS._tappeti[58] = T_VENTO; - GLOBALS._tappeti[60] = T_VENTO; + GLOBALS._tappeti[6] = TAPPETI_GRILLI; + GLOBALS._tappeti[7] = TAPPETI_GRILLI; + GLOBALS._tappeti[8] = TAPPETI_GRILLIOV; + GLOBALS._tappeti[10] = TAPPETI_GRILLI; + GLOBALS._tappeti[12] = TAPPETI_GRILLI; + GLOBALS._tappeti[13] = TAPPETI_GRILLIOV; + GLOBALS._tappeti[15] = TAPPETI_GRILLI; + GLOBALS._tappeti[16] = TAPPETI_GRILLIVENTO; + GLOBALS._tappeti[18] = TAPPETI_GRILLI; + GLOBALS._tappeti[19] = TAPPETI_GRILLIVENTO; + GLOBALS._tappeti[20] = TAPPETI_GRILLI; + GLOBALS._tappeti[23] = TAPPETI_GRILLI; + GLOBALS._tappeti[26] = TAPPETI_MAREMETA; + GLOBALS._tappeti[27] = TAPPETI_GRILLI; + GLOBALS._tappeti[28] = TAPPETI_GRILLIVENTO; + GLOBALS._tappeti[31] = TAPPETI_GRILLI; + GLOBALS._tappeti[33] = TAPPETI_MARE; + GLOBALS._tappeti[35] = TAPPETI_MARE; + GLOBALS._tappeti[36] = TAPPETI_GRILLI; + GLOBALS._tappeti[37] = TAPPETI_GRILLI; + GLOBALS._tappeti[40] = TAPPETI_GRILLI; + GLOBALS._tappeti[41] = TAPPETI_GRILLI; + GLOBALS._tappeti[42] = TAPPETI_GRILLI; + GLOBALS._tappeti[45] = TAPPETI_GRILLI; + GLOBALS._tappeti[51] = TAPPETI_GRILLI; + GLOBALS._tappeti[52] = TAPPETI_GRILLIVENTO1; + GLOBALS._tappeti[53] = TAPPETI_GRILLI; + GLOBALS._tappeti[54] = TAPPETI_GRILLI; + GLOBALS._tappeti[57] = TAPPETI_VENTO; + GLOBALS._tappeti[58] = TAPPETI_VENTO; + GLOBALS._tappeti[60] = TAPPETI_VENTO; -- cgit v1.2.3 From ddd1414a56568d62348e56ccc907b8ba7bb296eb Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 16 Jun 2012 11:32:50 +0200 Subject: TONY: Rename sound functions and class names --- engines/tony/custom.cpp | 72 +++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 35 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 9acdc84932..ef4f889a12 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -253,7 +253,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX int i; int curOffset; VoiceHeader *curVoc; - FPSFX *voice; + FPSfx *voice; RMTextDialog text; CORO_END_CONTEXT(_ctx); @@ -276,12 +276,12 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX // First time allocation _vm->_vdbFP.seek(_ctx->curOffset); - _vm->_theSound.CreateSfx(&_ctx->voice); + _vm->_theSound.createSfx(&_ctx->voice); - _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); + _ctx->voice->loadVoiceFromVDB(_vm->_vdbFP); _ctx->curOffset = _vm->_vdbFP.pos(); - _ctx->voice->SetLoop(false); + _ctx->voice->setLoop(false); } if (GLOBALS._nTonyNextTalkType != GLOBALS._tony->TALK_NORMAL) { @@ -330,16 +330,16 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX if (_ctx->curVoc) { if (_ctx->i == 0) { - _ctx->voice->Play(); + _ctx->voice->play(); _ctx->text.setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } else { _vm->_vdbFP.seek(_ctx->curOffset); - _vm->_theSound.CreateSfx(&_ctx->voice); - _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); + _vm->_theSound.createSfx(&_ctx->voice); + _ctx->voice->loadVoiceFromVDB(_vm->_vdbFP); _ctx->curOffset = _vm->_vdbFP.pos(); - _ctx->voice->SetLoop(false); - _ctx->voice->Play(); + _ctx->voice->setLoop(false); + _ctx->voice->play(); _ctx->text.setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } } @@ -349,8 +349,8 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX CORO_INVOKE_0(_ctx->text.waitForEndDisplay); if (_ctx->curVoc) { - _ctx->voice->Stop(); - _ctx->voice->Release(); + _ctx->voice->stop(); + _ctx->voice->release(); _ctx->voice = NULL; } } @@ -1458,7 +1458,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess RMTextDialog *text; int curOffset; VoiceHeader *curVoc; - FPSFX *voice; + FPSfx *voice; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -1524,12 +1524,12 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { - _vm->_theSound.CreateSfx(&_ctx->voice); + _vm->_theSound.createSfx(&_ctx->voice); _vm->_vdbFP.seek(_ctx->curOffset); - _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); - _ctx->voice->SetLoop(false); - if (bIsBack) _ctx->voice->SetVolume(55); - _ctx->voice->Play(); + _ctx->voice->loadVoiceFromVDB(_vm->_vdbFP); + _ctx->voice->setLoop(false); + if (bIsBack) _ctx->voice->setVolume(55); + _ctx->voice->play(); _ctx->text->setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); _ctx->curOffset = _vm->_vdbFP.pos(); } @@ -1539,8 +1539,8 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess CORO_INVOKE_0(_ctx->text->waitForEndDisplay); if (_ctx->curVoc) { - _ctx->voice->Stop(); - _ctx->voice->Release(); + _ctx->voice->stop(); + _ctx->voice->release(); _ctx->voice = NULL; } @@ -1662,7 +1662,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes RMTextDialog *text; int curOffset; VoiceHeader *curVoc; - FPSFX *voice; + FPSfx *voice; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); @@ -1737,12 +1737,13 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { - _vm->_theSound.CreateSfx(&_ctx->voice); + _vm->_theSound.createSfx(&_ctx->voice); _vm->_vdbFP.seek(_ctx->curOffset); - _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); - _ctx->voice->SetLoop(false); - if (bIsBack) _ctx->voice->SetVolume(55); - _ctx->voice->Play(); + _ctx->voice->loadVoiceFromVDB(_vm->_vdbFP); + _ctx->voice->setLoop(false); + if (bIsBack) + _ctx->voice->setVolume(55); + _ctx->voice->play(); _ctx->text->setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); _ctx->curOffset = _vm->_vdbFP.pos(); } @@ -1752,8 +1753,8 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes CORO_INVOKE_0(_ctx->text->waitForEndDisplay); if (_ctx->curVoc) { - _ctx->voice->Stop(); - _ctx->voice->Release(); + _ctx->voice->stop(); + _ctx->voice->release(); _ctx->voice = NULL; } @@ -1787,7 +1788,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg uint32 h; bool bIsBack; VoiceHeader *curVoc; - FPSFX *voice; + FPSfx *voice; RMPoint pt; CORO_END_CONTEXT(_ctx); @@ -1805,10 +1806,11 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (_ctx->curVoc) { // Position within the database of entries, beginning at the first _vm->_vdbFP.seek(_ctx->curVoc->_offset); - _vm->_theSound.CreateSfx(&_ctx->voice); - _ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP); - _ctx->voice->SetLoop(false); - if (_ctx->bIsBack) _ctx->voice->SetVolume(55); + _vm->_theSound.createSfx(&_ctx->voice); + _ctx->voice->loadVoiceFromVDB(_vm->_vdbFP); + _ctx->voice->setLoop(false); + if (_ctx->bIsBack) + _ctx->voice->setVolume(55); } _ctx->string = mpalQueryDialogPeriod(nMsg); @@ -1904,7 +1906,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { - _ctx->voice->Play(); + _ctx->voice->play(); _ctx->text->setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } @@ -1914,8 +1916,8 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg } if (_ctx->curVoc) { - _ctx->voice->Stop(); - _ctx->voice->Release(); + _ctx->voice->stop(); + _ctx->voice->release(); _ctx->voice = NULL; } -- cgit v1.2.3 From 25d95bd5e357187cde9634b0379b8469cee0397d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 16 Jun 2012 22:05:06 +1000 Subject: TONY: Workaround for original game bug opening the door in the first scene In the original, after moving to the door, the game scripts have Tony start immediately moving back to the desk. Unfortunately, they didn't realise that the _hEndOfPath event would still be briefly set from finishing the walk to the door, so the game didn't wait until Tony had reached the desk to start the conversation. --- engines/tony/custom.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index ef4f889a12..160fafa47f 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1198,6 +1198,11 @@ DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint3 CORO_BEGIN_CODE(_ctx); + // WORKAROUND: Delay for a frame before starting the move to give any previous move time to finish. + // This fixes a bug in the first scene where if you immediately 'Use Door', Tony moves to the door, + // and then floats to the right rather than properly walking. + CORO_SLEEP(1); + CORO_INVOKE_1(GLOBALS._tony->move, RMPoint(nX, nY)); if (!GLOBALS._bSkipIdle) -- cgit v1.2.3 From ac4567dcb6608bbcde680df36bba088ce0191dd5 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 16 Jun 2012 19:04:19 +0200 Subject: TONY: Rename sound variables --- engines/tony/custom.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 160fafa47f..375b405400 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -331,7 +331,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX if (_ctx->curVoc) { if (_ctx->i == 0) { _ctx->voice->play(); - _ctx->text.setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text.setCustomSkipHandle2(_ctx->voice->_hEndOfBuffer); } else { _vm->_vdbFP.seek(_ctx->curOffset); _vm->_theSound.createSfx(&_ctx->voice); @@ -340,7 +340,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->curOffset = _vm->_vdbFP.pos(); _ctx->voice->setLoop(false); _ctx->voice->play(); - _ctx->text.setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text.setCustomSkipHandle2(_ctx->voice->_hEndOfBuffer); } } @@ -1535,7 +1535,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->voice->setLoop(false); if (bIsBack) _ctx->voice->setVolume(55); _ctx->voice->play(); - _ctx->text->setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text->setCustomSkipHandle2(_ctx->voice->_hEndOfBuffer); _ctx->curOffset = _vm->_vdbFP.pos(); } @@ -1749,7 +1749,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes if (bIsBack) _ctx->voice->setVolume(55); _ctx->voice->play(); - _ctx->text->setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text->setCustomSkipHandle2(_ctx->voice->_hEndOfBuffer); _ctx->curOffset = _vm->_vdbFP.pos(); } @@ -1912,7 +1912,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (_ctx->curVoc) { _ctx->voice->play(); - _ctx->text->setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text->setCustomSkipHandle2(_ctx->voice->_hEndOfBuffer); } // Wait for the end of display -- cgit v1.2.3 From a91553efeb0e2beaf942fc3f7db30868ac8c6afa Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 17 Jun 2012 09:09:18 +1000 Subject: TONY: Cleaned up the @defgroup comments --- engines/tony/custom.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 375b405400..6e057cf031 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -131,7 +131,7 @@ void LoadChangedHotspot(Common::InSaveFile *f) { /** - * @defgroup Classes required for custom functions + * Classes required for custom functions * * Tony (To Move him) -> You can do MPAL through the animation? I really think so * @@ -139,6 +139,7 @@ void LoadChangedHotspot(Common::InSaveFile *f) { * ChangeLocation -> theEngine.ChangeLocation() * AddInventory -> theEngine.AddInventory() */ + void MCharResetCodes(void) { for (int i = 0; i < 10; i++) GLOBALS._mCharacter[i]._item = GLOBALS._loc->getItemFromCode(GLOBALS._mCharacter[i]._code); -- cgit v1.2.3 From b36b66630086044c54f745acfb64f91d90713045 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 17 Jun 2012 18:36:23 +0200 Subject: TONY: American-ification of English used --- engines/tony/custom.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 6e057cf031..fd5d17470b 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -308,7 +308,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX // Alignment _ctx->text.setAlignType(RMText::HCENTER, RMText::VBOTTOM); - // Colour + // Color _ctx->text.setColor(0, 255, 0); // Writes the text @@ -427,7 +427,7 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 // Forces the text to disappear in time _ctx->text.forceTime(); - // Colour + // Color _ctx->text.setColor(255, 255, 255); // Write the text @@ -1511,7 +1511,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess // Alignment _ctx->text->setAlignType(RMText::HCENTER, RMText::VBOTTOM); - // Colour + // Color _ctx->text->setColor(GLOBALS._character[nChar]._r, GLOBALS._character[nChar]._g, GLOBALS._character[nChar]._b); // Write the text @@ -1690,7 +1690,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->parm = (GLOBALS._mCharacter[nChar]._curGroup * 10) + _vm->_randomSource.getRandomNumber( GLOBALS._mCharacter[nChar]._numTalks[GLOBALS._mCharacter[nChar]._curGroup] - 1) + 1; - // Try to run the custom function to initialise the speech + // Try to run the custom function to initialize the speech if (GLOBALS._mCharacter[nChar]._item) { _ctx->h = mpalQueryDoAction(30, GLOBALS._mCharacter[nChar]._item->mpalCode(), _ctx->parm); if (_ctx->h != CORO_INVALID_PID_VALUE) { @@ -1724,7 +1724,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes // Alignment _ctx->text->setAlignType(RMText::HCENTER, RMText::VBOTTOM); - // Colour + // Color _ctx->text->setColor(GLOBALS._mCharacter[nChar]._r, GLOBALS._mCharacter[nChar]._g, GLOBALS._mCharacter[nChar]._b); // Write the text @@ -1874,7 +1874,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (GLOBALS._mCharacter[nPers]._numTexts != 0 && GLOBALS._mCharacter[nPers]._bInTexts) { GLOBALS._mCharacter[nPers]._numTexts--; } else { - // Try to run the custom function to initialise the speech + // Try to run the custom function to initialize the speech _ctx->h = mpalQueryDoAction(30, GLOBALS._mCharacter[nPers]._item->mpalCode(), _ctx->parm); if (_ctx->h != CORO_INVALID_PID_VALUE) CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE); -- cgit v1.2.3 From bb55045cc85e1c9b70bd7267de0b578e6662725b Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 18 Jun 2012 08:03:02 +0200 Subject: TONY: Rename two variables --- engines/tony/custom.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index fd5d17470b..e91d6873a4 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -408,8 +408,8 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 _ctx->msg = new RMMessage(nMsg); - GLOBALS.SFM_nLoc = GLOBALS._loc->TEMPGetNumLoc(); - GLOBALS.SFM_pt = GLOBALS._tony->position(); + GLOBALS._fullScreenMessageLoc = GLOBALS._loc->TEMPGetNumLoc(); + GLOBALS._fullScreenMessagePt = GLOBALS._tony->position(); if (GLOBALS._bSkipIdle) return; @@ -478,7 +478,7 @@ DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) { GLOBALS.Freeze(); - GLOBALS.LoadLocation(GLOBALS.SFM_nLoc, RMPoint(GLOBALS.SFM_pt._x, GLOBALS.SFM_pt._y), RMPoint(-1, -1)); + GLOBALS.LoadLocation(GLOBALS._fullScreenMessageLoc, RMPoint(GLOBALS._fullScreenMessagePt._x, GLOBALS._fullScreenMessagePt._y), RMPoint(-1, -1)); if (!bNotEnableTony) GLOBALS._tony->show(); GLOBALS.Unfreeze(); -- cgit v1.2.3 From e8a6f61f8815fcf36e7a43383695c74b8925993f Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 18 Jun 2012 08:24:33 +0200 Subject: TONY: Remove useless void in function declaration --- engines/tony/custom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index e91d6873a4..016c84ab39 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -106,7 +106,7 @@ const char *jingleFileNames[] = { }; -void ReapplyChangedHotspot(void) { +void ReapplyChangedHotspot() { int 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)); @@ -140,7 +140,7 @@ void LoadChangedHotspot(Common::InSaveFile *f) { * AddInventory -> theEngine.AddInventory() */ -void MCharResetCodes(void) { +void MCharResetCodes() { for (int i = 0; i < 10; i++) GLOBALS._mCharacter[i]._item = GLOBALS._loc->getItemFromCode(GLOBALS._mCharacter[i]._code); for (int i = 0; i < 10; i++) -- cgit v1.2.3 From 61d460a854ff4883411846703543bb2f797fcd6b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 19 Jun 2012 20:50:48 +1000 Subject: TONY: Implement more of the music related code from the original --- engines/tony/custom.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 016c84ab39..ce1c2860f8 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2198,14 +2198,14 @@ DECLARE_CUSTOM_FUNCTION(DemuteJingle)(CORO_PARAM, uint32, uint32, uint32, uint32 void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int nSync = 0) { if (nSync == 0) nSync = 2000; - debug("Start CustPlayMusic"); + debugC(DEBUG_INTERMEDIATE, kTonyDebugMusic, "Start CustPlayMusic"); GLOBALS.PlayMusic(nChannel, mFN, nFX, bLoop, nSync); - debug("End CustPlayMusic"); + debugC(DEBUG_INTERMEDIATE, kTonyDebugMusic, "End CustPlayMusic"); } DECLARE_CUSTOM_FUNCTION(PlaySoundEffect)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) { if (nFX == 0 || nFX == 1 || nFX == 2) { - debug("PlaySoundEffect stop fadeout"); + debugC(DEBUG_INTERMEDIATE, kTonyDebugSound, "PlaySoundEffect stop fadeout"); GLOBALS._bFadeOutStop = true; } -- cgit v1.2.3 From 85150232f036d1dead6a0807bac7b10c5ba923e1 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 21 Jun 2012 00:20:16 +0200 Subject: TONY: Some more renaming (thanks Hkz) --- engines/tony/custom.cpp | 119 +++++++++++++++++++++++------------------------- 1 file changed, 58 insertions(+), 61 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index ce1c2860f8..78b8f4e798 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -42,7 +42,7 @@ namespace Tony { -const char *tappetiFile[] = { +const char *ambianceFile[] = { "None", "1.ADP", // Grilli.WAV "2.ADP", // Grilli-Ovattati.WAV @@ -50,7 +50,7 @@ const char *tappetiFile[] = { "3.ADP", // Grilli-Vento1.WAV "5.ADP", // Vento1.WAV "4.ADP", // Mare1.WAV - "6.ADP" // Mare1.WAV metà volume + "6.ADP" // Mare1.WAV half volume }; struct MusicFileEntry { @@ -210,19 +210,19 @@ DECLARE_CUSTOM_FUNCTION(SetAlwaysDisplay)(CORO_PARAM, uint32 val, uint32, uint32 DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32, uint32) { switch (dwPointer) { case 1: - GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_FRECCIASU); + GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_ARROWUP); break; case 2: - GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_FRECCIAGIU); + GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_ARROWDOWN); break; case 3: - GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_FRECCIASINISTRA); + GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_ARROWLEFT); break; case 4: - GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_FRECCIADESTRA); + GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_ARROWRIGHT); break; case 5: - GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_FRECCIAMAPPA); + GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_ARROWMAP); break; default: @@ -232,15 +232,12 @@ DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32 } VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) { - uint i; - int code; - - code = (codehi << 16) | codelo; + int code = (codehi << 16) | codelo; if (_vm->_voices.size() == 0) return NULL; - for (i = 0; i < _vm->_voices.size(); i++) + for (uint i = 0; i < _vm->_voices.size(); i++) if (_vm->_voices[i]._code == code) return &_vm->_voices[i]; @@ -292,7 +289,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NORMAL; } else { if (_ctx->msg.numPeriods() > 1) - CORO_INVOKE_1(GLOBALS._tony->startTalk, GLOBALS._tony->TALK_FIANCHI); + CORO_INVOKE_1(GLOBALS._tony->startTalk, GLOBALS._tony->TALK_HIPS); else CORO_INVOKE_1(GLOBALS._tony->startTalk, GLOBALS._tony->TALK_NORMAL); } @@ -537,7 +534,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint CORO_INVOKE_0(GLOBALS.WaitWipeEnd); } - if (GLOBALS._lastTappeto != GLOBALS._tappeti[nLoc]) { + if (GLOBALS._lastTappeto != GLOBALS._ambiance[nLoc]) { _vm->stopMusic(4); } @@ -550,10 +547,10 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint else GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); - if (GLOBALS._lastTappeto != GLOBALS._tappeti[nLoc]) { - GLOBALS._lastTappeto = GLOBALS._tappeti[nLoc]; + if (GLOBALS._lastTappeto != GLOBALS._ambiance[nLoc]) { + GLOBALS._lastTappeto = GLOBALS._ambiance[nLoc]; if (GLOBALS._lastTappeto != 0) - _vm->playMusic(4, tappetiFile[GLOBALS._lastTappeto], 0, true, 2000); + _vm->playMusic(4, ambianceFile[GLOBALS._lastTappeto], 0, true, 2000); } if (!GLOBALS._bNoBullsEye) { @@ -802,19 +799,19 @@ void TonySetNumTexts(uint32 dwText) { GLOBALS._bTonyInTexts = false; } -DECLARE_CUSTOM_FUNCTION(TonyRide)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyLaugh)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_RIDE; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_LAUGH; } DECLARE_CUSTOM_FUNCTION(TonyGiggle)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_RIDE2; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_LAUGH2; } -DECLARE_CUSTOM_FUNCTION(TonyFianchi)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonyHips)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_FIANCHI; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_HIPS; } DECLARE_CUSTOM_FUNCTION(TonySing)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { @@ -1127,9 +1124,9 @@ DECLARE_CUSTOM_FUNCTION(TonySniffRight)(CORO_PARAM, uint32, uint32, uint32, uint CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyNaah)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { +DECLARE_CUSTOM_FUNCTION(TonySarcastic)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { TonySetNumTexts(dwText); - GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_NAAH; + GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SARCASTIC; } DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(CORO_PARAM, uint32 nPos, uint32, uint32, uint32) { @@ -2237,7 +2234,7 @@ void RestoreMusic(CORO_PARAM) { CORO_INVOKE_4(PlaySoundEffect, GLOBALS._lastMusic, 0, 0, 0); if (GLOBALS._lastTappeto != 0) - CustPlayMusic(4, tappetiFile[GLOBALS._lastTappeto], 0, true); + CustPlayMusic(4, ambianceFile[GLOBALS._lastTappeto], 0, true); CORO_END_CODE; } @@ -2447,8 +2444,8 @@ ASSIGN(37, TonyGetUp) ASSIGN(38, TonyShepherdess) ASSIGN(39, TonyWhistle) -ASSIGN(40, TonyRide) -ASSIGN(41, TonyFianchi) +ASSIGN(40, TonyLaugh) +ASSIGN(41, TonyHips) ASSIGN(42, TonySing) ASSIGN(43, TonyIndicate) ASSIGN(44, TonyScaredWithHands) @@ -2477,7 +2474,7 @@ ASSIGN(106, TonyWithBeardStart) ASSIGN(107, TonyWithBeardEnd) ASSIGN(108, TonyGiggle) ASSIGN(109, TonyDisgusted) -ASSIGN(110, TonyNaah) +ASSIGN(110, TonySarcastic) ASSIGN(111, TonyMacbeth) ASSIGN(112, TonySniffLeft) ASSIGN(113, TonySniffRight) @@ -2575,39 +2572,39 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation GLOBALS._mut[i] = CoroScheduler.createEvent(false, false); for (i = 0; i < 200; i++) - GLOBALS._tappeti[i] = 0; - - GLOBALS._tappeti[6] = TAPPETI_GRILLI; - GLOBALS._tappeti[7] = TAPPETI_GRILLI; - GLOBALS._tappeti[8] = TAPPETI_GRILLIOV; - GLOBALS._tappeti[10] = TAPPETI_GRILLI; - GLOBALS._tappeti[12] = TAPPETI_GRILLI; - GLOBALS._tappeti[13] = TAPPETI_GRILLIOV; - GLOBALS._tappeti[15] = TAPPETI_GRILLI; - GLOBALS._tappeti[16] = TAPPETI_GRILLIVENTO; - GLOBALS._tappeti[18] = TAPPETI_GRILLI; - GLOBALS._tappeti[19] = TAPPETI_GRILLIVENTO; - GLOBALS._tappeti[20] = TAPPETI_GRILLI; - GLOBALS._tappeti[23] = TAPPETI_GRILLI; - GLOBALS._tappeti[26] = TAPPETI_MAREMETA; - GLOBALS._tappeti[27] = TAPPETI_GRILLI; - GLOBALS._tappeti[28] = TAPPETI_GRILLIVENTO; - GLOBALS._tappeti[31] = TAPPETI_GRILLI; - GLOBALS._tappeti[33] = TAPPETI_MARE; - GLOBALS._tappeti[35] = TAPPETI_MARE; - GLOBALS._tappeti[36] = TAPPETI_GRILLI; - GLOBALS._tappeti[37] = TAPPETI_GRILLI; - GLOBALS._tappeti[40] = TAPPETI_GRILLI; - GLOBALS._tappeti[41] = TAPPETI_GRILLI; - GLOBALS._tappeti[42] = TAPPETI_GRILLI; - GLOBALS._tappeti[45] = TAPPETI_GRILLI; - GLOBALS._tappeti[51] = TAPPETI_GRILLI; - GLOBALS._tappeti[52] = TAPPETI_GRILLIVENTO1; - GLOBALS._tappeti[53] = TAPPETI_GRILLI; - GLOBALS._tappeti[54] = TAPPETI_GRILLI; - GLOBALS._tappeti[57] = TAPPETI_VENTO; - GLOBALS._tappeti[58] = TAPPETI_VENTO; - GLOBALS._tappeti[60] = TAPPETI_VENTO; + GLOBALS._ambiance[i] = 0; + + GLOBALS._ambiance[6] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[7] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[8] = AMBIANCE_CRICKETSMUFFLED; + GLOBALS._ambiance[10] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[12] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[13] = AMBIANCE_CRICKETSMUFFLED; + GLOBALS._ambiance[15] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[16] = AMBIANCE_CRICKETSWIND; + GLOBALS._ambiance[18] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[19] = AMBIANCE_CRICKETSWIND; + GLOBALS._ambiance[20] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[23] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[26] = AMBIANCE_SEAHALFVOLUME; + GLOBALS._ambiance[27] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[28] = AMBIANCE_CRICKETSWIND; + GLOBALS._ambiance[31] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[33] = AMBIANCE_SEA; + GLOBALS._ambiance[35] = AMBIANCE_SEA; + GLOBALS._ambiance[36] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[37] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[40] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[41] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[42] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[45] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[51] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[52] = AMBIANCE_CRICKETSWIND1; + GLOBALS._ambiance[53] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[54] = AMBIANCE_CRICKETS; + GLOBALS._ambiance[57] = AMBIANCE_WIND; + GLOBALS._ambiance[58] = AMBIANCE_WIND; + GLOBALS._ambiance[60] = AMBIANCE_WIND; -- cgit v1.2.3 From fdc619191b4778608263e57a815bd99b3823c11d Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 21 Jun 2012 07:31:38 +0200 Subject: TONY: Translate two comments --- engines/tony/custom.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 78b8f4e798..3a0792252b 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1413,10 +1413,8 @@ DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32, CORO_END_CODE; } - - /* - * Personaggi + * Characters */ DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { @@ -1778,7 +1776,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes } /* - * Dialoghi + * Dialogs */ int curDialog; -- cgit v1.2.3 From 2990482406710c77280c67f3b7672a569b9d5a92 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Thu, 21 Jun 2012 21:30:09 +0200 Subject: TONY: Fix Valgrind warning The loop uses _ctx->msg, so don't delete it until the loop is done. --- engines/tony/custom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 3a0792252b..35ae8849f1 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1761,9 +1761,9 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes GLOBALS._curBackText = NULL; delete _ctx->text; - delete _ctx->msg; } + delete _ctx->msg; // Try to run the custom function to close the speech if (GLOBALS._mCharacter[nChar]._item) { -- cgit v1.2.3 From c3407390013b1e1826bdb31979a50f5e8a957f04 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Wed, 22 Aug 2012 14:00:46 +0200 Subject: TONY: Replace _vm with g_vm. --- engines/tony/custom.cpp | 110 ++++++++++++++++++++++++------------------------ 1 file changed, 55 insertions(+), 55 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 35ae8849f1..6853cf51a0 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -234,12 +234,12 @@ DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32 VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) { int code = (codehi << 16) | codelo; - if (_vm->_voices.size() == 0) + if (g_vm->_voices.size() == 0) return NULL; - for (uint i = 0; i < _vm->_voices.size(); i++) - if (_vm->_voices[i]._code == code) - return &_vm->_voices[i]; + for (uint i = 0; i < g_vm->_voices.size(); i++) + if (g_vm->_voices[i]._code == code) + return &g_vm->_voices[i]; return NULL; } @@ -273,11 +273,11 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->curOffset = _ctx->curVoc->_offset; // First time allocation - _vm->_vdbFP.seek(_ctx->curOffset); - _vm->_theSound.createSfx(&_ctx->voice); + g_vm->_vdbFP.seek(_ctx->curOffset); + g_vm->_theSound.createSfx(&_ctx->voice); - _ctx->voice->loadVoiceFromVDB(_vm->_vdbFP); - _ctx->curOffset = _vm->_vdbFP.pos(); + _ctx->voice->loadVoiceFromVDB(g_vm->_vdbFP); + _ctx->curOffset = g_vm->_vdbFP.pos(); _ctx->voice->setLoop(false); } @@ -331,11 +331,11 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->voice->play(); _ctx->text.setCustomSkipHandle2(_ctx->voice->_hEndOfBuffer); } else { - _vm->_vdbFP.seek(_ctx->curOffset); - _vm->_theSound.createSfx(&_ctx->voice); - _ctx->voice->loadVoiceFromVDB(_vm->_vdbFP); + g_vm->_vdbFP.seek(_ctx->curOffset); + g_vm->_theSound.createSfx(&_ctx->voice); + _ctx->voice->loadVoiceFromVDB(g_vm->_vdbFP); - _ctx->curOffset = _vm->_vdbFP.pos(); + _ctx->curOffset = g_vm->_vdbFP.pos(); _ctx->voice->setLoop(false); _ctx->voice->play(); _ctx->text.setCustomSkipHandle2(_ctx->voice->_hEndOfBuffer); @@ -512,7 +512,7 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 CORO_INVOKE_0(GLOBALS.WaitWipeEnd); } - _vm->stopMusic(4); + g_vm->stopMusic(4); // On exit, unload and unfreeze CORO_INVOKE_2(GLOBALS.UnloadLocation, true, NULL); @@ -535,7 +535,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint } if (GLOBALS._lastTappeto != GLOBALS._ambiance[nLoc]) { - _vm->stopMusic(4); + g_vm->stopMusic(4); } // On exit, unfreeze @@ -550,7 +550,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint if (GLOBALS._lastTappeto != GLOBALS._ambiance[nLoc]) { GLOBALS._lastTappeto = GLOBALS._ambiance[nLoc]; if (GLOBALS._lastTappeto != 0) - _vm->playMusic(4, ambianceFile[GLOBALS._lastTappeto], 0, true, 2000); + g_vm->playMusic(4, ambianceFile[GLOBALS._lastTappeto], 0, true, 2000); } if (!GLOBALS._bNoBullsEye) { @@ -1286,7 +1286,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui _ctx->startpt = GLOBALS._loc->scrollPosition(); - _ctx->dwStartTime = _vm->getTime(); + _ctx->dwStartTime = g_vm->getTime(); if (sX) _ctx->dwTotalTime = _ctx->dimx * (1000 / 35) / sX; @@ -1294,7 +1294,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui _ctx->dwTotalTime = _ctx->dimy * (1000 / 35) / sY; while ((_ctx->lx != 0 || _ctx->ly != 0) && !GLOBALS._bSkipIdle) { - _ctx->dwCurTime = _vm->getTime() - _ctx->dwStartTime; + _ctx->dwCurTime = g_vm->getTime() - _ctx->dwStartTime; if (_ctx->dwCurTime > _ctx->dwTotalTime) break; @@ -1368,11 +1368,11 @@ DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uin DECLARE_CUSTOM_FUNCTION(AutoSave)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->autoSave(coroParam); + g_vm->autoSave(coroParam); } DECLARE_CUSTOM_FUNCTION(AbortGame)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->abortGame(); + g_vm->abortGame(); } DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) { @@ -1384,12 +1384,12 @@ DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32, CORO_BEGIN_CODE(_ctx); - _ctx->curTime = _vm->getTime(); + _ctx->curTime = g_vm->getTime(); _ctx->dirx = 1; _ctx->diry = 1; - while (_vm->getTime() < _ctx->curTime + nScosse) { + while (g_vm->getTime() < _ctx->curTime + nScosse) { CORO_INVOKE_0(GLOBALS.WaitFrame); GLOBALS.Freeze(); @@ -1397,7 +1397,7 @@ DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32, GLOBALS._tony->setFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); GLOBALS.Unfreeze(); - _ctx->i = _vm->_randomSource.getRandomNumber(2); + _ctx->i = g_vm->_randomSource.getRandomNumber(2); if (_ctx->i == 0 || _ctx->i == 2) _ctx->dirx = -_ctx->dirx; @@ -1486,7 +1486,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->voice = NULL; if (_ctx->curVoc) { // Position within the database of entries, beginning at the first - _vm->_vdbFP.seek(_ctx->curVoc->_offset); + g_vm->_vdbFP.seek(_ctx->curVoc->_offset); _ctx->curOffset = _ctx->curVoc->_offset; } @@ -1525,14 +1525,14 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { - _vm->_theSound.createSfx(&_ctx->voice); - _vm->_vdbFP.seek(_ctx->curOffset); - _ctx->voice->loadVoiceFromVDB(_vm->_vdbFP); + g_vm->_theSound.createSfx(&_ctx->voice); + g_vm->_vdbFP.seek(_ctx->curOffset); + _ctx->voice->loadVoiceFromVDB(g_vm->_vdbFP); _ctx->voice->setLoop(false); if (bIsBack) _ctx->voice->setVolume(55); _ctx->voice->play(); _ctx->text->setCustomSkipHandle2(_ctx->voice->_hEndOfBuffer); - _ctx->curOffset = _vm->_vdbFP.pos(); + _ctx->curOffset = g_vm->_vdbFP.pos(); } // Wait for the end of display @@ -1682,7 +1682,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->pt = RMPoint(GLOBALS._mCharacter[nChar]._x, GLOBALS._mCharacter[nChar]._y); // Parameter for special actions: random between the spoken - _ctx->parm = (GLOBALS._mCharacter[nChar]._curGroup * 10) + _vm->_randomSource.getRandomNumber( + _ctx->parm = (GLOBALS._mCharacter[nChar]._curGroup * 10) + g_vm->_randomSource.getRandomNumber( GLOBALS._mCharacter[nChar]._numTalks[GLOBALS._mCharacter[nChar]._curGroup] - 1) + 1; // Try to run the custom function to initialize the speech @@ -1697,8 +1697,8 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->voice = NULL; if (_ctx->curVoc) { // Position within the database of entries, beginning at the first - // fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET); - _vm->_vdbFP.seek(_ctx->curVoc->_offset); + // fseek(g_vm->m_vdbFP, curVoc->offset, SEEK_SET); + g_vm->_vdbFP.seek(_ctx->curVoc->_offset); _ctx->curOffset = _ctx->curVoc->_offset; } @@ -1738,15 +1738,15 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { - _vm->_theSound.createSfx(&_ctx->voice); - _vm->_vdbFP.seek(_ctx->curOffset); - _ctx->voice->loadVoiceFromVDB(_vm->_vdbFP); + g_vm->_theSound.createSfx(&_ctx->voice); + g_vm->_vdbFP.seek(_ctx->curOffset); + _ctx->voice->loadVoiceFromVDB(g_vm->_vdbFP); _ctx->voice->setLoop(false); if (bIsBack) _ctx->voice->setVolume(55); _ctx->voice->play(); _ctx->text->setCustomSkipHandle2(_ctx->voice->_hEndOfBuffer); - _ctx->curOffset = _vm->_vdbFP.pos(); + _ctx->curOffset = g_vm->_vdbFP.pos(); } // Wait for the end of display @@ -1806,9 +1806,9 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (_ctx->curVoc) { // Position within the database of entries, beginning at the first - _vm->_vdbFP.seek(_ctx->curVoc->_offset); - _vm->_theSound.createSfx(&_ctx->voice); - _ctx->voice->loadVoiceFromVDB(_vm->_vdbFP); + g_vm->_vdbFP.seek(_ctx->curVoc->_offset); + g_vm->_theSound.createSfx(&_ctx->voice); + _ctx->voice->loadVoiceFromVDB(g_vm->_vdbFP); _ctx->voice->setLoop(false); if (_ctx->bIsBack) _ctx->voice->setVolume(55); @@ -1863,7 +1863,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->pt = RMPoint(GLOBALS._mCharacter[nPers]._x, GLOBALS._mCharacter[nPers]._y); // Parameter for special actions. Random between the spoken. - _ctx->parm = (GLOBALS._mCharacter[nPers]._curGroup * 10) + _vm->_randomSource.getRandomNumber( + _ctx->parm = (GLOBALS._mCharacter[nPers]._curGroup * 10) + g_vm->_randomSource.getRandomNumber( GLOBALS._mCharacter[nPers]._numTalks[GLOBALS._mCharacter[nPers]._curGroup] - 1) + 1; if (GLOBALS._mCharacter[nPers]._numTexts != 0 && GLOBALS._mCharacter[nPers]._bInTexts) { @@ -2097,11 +2097,11 @@ void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) { debug("Start FadeIn Music"); for (_ctx->i = 0; _ctx->i < 16; _ctx->i++) { - _vm->setMusicVolume(nChannel, _ctx->i * 4); + g_vm->setMusicVolume(nChannel, _ctx->i * 4); CORO_INVOKE_1(CoroScheduler.sleep, 100); } - _vm->setMusicVolume(nChannel, 64); + g_vm->setMusicVolume(nChannel, 64); debug("End FadeIn Music"); @@ -2120,23 +2120,23 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { CORO_BEGIN_CODE(_ctx); - _ctx->startVolume = _vm->getMusicVolume(nChannel); + _ctx->startVolume = g_vm->getMusicVolume(nChannel); debug("Start FadeOut Music"); for (_ctx->i = 16; _ctx->i > 0 && !GLOBALS._bFadeOutStop; _ctx->i--) { if (_ctx->i * 4 < _ctx->startVolume) - _vm->setMusicVolume(nChannel, _ctx->i * 4); + g_vm->setMusicVolume(nChannel, _ctx->i * 4); CORO_INVOKE_1(CoroScheduler.sleep, 100); } if (!GLOBALS._bFadeOutStop) - _vm->setMusicVolume(nChannel, 0); + g_vm->setMusicVolume(nChannel, 0); // If a jingle is played, stop it if (nChannel == 2) - _vm->stopMusic(2); + g_vm->stopMusic(2); debug("End FadeOut Music"); @@ -2166,28 +2166,28 @@ DECLARE_CUSTOM_FUNCTION(FadeInJingle)(CORO_PARAM, uint32, uint32, uint32, uint32 } DECLARE_CUSTOM_FUNCTION(StopSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->stopMusic(GLOBALS._curSoundEffect); + g_vm->stopMusic(GLOBALS._curSoundEffect); } DECLARE_CUSTOM_FUNCTION(StopJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->stopMusic(2); + g_vm->stopMusic(2); } DECLARE_CUSTOM_FUNCTION(MuteSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->setMusicVolume(GLOBALS._curSoundEffect, 0); + g_vm->setMusicVolume(GLOBALS._curSoundEffect, 0); } DECLARE_CUSTOM_FUNCTION(DemuteSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._bFadeOutStop = true; - _vm->setMusicVolume(GLOBALS._curSoundEffect, 64); + g_vm->setMusicVolume(GLOBALS._curSoundEffect, 64); } DECLARE_CUSTOM_FUNCTION(MuteJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->setMusicVolume(2, 0); + g_vm->setMusicVolume(2, 0); } DECLARE_CUSTOM_FUNCTION(DemuteJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) { - _vm->setMusicVolume(2, 64); + g_vm->setMusicVolume(2, 64); } void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int nSync = 0) { @@ -2298,7 +2298,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, ui CORO_BEGIN_CODE(_ctx); GLOBALS.Freeze(); - CORO_INVOKE_0(_vm->openInitLoadMenu); + CORO_INVOKE_0(g_vm->openInitLoadMenu); GLOBALS.Unfreeze(); CORO_END_CODE; @@ -2311,7 +2311,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uin CORO_BEGIN_CODE(_ctx); GLOBALS.Freeze(); - CORO_INVOKE_0(_vm->openInitOptions); + CORO_INVOKE_0(g_vm->openInitOptions); GLOBALS.Unfreeze(); CORO_END_CODE; @@ -2367,13 +2367,13 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 GLOBALS.LinkGraphicTask(&_ctx->text[_ctx->i]); } - _ctx->startTime = _vm->getTime(); + _ctx->startTime = g_vm->getTime(); - while (_ctx->startTime + dwTime * 1000 > _vm->getTime()) { + while (_ctx->startTime + dwTime * 1000 > g_vm->getTime()) { CORO_INVOKE_0(GLOBALS.WaitFrame); if (GLOBALS._input->mouseLeftClicked() || GLOBALS._input->mouseRightClicked()) break; - if (_vm->getEngine()->getInput().getAsyncKeyState(Common::KEYCODE_TAB)) + if (g_vm->getEngine()->getInput().getAsyncKeyState(Common::KEYCODE_TAB)) break; } -- cgit v1.2.3 From 93e10b52108e84e4db0e05a10d274a90e6cc50ff Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 22 Aug 2012 22:35:42 +1000 Subject: TONY: Removed some debug warnings which aren't needed any longer --- engines/tony/custom.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 6853cf51a0..e082e5fcde 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2122,8 +2122,6 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { _ctx->startVolume = g_vm->getMusicVolume(nChannel); - debug("Start FadeOut Music"); - for (_ctx->i = 16; _ctx->i > 0 && !GLOBALS._bFadeOutStop; _ctx->i--) { if (_ctx->i * 4 < _ctx->startVolume) g_vm->setMusicVolume(nChannel, _ctx->i * 4); @@ -2138,8 +2136,6 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { if (nChannel == 2) g_vm->stopMusic(2); - debug("End FadeOut Music"); - CORO_KILL_SELF(); CORO_END_CODE; -- cgit v1.2.3 From 8b0dca3862da10e87fe0fec237c694c48e12f83c Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Sat, 25 Aug 2012 13:15:28 +0200 Subject: TONY: Fix Take/ReleaseOwnership. --- engines/tony/custom.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index e082e5fcde..fcb304c623 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2052,25 +2052,12 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr */ DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { - CORO_BEGIN_CONTEXT; - bool expired; - CORO_END_CONTEXT(_ctx); - - CORO_BEGIN_CODE(_ctx); - // The event is operating as a mutex, so if the event is already set, wait until it's reset - do { - CORO_INVOKE_3(CoroScheduler.waitForSingleObject, GLOBALS._mut[num], 0, &_ctx->expired); - } while (!_ctx->expired); - - // Set the event to flag ownership - CoroScheduler.setEvent(GLOBALS._mut[num]); - - CORO_END_CODE; + CoroScheduler.waitForSingleObject(coroParam, GLOBALS._mut[num], CORO_INFINITE); } DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { - CoroScheduler.resetEvent(GLOBALS._mut[num]); + CoroScheduler.setEvent(GLOBALS._mut[num]); } /* @@ -2563,7 +2550,7 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation int i; for (i = 0; i < 10; i++) - GLOBALS._mut[i] = CoroScheduler.createEvent(false, false); + GLOBALS._mut[i] = CoroScheduler.createEvent(false, true); for (i = 0; i < 200; i++) GLOBALS._ambiance[i] = 0; -- cgit v1.2.3 From 3570a0153dfa1034fc8acece5f755038487a5886 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Tue, 28 Aug 2012 09:19:10 +0200 Subject: TONY: Improve Take/ReleaseOwnership. This releases all held 'mutexes' when processes die, and keeps track of the lock count too, just in case. --- engines/tony/custom.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index fcb304c623..3031fc342b 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2052,12 +2052,39 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr */ DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { - // The event is operating as a mutex, so if the event is already set, wait until it's reset - CoroScheduler.waitForSingleObject(coroParam, GLOBALS._mut[num], CORO_INFINITE); + CORO_BEGIN_CONTEXT; + CORO_END_CONTEXT(_ctx); + + CORO_BEGIN_CODE(_ctx); + + if (GLOBALS._mut[num]._ownerPid != (uint32)CoroScheduler.getCurrentPID()) { + // The mutex is currently owned by a different process. + // Wait for the event to be signalled, which means the mutex is free. + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, GLOBALS._mut[num]._eventId, CORO_INFINITE); + GLOBALS._mut[num]._ownerPid = (uint32)CoroScheduler.getCurrentPID(); + } + + GLOBALS._mut[num]._lockCount++; + + CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { - CoroScheduler.setEvent(GLOBALS._mut[num]); + if (!GLOBALS._mut[num]._lockCount) { + warning("ReleaseOwnership tried to release mutex %d, which isn't held", num); + return; + } + + if (GLOBALS._mut[num]._ownerPid != (uint32)CoroScheduler.getCurrentPID()) + error("ReleaseOwnership tried to release mutex %d, which is held by a different process", num); + + GLOBALS._mut[num]._lockCount--; + if (!GLOBALS._mut[num]._lockCount) { + GLOBALS._mut[num]._ownerPid = 0; + + // Signal the event, to wake up processes waiting for the lock. + CoroScheduler.setEvent(GLOBALS._mut[num]._eventId); + } } /* @@ -2524,6 +2551,19 @@ ASSIGN(201, MustSkipIdleEnd); END_CUSTOM_FUNCTION_MAP() +void processKilledCallback(Common::PROCESS *p) { + for (uint i = 0; i < 10; i++) + if (GLOBALS._mut[i]._ownerPid == p->pid) { + // Handle scripts which don't call ReleaseOwnership, such as + // the one in loc37's vEnter when Tony is chasing the mouse. + debug(DEBUG_BASIC, "Force-releasing mutex %d after process died", i); + + GLOBALS._mut[i]._ownerPid = 0; + GLOBALS._mut[i]._lockCount = 0; + CoroScheduler.setEvent(GLOBALS._mut[i]._eventId); + } +} + void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation *loc, RMInventory *inv, RMInput *input) { GLOBALS._tony = tony; GLOBALS._pointer = ptr; @@ -2549,8 +2589,9 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation GLOBALS._bAlwaysDisplay = false; int i; + CoroScheduler.setResourceCallback(processKilledCallback); for (i = 0; i < 10; i++) - GLOBALS._mut[i] = CoroScheduler.createEvent(false, true); + GLOBALS._mut[i]._eventId = CoroScheduler.createEvent(false, true); for (i = 0; i < 200; i++) GLOBALS._ambiance[i] = 0; -- cgit v1.2.3 From e6bd426398c75fb6e268e58508b19307ab0c53eb Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Tue, 28 Aug 2012 09:47:21 +0200 Subject: TONY: Rename curDialog to g_curDialog. --- engines/tony/custom.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 3031fc342b..c73c7dec36 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1779,7 +1779,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes * Dialogs */ -int curDialog; +int g_curDialog; DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg, uint32, uint32) { CORO_BEGIN_CONTEXT; @@ -1801,7 +1801,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (nPers != 0 && GLOBALS._isMChar[nPers] && GLOBALS._mCharacter[nPers]._bAlwaysBack) _ctx->bIsBack = true; - _ctx->curVoc = SearchVoiceHeader(curDialog, nMsg); + _ctx->curVoc = SearchVoiceHeader(g_curDialog, nMsg); _ctx->voice = NULL; if (_ctx->curVoc) { @@ -1978,7 +1978,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr CORO_BEGIN_CODE(_ctx); - curDialog = nDialog; + g_curDialog = nDialog; // Call MPAL to start the dialog mpalQueryDoDialog(nDialog, nStartGroup); -- cgit v1.2.3 From 3c986af9ce531f4d9cab889b196991be14cb88f6 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Tue, 28 Aug 2012 22:10:10 +0200 Subject: TONY: Remove unnecessary mainloop mutex. Also, all the related freeze functions/members. --- engines/tony/custom.cpp | 56 ++----------------------------------------------- 1 file changed, 2 insertions(+), 54 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index c73c7dec36..593d27655d 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -374,15 +374,12 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, ui CORO_BEGIN_CODE(_ctx); - GLOBALS.Freeze(); - GLOBALS._curChangedHotspot = 0; if (bUseStartPos != 0) GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), GLOBALS._startLocPos[nLoc]); else GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); - GLOBALS.Unfreeze(); _ctx->h = mpalQueryDoAction(0, nLoc, 0); // On Enter? @@ -413,7 +410,6 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 CORO_INVOKE_2(GLOBALS.UnloadLocation, false, NULL); GLOBALS._tony->hide(); - GLOBALS.Unfreeze(); for (_ctx->i = 0; _ctx->i < _ctx->msg->numPeriods() && !GLOBALS._bSkipIdle; _ctx->i++) { _ctx->text.setInput(GLOBALS._input); @@ -474,11 +470,9 @@ DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) } DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) { - GLOBALS.Freeze(); GLOBALS.LoadLocation(GLOBALS._fullScreenMessageLoc, RMPoint(GLOBALS._fullScreenMessagePt._x, GLOBALS._fullScreenMessagePt._y), RMPoint(-1, -1)); if (!bNotEnableTony) GLOBALS._tony->show(); - GLOBALS.Unfreeze(); MCharResetCodes(); ReapplyChangedHotspot(); @@ -514,9 +508,8 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 g_vm->stopMusic(4); - // On exit, unload and unfreeze + // On exit, unload CORO_INVOKE_2(GLOBALS.UnloadLocation, true, NULL); - GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -557,9 +550,6 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint GLOBALS.InitWipe(2); } - GLOBALS.Unfreeze(); - - _ctx->h = mpalQueryDoAction(0, nLoc, 0); if (!GLOBALS._bNoBullsEye) { @@ -626,9 +616,7 @@ void TonyGenericTake1(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); - GLOBALS.Freeze(); GLOBALS._tony->take(nDirection, 0); - GLOBALS.Unfreeze(); if (!GLOBALS._bSkipIdle) CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); @@ -642,16 +630,12 @@ void TonyGenericTake2(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); - GLOBALS.Freeze(); GLOBALS._tony->take(nDirection, 1); - GLOBALS.Unfreeze(); if (!GLOBALS._bSkipIdle) CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); - GLOBALS.Freeze(); GLOBALS._tony->take(nDirection, 2); - GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -662,9 +646,7 @@ void TonyGenericPut1(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); - GLOBALS.Freeze(); GLOBALS._tony->put(nDirection, 0); - GLOBALS.Unfreeze(); if (!GLOBALS._bSkipIdle) CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); @@ -678,16 +660,12 @@ void TonyGenericPut2(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CODE(_ctx); - GLOBALS.Freeze(); GLOBALS._tony->put(nDirection, 1); - GLOBALS.Unfreeze(); if (!GLOBALS._bSkipIdle) CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern); - GLOBALS.Freeze(); GLOBALS._tony->put(nDirection, 2); - GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -1250,10 +1228,8 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 CORO_INVOKE_0(GLOBALS.WaitFrame); - GLOBALS.Freeze(); GLOBALS._loc->setScrollPosition(_ctx->pt); GLOBALS._tony->setScrollPosition(_ctx->pt); - GLOBALS.Unfreeze(); } CORO_END_CODE; @@ -1315,10 +1291,8 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui CORO_INVOKE_0(GLOBALS.WaitFrame); - GLOBALS.Freeze(); GLOBALS._loc->setScrollPosition(_ctx->pt); GLOBALS._tony->setScrollPosition(_ctx->pt); - GLOBALS.Unfreeze(); } @@ -1336,10 +1310,8 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui _ctx->pt._y = _ctx->startpt._y - _ctx->dimy; } - GLOBALS.Freeze(); GLOBALS._loc->setScrollPosition(_ctx->pt); GLOBALS._tony->setScrollPosition(_ctx->pt); - GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -1392,10 +1364,8 @@ DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32, while (g_vm->getTime() < _ctx->curTime + nScosse) { CORO_INVOKE_0(GLOBALS.WaitFrame); - GLOBALS.Freeze(); GLOBALS._loc->setFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); GLOBALS._tony->setFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); - GLOBALS.Unfreeze(); _ctx->i = g_vm->_randomSource.getRandomNumber(2); @@ -1405,10 +1375,8 @@ DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32, _ctx->diry = -_ctx->diry; } - GLOBALS.Freeze(); GLOBALS._loc->setFixedScroll(RMPoint(0, 0)); GLOBALS._tony->setFixedScroll(RMPoint(0, 0)); - GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -1471,16 +1439,12 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->pt = GLOBALS._character[nChar]._item->calculatePos() - RMPoint(-60, 20) - GLOBALS._loc->scrollPosition(); if (GLOBALS._character[nChar]._startTalkPattern != 0) { - GLOBALS.Freeze(); GLOBALS._character[nChar]._item->setPattern(GLOBALS._character[nChar]._startTalkPattern); - GLOBALS.Unfreeze(); CORO_INVOKE_0(GLOBALS._character[nChar]._item->waitForEndPattern); } - GLOBALS.Freeze(); GLOBALS._character[nChar]._item->setPattern(GLOBALS._character[nChar]._talkPattern); - GLOBALS.Unfreeze(); _ctx->curVoc = SearchVoiceHeader(0, dwMessage); _ctx->voice = NULL; @@ -1551,15 +1515,11 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess } if (GLOBALS._character[nChar]._endTalkPattern != 0) { - GLOBALS.Freeze(); GLOBALS._character[nChar]._item->setPattern(GLOBALS._character[nChar]._endTalkPattern); - GLOBALS.Unfreeze(); CORO_INVOKE_0(GLOBALS._character[nChar]._item->waitForEndPattern); } - GLOBALS.Freeze(); GLOBALS._character[nChar]._item->setPattern(GLOBALS._character[nChar]._standPattern); - GLOBALS.Unfreeze(); delete _ctx->msg; CORO_END_CODE; @@ -1845,9 +1805,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->pt = GLOBALS._character[nPers]._item->calculatePos() - RMPoint(-60, 20) - GLOBALS._loc->scrollPosition(); if (GLOBALS._character[nPers]._startTalkPattern != 0) { - GLOBALS.Freeze(); GLOBALS._character[nPers]._item->setPattern(GLOBALS._character[nPers]._startTalkPattern); - GLOBALS.Unfreeze(); CORO_INVOKE_0(GLOBALS._character[nPers]._item->waitForEndPattern); } @@ -1925,9 +1883,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (nPers != 0) { if (!GLOBALS._isMChar[nPers]) { if (GLOBALS._character[nPers]._endTalkPattern != 0) { - GLOBALS.Freeze(); GLOBALS._character[nPers]._item->setPattern(GLOBALS._character[nPers]._endTalkPattern); - GLOBALS.Unfreeze(); CORO_INVOKE_0(GLOBALS._character[nPers]._item->waitForEndPattern); } @@ -2023,9 +1979,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr while (!(GLOBALS._input->mouseLeftClicked() && ((_ctx->sel = _ctx->dc.getSelection()) != -1))) { CORO_INVOKE_0(GLOBALS.WaitFrame); - GLOBALS.Freeze(); CORO_INVOKE_1(_ctx->dc.doFrame, GLOBALS._input->mousePos()); - GLOBALS.Unfreeze(); } // Hide the pointer @@ -2298,7 +2252,7 @@ DECLARE_CUSTOM_FUNCTION(MustSkipIdleEnd)(CORO_PARAM, uint32, uint32, uint32, uin } DECLARE_CUSTOM_FUNCTION(PatIrqFreeze)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { - GLOBALS._bPatIrqFreeze = bStatus; + // Unused in ScummVM. } DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -2307,9 +2261,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, ui CORO_BEGIN_CODE(_ctx); - GLOBALS.Freeze(); CORO_INVOKE_0(g_vm->openInitLoadMenu); - GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -2320,9 +2272,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uin CORO_BEGIN_CODE(_ctx); - GLOBALS.Freeze(); CORO_INVOKE_0(g_vm->openInitOptions); - GLOBALS.Unfreeze(); CORO_END_CODE; } @@ -2575,8 +2525,6 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation GLOBALS.LoadLocation = mainLoadLocation; GLOBALS.UnloadLocation = mainUnloadLocation; GLOBALS.LinkGraphicTask = mainLinkGraphicTask; - GLOBALS.Freeze = mainFreeze; - GLOBALS.Unfreeze = mainUnfreeze; GLOBALS.WaitFrame = mainWaitFrame; GLOBALS.PlayMusic = mainPlayMusic; GLOBALS.InitWipe = mainInitWipe; -- cgit v1.2.3 From 142ac7600f61e193612ec81c7fd7070ec2ca5c0e Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Tue, 28 Aug 2012 22:28:44 +0200 Subject: TONY: Remove most of the remaining global functions. --- engines/tony/custom.cpp | 87 ++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 48 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 593d27655d..27de5cf717 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -186,7 +186,7 @@ DECLARE_CUSTOM_FUNCTION(RightToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { DECLARE_CUSTOM_FUNCTION(TonySetPerorate)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { - GLOBALS.SetPerorate(bStatus); + g_vm->getEngine()->setPerorate(bStatus); } DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint32) { @@ -324,7 +324,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX } // Record the text - GLOBALS.LinkGraphicTask(&_ctx->text); + g_vm->getEngine()->linkGraphicTask(&_ctx->text); if (_ctx->curVoc) { if (_ctx->i == 0) { @@ -376,9 +376,9 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, ui GLOBALS._curChangedHotspot = 0; if (bUseStartPos != 0) - GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), GLOBALS._startLocPos[nLoc]); + g_vm->getEngine()->loadLocation(nLoc, RMPoint(tX, tY), GLOBALS._startLocPos[nLoc]); else - GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); + g_vm->getEngine()->loadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); _ctx->h = mpalQueryDoAction(0, nLoc, 0); @@ -408,7 +408,7 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 if (GLOBALS._bSkipIdle) return; - CORO_INVOKE_2(GLOBALS.UnloadLocation, false, NULL); + CORO_INVOKE_2(g_vm->getEngine()->unloadLocation, false, NULL); GLOBALS._tony->hide(); for (_ctx->i = 0; _ctx->i < _ctx->msg->numPeriods() && !GLOBALS._bSkipIdle; _ctx->i++) { @@ -436,8 +436,8 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 _ctx->text.forceTime(); // Record the text - GLOBALS.LinkGraphicTask(&_ctx->clear); - GLOBALS.LinkGraphicTask(&_ctx->text); + g_vm->getEngine()->linkGraphicTask(&_ctx->clear); + g_vm->getEngine()->linkGraphicTask(&_ctx->text); // Wait for the end of display _ctx->text.setCustomSkipHandle(GLOBALS._hSkipIdle); @@ -457,20 +457,20 @@ DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) CORO_BEGIN_CODE(_ctx); - GLOBALS.LinkGraphicTask(&_ctx->clear); + g_vm->getEngine()->linkGraphicTask(&_ctx->clear); - CORO_INVOKE_0(GLOBALS.WaitFrame); + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, g_vm->_hEndOfFrame, CORO_INFINITE); // WORKAROUND: This fixes a bug in the original source where the linked clear task // didn't have time to be drawn and removed from the draw list before the method // ended, thus remaining in the draw list and causing a later crash - CORO_INVOKE_0(GLOBALS.WaitFrame); + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, g_vm->_hEndOfFrame, CORO_INFINITE); CORO_END_CODE; } DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) { - GLOBALS.LoadLocation(GLOBALS._fullScreenMessageLoc, RMPoint(GLOBALS._fullScreenMessagePt._x, GLOBALS._fullScreenMessagePt._y), RMPoint(-1, -1)); + g_vm->getEngine()->loadLocation(GLOBALS._fullScreenMessageLoc, RMPoint(GLOBALS._fullScreenMessagePt._x, GLOBALS._fullScreenMessagePt._y), RMPoint(-1, -1)); if (!bNotEnableTony) GLOBALS._tony->show(); @@ -502,14 +502,14 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 CORO_BEGIN_CODE(_ctx); if (!GLOBALS._bNoBullsEye) { - GLOBALS.InitWipe(1); - CORO_INVOKE_0(GLOBALS.WaitWipeEnd); + g_vm->getEngine()->initWipe(1); + CORO_INVOKE_0(g_vm->getEngine()->waitWipeEnd); } g_vm->stopMusic(4); // On exit, unload - CORO_INVOKE_2(GLOBALS.UnloadLocation, true, NULL); + CORO_INVOKE_2(g_vm->getEngine()->unloadLocation, true, NULL); CORO_END_CODE; } @@ -523,8 +523,8 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint CORO_BEGIN_CODE(_ctx); if (!GLOBALS._bNoBullsEye) { - GLOBALS.InitWipe(1); - CORO_INVOKE_0(GLOBALS.WaitWipeEnd); + g_vm->getEngine()->initWipe(1); + CORO_INVOKE_0(g_vm->getEngine()->waitWipeEnd); } if (GLOBALS._lastTappeto != GLOBALS._ambiance[nLoc]) { @@ -532,13 +532,13 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint } // On exit, unfreeze - CORO_INVOKE_2(GLOBALS.UnloadLocation, true, NULL); + CORO_INVOKE_2(g_vm->getEngine()->unloadLocation, true, NULL); GLOBALS._curChangedHotspot = 0; if (bUseStartPos != 0) - GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), GLOBALS._startLocPos[nLoc]); + g_vm->getEngine()->loadLocation(nLoc, RMPoint(tX, tY), GLOBALS._startLocPos[nLoc]); else - GLOBALS.LoadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); + g_vm->getEngine()->loadLocation(nLoc, RMPoint(tX, tY), RMPoint(-1, -1)); if (GLOBALS._lastTappeto != GLOBALS._ambiance[nLoc]) { GLOBALS._lastTappeto = GLOBALS._ambiance[nLoc]; @@ -547,14 +547,14 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint } if (!GLOBALS._bNoBullsEye) { - GLOBALS.InitWipe(2); + g_vm->getEngine()->initWipe(2); } _ctx->h = mpalQueryDoAction(0, nLoc, 0); if (!GLOBALS._bNoBullsEye) { - CORO_INVOKE_0(GLOBALS.WaitWipeEnd); - GLOBALS.CloseWipe(); + CORO_INVOKE_0(g_vm->getEngine()->waitWipeEnd); + g_vm->getEngine()->closeWipe(); } GLOBALS._bNoBullsEye = false; @@ -589,11 +589,11 @@ DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32, } DECLARE_CUSTOM_FUNCTION(DisableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) { - mainDisableInput(); + g_vm->getEngine()->disableInput(); } DECLARE_CUSTOM_FUNCTION(EnableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) { - mainEnableInput(); + g_vm->getEngine()->enableInput(); } DECLARE_CUSTOM_FUNCTION(StopTony)(CORO_PARAM, uint32, uint32, uint32, uint32) { @@ -1226,7 +1226,7 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 _ctx->pt.offset(0, -(int32)sY); } - CORO_INVOKE_0(GLOBALS.WaitFrame); + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, g_vm->_hEndOfFrame, CORO_INFINITE); GLOBALS._loc->setScrollPosition(_ctx->pt); GLOBALS._tony->setScrollPosition(_ctx->pt); @@ -1289,7 +1289,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui } - CORO_INVOKE_0(GLOBALS.WaitFrame); + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, g_vm->_hEndOfFrame, CORO_INFINITE); GLOBALS._loc->setScrollPosition(_ctx->pt); GLOBALS._tony->setScrollPosition(_ctx->pt); @@ -1362,7 +1362,7 @@ DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32, _ctx->diry = 1; while (g_vm->getTime() < _ctx->curTime + nScosse) { - CORO_INVOKE_0(GLOBALS.WaitFrame); + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, g_vm->_hEndOfFrame, CORO_INFINITE); GLOBALS._loc->setFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); GLOBALS._tony->setFixedScroll(RMPoint(1 * _ctx->dirx, 1 * _ctx->diry)); @@ -1486,7 +1486,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess } // Record the text - GLOBALS.LinkGraphicTask(_ctx->text); + g_vm->getEngine()->linkGraphicTask(_ctx->text); if (_ctx->curVoc) { g_vm->_theSound.createSfx(&_ctx->voice); @@ -1695,7 +1695,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes } // Record the text - GLOBALS.LinkGraphicTask(_ctx->text); + g_vm->getEngine()->linkGraphicTask(_ctx->text); if (_ctx->curVoc) { g_vm->_theSound.createSfx(&_ctx->voice); @@ -1862,7 +1862,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg _ctx->text->forceTime(); } _ctx->text->setAlignType(RMText::HCENTER, RMText::VBOTTOM); - GLOBALS.LinkGraphicTask(_ctx->text); + g_vm->getEngine()->linkGraphicTask(_ctx->text); if (_ctx->curVoc) { _ctx->voice->play(); @@ -1970,20 +1970,20 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr } // Activate the object - GLOBALS.LinkGraphicTask(&_ctx->dc); + g_vm->getEngine()->linkGraphicTask(&_ctx->dc); CORO_INVOKE_0(_ctx->dc.show); // Draw the pointer GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_NONE); - mainShowMouse(); + g_vm->getEngine()->enableMouse(); while (!(GLOBALS._input->mouseLeftClicked() && ((_ctx->sel = _ctx->dc.getSelection()) != -1))) { - CORO_INVOKE_0(GLOBALS.WaitFrame); + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, g_vm->_hEndOfFrame, CORO_INFINITE); CORO_INVOKE_1(_ctx->dc.doFrame, GLOBALS._input->mousePos()); } // Hide the pointer - mainHideMouse(); + g_vm->getEngine()->disableMouse(); CORO_INVOKE_0(_ctx->dc.hide); mpalQueryDialogSelectionDWORD(_ctx->nChoice, _ctx->sl[_ctx->sel]); @@ -2158,7 +2158,7 @@ void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int if (nSync == 0) nSync = 2000; debugC(DEBUG_INTERMEDIATE, kTonyDebugMusic, "Start CustPlayMusic"); - GLOBALS.PlayMusic(nChannel, mFN, nFX, bLoop, nSync); + g_vm->playMusic(nChannel, mFN, nFX, bLoop, nSync); debugC(DEBUG_INTERMEDIATE, kTonyDebugMusic, "End CustPlayMusic"); } @@ -2324,13 +2324,13 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 _ctx->text[_ctx->i].setCustomSkipHandle(_ctx->hDisable); // Record the text - GLOBALS.LinkGraphicTask(&_ctx->text[_ctx->i]); + g_vm->getEngine()->linkGraphicTask(&_ctx->text[_ctx->i]); } _ctx->startTime = g_vm->getTime(); while (_ctx->startTime + dwTime * 1000 > g_vm->getTime()) { - CORO_INVOKE_0(GLOBALS.WaitFrame); + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, g_vm->_hEndOfFrame, CORO_INFINITE); if (GLOBALS._input->mouseLeftClicked() || GLOBALS._input->mouseRightClicked()) break; if (g_vm->getEngine()->getInput().getAsyncKeyState(Common::KEYCODE_TAB)) @@ -2339,8 +2339,8 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 CoroScheduler.setEvent(_ctx->hDisable); - CORO_INVOKE_0(GLOBALS.WaitFrame); - CORO_INVOKE_0(GLOBALS.WaitFrame); + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, g_vm->_hEndOfFrame, CORO_INFINITE); + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, g_vm->_hEndOfFrame, CORO_INFINITE); delete[] _ctx->text; delete _ctx->msg; @@ -2522,17 +2522,8 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation GLOBALS._inventory = inv; GLOBALS._input = input; - GLOBALS.LoadLocation = mainLoadLocation; - GLOBALS.UnloadLocation = mainUnloadLocation; - GLOBALS.LinkGraphicTask = mainLinkGraphicTask; - GLOBALS.WaitFrame = mainWaitFrame; - GLOBALS.PlayMusic = mainPlayMusic; - GLOBALS.InitWipe = mainInitWipe; - GLOBALS.CloseWipe = mainCloseWipe; - GLOBALS.WaitWipeEnd = mainWaitWipeEnd; GLOBALS.DisableGUI = mainDisableGUI; GLOBALS.EnableGUI = mainEnableGUI; - GLOBALS.SetPerorate = mainSetPerorate; GLOBALS._bAlwaysDisplay = false; int i; -- cgit v1.2.3 From 56f4bc0225653be13813c662115b67152e78cf1a Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 28 Aug 2012 23:05:48 +0200 Subject: TONY: Fix some for and if statements with bad coding style --- engines/tony/custom.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 27de5cf717..9aef809826 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -237,9 +237,10 @@ VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) { if (g_vm->_voices.size() == 0) return NULL; - for (uint i = 0; i < g_vm->_voices.size(); i++) + for (uint i = 0; i < g_vm->_voices.size(); i++) { if (g_vm->_voices[i]._code == code) return &g_vm->_voices[i]; + } return NULL; } @@ -1208,21 +1209,25 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 while ((_ctx->lx != 0 || _ctx->ly != 0) && !GLOBALS._bSkipIdle) { if (_ctx->lx > 0) { _ctx->lx -= (int32)sX; - if (_ctx->lx < 0) _ctx->lx = 0; + if (_ctx->lx < 0) + _ctx->lx = 0; _ctx->pt.offset((int32)sX, 0); } else if (_ctx->lx < 0) { _ctx->lx += (int32)sX; - if (_ctx->lx > 0) _ctx->lx = 0; + if (_ctx->lx > 0) + _ctx->lx = 0; _ctx->pt.offset(-(int32)sX, 0); } if (_ctx->ly > 0) { _ctx->ly -= sY; - if (_ctx->ly < 0) _ctx->ly = 0; + if (_ctx->ly < 0) + _ctx->ly = 0; _ctx->pt.offset(0, sY); } else if (_ctx->ly < 0) { _ctx->ly += sY; - if (_ctx->ly > 0) _ctx->ly = 0; + if (_ctx->ly > 0) + _ctx->ly = 0; _ctx->pt.offset(0, -(int32)sY); } @@ -1493,7 +1498,8 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess g_vm->_vdbFP.seek(_ctx->curOffset); _ctx->voice->loadVoiceFromVDB(g_vm->_vdbFP); _ctx->voice->setLoop(false); - if (bIsBack) _ctx->voice->setVolume(55); + if (bIsBack) + _ctx->voice->setVolume(55); _ctx->voice->play(); _ctx->text->setCustomSkipHandle2(_ctx->voice->_hEndOfBuffer); _ctx->curOffset = g_vm->_vdbFP.pos(); -- cgit v1.2.3 From f2df769aab10e719cc4fba6cb71e1500eb3acae4 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 1 Sep 2012 00:25:35 +0200 Subject: TONY: More renaming --- engines/tony/custom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 9aef809826..4171691e87 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1749,7 +1749,7 @@ int g_curDialog; DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg, uint32, uint32) { CORO_BEGIN_CONTEXT; - LPSTR string; + char *string; RMTextDialog *text; int parm; uint32 h; -- cgit v1.2.3 From 1f41e5573175fb712e829a9c72b3e4f75afa8fdf Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 1 Sep 2012 02:36:54 +0200 Subject: TONY: Remove adv.h --- engines/tony/custom.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 4171691e87..f0a9197c6d 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -31,7 +31,6 @@ #include "common/savefile.h" #include "tony/mpal/mpal.h" #include "tony/mpal/memory.h" -#include "tony/adv.h" #include "tony/custom.h" #include "tony/font.h" #include "tony/game.h" -- cgit v1.2.3 From c91a72a9d5cf5b4f73fc0544231aefe2258f9e52 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 6 Sep 2012 08:26:08 +0200 Subject: TONY: Some more cleanup --- engines/tony/custom.cpp | 108 +++++------------------------------------------- 1 file changed, 11 insertions(+), 97 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index f0a9197c6d..16afa2dfb6 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -41,73 +41,8 @@ namespace Tony { -const char *ambianceFile[] = { - "None", - "1.ADP", // Grilli.WAV - "2.ADP", // Grilli-Ovattati.WAV - "3.ADP", // Grilli-Vento.WAV - "3.ADP", // Grilli-Vento1.WAV - "5.ADP", // Vento1.WAV - "4.ADP", // Mare1.WAV - "6.ADP" // Mare1.WAV half volume -}; - -struct MusicFileEntry { - const char *name; - int sync; -}; - -const MusicFileEntry musicFiles[] = { - {"00.ADP", 0}, {"01.ADP", 0}, - {"02.ADP", 0}, {"03.ADP", 0}, - {"04.ADP", 0}, {"05.ADP", 0}, - {"06.ADP", 0}, {"07.ADP", 0}, - {"08.ADP", 2450}, {"09.ADP", 0}, - {"10.ADP", 0}, {"11.ADP", 0}, - {"12.ADP", 0}, {"13.ADP", 0}, - {"14.ADP", 0}, {"15.ADP", 0}, - {"16.ADP", 0}, {"17.ADP", 0}, - {"18.ADP", 0}, {"19.ADP", 0}, - {"20.ADP", 0}, {"21.ADP", 0}, - {"22.ADP", 0}, {"23.ADP", 0}, - {"24.ADP", 0}, {"25.ADP", 0}, - {"26.ADP", 0}, {"27.ADP", 0}, - {"28.ADP", 1670}, {"29.ADP", 0}, - {"30.ADP", 0}, {"31.ADP", 0}, - {"32.ADP", 2900}, {"33.ADP", 0}, - {"34.ADP", 0}, {"35.ADP", 0}, - {"36.ADP", 0}, {"37.ADP", 0}, - {"38.ADP", 0}, {"39.ADP", 0}, - {"40.ADP", 0}, {"41.ADP", 1920}, - {"42.ADP", 1560}, {"43.ADP", 1920}, - {"44.ADP", 1920}, {"45.ADP", 1920}, - {"46.ADP", 1920}, {"47.ADP", 1920}, - {"48.ADP", 1920}, {"49.ADP", 1920}, - {"50.ADP", 1920}, {"51.ADP", 1920}, - {"52.ADP", 1920}, {"53.ADP", 0}, - {"54.ADP", 0}, {"55.ADP", 0}, - {"56.ADP", 0}, {"57.ADP", 0}, - {"58.ADP", 0}, {"59.ADP", 0} -}; - - -const char *jingleFileNames[] = { - "S00.ADP", "S01.ADP", - "S02.ADP", "S03.ADP", - "S04.ADP", "S05.ADP", - "S06.ADP", "S07.ADP", - "S08.ADP", "S09.ADP", - "S10.ADP", "S11.ADP", - "S12.ADP", "S13.ADP", - "S14.ADP", "S15.ADP", - "S16.ADP", "S17.ADP", - "S18.ADP" -}; - - void ReapplyChangedHotspot() { - int i; - for (i = 0; i < GLOBALS._curChangedHotspot; i++) + for (int i = 0; i < GLOBALS._curChangedHotspot; i++) GLOBALS._loc->getItemFromCode(GLOBALS._changedHotspot[i]._dwCode)->changeHotspot(RMPoint(GLOBALS._changedHotspot[i]._nX, GLOBALS._changedHotspot[i]._nY)); } @@ -543,7 +478,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint if (GLOBALS._lastTappeto != GLOBALS._ambiance[nLoc]) { GLOBALS._lastTappeto = GLOBALS._ambiance[nLoc]; if (GLOBALS._lastTappeto != 0) - g_vm->playMusic(4, ambianceFile[GLOBALS._lastTappeto], 0, true, 2000); + g_vm->playMusic(4, kAmbianceFile[GLOBALS._lastTappeto], 0, true, 2000); } if (!GLOBALS._bNoBullsEye) { @@ -608,8 +543,6 @@ DECLARE_CUSTOM_FUNCTION(CustDisableGUI)(CORO_PARAM, uint32, uint32, uint32, uint GLOBALS.DisableGUI(); } - - void TonyGenericTake1(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -699,13 +632,10 @@ DECLARE_CUSTOM_FUNCTION(TonyTakeDown2)(CORO_PARAM, uint32, uint32, uint32, uint3 TonyGenericTake2(coroParam, 2); } - - DECLARE_CUSTOM_FUNCTION(TonyPutUp1)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericPut1(coroParam, 0); } - DECLARE_CUSTOM_FUNCTION(TonyPutMid1)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericPut1(coroParam, 1); } @@ -718,7 +648,6 @@ DECLARE_CUSTOM_FUNCTION(TonyPutUp2)(CORO_PARAM, uint32, uint32, uint32, uint32) TonyGenericPut2(coroParam, 0); } - DECLARE_CUSTOM_FUNCTION(TonyPutMid2)(CORO_PARAM, uint32, uint32, uint32, uint32) { TonyGenericPut2(coroParam, 1); } @@ -771,7 +700,6 @@ DECLARE_CUSTOM_FUNCTION(TonyWhistle)(CORO_PARAM, uint32, uint32, uint32, uint32) CORO_END_CODE; } - void TonySetNumTexts(uint32 dwText) { GLOBALS._dwTonyNumTexts = dwText; GLOBALS._bTonyInTexts = false; @@ -1580,7 +1508,6 @@ DECLARE_CUSTOM_FUNCTION(MCharSetPosition)(CORO_PARAM, uint32 nChar, uint32 nX, u GLOBALS._mCharacter[nChar]._y = nY; } - DECLARE_CUSTOM_FUNCTION(MCharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) { assert(nChar < 10); GLOBALS._mCharacter[nChar]._r = r; @@ -1588,7 +1515,6 @@ DECLARE_CUSTOM_FUNCTION(MCharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint3 GLOBALS._mCharacter[nChar]._b = b; } - DECLARE_CUSTOM_FUNCTION(MCharSetNumTalksInGroup)(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32 nTalks, uint32) { assert(nChar < 10); assert(nGroup < 10); @@ -1596,7 +1522,6 @@ DECLARE_CUSTOM_FUNCTION(MCharSetNumTalksInGroup)(CORO_PARAM, uint32 nChar, uint3 GLOBALS._mCharacter[nChar]._numTalks[nGroup] = nTalks; } - DECLARE_CUSTOM_FUNCTION(MCharSetCurrentGroup)(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32, uint32) { assert(nChar < 10); assert(nGroup < 10); @@ -1617,7 +1542,6 @@ DECLARE_CUSTOM_FUNCTION(MCharSetAlwaysBack)(CORO_PARAM, uint32 nChar, uint32 bAl GLOBALS._mCharacter[nChar]._bAlwaysBack = bAlwaysBack; } - DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32 nFont) { CORO_BEGIN_CONTEXT; RMMessage *msg; @@ -1662,7 +1586,6 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->voice = NULL; if (_ctx->curVoc) { // Position within the database of entries, beginning at the first - // fseek(g_vm->m_vdbFP, curVoc->offset, SEEK_SET); g_vm->_vdbFP.seek(_ctx->curVoc->_offset); _ctx->curOffset = _ctx->curVoc->_offset; } @@ -1744,8 +1667,6 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes * Dialogs */ -int g_curDialog; - DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg, uint32, uint32) { CORO_BEGIN_CONTEXT; char *string; @@ -1766,7 +1687,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (nPers != 0 && GLOBALS._isMChar[nPers] && GLOBALS._mCharacter[nPers]._bAlwaysBack) _ctx->bIsBack = true; - _ctx->curVoc = SearchVoiceHeader(g_curDialog, nMsg); + _ctx->curVoc = SearchVoiceHeader(GLOBALS._curDialog, nMsg); _ctx->voice = NULL; if (_ctx->curVoc) { @@ -1939,7 +1860,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr CORO_BEGIN_CODE(_ctx); - g_curDialog = nDialog; + GLOBALS._curDialog = nDialog; // Call MPAL to start the dialog mpalQueryDoDialog(nDialog, nStartGroup); @@ -2174,11 +2095,11 @@ DECLARE_CUSTOM_FUNCTION(PlaySoundEffect)(CORO_PARAM, uint32 nMusic, uint32 nFX, } GLOBALS._lastMusic = nMusic; - CustPlayMusic(GLOBALS._curSoundEffect, musicFiles[nMusic].name, nFX, bNoLoop ? false : true, musicFiles[nMusic].sync); + CustPlayMusic(GLOBALS._curSoundEffect, kMusicFiles[nMusic]._name, nFX, bNoLoop ? false : true, kMusicFiles[nMusic]._sync); } DECLARE_CUSTOM_FUNCTION(PlayJingle)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) { - CustPlayMusic(2, jingleFileNames[nMusic], nFX, bLoop); + CustPlayMusic(2, kJingleFileNames[nMusic], nFX, bLoop); } DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) { @@ -2201,7 +2122,7 @@ void RestoreMusic(CORO_PARAM) { CORO_INVOKE_4(PlaySoundEffect, GLOBALS._lastMusic, 0, 0, 0); if (GLOBALS._lastTappeto != 0) - CustPlayMusic(4, ambianceFile[GLOBALS._lastTappeto], 0, true); + CustPlayMusic(4, kAmbianceFile[GLOBALS._lastTappeto], 0, true); CORO_END_CODE; } @@ -2216,7 +2137,6 @@ void LoadMusic(Common::InSaveFile *f) { GLOBALS._lastTappeto = f->readByte(); } - DECLARE_CUSTOM_FUNCTION(JingleFadeStart)(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -2243,9 +2163,6 @@ DECLARE_CUSTOM_FUNCTION(JingleFadeEnd)(CORO_PARAM, uint32 nJingle, uint32 bLoop, CORO_END_CODE; } - - - DECLARE_CUSTOM_FUNCTION(MustSkipIdleStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._bSkipIdle = true; CoroScheduler.setEvent(GLOBALS._hSkipIdle); @@ -2282,7 +2199,6 @@ DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uin CORO_END_CODE; } - DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint32, uint32) { CORO_BEGIN_CONTEXT; RMMessage *msg; @@ -2355,8 +2271,6 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 CORO_END_CODE; } - - BEGIN_CUSTOM_FUNCTION_MAP() ASSIGN(1, CustLoadLocation) @@ -2507,7 +2421,7 @@ ASSIGN(201, MustSkipIdleEnd); END_CUSTOM_FUNCTION_MAP() void processKilledCallback(Common::PROCESS *p) { - for (uint i = 0; i < 10; i++) + for (uint i = 0; i < 10; i++) { if (GLOBALS._mut[i]._ownerPid == p->pid) { // Handle scripts which don't call ReleaseOwnership, such as // the one in loc37's vEnter when Tony is chasing the mouse. @@ -2517,6 +2431,7 @@ void processKilledCallback(Common::PROCESS *p) { GLOBALS._mut[i]._lockCount = 0; CoroScheduler.setEvent(GLOBALS._mut[i]._eventId); } + } } void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation *loc, RMInventory *inv, RMInput *input) { @@ -2531,13 +2446,12 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation GLOBALS.EnableGUI = mainEnableGUI; GLOBALS._bAlwaysDisplay = false; - int i; CoroScheduler.setResourceCallback(processKilledCallback); - for (i = 0; i < 10; i++) + for (int i = 0; i < 10; i++) GLOBALS._mut[i]._eventId = CoroScheduler.createEvent(false, true); - for (i = 0; i < 200; i++) + for (int i = 0; i < 200; i++) GLOBALS._ambiance[i] = 0; GLOBALS._ambiance[6] = AMBIANCE_CRICKETS; -- cgit v1.2.3 From ab719630ba08d243baae155836d287ec4a1bd57d Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 7 Sep 2012 07:39:58 +0200 Subject: TONY: Move const tables back to .cpp, as suggested by LordHoto --- engines/tony/custom.cpp | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 16afa2dfb6..2e5705f059 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -41,6 +41,43 @@ namespace Tony { +static const char *kAmbianceFile[] = { + "None", + "1.ADP", // Grilli.WAV + "2.ADP", // Grilli-Ovattati.WAV + "3.ADP", // Grilli-Vento.WAV + "3.ADP", // Grilli-Vento1.WAV + "5.ADP", // Vento1.WAV + "4.ADP", // Mare1.WAV + "6.ADP" // Mare1.WAV half volume +}; + +static const MusicFileEntry kMusicFiles[] = { + {"00.ADP", 0}, {"01.ADP", 0}, {"02.ADP", 0}, {"03.ADP", 0}, + {"04.ADP", 0}, {"05.ADP", 0}, {"06.ADP", 0}, {"07.ADP", 0}, + {"08.ADP", 2450}, {"09.ADP", 0}, {"10.ADP", 0}, {"11.ADP", 0}, + {"12.ADP", 0}, {"13.ADP", 0}, {"14.ADP", 0}, {"15.ADP", 0}, + {"16.ADP", 0}, {"17.ADP", 0}, {"18.ADP", 0}, {"19.ADP", 0}, + {"20.ADP", 0}, {"21.ADP", 0}, {"22.ADP", 0}, {"23.ADP", 0}, + {"24.ADP", 0}, {"25.ADP", 0}, {"26.ADP", 0}, {"27.ADP", 0}, + {"28.ADP", 1670}, {"29.ADP", 0}, {"30.ADP", 0}, {"31.ADP", 0}, + {"32.ADP", 2900}, {"33.ADP", 0}, {"34.ADP", 0}, {"35.ADP", 0}, + {"36.ADP", 0}, {"37.ADP", 0}, {"38.ADP", 0}, {"39.ADP", 0}, + {"40.ADP", 0}, {"41.ADP", 1920}, {"42.ADP", 1560}, {"43.ADP", 1920}, + {"44.ADP", 1920}, {"45.ADP", 1920}, {"46.ADP", 1920}, {"47.ADP", 1920}, + {"48.ADP", 1920}, {"49.ADP", 1920}, {"50.ADP", 1920}, {"51.ADP", 1920}, + {"52.ADP", 1920}, {"53.ADP", 0}, {"54.ADP", 0}, {"55.ADP", 0}, + {"56.ADP", 0}, {"57.ADP", 0}, {"58.ADP", 0}, {"59.ADP", 0} +}; + + +static const char *kJingleFileNames[] = { + "S00.ADP", "S01.ADP", "S02.ADP", "S03.ADP", "S04.ADP", + "S05.ADP", "S06.ADP", "S07.ADP", "S08.ADP", "S09.ADP", + "S10.ADP", "S11.ADP", "S12.ADP", "S13.ADP", "S14.ADP", + "S15.ADP", "S16.ADP", "S17.ADP", "S18.ADP" +}; + void ReapplyChangedHotspot() { for (int i = 0; i < GLOBALS._curChangedHotspot; i++) GLOBALS._loc->getItemFromCode(GLOBALS._changedHotspot[i]._dwCode)->changeHotspot(RMPoint(GLOBALS._changedHotspot[i]._nX, GLOBALS._changedHotspot[i]._nY)); @@ -63,7 +100,6 @@ void LoadChangedHotspot(Common::InSaveFile *f) { } } - /** * Classes required for custom functions * -- cgit v1.2.3 From 80b51481b9dc3e70e2e55f16c853d6a1e6711522 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 7 Sep 2012 08:11:33 +0200 Subject: TONY: Some more cleanup --- engines/tony/custom.cpp | 705 ++++++++++++++++++++++++------------------------ 1 file changed, 351 insertions(+), 354 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 2e5705f059..516e55b53b 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -78,12 +78,12 @@ static const char *kJingleFileNames[] = { "S15.ADP", "S16.ADP", "S17.ADP", "S18.ADP" }; -void ReapplyChangedHotspot() { +void reapplyChangedHotspot() { for (int i = 0; i < GLOBALS._curChangedHotspot; i++) 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) { f->writeByte(GLOBALS._curChangedHotspot); if (GLOBALS._curChangedHotspot > 0) { for (int i = 0; i < GLOBALS._curChangedHotspot; ++i) @@ -91,7 +91,7 @@ void SaveChangedHotspot(Common::OutSaveFile *f) { } } -void LoadChangedHotspot(Common::InSaveFile *f) { +void loadChangedHotspot(Common::InSaveFile *f) { GLOBALS._curChangedHotspot = f->readByte(); if (GLOBALS._curChangedHotspot > 0) { @@ -110,14 +110,14 @@ void LoadChangedHotspot(Common::InSaveFile *f) { * AddInventory -> theEngine.AddInventory() */ -void MCharResetCodes() { +void mCharResetCodes() { for (int i = 0; i < 10; i++) GLOBALS._mCharacter[i]._item = GLOBALS._loc->getItemFromCode(GLOBALS._mCharacter[i]._code); for (int i = 0; i < 10; i++) GLOBALS._character[i]._item = GLOBALS._loc->getItemFromCode(GLOBALS._character[i]._code); } -void CharsSaveAll(Common::OutSaveFile *f) { +void charsSaveAll(Common::OutSaveFile *f) { for (int i = 0; i < 10; i++) { f->writeByte(GLOBALS._isMChar[i]); if (GLOBALS._isMChar[i]) { @@ -128,7 +128,7 @@ void CharsSaveAll(Common::OutSaveFile *f) { } } -void CharsLoadAll(Common::InSaveFile *f) { +void charsLoadAll(Common::InSaveFile *f) { for (int i = 0; i < 10; i++) { GLOBALS._isMChar[i] = f->readByte(); if (GLOBALS._isMChar[i]) @@ -138,28 +138,28 @@ void CharsLoadAll(Common::InSaveFile *f) { } } -DECLARE_CUSTOM_FUNCTION(FaceToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void faceToMe(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDDOWN); } -DECLARE_CUSTOM_FUNCTION(BackToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void backToMe(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDUP); } -DECLARE_CUSTOM_FUNCTION(LeftToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void leftToMe(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDLEFT); } -DECLARE_CUSTOM_FUNCTION(RightToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void rightToMe(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDRIGHT); } -DECLARE_CUSTOM_FUNCTION(TonySetPerorate)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { +void tonySetPerorate(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { g_vm->getEngine()->setPerorate(bStatus); } -DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint32) { +void mySleep(CORO_PARAM, uint32 dwTime, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; int i; CORO_END_CONTEXT(_ctx); @@ -172,12 +172,12 @@ DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(SetAlwaysDisplay)(CORO_PARAM, uint32 val, uint32, uint32, uint32) { +void setAlwaysDisplay(CORO_PARAM, uint32 val, uint32, uint32, uint32) { GLOBALS._bAlwaysDisplay = (val != 0); } -DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32, uint32) { +void setPointer(CORO_PARAM, uint32 dwPointer, uint32, uint32, uint32) { switch (dwPointer) { case 1: GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_ARROWUP); @@ -201,7 +201,7 @@ DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32 } } -VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) { +VoiceHeader *searchVoiceHeader(uint32 codehi, uint32 codelo) { int code = (codehi << 16) | codelo; if (g_vm->_voices.size() == 0) @@ -216,7 +216,7 @@ VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) { } -DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX, uint32 nY, uint32) { +void sendTonyMessage(CORO_PARAM, uint32 dwMessage, uint32 nX, uint32 nY, uint32) { CORO_BEGIN_CONTEXT; RMMessage msg; int i; @@ -237,7 +237,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX if (!_ctx->msg.isValid()) return; - _ctx->curVoc = SearchVoiceHeader(0, dwMessage); + _ctx->curVoc = searchVoiceHeader(0, dwMessage); _ctx->voice = NULL; if (_ctx->curVoc) { // Is positioned within the database of entries beginning at the first @@ -333,12 +333,12 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(ChangeBoxStatus)(CORO_PARAM, uint32 nLoc, uint32 nBox, uint32 nStatus, uint32) { +void changeBoxStatus(CORO_PARAM, uint32 nLoc, uint32 nBox, uint32 nStatus, uint32) { GLOBALS._boxes->changeBoxStatus(nLoc, nBox, nStatus); } -DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { +void custLoadLocation(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { CORO_BEGIN_CONTEXT; uint32 h; CORO_END_CONTEXT(_ctx); @@ -361,7 +361,7 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, ui } -DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) { +void sendFullscreenMsgStart(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) { CORO_BEGIN_CONTEXT; RMMessage *msg; RMGfxClearTask clear; @@ -420,7 +420,7 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void clearScreen(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; char buf[256]; RMGfxClearTask clear; @@ -440,33 +440,33 @@ DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) { +void sendFullscreenMsgEnd(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) { g_vm->getEngine()->loadLocation(GLOBALS._fullScreenMessageLoc, RMPoint(GLOBALS._fullScreenMessagePt._x, GLOBALS._fullScreenMessagePt._y), RMPoint(-1, -1)); if (!bNotEnableTony) GLOBALS._tony->show(); - MCharResetCodes(); - ReapplyChangedHotspot(); + mCharResetCodes(); + reapplyChangedHotspot(); } -DECLARE_CUSTOM_FUNCTION(SendFullscreenMessage)(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) { +void sendFullscreenMessage(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_4(SendFullscreenMsgStart, nMsg, nFont, 0, 0); - CORO_INVOKE_4(SendFullscreenMsgEnd, 0, 0, 0, 0); + CORO_INVOKE_4(sendFullscreenMsgStart, nMsg, nFont, 0, 0); + CORO_INVOKE_4(sendFullscreenMsgEnd, 0, 0, 0, 0); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(NoBullsEye)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void noBullsEye(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._bNoBullsEye = true; } -DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void closeLocation(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -486,7 +486,7 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3 } -DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { +void changeLocation(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) { CORO_BEGIN_CONTEXT; uint32 h; CORO_END_CONTEXT(_ctx); @@ -537,49 +537,49 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(CORO_PARAM, uint32 nLoc, uint32 lX, uint32 lY, uint32) { +void setLocStartPosition(CORO_PARAM, uint32 nLoc, uint32 lX, uint32 lY, uint32) { GLOBALS._startLocPos[nLoc].set(lX, lY); } -DECLARE_CUSTOM_FUNCTION(SaveTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void saveTonyPosition(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._saveTonyPos = GLOBALS._tony->position(); GLOBALS._saveTonyLoc = GLOBALS._loc->TEMPGetNumLoc(); } -DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void restoreTonyPosition(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_4(ChangeLocation, GLOBALS._saveTonyLoc, GLOBALS._saveTonyPos._x, GLOBALS._saveTonyPos._y, 0); + CORO_INVOKE_4(changeLocation, GLOBALS._saveTonyLoc, GLOBALS._saveTonyPos._x, GLOBALS._saveTonyPos._y, 0); - MCharResetCodes(); + mCharResetCodes(); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(DisableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void disableInput(CORO_PARAM, uint32, uint32, uint32, uint32) { g_vm->getEngine()->disableInput(); } -DECLARE_CUSTOM_FUNCTION(EnableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void enableInput(CORO_PARAM, uint32, uint32, uint32, uint32) { g_vm->getEngine()->enableInput(); } -DECLARE_CUSTOM_FUNCTION(StopTony)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void stopTony(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._tony->stopNoAction(coroParam); } -DECLARE_CUSTOM_FUNCTION(CustEnableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void custEnableGUI(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS.EnableGUI(); } -DECLARE_CUSTOM_FUNCTION(CustDisableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void custDisableGUI(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS.DisableGUI(); } -void TonyGenericTake1(CORO_PARAM, uint32 nDirection) { +void tonyGenericTake1(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -593,7 +593,7 @@ void TonyGenericTake1(CORO_PARAM, uint32 nDirection) { CORO_END_CODE; } -void TonyGenericTake2(CORO_PARAM, uint32 nDirection) { +void tonyGenericTake2(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -609,7 +609,7 @@ void TonyGenericTake2(CORO_PARAM, uint32 nDirection) { CORO_END_CODE; } -void TonyGenericPut1(CORO_PARAM, uint32 nDirection) { +void tonyGenericPut1(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -623,7 +623,7 @@ void TonyGenericPut1(CORO_PARAM, uint32 nDirection) { CORO_END_CODE; } -void TonyGenericPut2(CORO_PARAM, uint32 nDirection) { +void tonyGenericPut2(CORO_PARAM, uint32 nDirection) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -640,67 +640,65 @@ void TonyGenericPut2(CORO_PARAM, uint32 nDirection) { } -DECLARE_CUSTOM_FUNCTION(TonyTakeUp1)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericTake1(coroParam, 0); +void tonyTakeUp1(CORO_PARAM, uint32, uint32, uint32, uint32) { + tonyGenericTake1(coroParam, 0); } -DECLARE_CUSTOM_FUNCTION(TonyTakeMid1)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericTake1(coroParam, 1); +void tonyTakeMid1(CORO_PARAM, uint32, uint32, uint32, uint32) { + tonyGenericTake1(coroParam, 1); } -DECLARE_CUSTOM_FUNCTION(TonyTakeDown1)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericTake1(coroParam, 2); +void tonyTakeDown1(CORO_PARAM, uint32, uint32, uint32, uint32) { + tonyGenericTake1(coroParam, 2); } - - -DECLARE_CUSTOM_FUNCTION(TonyTakeUp2)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericTake2(coroParam, 0); +void tonyTakeUp2(CORO_PARAM, uint32, uint32, uint32, uint32) { + tonyGenericTake2(coroParam, 0); } -DECLARE_CUSTOM_FUNCTION(TonyTakeMid2)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericTake2(coroParam, 1); +void tonyTakeMid2(CORO_PARAM, uint32, uint32, uint32, uint32) { + tonyGenericTake2(coroParam, 1); } -DECLARE_CUSTOM_FUNCTION(TonyTakeDown2)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericTake2(coroParam, 2); +void tonyTakeDown2(CORO_PARAM, uint32, uint32, uint32, uint32) { + tonyGenericTake2(coroParam, 2); } -DECLARE_CUSTOM_FUNCTION(TonyPutUp1)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericPut1(coroParam, 0); +void tonyPutUp1(CORO_PARAM, uint32, uint32, uint32, uint32) { + tonyGenericPut1(coroParam, 0); } -DECLARE_CUSTOM_FUNCTION(TonyPutMid1)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericPut1(coroParam, 1); +void tonyPutMid1(CORO_PARAM, uint32, uint32, uint32, uint32) { + tonyGenericPut1(coroParam, 1); } -DECLARE_CUSTOM_FUNCTION(TonyPutDown1)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericPut1(coroParam, 2); +void tonyPutDown1(CORO_PARAM, uint32, uint32, uint32, uint32) { + tonyGenericPut1(coroParam, 2); } -DECLARE_CUSTOM_FUNCTION(TonyPutUp2)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericPut2(coroParam, 0); +void tonyPutUp2(CORO_PARAM, uint32, uint32, uint32, uint32) { + tonyGenericPut2(coroParam, 0); } -DECLARE_CUSTOM_FUNCTION(TonyPutMid2)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericPut2(coroParam, 1); +void tonyPutMid2(CORO_PARAM, uint32, uint32, uint32, uint32) { + tonyGenericPut2(coroParam, 1); } -DECLARE_CUSTOM_FUNCTION(TonyPutDown2)(CORO_PARAM, uint32, uint32, uint32, uint32) { - TonyGenericPut2(coroParam, 2); +void tonyPutDown2(CORO_PARAM, uint32, uint32, uint32, uint32) { + tonyGenericPut2(coroParam, 2); } -DECLARE_CUSTOM_FUNCTION(TonyOnTheFloor)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { +void tonyOnTheFloor(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { if (dwParte == 0) GLOBALS._tony->setPattern(GLOBALS._tony->PAT_ONTHEFLOORLEFT); else GLOBALS._tony->setPattern(GLOBALS._tony->PAT_ONTHEFLOORRIGHT); } -DECLARE_CUSTOM_FUNCTION(TonyGetUp)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { +void tonyGetUp(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -717,11 +715,11 @@ DECLARE_CUSTOM_FUNCTION(TonyGetUp)(CORO_PARAM, uint32 dwParte, uint32, uint32, u CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyShepherdess)(CORO_PARAM, uint32 bIsPast, uint32, uint32, uint32) { +void tonyShepherdess(CORO_PARAM, uint32 bIsPast, uint32, uint32, uint32) { GLOBALS._tony->setShepherdess(bIsPast); } -DECLARE_CUSTOM_FUNCTION(TonyWhistle)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWhistle(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -736,97 +734,97 @@ DECLARE_CUSTOM_FUNCTION(TonyWhistle)(CORO_PARAM, uint32, uint32, uint32, uint32) CORO_END_CODE; } -void TonySetNumTexts(uint32 dwText) { +void tonySetNumTexts(uint32 dwText) { GLOBALS._dwTonyNumTexts = dwText; GLOBALS._bTonyInTexts = false; } -DECLARE_CUSTOM_FUNCTION(TonyLaugh)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyLaugh(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_LAUGH; } -DECLARE_CUSTOM_FUNCTION(TonyGiggle)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyGiggle(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_LAUGH2; } -DECLARE_CUSTOM_FUNCTION(TonyHips)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyHips(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_HIPS; } -DECLARE_CUSTOM_FUNCTION(TonySing)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonySing(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SING; } -DECLARE_CUSTOM_FUNCTION(TonyIndicate)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyIndicate(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_INDICATE; } -DECLARE_CUSTOM_FUNCTION(TonyScaredWithHands)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyScaredWithHands(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SCARED; } -DECLARE_CUSTOM_FUNCTION(TonyScaredWithoutHands)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyScaredWithoutHands(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SCARED2; } -DECLARE_CUSTOM_FUNCTION(TonyWithHammer)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyWithHammer(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHHAMMER; GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHHAMMER); } -DECLARE_CUSTOM_FUNCTION(TonyWithGlasses)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyWithGlasses(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHGLASSES; GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHGLASSES); } -DECLARE_CUSTOM_FUNCTION(TonyWithWorm)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyWithWorm(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHWORM; GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHWORM); } -DECLARE_CUSTOM_FUNCTION(TonyWithRope)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyWithRope(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHROPE; GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHROPE); } -DECLARE_CUSTOM_FUNCTION(TonyWithSecretary)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyWithSecretary(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHSECRETARY; GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHSECRETARY); } -DECLARE_CUSTOM_FUNCTION(TonyWithRabbitANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyWithRabbitANIM(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHRABBIT; } -DECLARE_CUSTOM_FUNCTION(TonyWithRecipeANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyWithRecipeANIM(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHRECIPE; } -DECLARE_CUSTOM_FUNCTION(TonyWithCardsANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyWithCardsANIM(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHCARDS; } -DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyWithSnowmanANIM(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHSNOWMAN; } -DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithSnowmanStart(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -839,7 +837,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanStart)(CORO_PARAM, uint32, uint32, uint32 CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithSnowmanEnd(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -852,7 +850,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanEnd)(CORO_PARAM, uint32, uint32, uint32, CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyWithRabbitStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithRabbitStart(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -865,7 +863,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithRabbitStart)(CORO_PARAM, uint32, uint32, uint32, CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyWithRabbitEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithRabbitEnd(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -878,7 +876,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithRabbitEnd)(CORO_PARAM, uint32, uint32, uint32, u CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyWithRecipeStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithRecipeStart(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -891,7 +889,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithRecipeStart)(CORO_PARAM, uint32, uint32, uint32, CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyWithRecipeEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithRecipeEnd(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -904,7 +902,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithRecipeEnd)(CORO_PARAM, uint32, uint32, uint32, u CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyWithCardsStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithCardsStart(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -917,7 +915,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithCardsStart)(CORO_PARAM, uint32, uint32, uint32, CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyWithCardsEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithCardsEnd(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -930,7 +928,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithCardsEnd)(CORO_PARAM, uint32, uint32, uint32, ui CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyWithNotebookStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithNotebookStart(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -943,7 +941,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithNotebookStart)(CORO_PARAM, uint32, uint32, uint3 CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyWithNotebookEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithNotebookEnd(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -956,7 +954,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithNotebookEnd)(CORO_PARAM, uint32, uint32, uint32, CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithMegaphoneStart(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -969,7 +967,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneStart)(CORO_PARAM, uint32, uint32, uint CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithMegaphoneEnd(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -982,7 +980,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneEnd)(CORO_PARAM, uint32, uint32, uint32 CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyWithBeardStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithBeardStart(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -995,7 +993,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithBeardStart)(CORO_PARAM, uint32, uint32, uint32, CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyWithBeardEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyWithBeardEnd(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -1008,7 +1006,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithBeardEnd)(CORO_PARAM, uint32, uint32, uint32, ui CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyScaredStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyScaredStart(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -1021,7 +1019,7 @@ DECLARE_CUSTOM_FUNCTION(TonyScaredStart)(CORO_PARAM, uint32, uint32, uint32, uin CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(TonyScaredEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonyScaredEnd(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -1035,12 +1033,12 @@ DECLARE_CUSTOM_FUNCTION(TonyScaredEnd)(CORO_PARAM, uint32, uint32, uint32, uint3 } -DECLARE_CUSTOM_FUNCTION(TonyDisgusted)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonyDisgusted(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_DISGUSTED; } -DECLARE_CUSTOM_FUNCTION(TonySniffLeft)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonySniffLeft(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -1048,12 +1046,12 @@ DECLARE_CUSTOM_FUNCTION(TonySniffLeft)(CORO_PARAM, uint32, uint32, uint32, uint3 GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SNIFF_LEFT); 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; } -DECLARE_CUSTOM_FUNCTION(TonySniffRight)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void tonySniffRight(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -1061,17 +1059,17 @@ DECLARE_CUSTOM_FUNCTION(TonySniffRight)(CORO_PARAM, uint32, uint32, uint32, uint GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SNIFF_RIGHT); 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; } -DECLARE_CUSTOM_FUNCTION(TonySarcastic)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { - TonySetNumTexts(dwText); +void tonySarcastic(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) { + tonySetNumTexts(dwText); GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SARCASTIC; } -DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(CORO_PARAM, uint32 nPos, uint32, uint32, uint32) { +void tonyMacbeth(CORO_PARAM, uint32 nPos, uint32, uint32, uint32) { switch (nPos) { case 1: GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_MACBETH1; @@ -1104,15 +1102,15 @@ DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(CORO_PARAM, uint32 nPos, uint32, uint32, ui } -DECLARE_CUSTOM_FUNCTION(EnableTony)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void enableTony(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._tony->show(); } -DECLARE_CUSTOM_FUNCTION(DisableTony)(CORO_PARAM, uint32 bShowShadow, uint32, uint32, uint32) { +void disableTony(CORO_PARAM, uint32 bShowShadow, uint32, uint32, uint32) { GLOBALS._tony->hide(bShowShadow); } -DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uint32, uint32) { +void waitForPatternEnd(CORO_PARAM, uint32 nItem, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; RMItem *item; CORO_END_CONTEXT(_ctx); @@ -1128,11 +1126,11 @@ DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uin } -DECLARE_CUSTOM_FUNCTION(SetTonyPosition)(CORO_PARAM, uint32 nX, uint32 nY, uint32 nLoc, uint32) { +void setTonyPosition(CORO_PARAM, uint32 nX, uint32 nY, uint32 nLoc, uint32) { GLOBALS._tony->setPosition(RMPoint(nX, nY), nLoc); } -DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) { +void moveTonyAndWait(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -1151,11 +1149,11 @@ DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint3 CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(MoveTony)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) { +void moveTony(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) { GLOBALS._tony->move(coroParam, RMPoint(nX, nY)); } -DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) { +void scrollLocation(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) { CORO_BEGIN_CONTEXT; int lx, ly; RMPoint pt; @@ -1203,7 +1201,7 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) { +void syncScrollLocation(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) { CORO_BEGIN_CONTEXT; int lx, ly; RMPoint pt, startpt; @@ -1285,7 +1283,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui } -DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uint32 nY, uint32) { +void changeHotspot(CORO_PARAM, uint32 dwCode, uint32 nX, uint32 nY, uint32) { int i; for (i = 0; i < GLOBALS._curChangedHotspot; i++) { @@ -1307,15 +1305,15 @@ DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uin } -DECLARE_CUSTOM_FUNCTION(AutoSave)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void autoSave(CORO_PARAM, uint32, uint32, uint32, uint32) { g_vm->autoSave(coroParam); } -DECLARE_CUSTOM_FUNCTION(AbortGame)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void abortGame(CORO_PARAM, uint32, uint32, uint32, uint32) { g_vm->abortGame(); } -DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) { +void shakeScreen(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; uint32 i; uint32 curTime; @@ -1353,7 +1351,7 @@ DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32, * Characters */ -DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { +void charSetCode(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { assert(nChar < 16); GLOBALS._character[nChar]._code = nCode; GLOBALS._character[nChar]._item = GLOBALS._loc->getItemFromCode(nCode); @@ -1368,26 +1366,26 @@ DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uin GLOBALS._isMChar[nChar] = false; } -DECLARE_CUSTOM_FUNCTION(CharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) { +void charSetColor(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) { assert(nChar < 16); GLOBALS._character[nChar]._r = r; GLOBALS._character[nChar]._g = g; GLOBALS._character[nChar]._b = b; } -DECLARE_CUSTOM_FUNCTION(CharSetTalkPattern)(CORO_PARAM, uint32 nChar, uint32 tp, uint32 sp, uint32) { +void charSetTalkPattern(CORO_PARAM, uint32 nChar, uint32 tp, uint32 sp, uint32) { assert(nChar < 16); GLOBALS._character[nChar]._talkPattern = tp; GLOBALS._character[nChar]._standPattern = sp; } -DECLARE_CUSTOM_FUNCTION(CharSetStartEndTalkPattern)(CORO_PARAM, uint32 nChar, uint32 sp, uint32 ep, uint32) { +void charSetStartEndTalkPattern(CORO_PARAM, uint32 nChar, uint32 sp, uint32 ep, uint32) { assert(nChar < 16); GLOBALS._character[nChar]._startTalkPattern = sp; GLOBALS._character[nChar]._endTalkPattern = ep; } -DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32) { +void charSendMessage(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32) { CORO_BEGIN_CONTEXT; RMMessage *msg; int i; @@ -1414,7 +1412,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess GLOBALS._character[nChar]._item->setPattern(GLOBALS._character[nChar]._talkPattern); - _ctx->curVoc = SearchVoiceHeader(0, dwMessage); + _ctx->curVoc = searchVoiceHeader(0, dwMessage); _ctx->voice = NULL; if (_ctx->curVoc) { // Position within the database of entries, beginning at the first @@ -1494,15 +1492,15 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(AddInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { +void addInventory(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { GLOBALS._inventory->addItem(dwCode); } -DECLARE_CUSTOM_FUNCTION(RemoveInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { +void removeInventory(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) { GLOBALS._inventory->removeItem(dwCode); } -DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32 dwStatus, uint32, uint32) { +void changeInventoryStatus(CORO_PARAM, uint32 dwCode, uint32 dwStatus, uint32, uint32) { GLOBALS._inventory->changeItemStatus(dwCode, dwStatus); } @@ -1511,7 +1509,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32 * Master Characters */ -DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { +void mCharSetCode(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) { assert(nChar < 10); GLOBALS._mCharacter[nChar]._code = nCode; if (nCode == 0) @@ -1533,52 +1531,52 @@ DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, ui GLOBALS._isMChar[nChar] = true; } -DECLARE_CUSTOM_FUNCTION(MCharResetCode)(CORO_PARAM, uint32 nChar, uint32, uint32, uint32) { +void mCharResetCode(CORO_PARAM, uint32 nChar, uint32, uint32, uint32) { GLOBALS._mCharacter[nChar]._item = GLOBALS._loc->getItemFromCode(GLOBALS._mCharacter[nChar]._code); } -DECLARE_CUSTOM_FUNCTION(MCharSetPosition)(CORO_PARAM, uint32 nChar, uint32 nX, uint32 nY, uint32) { +void mCharSetPosition(CORO_PARAM, uint32 nChar, uint32 nX, uint32 nY, uint32) { assert(nChar < 10); GLOBALS._mCharacter[nChar]._x = nX; GLOBALS._mCharacter[nChar]._y = nY; } -DECLARE_CUSTOM_FUNCTION(MCharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) { +void mCharSetColor(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) { assert(nChar < 10); GLOBALS._mCharacter[nChar]._r = r; GLOBALS._mCharacter[nChar]._g = g; GLOBALS._mCharacter[nChar]._b = b; } -DECLARE_CUSTOM_FUNCTION(MCharSetNumTalksInGroup)(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32 nTalks, uint32) { +void mCharSetNumTalksInGroup(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32 nTalks, uint32) { assert(nChar < 10); assert(nGroup < 10); GLOBALS._mCharacter[nChar]._numTalks[nGroup] = nTalks; } -DECLARE_CUSTOM_FUNCTION(MCharSetCurrentGroup)(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32, uint32) { +void mCharSetCurrentGroup(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32, uint32) { assert(nChar < 10); assert(nGroup < 10); GLOBALS._mCharacter[nChar]._curGroup = nGroup; } -DECLARE_CUSTOM_FUNCTION(MCharSetNumTexts)(CORO_PARAM, uint32 nChar, uint32 nTexts, uint32, uint32) { +void mCharSetNumTexts(CORO_PARAM, uint32 nChar, uint32 nTexts, uint32, uint32) { assert(nChar < 10); GLOBALS._mCharacter[nChar]._numTexts = nTexts - 1; GLOBALS._mCharacter[nChar]._bInTexts = false; } -DECLARE_CUSTOM_FUNCTION(MCharSetAlwaysBack)(CORO_PARAM, uint32 nChar, uint32 bAlwaysBack, uint32, uint32) { +void mCharSetAlwaysBack(CORO_PARAM, uint32 nChar, uint32 bAlwaysBack, uint32, uint32) { assert(nChar < 10); GLOBALS._mCharacter[nChar]._bAlwaysBack = bAlwaysBack; } -DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32 nFont) { +void mCharSendMessage(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32 nFont) { CORO_BEGIN_CONTEXT; RMMessage *msg; int i; @@ -1618,7 +1616,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes } } - _ctx->curVoc = SearchVoiceHeader(0, dwMessage); + _ctx->curVoc = searchVoiceHeader(0, dwMessage); _ctx->voice = NULL; if (_ctx->curVoc) { // Position within the database of entries, beginning at the first @@ -1703,7 +1701,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes * Dialogs */ -DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg, uint32, uint32) { +void sendDialogMessage(CORO_PARAM, uint32 nPers, uint32 nMsg, uint32, uint32) { CORO_BEGIN_CONTEXT; char *string; RMTextDialog *text; @@ -1723,7 +1721,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (nPers != 0 && GLOBALS._isMChar[nPers] && GLOBALS._mCharacter[nPers]._bAlwaysBack) _ctx->bIsBack = true; - _ctx->curVoc = SearchVoiceHeader(GLOBALS._curDialog, nMsg); + _ctx->curVoc = searchVoiceHeader(GLOBALS._curDialog, nMsg); _ctx->voice = NULL; if (_ctx->curVoc) { @@ -1884,7 +1882,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg // @@@@ This cannot be skipped!!!!!!!!!!!!!!!!!!! -DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGroup, uint32, uint32) { +void startDialog(CORO_PARAM, uint32 nDialog, uint32 nStartGroup, uint32, uint32) { CORO_BEGIN_CONTEXT; uint32 nChoice; uint32 *sl; @@ -1967,7 +1965,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr * Sync between idle and mpal */ -DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { +void takeOwnership(CORO_PARAM, uint32 num, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -1985,7 +1983,7 @@ DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, u CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { +void releaseOwnership(CORO_PARAM, uint32 num, uint32, uint32, uint32) { if (!GLOBALS._mut[num]._lockCount) { warning("ReleaseOwnership tried to release mutex %d, which isn't held", num); return; @@ -2015,7 +2013,7 @@ DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32 * */ -void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) { +void threadFadeInMusic(CORO_PARAM, const void *nMusic) { CORO_BEGIN_CONTEXT; int i; CORO_END_CONTEXT(_ctx); @@ -2040,7 +2038,7 @@ void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) { CORO_END_CODE; } -void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { +void threadFadeOutMusic(CORO_PARAM, const void *nMusic) { CORO_BEGIN_CONTEXT; int i; int startVolume; @@ -2071,52 +2069,52 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) { CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(FadeInSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) { - CoroScheduler.createProcess(ThreadFadeInMusic, &GLOBALS._curSoundEffect, sizeof(int)); +void fadeInSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) { + CoroScheduler.createProcess(threadFadeInMusic, &GLOBALS._curSoundEffect, sizeof(int)); } -DECLARE_CUSTOM_FUNCTION(FadeOutSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void fadeOutSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._bFadeOutStop = false; - CoroScheduler.createProcess(ThreadFadeOutMusic, &GLOBALS._curSoundEffect, sizeof(int)); + CoroScheduler.createProcess(threadFadeOutMusic, &GLOBALS._curSoundEffect, sizeof(int)); } -DECLARE_CUSTOM_FUNCTION(FadeOutJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void fadeOutJingle(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._bFadeOutStop = false; int channel = 2; - CoroScheduler.createProcess(ThreadFadeOutMusic, &channel, sizeof(int)); + CoroScheduler.createProcess(threadFadeOutMusic, &channel, sizeof(int)); } -DECLARE_CUSTOM_FUNCTION(FadeInJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void fadeInJingle(CORO_PARAM, uint32, uint32, uint32, uint32) { int channel = 2; - CoroScheduler.createProcess(ThreadFadeInMusic, &channel, sizeof(int)); + CoroScheduler.createProcess(threadFadeInMusic, &channel, sizeof(int)); } -DECLARE_CUSTOM_FUNCTION(StopSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void stopSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) { g_vm->stopMusic(GLOBALS._curSoundEffect); } -DECLARE_CUSTOM_FUNCTION(StopJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void stopJingle(CORO_PARAM, uint32, uint32, uint32, uint32) { g_vm->stopMusic(2); } -DECLARE_CUSTOM_FUNCTION(MuteSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void muteSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) { g_vm->setMusicVolume(GLOBALS._curSoundEffect, 0); } -DECLARE_CUSTOM_FUNCTION(DemuteSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void demuteSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._bFadeOutStop = true; g_vm->setMusicVolume(GLOBALS._curSoundEffect, 64); } -DECLARE_CUSTOM_FUNCTION(MuteJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void muteJingle(CORO_PARAM, uint32, uint32, uint32, uint32) { g_vm->setMusicVolume(2, 0); } -DECLARE_CUSTOM_FUNCTION(DemuteJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void demuteJingle(CORO_PARAM, uint32, uint32, uint32, uint32) { g_vm->setMusicVolume(2, 64); } -void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int nSync = 0) { +void custPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int nSync = 0) { if (nSync == 0) nSync = 2000; debugC(DEBUG_INTERMEDIATE, kTonyDebugMusic, "Start CustPlayMusic"); @@ -2124,21 +2122,21 @@ void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int debugC(DEBUG_INTERMEDIATE, kTonyDebugMusic, "End CustPlayMusic"); } -DECLARE_CUSTOM_FUNCTION(PlaySoundEffect)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) { +void playSoundEffect(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) { if (nFX == 0 || nFX == 1 || nFX == 2) { debugC(DEBUG_INTERMEDIATE, kTonyDebugSound, "PlaySoundEffect stop fadeout"); GLOBALS._bFadeOutStop = true; } GLOBALS._lastMusic = nMusic; - CustPlayMusic(GLOBALS._curSoundEffect, kMusicFiles[nMusic]._name, nFX, bNoLoop ? false : true, kMusicFiles[nMusic]._sync); + custPlayMusic(GLOBALS._curSoundEffect, kMusicFiles[nMusic]._name, nFX, bNoLoop ? false : true, kMusicFiles[nMusic]._sync); } -DECLARE_CUSTOM_FUNCTION(PlayJingle)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) { - CustPlayMusic(2, kJingleFileNames[nMusic], nFX, bLoop); +void playJingle(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) { + custPlayMusic(2, kJingleFileNames[nMusic], nFX, bLoop); } -DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) { +void playItemSfx(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) { if (nItem == 0) { GLOBALS._tony->playSfx(nSFX); } else { @@ -2148,72 +2146,71 @@ DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint } } - -void RestoreMusic(CORO_PARAM) { +void restoreMusic(CORO_PARAM) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_4(PlaySoundEffect, GLOBALS._lastMusic, 0, 0, 0); + CORO_INVOKE_4(playSoundEffect, GLOBALS._lastMusic, 0, 0, 0); if (GLOBALS._lastTappeto != 0) - CustPlayMusic(4, kAmbianceFile[GLOBALS._lastTappeto], 0, true); + custPlayMusic(4, kAmbianceFile[GLOBALS._lastTappeto], 0, true); CORO_END_CODE; } -void SaveMusic(Common::OutSaveFile *f) { +void saveMusic(Common::OutSaveFile *f) { f->writeByte(GLOBALS._lastMusic); f->writeByte(GLOBALS._lastTappeto); } -void LoadMusic(Common::InSaveFile *f) { +void loadMusic(Common::InSaveFile *f) { GLOBALS._lastMusic = f->readByte(); GLOBALS._lastTappeto = f->readByte(); } -DECLARE_CUSTOM_FUNCTION(JingleFadeStart)(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) { +void jingleFadeStart(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_4(FadeOutSoundEffect, 0, 0, 0, 0); - CORO_INVOKE_4(MuteJingle, 0, 0, 0, 0); - CORO_INVOKE_4(PlayJingle, nJingle, 0, bLoop, 0); - CORO_INVOKE_4(FadeInJingle, 0, 0, 0, 0); + CORO_INVOKE_4(fadeOutSoundEffect, 0, 0, 0, 0); + CORO_INVOKE_4(muteJingle, 0, 0, 0, 0); + CORO_INVOKE_4(playJingle, nJingle, 0, bLoop, 0); + CORO_INVOKE_4(fadeInJingle, 0, 0, 0, 0); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(JingleFadeEnd)(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) { +void jingleFadeEnd(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_4(FadeOutJingle, 0, 0, 0, 0); - CORO_INVOKE_4(FadeInSoundEffect, 0, 0, 0, 0); + CORO_INVOKE_4(fadeOutJingle, 0, 0, 0, 0); + CORO_INVOKE_4(fadeInSoundEffect, 0, 0, 0, 0); CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(MustSkipIdleStart)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void mustSkipIdleStart(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._bSkipIdle = true; CoroScheduler.setEvent(GLOBALS._hSkipIdle); } -DECLARE_CUSTOM_FUNCTION(MustSkipIdleEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void mustSkipIdleEnd(CORO_PARAM, uint32, uint32, uint32, uint32) { GLOBALS._bSkipIdle = false; CoroScheduler.resetEvent(GLOBALS._hSkipIdle); } -DECLARE_CUSTOM_FUNCTION(PatIrqFreeze)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { +void patIrqFreeze(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) { // Unused in ScummVM. } -DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void openInitLoadMenu(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -2224,7 +2221,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, ui CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uint32) { +void openInitOptions(CORO_PARAM, uint32, uint32, uint32, uint32) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -2235,7 +2232,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uin CORO_END_CODE; } -DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint32, uint32) { +void doCredits(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint32, uint32) { CORO_BEGIN_CONTEXT; RMMessage *msg; RMTextDialog *text; @@ -2309,150 +2306,150 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 BEGIN_CUSTOM_FUNCTION_MAP() -ASSIGN(1, CustLoadLocation) -ASSIGN(2, MySleep) -ASSIGN(3, SetPointer) -ASSIGN(5, MoveTony) -ASSIGN(6, FaceToMe) -ASSIGN(7, BackToMe) -ASSIGN(8, LeftToMe) -ASSIGN(9, RightToMe) -ASSIGN(10, SendTonyMessage) -ASSIGN(11, ChangeBoxStatus) -ASSIGN(12, ChangeLocation) -ASSIGN(13, DisableTony) -ASSIGN(14, EnableTony) -ASSIGN(15, WaitForPatternEnd) -ASSIGN(16, SetLocStartPosition) -ASSIGN(17, ScrollLocation) -ASSIGN(18, MoveTonyAndWait) -ASSIGN(19, ChangeHotspot) -ASSIGN(20, AddInventory) -ASSIGN(21, RemoveInventory) -ASSIGN(22, ChangeInventoryStatus) -ASSIGN(23, SetTonyPosition) -ASSIGN(24, SendFullscreenMessage) -ASSIGN(25, SaveTonyPosition) -ASSIGN(26, RestoreTonyPosition) -ASSIGN(27, DisableInput) -ASSIGN(28, EnableInput) -ASSIGN(29, StopTony) - -ASSIGN(30, TonyTakeUp1) -ASSIGN(31, TonyTakeMid1) -ASSIGN(32, TonyTakeDown1) -ASSIGN(33, TonyTakeUp2) -ASSIGN(34, TonyTakeMid2) -ASSIGN(35, TonyTakeDown2) - -ASSIGN(72, TonyPutUp1) -ASSIGN(73, TonyPutMid1) -ASSIGN(74, TonyPutDown1) -ASSIGN(75, TonyPutUp2) -ASSIGN(76, TonyPutMid2) -ASSIGN(77, TonyPutDown2) - -ASSIGN(36, TonyOnTheFloor) -ASSIGN(37, TonyGetUp) -ASSIGN(38, TonyShepherdess) -ASSIGN(39, TonyWhistle) - -ASSIGN(40, TonyLaugh) -ASSIGN(41, TonyHips) -ASSIGN(42, TonySing) -ASSIGN(43, TonyIndicate) -ASSIGN(44, TonyScaredWithHands) -ASSIGN(49, TonyScaredWithoutHands) -ASSIGN(45, TonyWithGlasses) -ASSIGN(46, TonyWithWorm) -ASSIGN(47, TonyWithHammer) -ASSIGN(48, TonyWithRope) -ASSIGN(90, TonyWithRabbitANIM) -ASSIGN(91, TonyWithRecipeANIM) -ASSIGN(92, TonyWithCardsANIM) -ASSIGN(93, TonyWithSnowmanANIM) -ASSIGN(94, TonyWithSnowmanStart) -ASSIGN(95, TonyWithSnowmanEnd) -ASSIGN(96, TonyWithRabbitStart) -ASSIGN(97, TonyWithRabbitEnd) -ASSIGN(98, TonyWithRecipeStart) -ASSIGN(99, TonyWithRecipeEnd) -ASSIGN(100, TonyWithCardsStart) -ASSIGN(101, TonyWithCardsEnd) -ASSIGN(102, TonyWithNotebookStart) -ASSIGN(103, TonyWithNotebookEnd) -ASSIGN(104, TonyWithMegaphoneStart) -ASSIGN(105, TonyWithMegaphoneEnd) -ASSIGN(106, TonyWithBeardStart) -ASSIGN(107, TonyWithBeardEnd) -ASSIGN(108, TonyGiggle) -ASSIGN(109, TonyDisgusted) -ASSIGN(110, TonySarcastic) -ASSIGN(111, TonyMacbeth) -ASSIGN(112, TonySniffLeft) -ASSIGN(113, TonySniffRight) -ASSIGN(114, TonyScaredStart) -ASSIGN(115, TonyScaredEnd) -ASSIGN(116, TonyWithSecretary) - -ASSIGN(50, CharSetCode) -ASSIGN(51, CharSetColor) -ASSIGN(52, CharSetTalkPattern) -ASSIGN(53, CharSendMessage) -ASSIGN(54, CharSetStartEndTalkPattern) - -ASSIGN(60, MCharSetCode) -ASSIGN(61, MCharSetColor) -ASSIGN(62, MCharSetCurrentGroup) -ASSIGN(63, MCharSetNumTalksInGroup) -ASSIGN(64, MCharSetNumTexts) -ASSIGN(65, MCharSendMessage) -ASSIGN(66, MCharSetPosition) -ASSIGN(67, MCharSetAlwaysBack) -ASSIGN(68, MCharResetCode) - -ASSIGN(70, StartDialog) -ASSIGN(71, SendDialogMessage) - -ASSIGN(80, TakeOwnership) -ASSIGN(81, ReleaseOwnership) - -ASSIGN(86, PlaySoundEffect) -ASSIGN(87, PlayJingle) -ASSIGN(88, FadeInSoundEffect) -ASSIGN(89, FadeOutSoundEffect) -ASSIGN(123, FadeInJingle) -ASSIGN(124, FadeOutJingle) -ASSIGN(125, MuteSoundEffect) -ASSIGN(126, DemuteSoundEffect) -ASSIGN(127, MuteJingle) -ASSIGN(128, DemuteJingle) -ASSIGN(84, StopSoundEffect) -ASSIGN(85, StopJingle) -ASSIGN(83, PlayItemSfx) -ASSIGN(129, JingleFadeStart) -ASSIGN(130, JingleFadeEnd) - -ASSIGN(120, ShakeScreen) -ASSIGN(121, AutoSave) -ASSIGN(122, AbortGame) -ASSIGN(131, NoBullsEye) -ASSIGN(132, SendFullscreenMsgStart) -ASSIGN(133, SendFullscreenMsgEnd) -ASSIGN(134, CustEnableGUI) -ASSIGN(135, CustDisableGUI) -ASSIGN(136, ClearScreen) -ASSIGN(137, PatIrqFreeze) -ASSIGN(138, TonySetPerorate) -ASSIGN(139, OpenInitLoadMenu) -ASSIGN(140, OpenInitOptions) -ASSIGN(141, SyncScrollLocation) -ASSIGN(142, CloseLocation) -ASSIGN(143, SetAlwaysDisplay) -ASSIGN(144, DoCredits) - -ASSIGN(200, MustSkipIdleStart); -ASSIGN(201, MustSkipIdleEnd); +ASSIGN(1, custLoadLocation) +ASSIGN(2, mySleep) +ASSIGN(3, setPointer) +ASSIGN(5, moveTony) +ASSIGN(6, faceToMe) +ASSIGN(7, backToMe) +ASSIGN(8, leftToMe) +ASSIGN(9, rightToMe) +ASSIGN(10, sendTonyMessage) +ASSIGN(11, changeBoxStatus) +ASSIGN(12, changeLocation) +ASSIGN(13, disableTony) +ASSIGN(14, enableTony) +ASSIGN(15, waitForPatternEnd) +ASSIGN(16, setLocStartPosition) +ASSIGN(17, scrollLocation) +ASSIGN(18, moveTonyAndWait) +ASSIGN(19, changeHotspot) +ASSIGN(20, addInventory) +ASSIGN(21, removeInventory) +ASSIGN(22, changeInventoryStatus) +ASSIGN(23, setTonyPosition) +ASSIGN(24, sendFullscreenMessage) +ASSIGN(25, saveTonyPosition) +ASSIGN(26, restoreTonyPosition) +ASSIGN(27, disableInput) +ASSIGN(28, enableInput) +ASSIGN(29, stopTony) + +ASSIGN(30, tonyTakeUp1) +ASSIGN(31, tonyTakeMid1) +ASSIGN(32, tonyTakeDown1) +ASSIGN(33, tonyTakeUp2) +ASSIGN(34, tonyTakeMid2) +ASSIGN(35, tonyTakeDown2) + +ASSIGN(72, tonyPutUp1) +ASSIGN(73, tonyPutMid1) +ASSIGN(74, tonyPutDown1) +ASSIGN(75, tonyPutUp2) +ASSIGN(76, tonyPutMid2) +ASSIGN(77, tonyPutDown2) + +ASSIGN(36, tonyOnTheFloor) +ASSIGN(37, tonyGetUp) +ASSIGN(38, tonyShepherdess) +ASSIGN(39, tonyWhistle) + +ASSIGN(40, tonyLaugh) +ASSIGN(41, tonyHips) +ASSIGN(42, tonySing) +ASSIGN(43, tonyIndicate) +ASSIGN(44, tonyScaredWithHands) +ASSIGN(49, tonyScaredWithoutHands) +ASSIGN(45, tonyWithGlasses) +ASSIGN(46, tonyWithWorm) +ASSIGN(47, tonyWithHammer) +ASSIGN(48, tonyWithRope) +ASSIGN(90, tonyWithRabbitANIM) +ASSIGN(91, tonyWithRecipeANIM) +ASSIGN(92, tonyWithCardsANIM) +ASSIGN(93, tonyWithSnowmanANIM) +ASSIGN(94, tonyWithSnowmanStart) +ASSIGN(95, tonyWithSnowmanEnd) +ASSIGN(96, tonyWithRabbitStart) +ASSIGN(97, tonyWithRabbitEnd) +ASSIGN(98, tonyWithRecipeStart) +ASSIGN(99, tonyWithRecipeEnd) +ASSIGN(100, tonyWithCardsStart) +ASSIGN(101, tonyWithCardsEnd) +ASSIGN(102, tonyWithNotebookStart) +ASSIGN(103, tonyWithNotebookEnd) +ASSIGN(104, tonyWithMegaphoneStart) +ASSIGN(105, tonyWithMegaphoneEnd) +ASSIGN(106, tonyWithBeardStart) +ASSIGN(107, tonyWithBeardEnd) +ASSIGN(108, tonyGiggle) +ASSIGN(109, tonyDisgusted) +ASSIGN(110, tonySarcastic) +ASSIGN(111, tonyMacbeth) +ASSIGN(112, tonySniffLeft) +ASSIGN(113, tonySniffRight) +ASSIGN(114, tonyScaredStart) +ASSIGN(115, tonyScaredEnd) +ASSIGN(116, tonyWithSecretary) + +ASSIGN(50, charSetCode) +ASSIGN(51, charSetColor) +ASSIGN(52, charSetTalkPattern) +ASSIGN(53, charSendMessage) +ASSIGN(54, charSetStartEndTalkPattern) + +ASSIGN(60, mCharSetCode) +ASSIGN(61, mCharSetColor) +ASSIGN(62, mCharSetCurrentGroup) +ASSIGN(63, mCharSetNumTalksInGroup) +ASSIGN(64, mCharSetNumTexts) +ASSIGN(65, mCharSendMessage) +ASSIGN(66, mCharSetPosition) +ASSIGN(67, mCharSetAlwaysBack) +ASSIGN(68, mCharResetCode) + +ASSIGN(70, startDialog) +ASSIGN(71, sendDialogMessage) + +ASSIGN(80, takeOwnership) +ASSIGN(81, releaseOwnership) + +ASSIGN(86, playSoundEffect) +ASSIGN(87, playJingle) +ASSIGN(88, fadeInSoundEffect) +ASSIGN(89, fadeOutSoundEffect) +ASSIGN(123, fadeInJingle) +ASSIGN(124, fadeOutJingle) +ASSIGN(125, muteSoundEffect) +ASSIGN(126, demuteSoundEffect) +ASSIGN(127, muteJingle) +ASSIGN(128, demuteJingle) +ASSIGN(84, stopSoundEffect) +ASSIGN(85, stopJingle) +ASSIGN(83, playItemSfx) +ASSIGN(129, jingleFadeStart) +ASSIGN(130, jingleFadeEnd) + +ASSIGN(120, shakeScreen) +ASSIGN(121, autoSave) +ASSIGN(122, abortGame) +ASSIGN(131, noBullsEye) +ASSIGN(132, sendFullscreenMsgStart) +ASSIGN(133, sendFullscreenMsgEnd) +ASSIGN(134, custEnableGUI) +ASSIGN(135, custDisableGUI) +ASSIGN(136, clearScreen) +ASSIGN(137, patIrqFreeze) +ASSIGN(138, tonySetPerorate) +ASSIGN(139, openInitLoadMenu) +ASSIGN(140, openInitOptions) +ASSIGN(141, syncScrollLocation) +ASSIGN(142, closeLocation) +ASSIGN(143, setAlwaysDisplay) +ASSIGN(144, doCredits) + +ASSIGN(200, mustSkipIdleStart); +ASSIGN(201, mustSkipIdleEnd); END_CUSTOM_FUNCTION_MAP() -- cgit v1.2.3 From 1f228387656ff9a9dcdd6374a374c9d7a49284cf Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 8 Sep 2012 01:27:11 +0200 Subject: TONY: Constify static data tables in custom.cpp. --- engines/tony/custom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 516e55b53b..99debbfa0e 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -41,7 +41,7 @@ namespace Tony { -static const char *kAmbianceFile[] = { +static const char *const kAmbianceFile[] = { "None", "1.ADP", // Grilli.WAV "2.ADP", // Grilli-Ovattati.WAV @@ -71,7 +71,7 @@ static const MusicFileEntry kMusicFiles[] = { }; -static const char *kJingleFileNames[] = { +static const char *const kJingleFileNames[] = { "S00.ADP", "S01.ADP", "S02.ADP", "S03.ADP", "S04.ADP", "S05.ADP", "S06.ADP", "S07.ADP", "S08.ADP", "S09.ADP", "S10.ADP", "S11.ADP", "S12.ADP", "S13.ADP", "S14.ADP", -- cgit v1.2.3 From 0093c4d13ec23af4b1e72f2caa2d879673397c54 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Tue, 25 Sep 2012 17:32:34 +0200 Subject: TONY: Don't error out on invalid ReleaseOwnership calls. A script triggers this at the end of the scene where you give the flowers to the bearded woman. --- engines/tony/custom.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 99debbfa0e..8cc459b493 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1989,8 +1989,10 @@ void releaseOwnership(CORO_PARAM, uint32 num, uint32, uint32, uint32) { return; } - if (GLOBALS._mut[num]._ownerPid != (uint32)CoroScheduler.getCurrentPID()) - error("ReleaseOwnership tried to release mutex %d, which is held by a different process", num); + if (GLOBALS._mut[num]._ownerPid != (uint32)CoroScheduler.getCurrentPID()) { + warning("ReleaseOwnership tried to release mutex %d, which is held by a different process", num); + return; + } GLOBALS._mut[num]._lockCount--; if (!GLOBALS._mut[num]._lockCount) { -- cgit v1.2.3 From 050a02c6f85ffec8099acaf21cd7a3cf90cefff3 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Tue, 25 Sep 2012 17:33:49 +0200 Subject: TONY: Replace abortGame() with nicer error() calls. --- engines/tony/custom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 8cc459b493..8f260c4f06 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1310,7 +1310,7 @@ void autoSave(CORO_PARAM, uint32, uint32, uint32, uint32) { } void abortGame(CORO_PARAM, uint32, uint32, uint32, uint32) { - g_vm->abortGame(); + error("script called abortGame"); } void shakeScreen(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) { -- cgit v1.2.3 From c61effaff9b5636086204f5e40710feaca1197b8 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 25 Sep 2012 22:09:42 +0200 Subject: TONY: Use debug channel for fading messages --- engines/tony/custom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 8f260c4f06..7bca40b850 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2024,7 +2024,7 @@ void threadFadeInMusic(CORO_PARAM, const void *nMusic) { CORO_BEGIN_CODE(_ctx); - debug("Start FadeIn Music"); + debugC(DEBUG_INTERMEDIATE, kTonyDebugSound, "Start FadeIn Music"); for (_ctx->i = 0; _ctx->i < 16; _ctx->i++) { g_vm->setMusicVolume(nChannel, _ctx->i * 4); @@ -2033,7 +2033,7 @@ void threadFadeInMusic(CORO_PARAM, const void *nMusic) { } g_vm->setMusicVolume(nChannel, 64); - debug("End FadeIn Music"); + debugC(DEBUG_INTERMEDIATE, kTonyDebugSound, "End FadeIn Music"); CORO_KILL_SELF(); -- cgit v1.2.3 From 89abab97e3124fa25eb4c7d3e8b38501747a8d17 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 26 Sep 2012 04:17:31 +0200 Subject: JANITORIAL: Remove trailing whitespaces. Powered by: git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//' --- engines/tony/custom.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 7bca40b850..23c655e35a 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -72,9 +72,9 @@ static const MusicFileEntry kMusicFiles[] = { static const char *const kJingleFileNames[] = { - "S00.ADP", "S01.ADP", "S02.ADP", "S03.ADP", "S04.ADP", - "S05.ADP", "S06.ADP", "S07.ADP", "S08.ADP", "S09.ADP", - "S10.ADP", "S11.ADP", "S12.ADP", "S13.ADP", "S14.ADP", + "S00.ADP", "S01.ADP", "S02.ADP", "S03.ADP", "S04.ADP", + "S05.ADP", "S06.ADP", "S07.ADP", "S08.ADP", "S09.ADP", + "S10.ADP", "S11.ADP", "S12.ADP", "S13.ADP", "S14.ADP", "S15.ADP", "S16.ADP", "S17.ADP", "S18.ADP" }; -- cgit v1.2.3