aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2012-05-13 22:34:40 +1000
committerPaul Gilbert2012-05-13 22:34:40 +1000
commit546f47ddcee07b5bd7ecad5f25f4bb022944e234 (patch)
treef3b6953eaf877174014fc40268ad9084f1e3327b
parent35143eae094b713524ef677412befdc4c766df04 (diff)
downloadscummvm-rg350-546f47ddcee07b5bd7ecad5f25f4bb022944e234.tar.gz
scummvm-rg350-546f47ddcee07b5bd7ecad5f25f4bb022944e234.tar.bz2
scummvm-rg350-546f47ddcee07b5bd7ecad5f25f4bb022944e234.zip
TONY: Beginnings of refactoring Globals into their own class
-rw-r--r--engines/tony/custom.cpp1476
-rw-r--r--engines/tony/font.cpp12
-rw-r--r--engines/tony/game.cpp106
-rw-r--r--engines/tony/game.h20
-rw-r--r--engines/tony/gfxcore.cpp7
-rw-r--r--engines/tony/gfxengine.cpp98
-rw-r--r--engines/tony/globals.cpp93
-rw-r--r--engines/tony/globals.h232
-rw-r--r--engines/tony/inventory.cpp30
-rw-r--r--engines/tony/loc.cpp4
-rw-r--r--engines/tony/module.mk1
-rw-r--r--engines/tony/sound.cpp19
-rw-r--r--engines/tony/tony.cpp61
-rw-r--r--engines/tony/tony.h6
-rw-r--r--engines/tony/tonychar.cpp2
15 files changed, 1130 insertions, 1037 deletions
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; i<curChangedHotspot; i++)
- Loc->GetItemFromCode(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
diff --git a/engines/tony/font.cpp b/engines/tony/font.cpp
index f7f3fb3f8c..dee3c3228a 100644
--- a/engines/tony/font.cpp
+++ b/engines/tony/font.cpp
@@ -2003,7 +2003,7 @@ void RMText::WriteText(const RMString &text, RMFontColor *font, int *time) {
}
if (time != NULL)
- *time = 1000 + numchar * (11 - nCfgTextSpeed) * 14;
+ *time = 1000 + numchar * (11 - GLOBALS.nCfgTextSpeed) * 14;
}
void RMText::ClipOnScreen(RMGfxPrimitive *prim) {
@@ -2128,8 +2128,8 @@ void RMTextDialog::RemoveThis(CORO_PARAM, bool &result) {
// Frase NON di background
if (m_bSkipStatus) {
- if (!(bCfgDubbing && hCustomSkip2 != CORO_INVALID_PID_VALUE))
- if (bCfgTimerizedText) {
+ if (!(GLOBALS.bCfgDubbing && hCustomSkip2 != CORO_INVALID_PID_VALUE))
+ if (GLOBALS.bCfgTimerizedText) {
if (!m_bForceNoTime)
if (_vm->GetTime() > (uint32)m_time + m_startTime)
return;
@@ -2146,7 +2146,7 @@ void RMTextDialog::RemoveThis(CORO_PARAM, bool &result) {
}
// Frase di background
else {
- if (!(bCfgDubbing && hCustomSkip2 != CORO_INVALID_PID_VALUE))
+ if (!(GLOBALS.bCfgDubbing && hCustomSkip2 != CORO_INVALID_PID_VALUE))
if (!m_bForceNoTime)
if (_vm->GetTime() > (uint32)m_time + m_startTime)
return;
@@ -2164,7 +2164,7 @@ void RMTextDialog::RemoveThis(CORO_PARAM, bool &result) {
return;
}
- if (bCfgDubbing && hCustomSkip2 != CORO_INVALID_PID_VALUE) {
+ if (GLOBALS.bCfgDubbing && hCustomSkip2 != CORO_INVALID_PID_VALUE) {
CORO_INVOKE_3(CoroScheduler.waitForSingleObject, hCustomSkip2, 0, &_ctx->expired);
// == WAIT_OBJECT_0
if (!_ctx->expired)
@@ -2192,7 +2192,7 @@ void RMTextDialog::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *p
m_startTime = _vm->GetTime();
if (m_bShowed) {
- if (bCfgSottotitoli || m_bAlwaysDisplay) {
+ if (GLOBALS.bCfgSottotitoli || m_bAlwaysDisplay) {
prim->Dst().TopLeft() = dst;
CORO_INVOKE_2(RMText::Draw, bigBuf, prim);
}
diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp
index 758170c848..b21498a5e8 100644
--- a/engines/tony/game.cpp
+++ b/engines/tony/game.cpp
@@ -63,32 +63,6 @@ namespace Tony {
using namespace MPAL;
/****************************************/
-/* Variabili globali di configurazione */
-/****************************************/
-
-// FIXME: Move into a class instance
-bool bCfgInvLocked;
-bool bCfgInvNoScroll;
-bool bCfgTimerizedText;
-bool bCfgInvUp;
-bool bCfgAnni30;
-bool bCfgAntiAlias;
-bool bCfgSottotitoli;
-bool bCfgTransparence;
-bool bCfgInterTips;
-bool bCfgDubbing;
-bool bCfgMusic;
-bool bCfgSFX;
-int nCfgTonySpeed;
-int nCfgTextSpeed;
-int nCfgDubbingVolume;
-int nCfgMusicVolume;
-int nCfgSFXVolume;
-bool bSkipSfxNoLoop;
-
-bool bPatIrqFreeze;
-
-/****************************************/
/* Funzioni globali per la DLL Custom */
/****************************************/
@@ -699,57 +673,57 @@ void RMOptionScreen::InitState(CORO_PARAM) {
if (m_nState == MENUGAME) {
assert(m_ButtonGame_Lock == NULL);
m_ButtonGame_Lock = new RMOptionButton(20008,RMPoint(176, 262), true);
- m_ButtonGame_Lock->SetActiveState(bCfgInvLocked);
+ m_ButtonGame_Lock->SetActiveState(GLOBALS.bCfgInvLocked);
assert(m_ButtonGame_TimerizedText == NULL);
m_ButtonGame_TimerizedText = new RMOptionButton(20009,RMPoint(463, 273), true);
- m_ButtonGame_TimerizedText->SetActiveState(!bCfgTimerizedText);
+ m_ButtonGame_TimerizedText->SetActiveState(!GLOBALS.bCfgTimerizedText);
assert(m_ButtonGame_Scrolling == NULL);
m_ButtonGame_Scrolling = new RMOptionButton(20010, RMPoint(315, 263), true);
- m_ButtonGame_Scrolling->SetActiveState(bCfgInvNoScroll);
+ m_ButtonGame_Scrolling->SetActiveState(GLOBALS.bCfgInvNoScroll);
assert(m_ButtonGame_InterUp == NULL);
m_ButtonGame_InterUp = new RMOptionButton(20011,RMPoint(36, 258), true);
- m_ButtonGame_InterUp->SetActiveState(bCfgInvUp);
+ m_ButtonGame_InterUp->SetActiveState(GLOBALS.bCfgInvUp);
assert(m_SlideTextSpeed == NULL);
- m_SlideTextSpeed = new RMOptionSlide(RMPoint(165, 122), 10, nCfgTextSpeed);
+ m_SlideTextSpeed = new RMOptionSlide(RMPoint(165, 122), 10, GLOBALS.nCfgTextSpeed);
assert(m_SlideTonySpeed == NULL);
- m_SlideTonySpeed = new RMOptionSlide(RMPoint(165, 226), 5, nCfgTonySpeed);
+ m_SlideTonySpeed = new RMOptionSlide(RMPoint(165, 226), 5, GLOBALS.nCfgTonySpeed);
}
// Menu Graphics
else if (m_nState == MENUGFX) {
assert(m_ButtonGfx_Anni30 == NULL);
m_ButtonGfx_Anni30 = new RMOptionButton(20015,RMPoint(247, 178), true);
- m_ButtonGfx_Anni30->SetActiveState(bCfgAnni30);
+ m_ButtonGfx_Anni30->SetActiveState(GLOBALS.bCfgAnni30);
assert(m_ButtonGfx_AntiAlias == NULL);
m_ButtonGfx_AntiAlias = new RMOptionButton(20016, RMPoint(430, 83), true);
- m_ButtonGfx_AntiAlias->SetActiveState(!bCfgAntiAlias);
+ m_ButtonGfx_AntiAlias->SetActiveState(!GLOBALS.bCfgAntiAlias);
assert(m_ButtonGfx_Sottotitoli == NULL);
m_ButtonGfx_Sottotitoli = new RMOptionButton(20017,RMPoint(98, 82), true);
- m_ButtonGfx_Sottotitoli->SetActiveState(!bCfgSottotitoli);
+ m_ButtonGfx_Sottotitoli->SetActiveState(!GLOBALS.bCfgSottotitoli);
assert(m_ButtonGfx_Tips == NULL);
m_ButtonGfx_Tips = new RMOptionButton(20018,RMPoint(431, 246), true);
- m_ButtonGfx_Tips->SetActiveState(bCfgInterTips);
+ m_ButtonGfx_Tips->SetActiveState(GLOBALS.bCfgInterTips);
assert(m_ButtonGfx_Trans == NULL);
m_ButtonGfx_Trans = new RMOptionButton(20019,RMPoint(126, 271), true);
- m_ButtonGfx_Trans->SetActiveState(!bCfgTransparence);
+ m_ButtonGfx_Trans->SetActiveState(!GLOBALS.bCfgTransparence);
} else if (m_nState == MENUSOUND) {
assert(m_SliderSound_Dubbing == NULL);
- m_SliderSound_Dubbing = new RMOptionSlide(RMPoint(165, 122), 10, nCfgDubbingVolume);
+ m_SliderSound_Dubbing = new RMOptionSlide(RMPoint(165, 122), 10, GLOBALS.nCfgDubbingVolume);
assert(m_SliderSound_Music == NULL);
- m_SliderSound_Music = new RMOptionSlide(RMPoint(165, 226), 10, nCfgMusicVolume);
+ m_SliderSound_Music = new RMOptionSlide(RMPoint(165, 226), 10, GLOBALS.nCfgMusicVolume);
assert(m_SliderSound_SFX == NULL);
- m_SliderSound_SFX = new RMOptionSlide(RMPoint(165, 330), 10, nCfgSFXVolume);
+ m_SliderSound_SFX = new RMOptionSlide(RMPoint(165, 330), 10, GLOBALS.nCfgSFXVolume);
assert(m_ButtonSound_DubbingOn == NULL);
m_ButtonSound_DubbingOn = new RMOptionButton(20033, RMPoint(339, 75), true);
- m_ButtonSound_DubbingOn->SetActiveState(bCfgDubbing);
+ m_ButtonSound_DubbingOn->SetActiveState(GLOBALS.bCfgDubbing);
assert(m_ButtonSound_MusicOn == NULL);
m_ButtonSound_MusicOn = new RMOptionButton(20034,RMPoint(338, 179), true);
- m_ButtonSound_MusicOn->SetActiveState(bCfgMusic);
+ m_ButtonSound_MusicOn->SetActiveState(GLOBALS.bCfgMusic);
assert(m_ButtonSound_SFXOn == NULL);
m_ButtonSound_SFXOn = new RMOptionButton(20035,RMPoint(338, 283), true);
- m_ButtonSound_SFXOn->SetActiveState(bCfgSFX);
+ m_ButtonSound_SFXOn->SetActiveState(GLOBALS.bCfgSFX);
}
}
@@ -815,71 +789,71 @@ void RMOptionScreen::CloseState(void) {
}
if (m_nState == MENUGAME) {
- bCfgInvLocked = m_ButtonGame_Lock->IsActive();
+ GLOBALS.bCfgInvLocked = m_ButtonGame_Lock->IsActive();
delete m_ButtonGame_Lock;
m_ButtonGame_Lock = NULL;
- bCfgTimerizedText = !m_ButtonGame_TimerizedText->IsActive();
+ GLOBALS.bCfgTimerizedText = !m_ButtonGame_TimerizedText->IsActive();
delete m_ButtonGame_TimerizedText;
m_ButtonGame_TimerizedText = NULL;
- bCfgInvNoScroll = m_ButtonGame_Scrolling->IsActive();
+ GLOBALS.bCfgInvNoScroll = m_ButtonGame_Scrolling->IsActive();
delete m_ButtonGame_Scrolling;
m_ButtonGame_Scrolling = NULL;
- bCfgInvUp = m_ButtonGame_InterUp->IsActive();
+ GLOBALS.bCfgInvUp = m_ButtonGame_InterUp->IsActive();
delete m_ButtonGame_InterUp;
m_ButtonGame_InterUp = NULL;
- nCfgTextSpeed = m_SlideTextSpeed->GetValue();
+ GLOBALS.nCfgTextSpeed = m_SlideTextSpeed->GetValue();
delete m_SlideTextSpeed;
m_SlideTextSpeed = NULL;
- nCfgTonySpeed = m_SlideTonySpeed->GetValue();
+ GLOBALS.nCfgTonySpeed = m_SlideTonySpeed->GetValue();
delete m_SlideTonySpeed;
m_SlideTonySpeed = NULL;
} else if (m_nState == MENUGFX) {
- bCfgAnni30 = m_ButtonGfx_Anni30->IsActive();
+ GLOBALS.bCfgAnni30 = m_ButtonGfx_Anni30->IsActive();
delete m_ButtonGfx_Anni30;
m_ButtonGfx_Anni30 = NULL;
- bCfgAntiAlias = !m_ButtonGfx_AntiAlias->IsActive();
+ GLOBALS.bCfgAntiAlias = !m_ButtonGfx_AntiAlias->IsActive();
delete m_ButtonGfx_AntiAlias;
m_ButtonGfx_AntiAlias = NULL;
- bCfgSottotitoli = !m_ButtonGfx_Sottotitoli->IsActive();
+ GLOBALS.bCfgSottotitoli = !m_ButtonGfx_Sottotitoli->IsActive();
delete m_ButtonGfx_Sottotitoli;
m_ButtonGfx_Sottotitoli = NULL;
- bCfgInterTips = m_ButtonGfx_Tips->IsActive();
+ GLOBALS.bCfgInterTips = m_ButtonGfx_Tips->IsActive();
delete m_ButtonGfx_Tips;
m_ButtonGfx_Tips = NULL;
- bCfgTransparence = !m_ButtonGfx_Trans->IsActive();
+ GLOBALS.bCfgTransparence = !m_ButtonGfx_Trans->IsActive();
delete m_ButtonGfx_Trans;
m_ButtonGfx_Trans = NULL;
} else if (m_nState == MENUSOUND) {
- nCfgDubbingVolume = m_SliderSound_Dubbing->GetValue();
+ GLOBALS.nCfgDubbingVolume = m_SliderSound_Dubbing->GetValue();
delete m_SliderSound_Dubbing;
m_SliderSound_Dubbing = NULL;
- nCfgMusicVolume = m_SliderSound_Music->GetValue();
+ GLOBALS.nCfgMusicVolume = m_SliderSound_Music->GetValue();
delete m_SliderSound_Music;
m_SliderSound_Music = NULL;
- nCfgSFXVolume = m_SliderSound_SFX->GetValue();
+ GLOBALS.nCfgSFXVolume = m_SliderSound_SFX->GetValue();
delete m_SliderSound_SFX;
m_SliderSound_SFX = NULL;
- bCfgDubbing = m_ButtonSound_DubbingOn->IsActive();
+ GLOBALS.bCfgDubbing = m_ButtonSound_DubbingOn->IsActive();
delete m_ButtonSound_DubbingOn;
m_ButtonSound_DubbingOn = NULL;
- bCfgMusic = m_ButtonSound_MusicOn->IsActive();
+ GLOBALS.bCfgMusic = m_ButtonSound_MusicOn->IsActive();
delete m_ButtonSound_MusicOn;
m_ButtonSound_MusicOn = NULL;
- bCfgSFX = m_ButtonSound_SFXOn->IsActive();
+ GLOBALS.bCfgSFX = m_ButtonSound_SFXOn->IsActive();
delete m_ButtonSound_SFXOn;
m_ButtonSound_SFXOn = NULL;
}
@@ -1261,19 +1235,19 @@ void RMOptionScreen::DoFrame(CORO_PARAM, RMInput *input) {
if (m_nState == MENUGFX) {
// Queste opzioni hanno effetto immediato
if (m_ButtonGfx_Anni30->IsActive())
- bCfgAnni30 = true;
+ GLOBALS.bCfgAnni30 = true;
else
- bCfgAnni30 = false;
+ GLOBALS.bCfgAnni30 = false;
if (m_ButtonGfx_AntiAlias->IsActive())
- bCfgAntiAlias = false;
+ GLOBALS.bCfgAntiAlias = false;
else
- bCfgAntiAlias = true;
+ GLOBALS.bCfgAntiAlias = true;
if (m_ButtonGfx_Trans->IsActive())
- bCfgTransparence = false;
+ GLOBALS.bCfgTransparence = false;
else
- bCfgTransparence = true;
+ GLOBALS.bCfgTransparence = true;
}
}
}
diff --git a/engines/tony/game.h b/engines/tony/game.h
index 8cd64ec7d2..80482f39da 100644
--- a/engines/tony/game.h
+++ b/engines/tony/game.h
@@ -72,26 +72,6 @@ namespace Tony {
(buf8)->Init(*raw, raw->Width(), raw->Height(), true); \
delete raw;
-extern bool bCfgInvLocked;
-extern bool bCfgInvNoScroll;
-extern bool bCfgTimerizedText;
-extern bool bCfgInvUp;
-extern bool bCfgAnni30;
-extern bool bCfgAntiAlias;
-extern bool bCfgSottotitoli;
-extern bool bCfgTransparence;
-extern bool bCfgInterTips;
-extern bool bCfgDubbing;
-extern bool bCfgMusic;
-extern bool bCfgSFX;
-extern int nCfgTonySpeed;
-extern int nCfgTextSpeed;
-extern int nCfgDubbingVolume;
-extern int nCfgMusicVolume;
-extern int nCfgSFXVolume;
-extern bool bSkipSfxNoLoop;
-
-extern bool bPatIrqFreeze;
class RMPointer : public RMGfxTask {
private:
diff --git a/engines/tony/gfxcore.cpp b/engines/tony/gfxcore.cpp
index 49dd36cfe7..0c5ffa8096 100644
--- a/engines/tony/gfxcore.cpp
+++ b/engines/tony/gfxcore.cpp
@@ -47,6 +47,7 @@
#include "tony/gfxengine.h"
#include "tony/mpal/mpalutils.h"
+#include "tony/tony.h"
namespace Tony {
@@ -1437,7 +1438,7 @@ void RMGfxSourceBuffer8RLEWordAB::RLEDecompressLine(uint16 *dst, byte *src, int
int i, n;
int r, g, b, r2, g2, b2;
- if (!bCfgTransparence) {
+ if (!GLOBALS.bCfgTransparence) {
RMGfxSourceBuffer8RLEWord::RLEDecompressLine(dst, src, nStartSkip, nLength);
return;
}
@@ -1799,7 +1800,7 @@ void RMGfxSourceBuffer8RLEByteAA::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RM
CORO_BEGIN_CODE(_ctx);
CORO_INVOKE_2(RMGfxSourceBuffer8RLE::Draw, bigBuf, prim);
- if (bCfgAntiAlias)
+ if (GLOBALS.bCfgAntiAlias)
DrawAA(bigBuf,prim);
CORO_END_CODE;
@@ -1837,7 +1838,7 @@ void RMGfxSourceBuffer8RLEWordAA::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RM
CORO_BEGIN_CODE(_ctx);
CORO_INVOKE_2(RMGfxSourceBuffer8RLE::Draw, bigBuf, prim);
- if (bCfgAntiAlias)
+ if (GLOBALS.bCfgAntiAlias)
DrawAA(bigBuf,prim);
CORO_END_CODE;
diff --git a/engines/tony/gfxengine.cpp b/engines/tony/gfxengine.cpp
index 8f7d27dafc..bf1a08f245 100644
--- a/engines/tony/gfxengine.cpp
+++ b/engines/tony/gfxengine.cpp
@@ -54,17 +54,11 @@
namespace Tony {
-extern bool bIdleExited;
-extern bool bPatIrqFreeze;
-extern bool bSkipSfxNoLoop;
-
/****************************************************************************\
* Metodi di RMGfxEngine
\****************************************************************************/
-bool bIdleExited;
-
void ExitAllIdles(CORO_PARAM, const void *param) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -74,12 +68,12 @@ void ExitAllIdles(CORO_PARAM, const void *param) {
CORO_BEGIN_CODE(_ctx);
// Chiude le idle
- bSkipSfxNoLoop = true;
+ GLOBALS.bSkipSfxNoLoop = true;
CORO_INVOKE_2(mpalEndIdlePoll, nCurLoc, NULL);
- bIdleExited = true;
- bSkipSfxNoLoop = false;
+ GLOBALS.bIdleExited = true;
+ GLOBALS.bSkipSfxNoLoop = false;
CORO_END_CODE;
}
@@ -149,11 +143,11 @@ void RMGfxEngine::OpenOptionScreen(CORO_PARAM, int type) {
// Esce la IDLE onde evitare la morte prematura in caricamento
m_bMustEnterMenu = true;
if (type == 1 || type == 2) {
- bIdleExited = true;
+ GLOBALS.bIdleExited = true;
} else {
CORO_INVOKE_0(m_tony.StopNoAction);
- bIdleExited = false;
+ GLOBALS.bIdleExited = false;
CoroScheduler.createProcess(ExitAllIdles, &m_nCurLoc, sizeof(int));
}
@@ -173,10 +167,10 @@ void RMGfxEngine::DoFrame(CORO_PARAM, bool bDrawLocation) {
// Poll dei dispositivi di input
m_input.Poll();
- if (m_bMustEnterMenu && bIdleExited) {
+ if (m_bMustEnterMenu && GLOBALS.bIdleExited) {
m_bOption = true;
m_bMustEnterMenu = false;
- bIdleExited = false;
+ GLOBALS.bIdleExited = false;
}
if (m_bOption) {
@@ -401,10 +395,10 @@ void RMGfxEngine::ItemIrq(uint32 dwItem, int nPattern, int nStatus) {
item=This->m_loc.GetItemFromCode(dwItem);
if (item != NULL) {
if (nPattern!=-1) {
- if (bPatIrqFreeze)
+ if (GLOBALS.bPatIrqFreeze)
MainFreeze();
item->SetPattern(nPattern,true);
- if (bPatIrqFreeze)
+ if (GLOBALS.bPatIrqFreeze)
MainUnfreeze();
}
if (nStatus!=-1)
@@ -604,16 +598,16 @@ void RMGfxEngine::Init(/*HINSTANCE hInst*/) {
- bPatIrqFreeze = true;
+ GLOBALS.bPatIrqFreeze = true;
// GUI attivabile
m_bGUIOption = true;
m_bGUIInterface = true;
m_bGUIInventory = true;
- bSkipSfxNoLoop = false;
+ GLOBALS.bSkipSfxNoLoop = false;
m_bMustEnterMenu = false;
- bIdleExited = false;
+ GLOBALS.bIdleExited = false;
m_bOption = false;
m_bWiping = false;
m_hWipeEvent = CoroScheduler.createEvent(false, false);
@@ -806,23 +800,23 @@ void RMGfxEngine::SaveState(const char *fn, byte *curThumb, const char *name, bo
CharsSaveAll(f);
// Save the options
- f->writeByte(bCfgInvLocked);
- f->writeByte(bCfgInvNoScroll);
- f->writeByte(bCfgTimerizedText);
- f->writeByte(bCfgInvUp);
- f->writeByte(bCfgAnni30);
- f->writeByte(bCfgAntiAlias);
- f->writeByte(bCfgSottotitoli);
- f->writeByte(bCfgTransparence);
- f->writeByte(bCfgInterTips);
- f->writeByte(bCfgDubbing);
- f->writeByte(bCfgMusic);
- f->writeByte(bCfgSFX);
- f->writeByte(nCfgTonySpeed);
- f->writeByte(nCfgTextSpeed);
- f->writeByte(nCfgDubbingVolume);
- f->writeByte(nCfgMusicVolume);
- f->writeByte(nCfgSFXVolume);
+ f->writeByte(GLOBALS.bCfgInvLocked);
+ f->writeByte(GLOBALS.bCfgInvNoScroll);
+ f->writeByte(GLOBALS.bCfgTimerizedText);
+ f->writeByte(GLOBALS.bCfgInvUp);
+ f->writeByte(GLOBALS.bCfgAnni30);
+ f->writeByte(GLOBALS.bCfgAntiAlias);
+ f->writeByte(GLOBALS.bCfgSottotitoli);
+ f->writeByte(GLOBALS.bCfgTransparence);
+ f->writeByte(GLOBALS.bCfgInterTips);
+ f->writeByte(GLOBALS.bCfgDubbing);
+ f->writeByte(GLOBALS.bCfgMusic);
+ f->writeByte(GLOBALS.bCfgSFX);
+ f->writeByte(GLOBALS.nCfgTonySpeed);
+ f->writeByte(GLOBALS.nCfgTextSpeed);
+ f->writeByte(GLOBALS.nCfgDubbingVolume);
+ f->writeByte(GLOBALS.nCfgMusicVolume);
+ f->writeByte(GLOBALS.nCfgSFXVolume);
// Save the hotspots
SaveChangedHotspot(f);
@@ -942,23 +936,23 @@ void RMGfxEngine::LoadState(CORO_PARAM, const char *fn) {
if (_ctx->ver >= 6) {
// Load options
- bCfgInvLocked = _ctx->f->readByte();
- bCfgInvNoScroll = _ctx->f->readByte();
- bCfgTimerizedText = _ctx->f->readByte();
- bCfgInvUp = _ctx->f->readByte();
- bCfgAnni30 = _ctx->f->readByte();
- bCfgAntiAlias = _ctx->f->readByte();
- bCfgSottotitoli = _ctx->f->readByte();
- bCfgTransparence = _ctx->f->readByte();
- bCfgInterTips = _ctx->f->readByte();
- bCfgDubbing = _ctx->f->readByte();
- bCfgMusic = _ctx->f->readByte();
- bCfgSFX = _ctx->f->readByte();
- nCfgTonySpeed = _ctx->f->readByte();
- nCfgTextSpeed = _ctx->f->readByte();
- nCfgDubbingVolume = _ctx->f->readByte();
- nCfgMusicVolume = _ctx->f->readByte();
- nCfgSFXVolume = _ctx->f->readByte();
+ GLOBALS.bCfgInvLocked = _ctx->f->readByte();
+ GLOBALS.bCfgInvNoScroll = _ctx->f->readByte();
+ GLOBALS.bCfgTimerizedText = _ctx->f->readByte();
+ GLOBALS.bCfgInvUp = _ctx->f->readByte();
+ GLOBALS.bCfgAnni30 = _ctx->f->readByte();
+ GLOBALS.bCfgAntiAlias = _ctx->f->readByte();
+ GLOBALS.bCfgSottotitoli = _ctx->f->readByte();
+ GLOBALS.bCfgTransparence = _ctx->f->readByte();
+ GLOBALS.bCfgInterTips = _ctx->f->readByte();
+ GLOBALS.bCfgDubbing = _ctx->f->readByte();
+ GLOBALS.bCfgMusic = _ctx->f->readByte();
+ GLOBALS.bCfgSFX = _ctx->f->readByte();
+ GLOBALS.nCfgTonySpeed = _ctx->f->readByte();
+ GLOBALS.nCfgTextSpeed = _ctx->f->readByte();
+ GLOBALS.nCfgDubbingVolume = _ctx->f->readByte();
+ GLOBALS.nCfgMusicVolume = _ctx->f->readByte();
+ GLOBALS.nCfgSFXVolume = _ctx->f->readByte();
// Load hotspots
LoadChangedHotspot(_ctx->f);
diff --git a/engines/tony/globals.cpp b/engines/tony/globals.cpp
new file mode 100644
index 0000000000..c39ba215b4
--- /dev/null
+++ b/engines/tony/globals.cpp
@@ -0,0 +1,93 @@
+/* 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.
+ *
+ */
+
+#include "tony/globals.h"
+
+namespace Tony {
+
+Globals::Globals() {
+ nextLoop = false;
+ nextChannel = 0;
+ nextSync = 0;
+ curChannel = 0;
+ flipflop = 0;
+ curBackText = NULL;
+ Tony = NULL;
+ Pointer = NULL;
+ Boxes = NULL;
+ Loc = NULL;
+ Inventory = NULL;
+ Input = NULL;
+ LoadLocation = NULL;
+ UnloadLocation = NULL;
+ LinkGraphicTask = NULL;
+ Freeze = NULL;
+ Unfreeze = NULL;
+ WaitFrame = NULL;
+ PlayMusic = NULL;
+ WaitWipeEnd = NULL;
+ CloseWipe = NULL;
+ InitWipe = NULL;
+ EnableGUI = NULL;
+ DisableGUI = NULL;
+ SetPalesati = NULL;
+
+ dwTonyNumTexts = 0;
+ bTonyInTexts = false;
+ bStaticTalk = false;
+ bPatIrqFreeze = false;
+ bCfgInvLocked = false;
+ bCfgInvNoScroll = false;
+ bCfgTimerizedText = false;
+ bCfgInvUp = false;
+ bCfgAnni30 = false;
+ bCfgAntiAlias = false;
+ bCfgSottotitoli = false;
+ bCfgTransparence = false;
+ bCfgInterTips = false;
+ bCfgDubbing = false;
+ bCfgMusic = false;
+ bCfgSFX = false;
+ nCfgTonySpeed = 0;
+ nCfgTextSpeed = 0;
+ nCfgDubbingVolume = 0;
+ nCfgMusicVolume = 0;
+ nCfgSFXVolume = 0;
+ bIdleExited = false;
+ bSkipSfxNoLoop = false;
+ bNoOcchioDiBue = false;
+ curDialog = 0;
+ curSonoriz = 0;
+ bFadeOutStop = false;
+
+// OSystem::MutexRef cs[10];
+// OSystem::MutexRef vdb;
+ Common::fill(&mut[0], &mut[10], (HANDLE)NULL);
+ bSkipIdle = false;
+ hSkipIdle = 0;
+ lastMusic = 0;
+ lastTappeto = 0;
+ Common::fill(&tappeti[0], &tappeti[200], 0);
+ SFM_nLoc = 0;
+}
+
+} // End of namespace Tony
diff --git a/engines/tony/globals.h b/engines/tony/globals.h
new file mode 100644
index 0000000000..7f6f8ed880
--- /dev/null
+++ b/engines/tony/globals.h
@@ -0,0 +1,232 @@
+/* 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.
+ *
+ */
+
+#ifndef TONY_GLOBALS
+#define TONY_GLOBALS
+
+#include "common/savefile.h"
+#include "tony/adv.h"
+#include "tony/input.h"
+#include "tony/inventory.h"
+#include "tony/loc.h"
+#include "tony/tonychar.h"
+
+namespace Tony {
+
+#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
+
+
+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();
+ }
+};
+
+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 ChangedHotspotStruct {
+ 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();
+ }
+};
+
+class Globals {
+public:
+ Globals();
+
+ char nextMusic[MAX_PATH];
+ bool nextLoop;
+ int nextChannel;
+ int nextSync;
+ int curChannel;
+ int flipflop;
+ // OSystem::MutexRef csMusic;
+ CharacterStruct Character[16];
+ MCharacterStruct MCharacter[10];
+ ChangedHotspotStruct ChangedHotspot[256];
+ bool IsMChar[16];
+ bool bAlwaysDisplay;
+ RMPoint saveTonyPos;
+ int saveTonyLoc;
+ RMTextDialog *curBackText;
+ bool bTonyIsSpeaking;
+ int curChangedHotspot;
+ bool bPatIrqFreeze;
+ bool bCfgInvLocked;
+ bool bCfgInvNoScroll;
+ bool bCfgTimerizedText;
+ bool bCfgInvUp;
+ bool bCfgAnni30;
+ bool bCfgAntiAlias;
+ bool bCfgSottotitoli;
+ bool bCfgTransparence;
+ bool bCfgInterTips;
+ bool bCfgDubbing;
+ bool bCfgMusic;
+ bool bCfgSFX;
+ int nCfgTonySpeed;
+ int nCfgTextSpeed;
+ int nCfgDubbingVolume;
+ int nCfgMusicVolume;
+ int nCfgSFXVolume;
+ bool bSkipSfxNoLoop;
+ bool bIdleExited;
+ bool bNoOcchioDiBue;
+ int curDialog;
+ int curSonoriz;
+ bool bFadeOutStop;
+
+ 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;
+ bool bTonyInTexts;
+ bool bStaticTalk;
+ RMTony::TALKTYPE nTonyNextTalkType;
+
+ RMPoint StartLocPos[256];
+ OSystem::MutexRef cs[10];
+ OSystem::MutexRef vdb;
+ HANDLE mut[10];
+
+ bool bSkipIdle;
+ uint32 hSkipIdle;
+
+ int lastMusic, lastTappeto;
+
+ int tappeti[200];
+ RMPoint SFM_pt;
+ int SFM_nLoc;
+};
+
+} // End of namespace Tony
+
+#endif // TONY_GLOBALS
diff --git a/engines/tony/inventory.cpp b/engines/tony/inventory.cpp
index 468ec225a5..fbc0918e10 100644
--- a/engines/tony/inventory.cpp
+++ b/engines/tony/inventory.cpp
@@ -84,7 +84,7 @@ RMInventory::~RMInventory() {
}
bool RMInventory::CheckPointInside(const RMPoint &pt) {
- if (!bCfgInvUp)
+ if (!GLOBALS.bCfgInvUp)
return pt.y > RM_SY - 70;
else
return pt.y < 70;
@@ -226,7 +226,7 @@ void RMInventory::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
if (m_state == SELECTING) {
- if (!bCfgInvUp) {
+ if (!GLOBALS.bCfgInvUp) {
_ctx->pos.Set((m_nSelectObj+1)*64 - 20,RM_SY - 113);
_ctx->pos2.Set((m_nSelectObj+1)*64 + 34,RM_SY - 150);
} else {
@@ -240,7 +240,7 @@ void RMInventory::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
// Disegna l'interfaccina stupida
CORO_INVOKE_2(miniInterface.Draw, bigBuf, _ctx->p);
- if (bCfgInterTips) {
+ if (GLOBALS.bCfgInterTips) {
if (miniAction == 1) // Esamina
CORO_INVOKE_2(m_hints[0].Draw, bigBuf, _ctx->p2);
else if (miniAction == 2) // Parla
@@ -563,7 +563,7 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
}
if (_vm->GetEngine()->GetInput().GetAsyncKeyState(Common::KEYCODE_i)) {
- bCfgInvLocked = !bCfgInvLocked;
+ GLOBALS.bCfgInvLocked = !GLOBALS.bCfgInvLocked;
}
if (m_bCombining) {//m_state == COMBINING)
@@ -571,9 +571,9 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
ptr.SetSpecialPointer(RMPointer::PTR_CUSTOM);
}
- if (!bCfgInvUp) {
- if ((m_state == CLOSED) && (mpos.y > RM_SY - 10 || bCfgInvLocked) && bCanOpen) {
- if (!bCfgInvNoScroll) {
+ if (!GLOBALS.bCfgInvUp) {
+ if ((m_state == CLOSED) && (mpos.y > RM_SY - 10 || GLOBALS.bCfgInvLocked) && bCanOpen) {
+ if (!GLOBALS.bCfgInvNoScroll) {
m_state = OPENING;
m_curPutY = RM_SY - 1;
m_curPutTime=_vm->GetTime();
@@ -582,8 +582,8 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
m_curPutY = RM_SY - 68;
}
} else if (m_state == OPENED) {
- if ((mpos.y < RM_SY - 70 && !bCfgInvLocked) || !bCanOpen) {
- if (!bCfgInvNoScroll) {
+ if ((mpos.y < RM_SY - 70 && !GLOBALS.bCfgInvLocked) || !bCanOpen) {
+ if (!GLOBALS.bCfgInvNoScroll) {
m_state = CLOSING;
m_curPutY = RM_SY - 68;
m_curPutTime = _vm->GetTime();
@@ -612,8 +612,8 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
m_state = CLOSED;
}
} else {
- if ((m_state == CLOSED) && (mpos.y<10 || bCfgInvLocked) && bCanOpen) {
- if (!bCfgInvNoScroll) {
+ if ((m_state == CLOSED) && (mpos.y<10 || GLOBALS.bCfgInvLocked) && bCanOpen) {
+ if (!GLOBALS.bCfgInvNoScroll) {
m_state = OPENING;
m_curPutY =- 68;
m_curPutTime = _vm->GetTime();
@@ -623,8 +623,8 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
}
}
else if (m_state == OPENED) {
- if ((mpos.y>70 && !bCfgInvLocked) || !bCanOpen) {
- if (!bCfgInvNoScroll) {
+ if ((mpos.y>70 && !GLOBALS.bCfgInvLocked) || !bCanOpen) {
+ if (!GLOBALS.bCfgInvNoScroll) {
m_state = CLOSING;
m_curPutY = -2;
m_curPutTime = _vm->GetTime();
@@ -657,7 +657,7 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
int startx = (m_nSelectObj + 1) * 64 - 20;
int starty;
- if (!bCfgInvUp)
+ if (!GLOBALS.bCfgInvUp)
starty=RM_SY-109;
else
starty=70;
@@ -828,7 +828,7 @@ void RMInterface::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
_vm->PlayUtilSFX(1);
}
- if (bCfgInterTips) {
+ if (GLOBALS.bCfgInterTips) {
prim->Dst().TopLeft() = m_openStart + RMPoint(70, 177);
CORO_INVOKE_2(m_hints[_ctx->h].Draw, bigBuf, prim);
}
diff --git a/engines/tony/loc.cpp b/engines/tony/loc.cpp
index 32754bbb51..306322f2ad 100644
--- a/engines/tony/loc.cpp
+++ b/engines/tony/loc.cpp
@@ -55,8 +55,6 @@ namespace Tony {
using namespace ::Tony::MPAL;
-extern bool bSkipSfxNoLoop;
-
/****************************************************************************\
* Metodi di RMPalette
@@ -186,7 +184,7 @@ void RMPattern::StopSfx(RMSfx *sfx) {
if (m_slots[i].m_type == SOUND) {
if (sfx[m_slots[i].m_data].m_name[0] == '_')
sfx[m_slots[i].m_data].Stop();
- else if (bSkipSfxNoLoop)
+ else if (GLOBALS.bSkipSfxNoLoop)
sfx[m_slots[i].m_data].Stop();
}
}
diff --git a/engines/tony/module.mk b/engines/tony/module.mk
index af0b3acd2c..6512391d04 100644
--- a/engines/tony/module.mk
+++ b/engines/tony/module.mk
@@ -7,6 +7,7 @@ MODULE_OBJS := \
game.o \
gfxcore.o \
gfxengine.o \
+ globals.o \
input.o \
inventory.o \
loc.o \
diff --git a/engines/tony/sound.cpp b/engines/tony/sound.cpp
index 01968ea579..53d3b962d2 100644
--- a/engines/tony/sound.cpp
+++ b/engines/tony/sound.cpp
@@ -51,13 +51,6 @@
namespace Tony {
-extern bool bCfgMusic;
-extern bool bCfgSFX;
-extern bool bCfgDubbing;
-extern int nCfgSFXVolume;
-extern int nCfgMusicVolume;
-extern int nCfgDubbingVolume;
-
/****************************************************************************\
* Defines
@@ -1527,15 +1520,15 @@ void FPSFX::SetVolume(int dwVolume) {
lastVolume = dwVolume;
if (bIsVoice) {
- if (!bCfgDubbing) dwVolume = 0;
+ if (!GLOBALS.bCfgDubbing) dwVolume = 0;
else {
- dwVolume -= (10 - nCfgDubbingVolume) * 2;
+ dwVolume -= (10 - GLOBALS.nCfgDubbingVolume) * 2;
if (dwVolume<0) dwVolume = 0;
}
} else {
- if (!bCfgSFX) dwVolume = 0;
+ if (!GLOBALS.bCfgSFX) dwVolume = 0;
else {
- dwVolume -= (10 - nCfgSFXVolume) * 2;
+ dwVolume -= (10 - GLOBALS.nCfgSFXVolume) * 2;
if (dwVolume < 0) dwVolume = 0;
}
}
@@ -2273,9 +2266,9 @@ void FPSTREAM::SetVolume(int dwVolume) {
lastVolume = dwVolume;
- if (!bCfgMusic) dwVolume = 0;
+ if (!GLOBALS.bCfgMusic) dwVolume = 0;
else {
- dwVolume -= (10 - nCfgMusicVolume) * 2;
+ dwVolume -= (10 - GLOBALS.nCfgMusicVolume) * 2;
if (dwVolume<0) dwVolume = 0;
}
diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp
index 56b68419fd..1b4a11df0c 100644
--- a/engines/tony/tony.cpp
+++ b/engines/tony/tony.cpp
@@ -119,23 +119,23 @@ Common::ErrorCode TonyEngine::Init() {
m_curThumbnail = new uint16[160 * 120];
// Configurazione di default
- bCfgInvLocked = false;
- bCfgInvNoScroll = false;
- bCfgTimerizedText = true;
- bCfgInvUp = false;
- bCfgAnni30 = false;
- bCfgAntiAlias = false;
- bCfgTransparence = true;
- bCfgInterTips = true;
- bCfgSottotitoli = true;
- nCfgTonySpeed = 3;
- nCfgTextSpeed = 5;
- bCfgDubbing = true;
- bCfgMusic = true;
- bCfgSFX = true;
- nCfgDubbingVolume = 10;
- nCfgMusicVolume = 7;
- nCfgSFXVolume = 10;
+ GLOBALS.bCfgInvLocked = false;
+ GLOBALS.bCfgInvNoScroll = false;
+ GLOBALS.bCfgTimerizedText = true;
+ GLOBALS.bCfgInvUp = false;
+ GLOBALS.bCfgAnni30 = false;
+ GLOBALS.bCfgAntiAlias = false;
+ GLOBALS.bCfgTransparence = true;
+ GLOBALS.bCfgInterTips = true;
+ GLOBALS.bCfgSottotitoli = true;
+ GLOBALS.nCfgTonySpeed = 3;
+ GLOBALS.nCfgTextSpeed = 5;
+ GLOBALS.bCfgDubbing = true;
+ GLOBALS.bCfgMusic = true;
+ GLOBALS.bCfgSFX = true;
+ GLOBALS.nCfgDubbingVolume = 10;
+ GLOBALS.nCfgMusicVolume = 7;
+ GLOBALS.nCfgSFXVolume = 10;
m_bQuitNow = false;
return Common::kNoError;
@@ -152,21 +152,12 @@ void TonyEngine::GUIError(const Common::String &msg) {
GUIErrorMessage(msg);
}
-char nextMusic[MAX_PATH];
-bool nextLoop;
-int nextChannel;
-int nextSync;
-int curChannel;
-int flipflop=0;
-OSystem::MutexRef csMusic;
-
-
void TonyEngine::PlayMusic(int nChannel, const char *fn, int nFX, bool bLoop, int nSync) {
warning("TODO: TonyEngine::PlayMusic");
- g_system->lockMutex(csMusic);
+// g_system->lockMutex(csMusic);
if (nChannel < 4)
- if (flipflop)
+ if (GLOBALS.flipflop)
nChannel = nChannel + 1;
switch (nFX) {
@@ -243,7 +234,7 @@ void TonyEngine::PlayMusic(int nChannel, const char *fn, int nFX, bool bLoop, in
}
#endif
- g_system->unlockMutex(csMusic);
+// g_system->unlockMutex(csMusic);
}
void TonyEngine::PlaySFX(int nChannel, int nFX) {
@@ -264,14 +255,14 @@ void TonyEngine::PlaySFX(int nChannel, int nFX) {
}
void TonyEngine::StopMusic(int nChannel) {
- g_system->lockMutex(csMusic);
+// g_system->lockMutex(csMusic);
if (nChannel < 4)
- m_stream[nChannel+flipflop]->Stop();
+ m_stream[nChannel + GLOBALS.flipflop]->Stop();
else
m_stream[nChannel]->Stop();
- g_system->unlockMutex(csMusic);
+// g_system->unlockMutex(csMusic);
}
void TonyEngine::StopSFX(int nChannel) {
@@ -279,7 +270,7 @@ void TonyEngine::StopSFX(int nChannel) {
}
void TonyEngine::PlayUtilSFX(int nChannel, int nFX) {
- if (m_utilSfx[nChannel]==NULL)
+ if (m_utilSfx[nChannel] == NULL)
return;
switch (nFX) {
@@ -355,7 +346,7 @@ void TonyEngine::InitMusic() {
}
// Crea la critical section per la musica
- csMusic = g_system->createMutex();
+// csMusic = g_system->createMutex();
// Carica effetti sonori
// PreloadUtilSFX(0,"AccendiOpzione.ADP");
@@ -372,7 +363,7 @@ void TonyEngine::CloseMusic() {
m_stream[i]->Release();
}
- g_system->deleteMutex(csMusic);
+// g_system->deleteMutex(csMusic);
UnloadAllSFX();
UnloadAllUtilSFX();
diff --git a/engines/tony/tony.h b/engines/tony/tony.h
index 4a80970bb9..c1ad6756c2 100644
--- a/engines/tony/tony.h
+++ b/engines/tony/tony.h
@@ -38,6 +38,7 @@
#include "tony/loc.h"
#include "tony/utils.h"
#include "tony/window.h"
+#include "tony/globals.h"
/**
* This is the namespace of the Tony engine.
@@ -51,6 +52,8 @@ namespace Tony {
using namespace MPAL;
+class Globals;
+
enum {
kTonyDebugAnimations = 1 << 0,
kTonyDebugActions = 1 << 1,
@@ -97,6 +100,7 @@ public:
Common::File _vdbFP;
Common::Array<VoiceHeader> _voices;
FPSOUND _theSound;
+ Globals _globals;
enum DATADIR {
DD_BASE = 1,
@@ -209,6 +213,8 @@ public:
// Global reference to the TonyEngine object
extern TonyEngine *_vm;
+#define GLOBALS _vm->_globals
+
} // End of namespace Tony
#endif /* TONY_H */
diff --git a/engines/tony/tonychar.cpp b/engines/tony/tonychar.cpp
index 0e59779229..072e822c36 100644
--- a/engines/tony/tonychar.cpp
+++ b/engines/tony/tonychar.cpp
@@ -153,7 +153,7 @@ void RMTony::DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int curLoc) {
if (!m_nInList && m_bShow)
bigBuf->AddPrim(new RMGfxPrimitive(this));
- SetSpeed(nCfgTonySpeed);
+ SetSpeed(GLOBALS.nCfgTonySpeed);
// Esegue il movimento normale del personaggio
_ctx->time = _vm->GetTime();