aboutsummaryrefslogtreecommitdiff
path: root/engines/tony/gfxengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/tony/gfxengine.cpp')
-rw-r--r--engines/tony/gfxengine.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/engines/tony/gfxengine.cpp b/engines/tony/gfxengine.cpp
index 4a0fdc0795..a2b58f660e 100644
--- a/engines/tony/gfxengine.cpp
+++ b/engines/tony/gfxengine.cpp
@@ -361,28 +361,21 @@ void RMGfxEngine::InitCustomDll(void) {
SetupGlobalVars(&m_tony, &m_point, &_vm->_theBoxes, &m_loc, &m_inv, &m_input);
}
-// FIXME: Casting nPattern from int to RMGfxEngine *
void RMGfxEngine::ItemIrq(uint32 dwItem, int nPattern, int nStatus) {
- static RMGfxEngine *This = NULL;
RMItem *item;
+ assert(GLOBALS.GfxEngine);
- // Inizializzazione!
- if ((int)dwItem == -1) {
- This = (RMGfxEngine*)nPattern;
- return;
- }
-
- if (This->m_bLocationLoaded) {
- item=This->m_loc.GetItemFromCode(dwItem);
+ if (GLOBALS.GfxEngine->m_bLocationLoaded) {
+ item = GLOBALS.GfxEngine->m_loc.GetItemFromCode(dwItem);
if (item != NULL) {
- if (nPattern!=-1) {
+ if (nPattern != -1) {
if (GLOBALS.bPatIrqFreeze)
MainFreeze();
item->SetPattern(nPattern,true);
if (GLOBALS.bPatIrqFreeze)
MainUnfreeze();
}
- if (nStatus!=-1)
+ if (nStatus != -1)
item->SetStatus(nStatus);
}
}
@@ -597,7 +590,7 @@ void RMGfxEngine::Init(/*HINSTANCE hInst*/) {
csMainLoop = g_system->createMutex();
// Inizializza la funzione di IRQ di Item per l'MPAL
- ItemIrq((uint32)-1, (uint32)this, 0);
+ GLOBALS.GfxEngine = this;
mpalInstallItemIrq(ItemIrq);
// Inizializza DirectInput