From af72280fb93115b694f87ab71a5feeb35c85ff3f Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Sun, 2 Sep 2007 15:27:25 +0000 Subject: Cleanup: removed unneeded references to engine (_vm). svn-id: r28826 --- engines/parallaction/exec_ns.cpp | 72 ++++++++++++++++---------------- engines/parallaction/inventory.cpp | 9 +--- engines/parallaction/parallaction_ns.cpp | 2 +- engines/parallaction/walk.cpp | 26 ++++++------ 4 files changed, 52 insertions(+), 57 deletions(-) diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp index f5a7579eaf..48817c10ab 100644 --- a/engines/parallaction/exec_ns.cpp +++ b/engines/parallaction/exec_ns.cpp @@ -342,7 +342,7 @@ void Parallaction_ns::jobDisplayAnimations(void *parm, Job *j) { uint16 _si = 0; - for (AnimationList::iterator it = _vm->_animations.begin(); it != _vm->_animations.end(); it++) { + for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) { Animation *v18 = *it; @@ -357,11 +357,11 @@ void Parallaction_ns::jobDisplayAnimations(void *parm, Job *j) { if (v18->_flags & kFlagsNoMasked) _si = 3; else - _si = _vm->_gfx->queryMask(v18->_top + v18->height()); + _si = _gfx->queryMask(v18->_top + v18->height()); debugC(9, kDebugLocation, "jobDisplayAnimations(%s, x:%i, y:%i, z:%i, w:%i, h:%i, f:%i/%i, %p)", v18->_label._text, v18->_left, v18->_top, _si, v14.w, v14.h, frame, v18->getFrameNum(), v14.pixels); - _vm->_gfx->blitCnv(&v14, v18->_left, v18->_top, _si, Gfx::kBitBack); + _gfx->blitCnv(&v14, v18->_left, v18->_top, _si, Gfx::kBitBack); } @@ -383,7 +383,7 @@ void Parallaction_ns::jobDisplayAnimations(void *parm, Job *j) { void Parallaction_ns::jobEraseAnimations(void *arg_0, Job *j) { debugC(3, kDebugJobs, "jobEraseAnimations"); - for (AnimationList::iterator it = _vm->_animations.begin(); it != _vm->_animations.end(); it++) { + for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) { Animation *a = *it; @@ -391,7 +391,7 @@ void Parallaction_ns::jobEraseAnimations(void *arg_0, Job *j) { Common::Rect r(a->width(), a->height()); r.moveTo(a->_oldPos); - _vm->_gfx->restoreBackground(r); + _gfx->restoreBackground(r); if (arg_0) { a->_oldPos.x = a->_left; @@ -409,7 +409,7 @@ void Parallaction_ns::jobRunScripts(void *parm, Job *j) { static uint16 modCounter = 0; - for (AnimationList::iterator it = _vm->_animations.begin(); it != _vm->_animations.end(); it++) { + for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) { Animation *a = *it; @@ -422,18 +422,18 @@ void Parallaction_ns::jobRunScripts(void *parm, Job *j) { InstructionList::iterator inst = a->_program->_ip; while (((*inst)->_index != INST_SHOW) && (a->_flags & kFlagsActing)) { - debugC(9, kDebugJobs, "Animation: %s, instruction: %s", a->_label._text, _vm->_instructionNamesRes[(*inst)->_index - 1]); + debugC(9, kDebugJobs, "Animation: %s, instruction: %s", a->_label._text, _instructionNamesRes[(*inst)->_index - 1]); - _vm->_instRunCtxt.inst = inst; - _vm->_instRunCtxt.a = a; - _vm->_instRunCtxt.modCounter = modCounter; - _vm->_instRunCtxt.suspend = false; + _instRunCtxt.inst = inst; + _instRunCtxt.a = a; + _instRunCtxt.modCounter = modCounter; + _instRunCtxt.suspend = false; - (*_vm->_instructionOpcodes[(*inst)->_index])(); + (*_instructionOpcodes[(*inst)->_index])(); - inst = _vm->_instRunCtxt.inst; // handles endloop correctly + inst = _instRunCtxt.inst; // handles endloop correctly - if (_vm->_instRunCtxt.suspend) + if (_instRunCtxt.suspend) goto label1; inst++; @@ -446,7 +446,7 @@ label1: a->_z = a->_top + a->height(); } - _vm->sortAnimations(); + sortAnimations(); modCounter++; return; @@ -627,11 +627,11 @@ void Parallaction_ns::jobToggleDoor(void *parm, Job *j) { r.moveTo(z->_left, z->_top); uint16 _ax = (z->_flags & kFlagsClosed ? 1 : 0); - _vm->_gfx->restoreDoorBackground(r, z->u.door->_cnv->getData(_ax), z->u.door->_background); + _gfx->restoreDoorBackground(r, z->u.door->_cnv->getData(_ax), z->u.door->_background); _ax = (z->_flags & kFlagsClosed ? 0 : 1); - _vm->_gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBitBack); - _vm->_gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBit2); + _gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBitBack); + _gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBit2); } count++; @@ -666,7 +666,7 @@ void Parallaction_ns::jobRemovePickedItem(void *parm, Job *j) { if (z->u.get->_cnv) { Common::Rect r(z->_left, z->_top, z->_left + z->u.get->_cnv->w, z->_top + z->u.get->_cnv->h); - _vm->_gfx->restoreGetBackground(r, z->u.get->_backup); + _gfx->restoreGetBackground(r, z->u.get->_backup); } count++; @@ -685,11 +685,11 @@ void Parallaction_ns::jobDisplayDroppedItem(void *parm, Job *j) { if (z->u.get->_cnv) { if (j->_count == 0) { - _vm->_gfx->backupGetBackground(z->u.get, z->_left, z->_top); + _gfx->backupGetBackground(z->u.get, z->_left, z->_top); } - _vm->_gfx->flatBlitCnv(z->u.get->_cnv, z->_left, z->_top, Gfx::kBitBack); - _vm->_gfx->flatBlitCnv(z->u.get->_cnv, z->_left, z->_top, Gfx::kBit2); + _gfx->flatBlitCnv(z->u.get->_cnv, z->_left, z->_top, Gfx::kBitBack); + _gfx->flatBlitCnv(z->u.get->_cnv, z->_left, z->_top, Gfx::kBit2); } j->_count++; @@ -860,7 +860,7 @@ void Parallaction_ns::jobDisplayLabel(void *parm, Job *j) { if (label->_cnv.w == 0) return; - _vm->_gfx->flatBlitCnv(&label->_cnv, _vm->_gfx->_labelPosition[0].x, _vm->_gfx->_labelPosition[0].y, Gfx::kBitBack); + _gfx->flatBlitCnv(&label->_cnv, _gfx->_labelPosition[0].x, _gfx->_labelPosition[0].y, Gfx::kBitBack); return; } @@ -872,27 +872,27 @@ void Parallaction_ns::jobEraseLabel(void *parm, Job *j) { int16 _si, _di; - if (_vm->_activeItem._id != 0) { - _si = _vm->_mousePos.x + 16 - label->_cnv.w/2; - _di = _vm->_mousePos.y + 34; + if (_activeItem._id != 0) { + _si = _mousePos.x + 16 - label->_cnv.w/2; + _di = _mousePos.y + 34; } else { - _si = _vm->_mousePos.x + 8 - label->_cnv.w/2; - _di = _vm->_mousePos.y + 21; + _si = _mousePos.x + 8 - label->_cnv.w/2; + _di = _mousePos.y + 21; } if (_si < 0) _si = 0; if (_di > 190) _di = 190; - if (label->_cnv.w + _si > _vm->_screenWidth) - _si = _vm->_screenWidth - label->_cnv.w; + if (label->_cnv.w + _si > _screenWidth) + _si = _screenWidth - label->_cnv.w; Common::Rect r(label->_cnv.w, label->_cnv.h); - r.moveTo(_vm->_gfx->_labelPosition[1]); - _vm->_gfx->restoreBackground(r); + r.moveTo(_gfx->_labelPosition[1]); + _gfx->restoreBackground(r); - _vm->_gfx->_labelPosition[1] = _vm->_gfx->_labelPosition[0]; - _vm->_gfx->_labelPosition[0].x = _si; - _vm->_gfx->_labelPosition[0].y = _di; + _gfx->_labelPosition[1] = _gfx->_labelPosition[0]; + _gfx->_labelPosition[0].x = _si; + _gfx->_labelPosition[0].y = _di; return; } @@ -914,7 +914,7 @@ void Parallaction_ns::jobWaitRemoveJob(void *parm, Job *j) { count++; if (count == 2) { count = 0; - _vm->removeJob(arg); + removeJob(arg); _engineFlags &= ~kEngineBlockInput; j->_finished = 1; } diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp index e0b5d38fc9..06d48744be 100644 --- a/engines/parallaction/inventory.cpp +++ b/engines/parallaction/inventory.cpp @@ -243,12 +243,7 @@ void Parallaction_ns::jobShowInventory(void *parm, Job *j) { r.moveTo(_invPosition); - _vm->_gfx->copyRect( - Gfx::kBitBack, - r, - _buffer, - INVENTORY_WIDTH - ); + _gfx->copyRect(Gfx::kBitBack, r, _buffer, INVENTORY_WIDTH); return; } @@ -272,7 +267,7 @@ void Parallaction_ns::jobHideInventory(void *parm, Job *j) { Common::Rect r(INVENTORY_WIDTH, _numInvLines * INVENTORYITEM_HEIGHT); r.moveTo(_invPosition); - _vm->_gfx->restoreBackground(r); + _gfx->restoreBackground(r); return; } diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index fb0ca0dd7d..5654ebd53e 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -108,7 +108,7 @@ void Parallaction_ns::freeFonts() { void Parallaction_ns::renderLabel(Graphics::Surface *cnv, char *text) { - if (_vm->getPlatform() == Common::kPlatformAmiga) { + if (getPlatform() == Common::kPlatformAmiga) { cnv->create(_labelFont->getStringWidth(text) + 16, 10, 1); _labelFont->setColor(7); diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index f25e907f37..73b7407308 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -265,7 +265,7 @@ uint16 PathBuilder::walkFunc1(int16 x, int16 y, WalkNode *Node) { void Parallaction::clipMove(Common::Point& pos, const WalkNode* from) { - if ((pos.x < from->_x) && (pos.x < _vm->_pathBuffer->w) && (_pathBuffer->getValue(pos.x + 2, pos.y) != 0)) { + if ((pos.x < from->_x) && (pos.x < _pathBuffer->w) && (_pathBuffer->getValue(pos.x + 2, pos.y) != 0)) { pos.x = (pos.x + 2 < from->_x) ? pos.x + 2 : from->_x; } @@ -273,7 +273,7 @@ void Parallaction::clipMove(Common::Point& pos, const WalkNode* from) { pos.x = (pos.x - 2 > from->_x) ? pos.x - 2 : from->_x; } - if ((pos.y < from->_y) && (pos.y < _vm->_pathBuffer->h) && (_pathBuffer->getValue(pos.x, pos.y + 2) != 0)) { + if ((pos.y < from->_y) && (pos.y < _pathBuffer->h) && (_pathBuffer->getValue(pos.x, pos.y + 2) != 0)) { pos.y = (pos.y + 2 <= from->_y) ? pos.y + 2 : from->_y; } @@ -387,11 +387,11 @@ void Parallaction::finalizeWalk(WalkNodeList *list) { void Parallaction_ns::jobWalk(void *parm, Job *j) { WalkNodeList *list = (WalkNodeList*)parm; - _vm->_char._ani._oldPos.x = _vm->_char._ani._left; - _vm->_char._ani._oldPos.y = _vm->_char._ani._top; + _char._ani._oldPos.x = _char._ani._left; + _char._ani._oldPos.y = _char._ani._top; Common::Point pos; - _vm->_char.getFoot(pos); + _char.getFoot(pos); WalkNodeList::iterator it = list->begin(); @@ -404,25 +404,25 @@ void Parallaction_ns::jobWalk(void *parm, Job *j) { if (it == list->end()) { debugC(1, kDebugWalk, "jobWalk reached last node"); j->_finished = 1; - _vm->finalizeWalk(list); + finalizeWalk(list); return; } j->_parm = list; // selectWalkFrame must be performed before position is changed by clipMove - int16 v16 = _vm->selectWalkFrame(pos, *it); - _vm->clipMove(pos, *it); + int16 v16 = selectWalkFrame(pos, *it); + clipMove(pos, *it); - _vm->_char.setFoot(pos); + _char.setFoot(pos); - Common::Point newpos(_vm->_char._ani._left, _vm->_char._ani._top); + Common::Point newpos(_char._ani._left, _char._ani._top); - if (newpos == _vm->_char._ani._oldPos) { + if (newpos == _char._ani._oldPos) { debugC(1, kDebugWalk, "jobWalk was blocked by an unforeseen obstacle"); j->_finished = 1; - _vm->finalizeWalk(list); + finalizeWalk(list); } else { - _vm->_char._ani._frame = v16 + walkData2 + 1; + _char._ani._frame = v16 + walkData2 + 1; } return; -- cgit v1.2.3