diff --git a/engines/dragons/actor.cpp b/engines/dragons/actor.cpp index bdf22b22c4b..062ef5e5c22 100644 --- a/engines/dragons/actor.cpp +++ b/engines/dragons/actor.cpp @@ -42,7 +42,7 @@ ActorManager::ActorManager(ActorResourceLoader *actorResourceLoader) : _actorRes Actor *ActorManager::loadActor(uint32 resourceId, uint32 sequenceId, int16 x, int16 y, uint16 priorityLayer) { Actor *actor = loadActor(resourceId, sequenceId, x, y); if (actor) { - actor->priorityLayer = priorityLayer; + actor->_priorityLayer = priorityLayer; } return actor; } @@ -67,7 +67,7 @@ Actor *ActorManager::findFreeActor(int16 resourceId) { for (ActorsIterator it = _actors.begin(); it != _actors.end() && i < 23; ++it, i++) { Actor *actor = it; if (!(actor->_flags & Dragons::ACTOR_FLAG_40)) { - actor->resourceID = resourceId; + actor->_resourceID = resourceId; actor->_walkSpeed = 0x100000; return actor; } @@ -105,10 +105,10 @@ void ActorManager::updateActorDisplayOrder() { for (int i = 0; i < DRAGONS_ENGINE_NUM_ACTORS - 1; i++) { Actor *curActor = getActor(_displayOrder[i]); Actor *nextActor = getActor(_displayOrder[i + 1]); - int16 curY = curActor->y_pos > 0 ? curActor->y_pos : 0; - int16 nextY = nextActor->y_pos > 0 ? nextActor->y_pos : 0; - if (nextActor->priorityLayer * 0x1000000 + nextY * 0x100 + nextActor->_actorID < - curActor->priorityLayer * 0x1000000 + curY * 0x100 + curActor->_actorID) { + int16 curY = curActor->_y_pos > 0 ? curActor->_y_pos : 0; + int16 nextY = nextActor->_y_pos > 0 ? nextActor->_y_pos : 0; + if (nextActor->_priorityLayer * 0x1000000 + nextY * 0x100 + nextActor->_actorID < + curActor->_priorityLayer * 0x1000000 + curY * 0x100 + curActor->_actorID) { _displayOrder[i] = nextActor->_actorID; _displayOrder[i + 1] = curActor->_actorID; shouldContinue = true; @@ -122,7 +122,7 @@ void ActorManager::resetDisplayOrder() { Actor *actor = getActor(i); _displayOrder[i] = i; if (!actor->isFlagSet(ACTOR_FLAG_40)) { - actor->priorityLayer = 0; + actor->_priorityLayer = 0; } } } @@ -133,38 +133,38 @@ Actor *ActorManager::getActorByDisplayOrder(uint16 position) { Actor::Actor(uint16 id) : _actorID(id) { _actorResource = NULL; - resourceID = -1; + _resourceID = -1; _seqCodeIp = 0; - frame_pointer_maybe = NULL; - priorityLayer = 3; - x_pos = 160; - y_pos = 110; + _frame_pointer_maybe = NULL; + _priorityLayer = 3; + _x_pos = 160; + _y_pos = 110; _walkDestX = 0; _walkDestY = 0; _walkSpeed = 0; _flags = 0; - frame_width = 0; - frame_height = 0; - frame_flags = 0; - clut = 0; - frame = NULL; - surface = NULL; + _frame_width = 0; + _frame_height = 0; + _frame_flags = 0; + _clut = 0; + _frame = NULL; + _surface = NULL; } void Actor::init(ActorResource *resource, int16 x, int16 y, uint32 sequenceID) { debug(3, "actor %d Init", _actorID); _actorResource = resource; - x_pos = x; - y_pos = y; - sequenceTimer = 0; + _x_pos = x; + _y_pos = y; + _sequenceTimer = 0; _walkDestX = x; _walkDestY = y; - scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + _scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; _sequenceID2 = 0; _flags = (Dragons::ACTOR_FLAG_40 | Dragons::ACTOR_FLAG_4); - frame_width = 0; - frame_height = 0; - frame_flags = 4; + _frame_width = 0; + _frame_height = 0; + _frame_flags = 4; //TODO sub_80017010(); freeFrame(); @@ -184,27 +184,27 @@ void Actor::resetSequenceIP() { void Actor::loadFrame(uint16 frameOffset) { freeFrame(); - frame = _actorResource->loadFrameHeader(frameOffset); + _frame = _actorResource->loadFrameHeader(frameOffset); - if (frame->flags & 0x800) { - frame_flags |= ACTOR_FRAME_FLAG_2; + if (_frame->flags & 0x800) { + _frame_flags |= ACTOR_FRAME_FLAG_2; } else { - frame_flags &= ~ACTOR_FRAME_FLAG_2; + _frame_flags &= ~ACTOR_FRAME_FLAG_2; } - surface = _actorResource->loadFrame(*frame, NULL); // TODO paletteId == 0xf1 ? getEngine()->getBackgroundPalette() : NULL); + _surface = _actorResource->loadFrame(*_frame, NULL); // TODO paletteId == 0xf1 ? getEngine()->getBackgroundPalette() : NULL); - debug(5, "ActorId: %d load frame header: (%d,%d)", _actorID, frame->width, frame->height); + debug(5, "ActorId: %d load frame header: (%d,%d)", _actorID, _frame->width, _frame->height); _flags |= Dragons::ACTOR_FLAG_8; //TODO check if this is the right spot. engine sets it at 0x800185b0 } void Actor::freeFrame() { - delete frame; - delete surface; - frame = NULL; - surface = NULL; + delete _frame; + delete _surface; + _frame = NULL; + _surface = NULL; } byte *Actor::getSeqIpAtOffset(uint32 offset) { @@ -243,7 +243,7 @@ bool Actor::startWalk(int16 destX, int16 destY, uint16 flags) { clearFlag(ACTOR_FLAG_10); // Check if the actor already is at the destination - if (x_pos == destX && y_pos == destY) { + if (_x_pos == destX && _y_pos == destY) { if (wasAlreadyWalking) { stopWalk(); } @@ -296,7 +296,7 @@ bool Actor::startWalk(int16 destX, int16 destY, uint16 flags) { } // Check if the actor already is at the adjusted destination - if (x_pos == destX && y_pos == destY) { + if (_x_pos == destX && _y_pos == destY) { if (wasAlreadyWalking) { stopWalk(); } @@ -304,7 +304,7 @@ bool Actor::startWalk(int16 destX, int16 destY, uint16 flags) { } int tempDestX1 = destX, tempDestY1 = destY; - int actorX1 = x_pos, actorY1 = y_pos; + int actorX1 = _x_pos, actorY1 = _y_pos; bool pathPointProcessed[kPathPointsCount]; for (int pointIndex = 0; pointIndex < kPathPointsCount; ++pointIndex) { @@ -329,8 +329,8 @@ bool Actor::startWalk(int16 destX, int16 destY, uint16 flags) { actorY1 += syd; tempDestX1 += dxd; tempDestY1 += dyd; - x_pos += sxd; - y_pos += syd; + _x_pos += sxd; + _y_pos += syd; } } } @@ -357,8 +357,8 @@ bool Actor::startWalk(int16 destX, int16 destY, uint16 flags) { if (canWalkLine(actorX1 + deltaX, actorY1 + deltaY, pt.x, pt.y, flags)) { actorX1 += deltaX; actorY1 += deltaY; - x_pos += deltaX; - y_pos += deltaY; + _x_pos += deltaX; + _y_pos += deltaY; needAdjustSourcePoint = false; } } @@ -404,7 +404,7 @@ bool Actor::startWalk(int16 destX, int16 destY, uint16 flags) { tempDestX1 = pt.x; tempDestY1 = pt.y; if (pathPointsIndex >= 2) { - const Common::Point prevPt = getEngine()->_scene->getPoint(walkPointsTbl[pathPointsIndex - 2]); + const Common::Point prevPt = getEngine()->_scene->getPoint(_walkPointsTbl[pathPointsIndex - 2]); if (canWalkLine(pt.x, pt.y, prevPt.x, prevPt.y, flags)) { --pathPointsIndex; } @@ -413,7 +413,7 @@ bool Actor::startWalk(int16 destX, int16 destY, uint16 flags) { --pathPointsIndex; } } - walkPointsTbl[pathPointsIndex] = foundPointIndex; + _walkPointsTbl[pathPointsIndex] = foundPointIndex; ++pathPointsIndex; } @@ -445,14 +445,14 @@ bool Actor::startWalk(int16 destX, int16 destY, uint16 flags) { } } - walkPointsIndex = pathPointsIndex - 1; + _walkPointsIndex = pathPointsIndex - 1; if (pathPointsIndex == 0) { _walkDestX = tempDestX1; _walkDestY = tempDestY1; _finalWalkDestX = -1; _finalWalkDestY = -1; } else { - const Common::Point pt = getEngine()->_scene->getPoint(walkPointsTbl[walkPointsIndex]); + const Common::Point pt = getEngine()->_scene->getPoint(_walkPointsTbl[_walkPointsIndex]); _walkDestX = pt.x; _walkDestY = pt.y; } @@ -469,9 +469,9 @@ bool Actor::startWalk(int16 destX, int16 destY, uint16 flags) { void Actor::stopWalk() { clearFlag(Dragons::ACTOR_FLAG_10); - walkPointsIndex = 0; - _walkDestX = x_pos; - _walkDestY = y_pos; + _walkPointsIndex = 0; + _walkDestX = _x_pos; + _walkDestY = _y_pos; _finalWalkDestX = -1; _finalWalkDestY = -1; setFlag(Dragons::ACTOR_FLAG_4); @@ -525,7 +525,7 @@ bool Actor::isFlagSet(uint32 flag) { } uint16 Actor::canWalkLine(int16 actor_x, int16 actor_y, int16 target_x, int16 target_y, uint16 walkFlags) { - debug(1, "canWalkLine. (%X,%X) -> (%X,%X) %d", x_pos, y_pos, target_x, target_y, walkFlags); + debug(1, "canWalkLine. (%X,%X) -> (%X,%X) %d", _x_pos, _y_pos, target_x, target_y, walkFlags); if (walkFlags == 2) { return 1; @@ -611,14 +611,14 @@ uint16 Actor::canWalkLine(int16 actor_x, int16 actor_y, int16 target_x, int16 ta int Actor::startMoveToPoint(int destX, int destY) { int direction = 0; int quadrant = 0; - int deltaX = destX - x_pos; - int deltaY = (destY - y_pos) * 2; + int deltaX = destX - _x_pos; + int deltaY = (destY - _y_pos) * 2; int absDeltaX = ABS(deltaX); int absDeltaY = ABS(deltaY); - // debug("from: (%d, %d); to: (%d, %d); d: (%d, %d); actor._walkSpeed: %08X", x_pos, actor._y, destX, destY, deltaX, deltaY, actor._walkSpeed); + // debug("from: (%d, %d); to: (%d, %d); d: (%d, %d); actor._walkSpeed: %08X", _x_pos, actor._y, destX, destY, deltaX, deltaY, actor._walkSpeed); - _xShl16 = x_pos << 16; - _yShl16 = y_pos << 16; + _xShl16 = _x_pos << 16; + _yShl16 = _y_pos << 16; // Walk slope is a fixed point value, where the upper 16 bits are the integral part, // and the lower 16 bits the fractional part. 0x10000 is 1.0. @@ -688,8 +688,8 @@ int Actor::startMoveToPoint(int destX, int destY) { void Actor::walkPath() { if (isFlagClear(Dragons::ACTOR_FLAG_400) && isFlagSet(Dragons::ACTOR_FLAG_40) && isFlagSet(Dragons::ACTOR_FLAG_10)) { - _xShl16 += (((scale * _walkSlopeX) / DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE) * 5) / 4; - _yShl16 += (((scale * _walkSlopeY) / DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE) * 5) / 4; + _xShl16 += (((_scale * _walkSlopeX) / DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE) * 5) / 4; + _yShl16 += (((_scale * _walkSlopeY) / DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE) * 5) / 4; if ( (_walkSlopeX >= 0 && _walkDestX < (_xShl16 >> 0x10)) || (_walkSlopeX < 0 && (_xShl16 >> 0x10) < _walkDestX)) { @@ -701,11 +701,11 @@ int Actor::startMoveToPoint(int destX, int destY) { _yShl16 = _walkDestY << 0x10; } - x_pos = _xShl16 >> 0x10; - y_pos = _yShl16 >> 0x10; + _x_pos = _xShl16 >> 0x10; + _y_pos = _yShl16 >> 0x10; - if (x_pos == _walkDestX && y_pos == _walkDestY) { - if (walkPointsIndex <= 0) { + if (_x_pos == _walkDestX && _y_pos == _walkDestY) { + if (_walkPointsIndex <= 0) { if (_finalWalkDestX < 0) { clearFlag(ACTOR_FLAG_10); if (isFlagClear(ACTOR_FLAG_200)) { @@ -721,8 +721,8 @@ int Actor::startMoveToPoint(int destX, int destY) { _finalWalkDestY = -1; } } else { - walkPointsIndex--; - Common::Point point = getEngine()->_scene->getPoint(walkPointsTbl[walkPointsIndex]); + _walkPointsIndex--; + Common::Point point = getEngine()->_scene->getPoint(_walkPointsTbl[_walkPointsIndex]); _walkDestX = point.x; _walkDestY = point.y; } @@ -780,7 +780,7 @@ bool Actor::waitUntilFlag4IsSetAllowSkip() { byte *Actor::getPalette() { if (!isFlagSet(ACTOR_FLAG_4000)) { if (!isFlagSet(ACTOR_FLAG_8000)) { - if ((frame_flags & 0x30) != 0) { + if ((_frame_flags & 0x30) != 0) { return _actorResource->getPalette(); } return getEngine()->_screen->getPalette(1); diff --git a/engines/dragons/actor.h b/engines/dragons/actor.h index 07b2616a0ae..b179ac49fc1 100644 --- a/engines/dragons/actor.h +++ b/engines/dragons/actor.h @@ -87,40 +87,40 @@ class Actor { public: uint16 _actorID; ActorResource* _actorResource; - uint16 actorFileDictionaryIndex; - int16 resourceID; + uint16 _actorFileDictionaryIndex; + int16 _resourceID; byte *_seqCodeIp; - void* frame_pointer_maybe; - ActorFrame *frame; - Graphics::Surface *surface; - uint16 field_c; - int16 scale; // scale factor 0x100 is 100% - uint16 sequenceTimer; + void* _frame_pointer_maybe; + ActorFrame *_frame; + Graphics::Surface *_surface; + uint16 _field_c; + int16 _scale; // scale factor 0x100 is 100% + uint16 _sequenceTimer; uint16 _sequenceID; int16 _sequenceID2; - int16 priorityLayer; + int16 _priorityLayer; uint16 _flags; - int16 x_pos; - int16 y_pos; + int16 _x_pos; + int16 _y_pos; int16 _walkDestX; int16 _walkDestY; int32 _xShl16; int32 _yShl16; int32 _walkSlopeX; int32 _walkSlopeY; - uint16 walkPointsTbl[32]; - int16 walkPointsIndex; + uint16 _walkPointsTbl[32]; + int16 _walkPointsIndex; int16 _finalWalkDestX; int16 _finalWalkDestY; - uint16 field_7a; + uint16 _field_7a; int32 _walkSpeed; - uint16 field_80; - uint16 frame_vram_x; - uint16 frame_vram_y; - uint16 frame_width; - uint16 frame_height; - uint16 frame_flags; - uint16 clut; + uint16 _field_80; + uint16 _frame_vram_x; + uint16 _frame_vram_y; + uint16 _frame_width; + uint16 _frame_height; + uint16 _frame_flags; + uint16 _clut; public: Actor(uint16 id); diff --git a/engines/dragons/cursor.cpp b/engines/dragons/cursor.cpp index 33e40d7afb3..55ed3c07796 100644 --- a/engines/dragons/cursor.cpp +++ b/engines/dragons/cursor.cpp @@ -40,11 +40,11 @@ Cursor::Cursor(DragonsEngine *vm): _vm(vm), _actor(0), _x(0), _y(0) { void Cursor::init(ActorManager *actorManager, DragonINIResource *dragonINIResource) { _sequenceID = 0; _actor = actorManager->loadActor(0, 0); //Load cursor - _actor->x_pos = _x = 160; - _actor->y_pos = _y = 100; - _actor->priorityLayer = 6; + _actor->_x_pos = _x = 160; + _actor->_y_pos = _y = 100; + _actor->_priorityLayer = 6; _actor->_flags = 0; - _actor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + _actor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; _actor->updateSequence(_sequenceID); _actor->_flags |= (Dragons::ACTOR_FLAG_40 | Dragons::ACTOR_FLAG_80 | Dragons::ACTOR_FLAG_100 | Dragons::ACTOR_FLAG_200); @@ -71,8 +71,8 @@ void Cursor::update() { _sequenceID = 1; } - _actor->x_pos = _x; - _actor->y_pos = _y; + _actor->_x_pos = _x; + _actor->_y_pos = _y; // 0x80028104 if (_iniUnderCursor != 0 @@ -136,9 +136,9 @@ void Cursor::update() { void Cursor::updateVisibility() { if (_vm->isFlagSet(Dragons::ENGINE_FLAG_8) && !_vm->isUnkFlagSet(Dragons::ENGINE_UNK1_FLAG_10)) { - _actor->priorityLayer = 9; + _actor->_priorityLayer = 9; } else { - _actor->priorityLayer = 0; + _actor->_priorityLayer = 0; } } @@ -215,10 +215,10 @@ int16 Cursor::updateIniFromScene() { if (ini->field_1a_flags_maybe & 1) { // 0x80028b18 if (ini->actor->isFlagSet(ACTOR_FLAG_40) && ini->actor->isFlagSet(ACTOR_FLAG_8)) { - int16 iniActorXPosition = ini->actor->x_pos - ini->actor->frame->xOffset; - int16 iniActorYPosition = ini->actor->y_pos - ini->actor->frame->yOffset; - if (cursorX >= iniActorXPosition && cursorX < iniActorXPosition + ini->actor->frame->width - && cursorY >= iniActorYPosition && cursorY < iniActorYPosition + ini->actor->frame->height) { + int16 iniActorXPosition = ini->actor->_x_pos - ini->actor->_frame->xOffset; + int16 iniActorYPosition = ini->actor->_y_pos - ini->actor->_frame->yOffset; + if (cursorX >= iniActorXPosition && cursorX < iniActorXPosition + ini->actor->_frame->width + && cursorY >= iniActorYPosition && cursorY < iniActorYPosition + ini->actor->_frame->height) { cursorOverIni = i + 1; } } @@ -357,8 +357,8 @@ byte *Cursor::getPalette() { void Cursor::updateActorPosition(int16 x, int16 y) { updatePosition(x, y); - _actor->x_pos = _x; - _actor->y_pos = _y; + _actor->_x_pos = _x; + _actor->_y_pos = _y; } } // End of namespace Dragons diff --git a/engines/dragons/cutscene.cpp b/engines/dragons/cutscene.cpp index e6cd169da00..93d50832b43 100644 --- a/engines/dragons/cutscene.cpp +++ b/engines/dragons/cutscene.cpp @@ -230,30 +230,30 @@ void CutScene::scene1() { DAT_80072de8->setFlag(ACTOR_FLAG_800); DAT_80072de8->setFlag(ACTOR_FLAG_8000); DAT_80072de8->_walkSpeed = 0x20000; - DAT_80072de8->priorityLayer = 3; + DAT_80072de8->_priorityLayer = 3; DAT_80072dec->setFlag(ACTOR_FLAG_100); DAT_80072dec->setFlag(ACTOR_FLAG_800); DAT_80072dec->setFlag(ACTOR_FLAG_8000); DAT_80072dec->_walkSpeed = 0x18000; - DAT_80072dec->priorityLayer = 3; + DAT_80072dec->_priorityLayer = 3; DAT_80072df0->setFlag(ACTOR_FLAG_100); DAT_80072df0->setFlag(ACTOR_FLAG_800); DAT_80072df0->setFlag(ACTOR_FLAG_8000); DAT_80072df0->_walkSpeed = 0x14000; - DAT_80072df0->priorityLayer = 3; + DAT_80072df0->_priorityLayer = 3; DAT_80072df4->setFlag(ACTOR_FLAG_100); DAT_80072df4->setFlag(ACTOR_FLAG_800); DAT_80072df4->setFlag(ACTOR_FLAG_8000); DAT_80072df4->_walkSpeed = 0x1c000; - DAT_80072df4->priorityLayer = 3; + DAT_80072df4->_priorityLayer = 3; DAT_80072df8->setFlag(ACTOR_FLAG_100); DAT_80072df8->setFlag(ACTOR_FLAG_800); DAT_80072df8->setFlag(ACTOR_FLAG_8000); - DAT_80072df8->priorityLayer = 3; + DAT_80072df8->_priorityLayer = 3; _vm->waitForFramesAllowSkip(0xe); // call_fade_related_1f(); @@ -272,8 +272,8 @@ void CutScene::scene1() { _vm->_talk->displayDialogAroundPoint(dialog,0x27,0xc,0xc01,0,0x5ea2); DAT_80072df0->waitUntilFlag8And4AreSet(); - DAT_80072df0->x_pos = 0xcf; - DAT_80072df0->y_pos = 0x90; + DAT_80072df0->_x_pos = 0xcf; + DAT_80072df0->_y_pos = 0x90; DAT_80072df0->startWalk(0x97, 0x37, 2); DAT_80072df0->updateSequence(7); //TODO @@ -399,7 +399,7 @@ void CutScene::FUN_8003d388() { DAT_800830bc = _vm->_actorManager->loadActor(0xaa,1,0x115,0x22,1); DAT_800830bc->setFlag(ACTOR_FLAG_100); DAT_800830bc->setFlag(ACTOR_FLAG_8000); - DAT_800830bc->priorityLayer = 4; + DAT_800830bc->_priorityLayer = 4; if ((DAT_80063514 & 0x100) != 0) { DAT_800830c0 = _vm->_actorManager->loadActor(0x7e,0x1c,0x21,0x87,1); } @@ -461,7 +461,7 @@ void CutScene::changeBackgroundPosition(uint16 newPosition, int16 sParm2) _vm->_screen->loadPalette(0, _palettes + 2 * 512); for (int i = 2; i < 0x17; i++) { Actor *actor = _vm->_actorManager->getActor(i); - actor->x_pos += 0x3c0; + actor->_x_pos += 0x3c0; } } else { @@ -508,7 +508,7 @@ void CutScene::diamondScene() { actorId_03 = _vm->getINI(0x259)->actor; actorId_01 = _vm->getINI(0x258)->actor; actorId_03->setFlag(ACTOR_FLAG_100); - actorId_03->priorityLayer = 4; + actorId_03->_priorityLayer = 4; actorId_00 = _vm->getINI(0x256)->actor; _vm->setFlags(ENGINE_FLAG_20000); actorId_02 = _vm->getINI(0x25a)->actor; @@ -534,9 +534,9 @@ void CutScene::diamondScene() { actorId->updateSequence(4); _vm->waitForFramesAllowSkip(0x17); actorId_03->updateSequence(9); - actorId_03->x_pos = 0x82; - actorId_03->y_pos = 0xc4; - actorId_03->priorityLayer = 4; + actorId_03->_x_pos = 0x82; + actorId_03->_y_pos = 0xc4; + actorId_03->_priorityLayer = 4; if (!actorId->waitUntilFlag4IsSetAllowSkip()) { actorId->updateSequence(5); if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(actorId_01,0x10,2,0x42ac2,0x3c01) != 2 && @@ -684,10 +684,10 @@ void CutScene::flameReturnsCutScene() { DAT_80063514 = (DAT_80063514 & 0xfffe) | 0x600; FUN_8003d388(); DAT_80072de8->updateSequence(0x1f); - DAT_80072e04->x_pos = 0x10b; - DAT_80072e04->y_pos = 99; - DAT_80072de8->x_pos = 0x10a; - DAT_80072de8->y_pos = 0x5a; + DAT_80072e04->_x_pos = 0x10b; + DAT_80072e04->_y_pos = 99; + DAT_80072de8->_x_pos = 0x10a; + DAT_80072de8->_y_pos = 0x5a; DAT_80072de8->_walkSpeed = 0x10000; DAT_80072e04->_walkSpeed = 0x10000; DAT_80072de8->setFlag(ACTOR_FLAG_800); diff --git a/engines/dragons/dragons.cpp b/engines/dragons/dragons.cpp index b288503afa4..04609b07fd8 100644 --- a/engines/dragons/dragons.cpp +++ b/engines/dragons/dragons.cpp @@ -240,8 +240,8 @@ uint16 DragonsEngine::ipt_img_file_related() { DragonINI *flicker = _dragonINIResource->getFlickerRecord(); assert(flicker); - int16 tileX = flicker->actor->x_pos / 32; - int16 tileY = flicker->actor->y_pos / 8; + int16 tileX = flicker->actor->_x_pos / 32; + int16 tileY = flicker->actor->_y_pos / 8; for (int i=0;i < _dragonINIResource->totalRecords(); i++) { DragonINI *ini = getINI(i); @@ -285,7 +285,7 @@ void DragonsEngine::gameLoop() { _counter++; if (0x4af < _counter) { pDVar8 = _dragonINIResource->getFlickerRecord(); - if (pDVar8->actor->resourceID == 0xe) { + if (pDVar8->actor->_resourceID == 0xe) { pDVar8->actor->_sequenceID2 = 2; pDVar8->field_20_actor_field_14 = 2; if (getINI(0xc2)->field_1e == 1) { @@ -560,14 +560,14 @@ void DragonsEngine::gameLoop() { actorId = uVar3; if (tmpId != 0) { actor->_flags = 0; - actor->priorityLayer = 0; - actor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + actor->_priorityLayer = 0; + actor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; actor->updateSequence(getINI(tmpId - 1)->field_8 * 2 + 10); actor->setFlag(ACTOR_FLAG_40); actor->setFlag(ACTOR_FLAG_80); actor->setFlag(ACTOR_FLAG_100); actor->setFlag(ACTOR_FLAG_200); - actor->priorityLayer = 6; + actor->_priorityLayer = 6; actorId = uVar3; } continue; @@ -577,8 +577,8 @@ void DragonsEngine::gameLoop() { if (_inventory->addItemIfPositionIsEmpty(_cursor->iniItemInHand, _cursor->_x, _cursor->_y)) { Actor *invActor = _inventory->getInventoryItemActor(_cursor->iniItemInHand); invActor->_flags = 0; - invActor->priorityLayer = 0; - invActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + invActor->_priorityLayer = 0; + invActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; invActor->updateSequence( getINI(_cursor->iniItemInHand - 1)->field_8 * 2 + 10); _cursor->iniItemInHand = 0; @@ -586,7 +586,7 @@ void DragonsEngine::gameLoop() { invActor->setFlag(ACTOR_FLAG_80); invActor->setFlag(ACTOR_FLAG_100); invActor->setFlag(ACTOR_FLAG_200); - invActor->priorityLayer = 6; + invActor->_priorityLayer = 6; if (_cursor->_sequenceID == 5) { _cursor->_sequenceID = 4; } @@ -624,29 +624,29 @@ void DragonsEngine::updateHandler() { Actor *actor = _actorManager->getActor(i); if (actor->_flags & Dragons::ACTOR_FLAG_40) { if (!(actor->_flags & Dragons::ACTOR_FLAG_100)) { - int16 priority = _scene->getPriorityAtPosition(Common::Point(actor->x_pos, actor->y_pos)); + int16 priority = _scene->getPriorityAtPosition(Common::Point(actor->_x_pos, actor->_y_pos)); DragonINI *flicker = _dragonINIResource->getFlickerRecord(); if (flicker && _scene->contains(flicker) && flicker->actor->_actorID == i) { if (priority < 8 || priority == 0x10) { - actor->priorityLayer = priority; + actor->_priorityLayer = priority; } } else { if (priority != -1) { - actor->priorityLayer = priority; + actor->_priorityLayer = priority; } } - if (actor->priorityLayer >= 0x11) { - actor->priorityLayer = 0; + if (actor->_priorityLayer >= 0x11) { + actor->_priorityLayer = 0; } - if (actor->priorityLayer >= 9) { - actor->priorityLayer -= 8; + if (actor->_priorityLayer >= 9) { + actor->_priorityLayer -= 8; } } - if (actor->sequenceTimer != 0) { - actor->sequenceTimer--; + if (actor->_sequenceTimer != 0) { + actor->_sequenceTimer--; } } } @@ -654,8 +654,8 @@ void DragonsEngine::updateHandler() { if (_flags & Dragons::ENGINE_FLAG_80) { for (uint16 i = 0x17; i < DRAGONS_ENGINE_NUM_ACTORS; i++) { Actor *actor = _actorManager->getActor(i); - if (actor->sequenceTimer != 0) { - actor->sequenceTimer--; + if (actor->_sequenceTimer != 0) { + actor->_sequenceTimer--; } } } @@ -720,7 +720,7 @@ void DragonsEngine::updateActorSequences() { if (actor->_flags & Dragons::ACTOR_FLAG_40 && !(actor->_flags & Dragons::ACTOR_FLAG_4) && !(actor->_flags & Dragons::ACTOR_FLAG_400) && - (actor->sequenceTimer == 0 || actor->_flags & Dragons::ACTOR_FLAG_1)) { + (actor->_sequenceTimer == 0 || actor->_flags & Dragons::ACTOR_FLAG_1)) { debug(5, "Actor[%d] execute sequenceOp", actorId); if (actor->_flags & Dragons::ACTOR_FLAG_1) { @@ -729,7 +729,7 @@ void DragonsEngine::updateActorSequences() { actor->clearFlag(ACTOR_FLAG_1); actor->clearFlag(ACTOR_FLAG_8); actor->clearFlag(ACTOR_FLAG_1000); - actor->field_7a = 0; + actor->_field_7a = 0; } OpCall opCall; opCall._result = 1; @@ -803,8 +803,8 @@ void DragonsEngine::setVar(uint16 offset, uint16 value) { uint16 DragonsEngine::getIniFromImg() { DragonINI *flicker = _dragonINIResource->getFlickerRecord(); - int16 x = flicker->actor->x_pos / 32; - int16 y = flicker->actor->y_pos / 8; + int16 x = flicker->actor->_x_pos / 32; + int16 y = flicker->actor->_y_pos / 8; uint16 currentSceneId = _scene->getSceneId(); @@ -862,7 +862,7 @@ void DragonsEngine::engineFlag0x20UpdateFunction() { // if ((flickerINI->sceneId == currentSceneId) // && (uVar5 != 0xffff)) { // actors[(uint)uVar5]._sequenceID = 8; -// actors[(uint)uVar5].priorityLayer_maybe = 0; +// actors[(uint)uVar5]._priorityLayer_maybe = 0; // } } else { @@ -871,7 +871,7 @@ void DragonsEngine::engineFlag0x20UpdateFunction() { if ((flickerINI->sceneId == currentSceneId) && (uVar5 != 0xffff)) { // actors[(uint)uVar5]._sequenceID = 8; -// actors[(uint)uVar5].priorityLayer_maybe = 0; +// actors[(uint)uVar5]._priorityLayer_maybe = 0; } } else { if ((bit_flags_8006fbd8 & 2) == 0) { @@ -885,7 +885,7 @@ void DragonsEngine::engineFlag0x20UpdateFunction() { } } else { - //actors[(uint)uVar5].priorityLayer_maybe = 0; + //actors[(uint)uVar5]._priorityLayer_maybe = 0; } } @@ -935,7 +935,7 @@ void DragonsEngine::engineFlag0x20UpdateFunction() { // if ((flickerINI->sceneId == currentSceneId) // && (uVar5 != 0xffff)) { // actors[(uint)uVar5]._sequenceID = 8; -// actors[(uint)uVar5].priorityLayer_maybe = 0; +// actors[(uint)uVar5]._priorityLayer_maybe = 0; // } } else { @@ -1163,8 +1163,8 @@ void DragonsEngine::walkFlickerToObject() targetY = img->field_c; } else { - targetX = targetINI->actor->x_pos; - targetY = targetINI->actor->y_pos; + targetX = targetINI->actor->_x_pos; + targetY = targetINI->actor->_y_pos; } flickerINI->actor->_walkSpeed = 0x10000; if (flickerINI->field_20_actor_field_14 == -1) { diff --git a/engines/dragons/inventory.cpp b/engines/dragons/inventory.cpp index 537a472b4fe..41a2bbce4d6 100644 --- a/engines/dragons/inventory.cpp +++ b/engines/dragons/inventory.cpp @@ -77,11 +77,11 @@ Inventory::Inventory(DragonsEngine *vm) : _vm(vm) { void Inventory::init(ActorManager *actorManager, BackgroundResourceLoader *backgroundResourceLoader, Bag *bag, DragonINIResource *dragonIniResource) { _actor = actorManager->loadActor(1, 1); //Load inventory - _actor->x_pos = 2; - _actor->y_pos = 0; - _actor->priorityLayer = 6; + _actor->_x_pos = 2; + _actor->_y_pos = 0; + _actor->_priorityLayer = 6; _actor->_flags = 0; - _actor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + _actor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; _actor->updateSequence(0); _actor->_flags |= (Dragons::ACTOR_FLAG_40 | Dragons::ACTOR_FLAG_80 | Dragons::ACTOR_FLAG_100 | Dragons::ACTOR_FLAG_200); @@ -113,7 +113,7 @@ void Inventory::loadScene(uint32 sceneId) { } void Inventory::updateVisibility() { - _actor->priorityLayer = _vm->isFlagSet(Dragons::ENGINE_FLAG_10) ? (int16)6 : (int16)0; + _actor->_priorityLayer = _vm->isFlagSet(Dragons::ENGINE_FLAG_10) ? (int16)6 : (int16)0; } Common::Point Inventory::getPosition() { @@ -129,7 +129,7 @@ void Inventory::clearActorFlag400() { } void Inventory::setPriority(uint16 priority) { - _actor->priorityLayer = priority; + _actor->_priorityLayer = priority; } void Inventory::setActorSequenceId(int32 sequenceId) { @@ -157,11 +157,11 @@ void Inventory::openInventory() { } _actor->updateSequence(_sequenceId); _screenPositionIndex = 1; - _actor->x_pos = positionTable[_screenPositionIndex].x; + _actor->_x_pos = positionTable[_screenPositionIndex].x; if ((_sequenceId == 0) || (_sequenceId == 2)) { - _actor->x_pos = positionTable[_screenPositionIndex].x + 0x32; + _actor->_x_pos = positionTable[_screenPositionIndex].x + 0x32; } - _actor->y_pos = positionTable[_screenPositionIndex].y; + _actor->_y_pos = positionTable[_screenPositionIndex].y; animateBagIn(); //TODO 0x800310e0 update cursor position. @@ -169,19 +169,19 @@ void Inventory::openInventory() { for (int i = 0; i < DRAGONS_MAX_INVENTORY_ITEMS; i++) { Actor *item = _vm->_actorManager->getActor(i + ACTOR_INVENTORY_OFFSET); - item->x_pos = item->_walkDestX = invXPosTable[i] + 0x10; - item->y_pos = item->_walkDestY = invYPosTable[i] + 0xc; + item->_x_pos = item->_walkDestX = invXPosTable[i] + 0x10; + item->_y_pos = item->_walkDestY = invYPosTable[i] + 0xc; if (inventoryItemTbl[i]) { item->_flags = 0; //clear all flags - item->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - item->priorityLayer = 0; + item->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + item->_priorityLayer = 0; item->updateSequence(_vm->getINI(inventoryItemTbl[i] - 1)->field_8 * 2 + 10); item->setFlag(ACTOR_FLAG_200); item->setFlag(ACTOR_FLAG_100); item->setFlag(ACTOR_FLAG_80); item->setFlag(ACTOR_FLAG_40); - item->priorityLayer = 6; + item->_priorityLayer = 6; } } } @@ -243,11 +243,11 @@ void Inventory::closeInventory() { } } _actor->updateSequence(_sequenceId); - _actor->x_pos = positionTable[_screenPositionIndex].x; + _actor->_x_pos = positionTable[_screenPositionIndex].x; if (((_sequenceId == 0) || (_sequenceId == 2)) && ((_screenPositionIndex == 1 || (_screenPositionIndex == 3)))) { - _actor->x_pos += 0x32; + _actor->_x_pos += 0x32; } - _actor->y_pos = positionTable[_screenPositionIndex].y; + _actor->_y_pos = positionTable[_screenPositionIndex].y; animateBagOut(); } @@ -261,8 +261,8 @@ uint16 Inventory::getIniAtPosition(int16 x, int16 y) { for (int i = 0; i < DRAGONS_MAX_INVENTORY_ITEMS; i++) { if (inventoryItemTbl[i]) { Actor *item = _vm->_actorManager->getActor(i + ACTOR_INVENTORY_OFFSET); - if (item->x_pos - 0x10 <= x && x < item->x_pos + 0x10 - && item->y_pos - 0xc <= y && y < item->y_pos + 0xc) { + if (item->_x_pos - 0x10 <= x && x < item->_x_pos + 0x10 + && item->_y_pos - 0xc <= y && y < item->_y_pos + 0xc) { return inventoryItemTbl[i]; } } @@ -291,7 +291,7 @@ void Inventory::openInventionBook() { DragonINI *flicker = _vm->_dragonINIResource->getFlickerRecord(); if (flicker && flicker->actor) { inventionBookPrevFlickerINISceneId = flicker->sceneId; - inventionBookPrevFlickerINIPosition = Common::Point(flicker->actor->x_pos, flicker->actor->y_pos); + inventionBookPrevFlickerINIPosition = Common::Point(flicker->actor->_x_pos, flicker->actor->_y_pos); flicker->sceneId = 0; } _vm->_scene->setSceneId(2); @@ -306,8 +306,8 @@ void Inventory::closeInventionBook() { DragonINI *flicker = _vm->_dragonINIResource->getFlickerRecord(); if (flicker && flicker->actor) { - flicker->actor->x_pos = inventionBookPrevFlickerINIPosition.x; - flicker->actor->y_pos = inventionBookPrevFlickerINIPosition.y; + flicker->actor->_x_pos = inventionBookPrevFlickerINIPosition.x; + flicker->actor->_y_pos = inventionBookPrevFlickerINIPosition.y; flicker->sceneId = inventionBookPrevFlickerINISceneId; } _vm->_scene->setSceneId(inventionBookPrevSceneId); @@ -338,11 +338,11 @@ void Inventory::closeInventionBook() { void Inventory::setPositionFromSceneId(uint32 sceneId) { _screenPositionIndex = _vm->_dragonRMS->getInventoryPosition(sceneId); - _actor->x_pos = positionTable[_screenPositionIndex].x; + _actor->_x_pos = positionTable[_screenPositionIndex].x; if ((_sequenceId == 0 || _sequenceId == 2) && (_screenPositionIndex == 1 || _screenPositionIndex == 3)) { - _actor->x_pos += 0x32; + _actor->_x_pos += 0x32; } - _actor->y_pos = positionTable[_screenPositionIndex].y; + _actor->_y_pos = positionTable[_screenPositionIndex].y; } bool Inventory::addItem(uint16 initId) { @@ -377,10 +377,10 @@ void Inventory::replaceItem(uint16 existingIniId, uint16 newIniId) { bool Inventory::addItemIfPositionIsEmpty(uint16 iniId, uint16 x, uint16 y) { for (int i = 0; i < DRAGONS_MAX_INVENTORY_ITEMS; i++) { Actor *actor = _vm->_actorManager->getActor(i + ACTOR_INVENTORY_OFFSET); - if ((((actor->x_pos - 0x10 <= x) && - (x < actor->x_pos + 0x10)) && - (actor->y_pos - 0xc <= y)) && - (y < actor->y_pos + 0xc)) { + if ((((actor->_x_pos - 0x10 <= x) && + (x < actor->_x_pos + 0x10)) && + (actor->_y_pos - 0xc <= y)) && + (y < actor->_y_pos + 0xc)) { inventoryItemTbl[i] = iniId; return true; } @@ -405,7 +405,7 @@ void Inventory::inventoryMissing() { DragonINI *flicker = _vm->_dragonINIResource->getFlickerRecord(); if (flicker->actor != NULL) { flicker->actor->clearFlag(ACTOR_FLAG_10); - if ((_vm->getCurrentSceneId() != 0x2e) || (flicker->actor->resourceID != 0x91)) { + if ((_vm->getCurrentSceneId() != 0x2e) || (flicker->actor->_resourceID != 0x91)) { flicker->actor->setFlag(ACTOR_FLAG_4); } } diff --git a/engines/dragons/minigame1.cpp b/engines/dragons/minigame1.cpp index 3b394be3091..aa9df0c5065 100644 --- a/engines/dragons/minigame1.cpp +++ b/engines/dragons/minigame1.cpp @@ -165,7 +165,7 @@ void Minigame1::run() { originalFlickerIniID = _vm->_dragonINIResource->getFlickerRecord(); originalFlickerIniID->actor->setFlag(ACTOR_FLAG_100); - originalFlickerIniID->actor->priorityLayer = 0; + originalFlickerIniID->actor->_priorityLayer = 0; savedEngineFlags = _vm->getMultipleFlags(ENGINE_FLAG_8 | ENGINE_FLAG_10 | ENGINE_FLAG_20 | ENGINE_FLAG_80); _vm->clearFlags(ENGINE_FLAG_8); @@ -175,34 +175,34 @@ void Minigame1::run() { _vm->_dragonINIResource->setFlickerRecord(_vm->getINI(DAT_80063a40 - 1)); flickerActor = _vm->getINI(DAT_80063a40 - 1)->actor; flickerActor->_flags = flickerActor->_flags | 0x380; - flickerActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - flickerActor->priorityLayer = 4; + flickerActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + flickerActor->_priorityLayer = 4; flickerActor->_sequenceID2 = -1; flickerActor->updateSequence(0x15); hitCounter = 0; local_254 = 0; local_252 = 0; - flickerXPos = flickerActor->x_pos; + flickerXPos = flickerActor->_x_pos; local_25c = 0; pusherActor = _vm->_actorManager->loadActor(0x26,1, flickerXPos, - (int)(((uint)(uint16)flickerActor->y_pos + 5) * 0x10000) >> 0x10); + (int)(((uint)(uint16)flickerActor->_y_pos + 5) * 0x10000) >> 0x10); // if (pusherActorId == -1) { // ProbablyShowASCIIMessage(s_couldn't_alloc_pusher_8008e954,2,4,0,0xffffffff); // } pusherActor->_flags = pusherActor->_flags | 0x380; - pusherActor->x_pos = flickerActor->x_pos + -0xe; - pusherActor->y_pos = flickerActor->y_pos + 7; - pusherActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - pusherActor->priorityLayer = 6; + pusherActor->_x_pos = flickerActor->_x_pos + -0xe; + pusherActor->_y_pos = flickerActor->_y_pos + 7; + pusherActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + pusherActor->_priorityLayer = 6; wheelsActor = _vm->_actorManager->loadActor(7,0x11,0,0); // if (wheelsActorId == -1) { // ProbablyShowASCIIMessage(s_couldn't_alloc_wheels_8008e96c,2,4,0,0xffffffff); // } wheelsActor->_flags = wheelsActor->_flags | 0x380; - wheelsActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - wheelsActor->x_pos = flickerActor->x_pos; - wheelsActor->y_pos = flickerActor->y_pos; - wheelsActor->priorityLayer = 5; + wheelsActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + wheelsActor->_x_pos = flickerActor->_x_pos; + wheelsActor->_y_pos = flickerActor->_y_pos; + wheelsActor->_priorityLayer = 5; wheelsActor->updateSequence(0x11); local_242 = 0; catActor = _vm->_actorManager->loadActor(7,9,0,0); @@ -210,8 +210,8 @@ void Minigame1::run() { // ProbablyShowASCIIMessage(s_couldn't_alloc-cat_8008e984,2,4,0,0xffffffff); // } catActor->_flags = catActor->_flags | 0x380; - catActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - catActor->priorityLayer = 0; + catActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + catActor->_priorityLayer = 0; i = 0; while (i < 3) { targetActorIdTbl[(uint)i + 1] = _vm->_actorManager->loadActor(8,1,0,0,0); @@ -219,7 +219,7 @@ void Minigame1::run() { // ProbablyShowASCIIMessage(s_couldn't_alloc_target!_8008e998,2,4,0,0xffffffff); // } targetActorIdTbl[(uint)i + 1]->_flags = targetActorIdTbl[(uint)i + 1]->_flags | 0x380; - targetActorIdTbl[(uint)i + 1]->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + targetActorIdTbl[(uint)i + 1]->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; auStack378[(uint)i] = 0; //TODO FUN_80017010_update_actor_texture_maybe(1); i = i + 1; @@ -234,20 +234,20 @@ void Minigame1::run() { // ProbablyShowASCIIMessage(s_couldn't_alloc_dust_sprite!_8008e9b0,2,5,0,0xffffffff); // } dustSpriteActor->_flags = dustSpriteActor->_flags | 0x380; - dustSpriteActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + dustSpriteActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; uVar1 = _vm->getINI(DAT_80063a48 - 1)->actor; //dragon_ini_pointer[DAT_80063a48 + -1].actorId; local_21e = 0; - actorFieldC = uVar1->field_c; + actorFieldC = uVar1->_field_c; _vm->setFlags(ENGINE_FLAG_4000000); local_23e = 0x3700; local_23a = 0x100; local_240 = 0x4a80; local_238 = 0; catFieldE_scaleMaybe = 0x30; - catActor->y_pos = 0x6e; - catActor->x_pos = 0x95; - catActor->scale = 0x30; - catActor->priorityLayer = 2; + catActor->_y_pos = 0x6e; + catActor->_x_pos = 0x95; + catActor->_scale = 0x30; + catActor->_priorityLayer = 2; catActor->updateSequence(0xb); gameState = 5; local_246 = 1; @@ -263,7 +263,7 @@ void Minigame1::run() { _vm->_talk->FUN_8001a7c4_clearDialogBoxMaybe(); } if ((local_21e == 1) && (local_252 == 0)) { - uVar1->field_c = actorFieldC; + uVar1->_field_c = actorFieldC; } if (local_21e != 0) { local_21e = local_21e + -1; @@ -308,8 +308,8 @@ void Minigame1::run() { local_25c = 0; } else { - pusherActor->x_pos = flickerActor->x_pos + -0xe; - pusherActor->y_pos = flickerActor->y_pos + 7; + pusherActor->_x_pos = flickerActor->_x_pos + -0xe; + pusherActor->_y_pos = flickerActor->_y_pos + 7; if (local_25c < 0x168) { local_25c = local_25c + 1; if (local_25c < 0x14) { @@ -378,15 +378,15 @@ void Minigame1::run() { (short)((int)((uint)flickerXPos << 7) / 0x2a); } local_240 = flickerXPos << 7; - catActor->x_pos = flickerXPos & 0x1ff; + catActor->_x_pos = flickerXPos & 0x1ff; local_23e = 0x2d00; local_23a = (local_25a + 3) * 0x80; - catActor->y_pos = 0x5a; + catActor->_y_pos = 0x5a; catFieldE_scaleMaybe = 0x100; - catActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + catActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; catActor->updateSequence(0xc); _vm->playOrStopSound(5); - catActor->priorityLayer = 3; + catActor->_priorityLayer = 3; flickerActor->updateSequence(8); gameState = 3; } @@ -414,10 +414,10 @@ void Minigame1::run() { local_23a = 0; } } - catActor->x_pos = local_240 >> 7; - catActor->y_pos = local_23e >> 7; + catActor->_x_pos = local_240 >> 7; + catActor->_y_pos = local_23e >> 7; catFieldE_scaleMaybe = catFieldE_scaleMaybe - 3; - catActor->scale = catFieldE_scaleMaybe; + catActor->_scale = catFieldE_scaleMaybe; if (catFieldE_scaleMaybe == 0x7f) { i = 0; while ((i < 8 && (((local_240 >> 7 < auStack352[(uint)i * 3] || @@ -426,7 +426,7 @@ void Minigame1::run() { i = i + 1; } if ((i != 8) && (local_188[(uint)i] != 0)) { - uVar1->field_c = 2; + uVar1->_field_c = 2; local_21e = 0x3c; if (local_250 != 0) { _vm->_talk->FUN_8001a7c4_clearDialogBoxMaybe(); @@ -452,12 +452,12 @@ void Minigame1::run() { local_118[((uint)hitCounter - 1) * 2]); local_250 = *(short *)(local_118 + ((uint)hitCounter - 1) * 2 + 1); } - targetActorIdTbl[(uint)(uint16)local_188[(uint)i]]->priorityLayer = 3; + targetActorIdTbl[(uint)(uint16)local_188[(uint)i]]->_priorityLayer = 3; if (i == 0) { targetActorIdTbl[(uint)local_188[0]]->updateSequence(7); } else { - targetActorIdTbl[(uint)(uint16)local_188[(uint)i]]->y_pos -= 3; + targetActorIdTbl[(uint)(uint16)local_188[(uint)i]]->_y_pos -= 3; targetActorIdTbl[(uint)(uint16)local_188[(uint)i]]->updateSequence(6); } auStack378[(uint)(uint16)local_188[(uint)i] - 1] = 0; @@ -473,30 +473,30 @@ void Minigame1::run() { ((local_25a == 3 && (((0x3c < local_240 >> 7 && (local_240 >> 7 < 0x46)) || ((0x101 < local_240 >> 7 && (local_240 >> 7 < 0x10a)))))))))) { - dustSpriteActor->x_pos = catActor->x_pos; - dustSpriteActor->y_pos = catActor->y_pos + 2; + dustSpriteActor->_x_pos = catActor->_x_pos; + dustSpriteActor->_y_pos = catActor->_y_pos + 2; dustSpriteActor->updateSequence(8); - catActor->priorityLayer = 4; - dustSpriteActor->priorityLayer = 3; + catActor->_priorityLayer = 4; + dustSpriteActor->_priorityLayer = 3; catActor->updateSequence(0xd); gameState = 4; _vm->playOrStopSound(6); } } if (catFieldE_scaleMaybe < 0x7f) { - catActor->priorityLayer = 2; + catActor->_priorityLayer = 2; } if ((0xc < catFieldE_scaleMaybe) && (catFieldE_scaleMaybe < 0x41)) { - catActor->priorityLayer = 0; + catActor->_priorityLayer = 0; } if ((short)catFieldE_scaleMaybe < 2) { local_23e = 0x3700; local_23a = 0x100; local_240 = 0x4a80; catFieldE_scaleMaybe = 0x30; - catActor->y_pos = 0x6e; - catActor->x_pos = 0x95; - catActor->scale = 0x30; + catActor->_y_pos = 0x6e; + catActor->_x_pos = 0x95; + catActor->_scale = 0x30; catActor->updateSequence(0xb); gameState = 5; } @@ -508,7 +508,7 @@ void Minigame1::run() { if (local_23e < 0x4300) { local_23e = local_23e + local_23a; local_23a = local_23a + 0x18; - catActor->y_pos = local_23e >> 7; + catActor->_y_pos = local_23e >> 7; } else { catActor->updateSequence(0xf); @@ -517,8 +517,8 @@ void Minigame1::run() { } } else { - dustSpriteActor->priorityLayer = 0; - catActor->priorityLayer = 3; + dustSpriteActor->_priorityLayer = 0; + catActor->_priorityLayer = 3; catActor->updateSequence(0xe); _vm->playOrStopSound(8); local_23a = 0x40; @@ -529,8 +529,8 @@ void Minigame1::run() { if (local_23e >> 7 < 0x86) { local_23e = local_23e + local_23a; catFieldE_scaleMaybe = catFieldE_scaleMaybe + 8; - catActor->y_pos = local_23e >> 7; - catActor->scale = catFieldE_scaleMaybe; + catActor->_y_pos = local_23e >> 7; + catActor->_scale = catFieldE_scaleMaybe; } else { gameState = 6; @@ -539,7 +539,7 @@ void Minigame1::run() { } break; case 6: // cat run across field - catActor->priorityLayer = 3; + catActor->_priorityLayer = 3; if (local_252 == 0) { if (catActor->_sequenceID == 0xf) { if ((catActor->_flags & 4) != 0) { @@ -552,8 +552,8 @@ void Minigame1::run() { catFieldE_scaleMaybe = 0x80; local_23e = 0x4300; local_23a = 0x100; - catActor->y_pos = 0x86; - catActor->scale = 0x80; + catActor->_y_pos = 0x86; + catActor->_scale = 0x80; catActor->updateSequence(0xb); if (flickerXPos < local_240 >> 7) { sVar2 = flickerXPos + 0x32; @@ -575,9 +575,9 @@ void Minigame1::run() { if (0x100 < catFieldE_scaleMaybe) { catFieldE_scaleMaybe = 0x100; } - catActor->scale = catFieldE_scaleMaybe; - catActor->y_pos = local_23e >> 7; - catActor->x_pos = local_240 >> 7; + catActor->_scale = catFieldE_scaleMaybe; + catActor->_y_pos = local_23e >> 7; + catActor->_x_pos = local_240 >> 7; local_238 = 1; } else { @@ -587,20 +587,20 @@ void Minigame1::run() { else { if ((int)(uint)(local_240 >> 7) < (int)((uint)flickerXPos - 0x32)) { if (catActor->_sequenceID != 9) { - catActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + catActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; catActor->updateSequence(9); } local_240 = local_240 + 0x180; - catActor->x_pos = local_240 >> 7; + catActor->_x_pos = local_240 >> 7; } else { if ((uint)flickerXPos + 0x32 < (uint)(local_240 >> 7)) { if (catActor->_sequenceID != 10) { - catActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + catActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; catActor->updateSequence(10); } local_240 = local_240 - 0x180; - catActor->x_pos = local_240 >> 7; + catActor->_x_pos = local_240 >> 7; } else { gameState = 7; @@ -612,11 +612,11 @@ void Minigame1::run() { } break; case 7: // cat jumping into catapult - if (catActor->priorityLayer == 0) { + if (catActor->_priorityLayer == 0) { gameState = 1; } else { - catActor->priorityLayer = 0; + catActor->_priorityLayer = 0; if (local_240 >> 7 < flickerXPos) { flickerActor->updateSequence(5); } @@ -632,7 +632,7 @@ void Minigame1::run() { } else { local_23a--; - catActor->y_pos = catActor->y_pos + 2; + catActor->_y_pos = catActor->_y_pos + 2; } } else { @@ -646,17 +646,17 @@ void Minigame1::run() { if (local_234 == 2) { local_23e = 0x4100; local_240 = 0x4a80; - catActor->y_pos = 0x82; - catActor->x_pos = 0x95; - catActor->priorityLayer = 3; - catActor->scale = 0x80; + catActor->_y_pos = 0x82; + catActor->_x_pos = 0x95; + catActor->_priorityLayer = 3; + catActor->_scale = 0x80; catActor->updateSequence(0x10); gameState = 6; } else { if (local_234 == 3) { if (local_232 == 0) { - catActor->priorityLayer = 2; + catActor->_priorityLayer = 2; local_23a = 8; local_234 = 1; } @@ -671,7 +671,7 @@ void Minigame1::run() { default: //ProbablyShowASCIIMessage(s_undefined_state!_8008e9cc,2,3,0,0xffffffff); gameState = 1; - catActor->priorityLayer = 0; + catActor->_priorityLayer = 0; flickerActor->updateSequence(0); } if ((local_252 == 0) && (gameState != 2)) { @@ -683,12 +683,12 @@ void Minigame1::run() { (pusherActor->_sequenceID != 6)))) { pusherActor->updateSequence((uint)local_246); if (bVar3) { - pusherActor->x_pos = flickerActor->x_pos + 2; - pusherActor->y_pos = flickerActor->y_pos; + pusherActor->_x_pos = flickerActor->_x_pos + 2; + pusherActor->_y_pos = flickerActor->_y_pos; } else { - pusherActor->x_pos = flickerActor->x_pos - 0xe; - pusherActor->y_pos = flickerActor->y_pos + 7; + pusherActor->_x_pos = flickerActor->_x_pos - 0xe; + pusherActor->_y_pos = flickerActor->_y_pos + 7; } } } @@ -713,14 +713,14 @@ void Minigame1::run() { else { local_242 = local_242 - 1; } - flickerActor->x_pos = flickerXPos; - wheelsActor->x_pos = flickerXPos; + flickerActor->_x_pos = flickerXPos; + wheelsActor->_x_pos = flickerXPos; if ((uint)wheelsActor->_sequenceID != (uint)local_242 / 3 + 0x11) { wheelsActor->updateSequence((uint)local_242 / 3 + 0x11); } - pusherActor->x_pos = flickerActor->x_pos + 2; - pusherActor->y_pos = flickerActor->y_pos; + pusherActor->_x_pos = flickerActor->_x_pos + 2; + pusherActor->_y_pos = flickerActor->_y_pos; } } else { @@ -740,13 +740,13 @@ void Minigame1::run() { } local_242 = (short)((uint)local_242 + 1) + (short)((int)((uint)local_242 + 1) / 6 >> 1) * -0xc; - flickerActor->x_pos = flickerXPos; - wheelsActor->x_pos = flickerXPos; + flickerActor->_x_pos = flickerXPos; + wheelsActor->_x_pos = flickerXPos; if ((uint)wheelsActor->_sequenceID != (uint)local_242 / 3 + 0x11) { wheelsActor->updateSequence((uint)local_242 / 3 + 0x11); } - pusherActor->x_pos = flickerActor->x_pos + -2; - pusherActor->y_pos = flickerActor->y_pos; + pusherActor->_x_pos = flickerActor->_x_pos + -2; + pusherActor->_y_pos = flickerActor->_y_pos; } } if ((local_22c < 0x16) && (auStack536[(uint)local_22c * 3 + 2] <= local_22e)) { @@ -765,20 +765,20 @@ void Minigame1::run() { // ProbablyShowASCIIMessage(s_too_many_targets!_8008e9e0,2,4,0,0xffffffff); } if (auStack536[(uint)local_22c * 3] == 0) { - targetActorIdTbl[(uint)i + 1]->x_pos = auStack352[(uint)auStack536[(uint)local_22c * 3] * 3] + 0xd; + targetActorIdTbl[(uint)i + 1]->_x_pos = auStack352[(uint)auStack536[(uint)local_22c * 3] * 3] + 0xd; } else { - targetActorIdTbl[(uint)i + 1]->x_pos = auStack352[(uint)auStack536[(uint)local_22c * 3] * 3] + 8; + targetActorIdTbl[(uint)i + 1]->_x_pos = auStack352[(uint)auStack536[(uint)local_22c * 3] * 3] + 8; } - targetActorIdTbl[(uint)i + 1]->y_pos = (4 - auStack352[(uint)auStack536[(uint)local_22c * 3] * 3 + 2]) * 0x20; - targetActorIdTbl[(uint)i + 1]->priorityLayer = 2; + targetActorIdTbl[(uint)i + 1]->_y_pos = (4 - auStack352[(uint)auStack536[(uint)local_22c * 3] * 3 + 2]) * 0x20; + targetActorIdTbl[(uint)i + 1]->_priorityLayer = 2; if (auStack536[(uint)local_22c * 3] == 0) { targetActorIdTbl[(uint)i + 1]->updateSequence(3); } else { targetActorIdTbl[(uint)i + 1]->updateSequence(0); } - targetActorIdTbl[(uint)i + 1]->priorityLayer = 2; + targetActorIdTbl[(uint)i + 1]->_priorityLayer = 2; local_188[(uint)auStack536[(uint)local_22c * 3]] = i + 1; auStack378[(uint)i] = auStack536[(uint)local_22c * 3] + 1; } @@ -843,14 +843,14 @@ void Minigame1::run() { } local_22e = local_22e + 1; } while (local_252 == 0); - if (flickerActor->x_pos < 0x118) { - flickerActor->x_pos = flickerActor->x_pos + 2; + if (flickerActor->_x_pos < 0x118) { + flickerActor->_x_pos = flickerActor->_x_pos + 2; if (pusherActor->_sequenceID != 2) { pusherActor->updateSequence(2); } - pusherActor->x_pos = flickerActor->x_pos + 2; - pusherActor->y_pos = flickerActor->y_pos; - wheelsActor->x_pos = wheelsActor->x_pos + 2; + pusherActor->_x_pos = flickerActor->_x_pos + 2; + pusherActor->_y_pos = flickerActor->_y_pos; + wheelsActor->_x_pos = wheelsActor->_x_pos + 2; if (local_242 == 0) { local_242 = 0xb; } @@ -905,10 +905,10 @@ void Minigame1::run() { _vm->_dragonINIResource->setFlickerRecord(originalFlickerIniID); flickerActor = originalFlickerIniID->actor; flickerActor->clearFlag(ACTOR_FLAG_100); - flickerActor->priorityLayer = 6; //TODO this is 2 in the original but that leave flicker invisible. + flickerActor->_priorityLayer = 6; //TODO this is 2 in the original but that leave flicker invisible. _vm->clearFlags(ENGINE_FLAG_4000000); _vm->setFlags(savedEngineFlags); - uVar1->field_c = actorFieldC; + uVar1->_field_c = actorFieldC; return; } diff --git a/engines/dragons/minigame2.cpp b/engines/dragons/minigame2.cpp index 52557820177..745c4a80789 100644 --- a/engines/dragons/minigame2.cpp +++ b/engines/dragons/minigame2.cpp @@ -178,17 +178,17 @@ void Minigame2::run(int16 param_1, uint16 param_2, int16 param_3) { uVar8 = _vm->_actorManager->loadActor(0xf,0,0x7d,199,4); loungealotRightArm = _vm->_actorManager->loadActor(0x10, 0, 0x7d, 199, 4); flickerArm = _vm->_actorManager->loadActor(9, (uint)(uint16)actorSequenceIdTbl[(uint)DAT_80093cb4 * 3 + (uint)DAT_80093cbc], - loungealotLeftUpperArm->x_pos - loungealotLeftUpperArm->frame->field_e, - loungealotLeftUpperArm->y_pos - loungealotLeftUpperArm->frame->field_10, 4); + loungealotLeftUpperArm->_x_pos - loungealotLeftUpperArm->_frame->field_e, + loungealotLeftUpperArm->_y_pos - loungealotLeftUpperArm->_frame->field_10, 4); loungealotThumb = _vm->_actorManager->loadActor(0x12, (uint)(uint16)actorSequenceIdTbl[(uint)DAT_80093cb4 * 3 + (uint)DAT_80093cbc], - loungealotLeftUpperArm->x_pos - loungealotLeftUpperArm->frame->field_e, - loungealotLeftUpperArm->y_pos - loungealotLeftUpperArm->frame->field_10, 4); + loungealotLeftUpperArm->_x_pos - loungealotLeftUpperArm->_frame->field_e, + loungealotLeftUpperArm->_y_pos - loungealotLeftUpperArm->_frame->field_10, 4); uVar12 = _vm->_actorManager->loadActor(10, (uint)(uint16)actorSequenceIdTbl[(uint)DAT_80093cb8 * 3 + (uint)DAT_80093cc0], - flickerArm->x_pos - flickerArm->frame->field_e, - flickerArm->y_pos - flickerArm->frame->field_10, 4); + flickerArm->_x_pos - flickerArm->_frame->field_e, + flickerArm->_y_pos - flickerArm->_frame->field_10, 4); uVar13 = _vm->_actorManager->loadActor(0x13, (uint)(uint16)actorSequenceIdTbl[(uint)DAT_80093cb8 * 3 + (uint)DAT_80093cc0], - flickerArm->x_pos - flickerArm->frame->field_e, - flickerArm->y_pos - flickerArm->frame->field_10, 4); + flickerArm->_x_pos - flickerArm->_frame->field_e, + flickerArm->_y_pos - flickerArm->_frame->field_10, 4); uVar14 = _vm->_actorManager->loadActor(0x27,0,0x10,0xac,4); uVar15 = _vm->_actorManager->loadActor(0x27,1,0x10,0x8c,4); uVar5->setFlag(ACTOR_FLAG_100); @@ -203,17 +203,17 @@ void Minigame2::run(int16 param_1, uint16 param_2, int16 param_3) { uVar14->setFlag(ACTOR_FLAG_100); uVar15->setFlag(ACTOR_FLAG_100); - uVar5->priorityLayer = 6; - flickerArm->priorityLayer = 5; - uVar12->priorityLayer = 5; - loungealotThumb->priorityLayer = 4; - uVar13->priorityLayer = 3; - loungealotRightArm->priorityLayer = 3; - loungealotLeftUpperArm->priorityLayer = 2; - loungealotHeadActor->priorityLayer = 2; - uVar8->priorityLayer = 1; - uVar14->priorityLayer = 0; - uVar15->priorityLayer = 0; + uVar5->_priorityLayer = 6; + flickerArm->_priorityLayer = 5; + uVar12->_priorityLayer = 5; + loungealotThumb->_priorityLayer = 4; + uVar13->_priorityLayer = 3; + loungealotRightArm->_priorityLayer = 3; + loungealotLeftUpperArm->_priorityLayer = 2; + loungealotHeadActor->_priorityLayer = 2; + uVar8->_priorityLayer = 1; + uVar14->_priorityLayer = 0; + uVar15->_priorityLayer = 0; //TODO // uVar16 = AddFlatShadedQuad(0x28,0xa8,0x67,0xa8,0x67,0xaf,0x28,0xaf,0x1f,7,0); // uVar17 = AddFlatShadedQuad(0x28,0x88,0x67,0x88,0x67,0x8f,0x28,0x8f,0x3e0,7,0); @@ -238,14 +238,14 @@ void Minigame2::run(int16 param_1, uint16 param_2, int16 param_3) { uVar8->waitUntilFlag8And4AreSet(); uVar5->setFlag(ACTOR_FLAG_400); - flickerArm->x_pos = loungealotLeftUpperArm->x_pos - loungealotLeftUpperArm->frame->field_e; - flickerArm->y_pos = loungealotLeftUpperArm->y_pos - loungealotLeftUpperArm->frame->field_10; - loungealotThumb->x_pos = loungealotLeftUpperArm->x_pos - loungealotLeftUpperArm->frame->field_e; - loungealotThumb->y_pos = loungealotLeftUpperArm->y_pos - loungealotLeftUpperArm->frame->field_10; - uVar12->x_pos = loungealotLeftUpperArm->x_pos - flickerArm->frame->field_e; - uVar12->y_pos = loungealotLeftUpperArm->y_pos - flickerArm->frame->field_10; - uVar13->x_pos = loungealotLeftUpperArm->x_pos - flickerArm->frame->field_e; - uVar13->y_pos = loungealotLeftUpperArm->y_pos - flickerArm->frame->field_10; + flickerArm->_x_pos = loungealotLeftUpperArm->_x_pos - loungealotLeftUpperArm->_frame->field_e; + flickerArm->_y_pos = loungealotLeftUpperArm->_y_pos - loungealotLeftUpperArm->_frame->field_10; + loungealotThumb->_x_pos = loungealotLeftUpperArm->_x_pos - loungealotLeftUpperArm->_frame->field_e; + loungealotThumb->_y_pos = loungealotLeftUpperArm->_y_pos - loungealotLeftUpperArm->_frame->field_10; + uVar12->_x_pos = loungealotLeftUpperArm->_x_pos - flickerArm->_frame->field_e; + uVar12->_y_pos = loungealotLeftUpperArm->_y_pos - flickerArm->_frame->field_10; + uVar13->_x_pos = loungealotLeftUpperArm->_x_pos - flickerArm->_frame->field_e; + uVar13->_y_pos = loungealotLeftUpperArm->_y_pos - flickerArm->_frame->field_10; _vm->waitForFrames(2); // call_fade_related_1f(); @@ -308,9 +308,9 @@ void Minigame2::run(int16 param_1, uint16 param_2, int16 param_3) { if (DAT_80093c94 != 0) { local_264 = 0; } - if (uVar8->field_7a == 1) { + if (uVar8->_field_7a == 1) { shouldShakeScreen = true; - uVar8->field_7a = 0; + uVar8->_field_7a = 0; screenShakeCounter = 0; } if (shouldShakeScreen) { @@ -369,30 +369,30 @@ void Minigame2::run(int16 param_1, uint16 param_2, int16 param_3) { if (!bVar4) { //TODO FUN_8001a4e4_draw_dialogbox(4,0x14,0xd,0x16,1); //TODO FUN_8001a4e4_draw_dialogbox(4,0x10,0xd,0x12,1); - uVar14->priorityLayer = 6; - uVar15->priorityLayer = 6; + uVar14->_priorityLayer = 6; + uVar15->_priorityLayer = 6; bVar4 = true; } } if ((((local_278 == 0) && (local_27a == 0)) && (local_258 == 0)) && (bVar4)) { // TODO FUN_8001a7c4(4,0x14,0xd,0x16); // TODO FUN_8001a7c4(4,0x10,0xd,0x12); - uVar14->priorityLayer = 0; - uVar15->priorityLayer = 0; + uVar14->_priorityLayer = 0; + uVar15->_priorityLayer = 0; bVar4 = false; } //DisableVSyncEvent(); - loungealotThumb->x_pos = loungealotLeftUpperArm->x_pos - loungealotLeftUpperArm->frame->field_e; - flickerArm->x_pos = loungealotThumb->x_pos; - sVar2 = flickerArm->x_pos; - loungealotThumb->y_pos = loungealotLeftUpperArm->y_pos - loungealotLeftUpperArm->frame->field_10; - flickerArm->y_pos = loungealotThumb->y_pos; - sVar3 = flickerArm->y_pos; - uVar13->x_pos = sVar2 - flickerArm->frame->field_e; - uVar12->x_pos = uVar13->x_pos; - uVar13->y_pos = sVar3 - flickerArm->frame->field_10; - uVar12->y_pos = uVar13->y_pos; + loungealotThumb->_x_pos = loungealotLeftUpperArm->_x_pos - loungealotLeftUpperArm->_frame->field_e; + flickerArm->_x_pos = loungealotThumb->_x_pos; + sVar2 = flickerArm->_x_pos; + loungealotThumb->_y_pos = loungealotLeftUpperArm->_y_pos - loungealotLeftUpperArm->_frame->field_10; + flickerArm->_y_pos = loungealotThumb->_y_pos; + sVar3 = flickerArm->_y_pos; + uVar13->_x_pos = sVar2 - flickerArm->_frame->field_e; + uVar12->_x_pos = uVar13->_x_pos; + uVar13->_y_pos = sVar3 - flickerArm->_frame->field_10; + uVar12->_y_pos = uVar13->_y_pos; // EnableVSyncEvent(); local_282 = DAT_80093cc0; local_286 = DAT_80093cbc; @@ -761,7 +761,7 @@ void Minigame2::run(int16 param_1, uint16 param_2, int16 param_3) { DAT_80093c94 = 2; } } - + } while ( true ); } diff --git a/engines/dragons/minigame3.cpp b/engines/dragons/minigame3.cpp index e44fe5e2641..e78643061e5 100644 --- a/engines/dragons/minigame3.cpp +++ b/engines/dragons/minigame3.cpp @@ -210,9 +210,9 @@ void Minigame3::run() { bunnyActorTbl[(int16)i]->setFlag(ACTOR_FLAG_200); bunnyActorTbl[(int16)i]->setFlag(ACTOR_FLAG_4000); - bunnyActorTbl[(int16)i]->priorityLayer = 0; - bunnyActorTbl[(int16)i]->x_pos = bunnyPositionsTbl[(int16)i].x; - bunnyActorTbl[(int16)i]->y_pos = bunnyPositionsTbl[(int16)i].y; + bunnyActorTbl[(int16)i]->_priorityLayer = 0; + bunnyActorTbl[(int16)i]->_x_pos = bunnyPositionsTbl[(int16)i].x; + bunnyActorTbl[(int16)i]->_y_pos = bunnyPositionsTbl[(int16)i].y; i = i + 1; } i = 0; @@ -222,8 +222,8 @@ void Minigame3::run() { error("Couldn't alloc tear"); } tearActorTbl[(int16)i]->_flags = tearActorTbl[(int16)i]->_flags | 0x380; - tearActorTbl[(int16)i]->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - tearActorTbl[(int16)i]->priorityLayer = 0; + tearActorTbl[(int16)i]->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + tearActorTbl[(int16)i]->_priorityLayer = 0; local_208[(int16)i] = -1; local_208[(int)(int16)i + 8] = 0; i = i + 1; @@ -240,8 +240,8 @@ void Minigame3::run() { handActorId->setFlag(ACTOR_FLAG_800); handActorId->setFlag(ACTOR_FLAG_2000); handActorId->setFlag(ACTOR_FLAG_4000); - handActorId->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - handActorId->priorityLayer = 0; + handActorId->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + handActorId->_priorityLayer = 0; handActorId->_walkSpeed = 0x40000; i = 0; while ((int16)i < 2) { @@ -250,8 +250,8 @@ void Minigame3::run() { error("Couldn't alloc tear blink"); } tearBlinkActorTbl[(int16)i]->_flags = tearBlinkActorTbl[(int16)i]->_flags | 0x4384; - tearBlinkActorTbl[(int16)i]->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - tearBlinkActorTbl[(int16)i]->priorityLayer = 0; + tearBlinkActorTbl[(int16)i]->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + tearBlinkActorTbl[(int16)i]->_priorityLayer = 0; i = i + 1; } i = 0; @@ -262,18 +262,18 @@ void Minigame3::run() { } tearBlinkActorTbl2[(int16)i]->setFlag(ACTOR_FLAG_100); tearBlinkActorTbl2[(int16)i]->setFlag(ACTOR_FLAG_800); - tearBlinkActorTbl2[(int16)i]->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - tearBlinkActorTbl2[(int16)i]->priorityLayer = 0; + tearBlinkActorTbl2[(int16)i]->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + tearBlinkActorTbl2[(int16)i]->_priorityLayer = 0; i = i + 1; } - tearBlinkActorTbl2[0]->x_pos = 0x56; - tearBlinkActorTbl2[0]->y_pos = 0x8c; - tearBlinkActorTbl2[1]->x_pos = 0xf0; - tearBlinkActorTbl2[1]->y_pos = 0x8c; - tearBlinkActorTbl[0]->x_pos = 0x23; //DAT_80093228_23; - tearBlinkActorTbl[1]->x_pos = 0xbf; //DAT_8009322a_bf; - tearBlinkActorTbl[0]->y_pos = 0xcc; - tearBlinkActorTbl[1]->y_pos = 0xcc; + tearBlinkActorTbl2[0]->_x_pos = 0x56; + tearBlinkActorTbl2[0]->_y_pos = 0x8c; + tearBlinkActorTbl2[1]->_x_pos = 0xf0; + tearBlinkActorTbl2[1]->_y_pos = 0x8c; + tearBlinkActorTbl[0]->_x_pos = 0x23; //DAT_80093228_23; + tearBlinkActorTbl[1]->_x_pos = 0xbf; //DAT_8009322a_bf; + tearBlinkActorTbl[0]->_y_pos = 0xcc; + tearBlinkActorTbl[1]->_y_pos = 0xcc; // EnableVSyncEvent(); i = 0; while ((int16)i < 4) { @@ -285,7 +285,7 @@ void Minigame3::run() { i = 0; while ((int16)i < 4) { bunnyPositionTbl[(int16)i] = i; - bunnyActorTbl[(int16)i]->priorityLayer = 2; + bunnyActorTbl[(int16)i]->_priorityLayer = 2; bunnyActorTbl[(int16)i]->updateSequence(4); i = i + 1; } @@ -346,8 +346,8 @@ void Minigame3::run() { local_1b8 = 0; local_10 = 0; local_e = 0; - tearBlinkActorTbl[0]->priorityLayer = 3; - tearBlinkActorTbl[1]->priorityLayer = 3; + tearBlinkActorTbl[0]->_priorityLayer = 3; + tearBlinkActorTbl[1]->_priorityLayer = 3; tearBlinkActorTbl[0]->updateSequence(0); tearBlinkActorTbl[1]->updateSequence(1); local_1c2 = 0; @@ -359,10 +359,10 @@ void Minigame3::run() { if ((local_56 < 1) || (((int)bunnyInfo[local_20].x >> 9 <= (int)(uint)(uint16)bunnyPositionsTbl[bunnyInfo[local_1e].positionIdx].x || ((int)(uint)(uint16)bunnyPositionsTbl[bunnyInfo[local_20].positionIdx].x <= (int)bunnyInfo[local_1e].x >> 9)))) { - bunnyActorTbl[local_1c]->x_pos = bunnyPositionsTbl[bunnyInfo[local_1e].positionIdx].x; - bunnyActorTbl[local_1a]->x_pos = bunnyPositionsTbl[bunnyInfo[local_20].positionIdx].x; - bunnyActorTbl[local_1c]->y_pos = bunnyPositionsTbl[bunnyInfo[local_1e].positionIdx].y; - bunnyActorTbl[local_1a]->y_pos = bunnyPositionsTbl[bunnyInfo[local_20].positionIdx].y; + bunnyActorTbl[local_1c]->_x_pos = bunnyPositionsTbl[bunnyInfo[local_1e].positionIdx].x; + bunnyActorTbl[local_1a]->_x_pos = bunnyPositionsTbl[bunnyInfo[local_20].positionIdx].x; + bunnyActorTbl[local_1c]->_y_pos = bunnyPositionsTbl[bunnyInfo[local_1e].positionIdx].y; + bunnyActorTbl[local_1a]->_y_pos = bunnyPositionsTbl[bunnyInfo[local_20].positionIdx].y; currentState = 5; } else { @@ -375,14 +375,14 @@ void Minigame3::run() { bunnyInfo[local_20].x = bunnyInfo[local_20].x + UnkStruct_ARRAY_800931a0[local_50].field_0x14 * -0x200; bunnyInfo[local_20].y = bunnyInfo[local_20].y - bunnyInfo[local_20].field_0xc; bunnyInfo[local_20].field_0xc = bunnyInfo[local_20].field_0xc + bunnyInfo[local_20].field_0x10; - bunnyActorTbl[local_1c]->x_pos = (int16_t)((int)bunnyInfo[local_20].x >> 9); - bunnyActorTbl[local_1c]->y_pos = (int16_t)((int)bunnyInfo[local_20].y >> 9); + bunnyActorTbl[local_1c]->_x_pos = (int16_t)((int)bunnyInfo[local_20].x >> 9); + bunnyActorTbl[local_1c]->_y_pos = (int16_t)((int)bunnyInfo[local_20].y >> 9); bunnyInfo[local_1e].x = bunnyInfo[local_1e].x + UnkStruct_ARRAY_800931a0[local_50].field_0x14 * 0x200; bunnyInfo[local_1e].y = bunnyInfo[local_1e].y - bunnyInfo[local_1e].field_0xc; bunnyInfo[local_1e].field_0xc = bunnyInfo[local_1e].field_0xc + bunnyInfo[local_1e].field_0x10; - bunnyActorTbl[local_1a]->x_pos = (int16_t)((int)bunnyInfo[local_1e].x >> 9); - bunnyActorTbl[local_1a]->y_pos = (int16_t)((int)bunnyInfo[local_1e].y >> 9); - if ((local_228 < 4) && unkXPosTbl[local_50 * 4 + local_228] < bunnyActorTbl[local_1a]->x_pos) { + bunnyActorTbl[local_1a]->_x_pos = (int16_t)((int)bunnyInfo[local_1e].x >> 9); + bunnyActorTbl[local_1a]->_y_pos = (int16_t)((int)bunnyInfo[local_1e].y >> 9); + if ((local_228 < 4) && unkXPosTbl[local_50 * 4 + local_228] < bunnyActorTbl[local_1a]->_x_pos) { local_228 = local_228 + 1; bunnyActorTbl[local_1a]->updateSequence((uint)local_228 + 6 & 0xffff); bunnyActorTbl[local_1c]->updateSequence((uint)local_228 + 0xd & 0xffff); @@ -472,12 +472,12 @@ void Minigame3::run() { i = 0; while ((int16)i < 8) { if (local_208[(int16)i] != -1) { - tearActorTbl[(int16)i]->y_pos = tearActorTbl[(int16)i]->y_pos + ((uint16)local_208[(int)(int16)i + 8] >> 6); - if (tearActorTbl[(int16)i]->y_pos < (int16)tearInfo[local_208[(int16)i]].yRelated) { + tearActorTbl[(int16)i]->_y_pos = tearActorTbl[(int16)i]->_y_pos + ((uint16)local_208[(int)(int16)i + 8] >> 6); + if (tearActorTbl[(int16)i]->_y_pos < (int16)tearInfo[local_208[(int16)i]].yRelated) { local_208[(int)(int16)i + 8] = local_208[(int)(int16)i + 8] + 8; } else { - tearActorTbl[(int16)i]->priorityLayer = 0; + tearActorTbl[(int16)i]->_priorityLayer = 0; local_1e8 = local_1e8 & ~(1 << ((int)local_208[(int16)i] & 0x1fU)); local_208[(int16)i] = -1; local_1e0 = local_1e0 - 1; @@ -502,11 +502,11 @@ void Minigame3::run() { local_14 = local_14 + 1; } local_208[local_14] = sVar2; - tearActorTbl[local_14]->x_pos = tearInfo[sVar2].x; - tearActorTbl[local_14]->y_pos = tearInfo[sVar2].y; + tearActorTbl[local_14]->_x_pos = tearInfo[sVar2].x; + tearActorTbl[local_14]->_y_pos = tearInfo[sVar2].y; local_208[(int)local_14 + 8] = 0x20; tearActorTbl[local_14]->updateSequence(0x13); - tearActorTbl[local_14]->priorityLayer = 3; + tearActorTbl[local_14]->_priorityLayer = 3; local_1e0 = local_1e0 + 1; } if ((flags & 1) == 0) { @@ -535,8 +535,8 @@ void Minigame3::run() { local_1c8 = 0; local_1ba = 0; flags = flags & 0xfffb; - tearBlinkActorTbl2[0]->priorityLayer = 0; - tearBlinkActorTbl2[1]->priorityLayer = 0; + tearBlinkActorTbl2[0]->_priorityLayer = 0; + tearBlinkActorTbl2[1]->_priorityLayer = 0; tearBlinkActorTbl2[0]->updateSequence(0); tearBlinkActorTbl2[1]->updateSequence(1); } @@ -551,7 +551,7 @@ void Minigame3::run() { if (local_1c6 == 0) { i = 0; while ((int16)i < 8) { - tearActorTbl[(int16)i]->priorityLayer = 0; + tearActorTbl[(int16)i]->_priorityLayer = 0; local_208[(int16)i] = -1; i = i + 1; } @@ -565,8 +565,8 @@ void Minigame3::run() { local_1c8 = 2; local_1c6 = 3; updateBackgroundLayerOffset(2, 0x780, 0); - tearBlinkActorTbl[0]->y_pos = 0xcc; - tearBlinkActorTbl[1]->y_pos = 0xcc; + tearBlinkActorTbl[0]->_y_pos = 0xcc; + tearBlinkActorTbl[1]->_y_pos = 0xcc; } else { local_1c6 = local_1c6 + -1; @@ -581,8 +581,8 @@ void Minigame3::run() { updateBackgroundLayerOffset(2, 0x780, 0); tearBlinkActorTbl2[0]->updateSequence(0); tearBlinkActorTbl2[1]->updateSequence(1); - tearBlinkActorTbl2[0]->priorityLayer = 4; - tearBlinkActorTbl2[1]->priorityLayer = 4; + tearBlinkActorTbl2[0]->_priorityLayer = 4; + tearBlinkActorTbl2[1]->_priorityLayer = 4; } else { if (local_1c8 == 2) { @@ -618,9 +618,9 @@ void Minigame3::run() { local_1b8 = local_1b8 + 1; FUN_80017f70_paletteRelated((uint)local_1b8); } - if (100 < tearBlinkActorTbl[0]->y_pos) { - tearBlinkActorTbl[0]->y_pos = tearBlinkActorTbl[0]->y_pos + -3; - tearBlinkActorTbl[1]->y_pos = tearBlinkActorTbl[1]->y_pos + -3; + if (100 < tearBlinkActorTbl[0]->_y_pos) { + tearBlinkActorTbl[0]->_y_pos = tearBlinkActorTbl[0]->_y_pos + -3; + tearBlinkActorTbl[1]->_y_pos = tearBlinkActorTbl[1]->_y_pos + -3; } } if (hopCounter == 0x1e) { @@ -680,13 +680,13 @@ void Minigame3::run() { local_1b8 = 0; } FUN_80017f70_paletteRelated((uint)local_1b8); - tearBlinkActorTbl[0]->y_pos = tearBlinkActorTbl[0]->y_pos + 0x1e; - if (199 < tearBlinkActorTbl[0]->y_pos) { - tearBlinkActorTbl[0]->y_pos = 199; + tearBlinkActorTbl[0]->_y_pos = tearBlinkActorTbl[0]->_y_pos + 0x1e; + if (199 < tearBlinkActorTbl[0]->_y_pos) { + tearBlinkActorTbl[0]->_y_pos = 199; } - tearBlinkActorTbl[1]->y_pos = tearBlinkActorTbl[1]->y_pos + 0x1e; - if (199 < tearBlinkActorTbl[1]->y_pos) { - tearBlinkActorTbl[1]->y_pos = 199; + tearBlinkActorTbl[1]->_y_pos = tearBlinkActorTbl[1]->_y_pos + 0x1e; + if (199 < tearBlinkActorTbl[1]->_y_pos) { + tearBlinkActorTbl[1]->_y_pos = 199; } _vm->waitForFrames(0xf); local_16 = 1; @@ -704,9 +704,9 @@ void Minigame3::run() { updateBackgroundLayerOffset(0, 0, 0); local_224 = _vm->getRand(2); handActorId->updateSequence(0); - handActorId->x_pos = handPositionsTbl[local_224].x; - handActorId->y_pos = handPositionsTbl[local_224].y; - handActorId->priorityLayer = 2; + handActorId->_x_pos = handPositionsTbl[local_224].x; + handActorId->_y_pos = handPositionsTbl[local_224].y; + handActorId->_priorityLayer = 2; bVar1 = false; _vm->_talk->loadAndDisplayDialogAroundPoint(0x2958A,0x14,3,0x1e01,0); while (_vm->isFlagSet(ENGINE_FLAG_8000)) { diff --git a/engines/dragons/minigame4.cpp b/engines/dragons/minigame4.cpp index 1fb30cfd6b6..2b620ec7c2f 100644 --- a/engines/dragons/minigame4.cpp +++ b/engines/dragons/minigame4.cpp @@ -74,11 +74,11 @@ void Minigame4::run() { flickerActor->setFlag(ACTOR_FLAG_80); flickerActor->setFlag(ACTOR_FLAG_100); flickerActor->setFlag(ACTOR_FLAG_200); - flickerActor->priorityLayer = 3; + flickerActor->_priorityLayer = 3; bruteActor->setFlag(ACTOR_FLAG_80); bruteActor->setFlag(ACTOR_FLAG_100); bruteActor->setFlag(ACTOR_FLAG_200); - bruteActor->priorityLayer = 3; + bruteActor->_priorityLayer = 3; //DAT_800830e0_soundRelated = 0xf; //UnkSoundFunc5(0xf); //call_fade_related_1f(); @@ -231,8 +231,8 @@ const static uint16 uint16_t_ARRAY_80090400[6] = { 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, const static uint16 uint16_t_ARRAY_800903e8[6] = { 1, 2, 3, 4, 5, 6 }; uint16 Minigame4::singleDanceRound(uint16 currentDancePosition, uint16 duration) { - DAT_80090438->x_pos = xDancePosTbl[(uint)currentDancePosition]; - DAT_80090438->y_pos = yDancePosTbl[(uint)currentDancePosition]; + DAT_80090438->_x_pos = xDancePosTbl[(uint)currentDancePosition]; + DAT_80090438->_y_pos = yDancePosTbl[(uint)currentDancePosition]; DAT_80090438->updateSequence(10); ps1ControllerActor->updateSequence(uint16_t_ARRAY_80090400[(uint)currentDancePosition]); bruteActor->updateSequence(uint16_t_ARRAY_800903e8[(uint)currentDancePosition]); @@ -245,10 +245,10 @@ uint16 Minigame4::singleDanceRound(uint16 currentDancePosition, uint16 duration) while (duration = duration + -1, duration != 0) { _vm->waitForFrames(1); } - DAT_80090438->x_pos = xDancePosTbl[(uint)currentDancePosition]; - DAT_8009043c->x_pos = DAT_80090438->x_pos; - DAT_80090438->y_pos = yDancePosTbl[(uint)currentDancePosition]; - DAT_8009043c->y_pos = DAT_80090438->y_pos; + DAT_80090438->_x_pos = xDancePosTbl[(uint)currentDancePosition]; + DAT_8009043c->_x_pos = DAT_80090438->_x_pos; + DAT_80090438->_y_pos = yDancePosTbl[(uint)currentDancePosition]; + DAT_8009043c->_y_pos = DAT_80090438->_y_pos; DAT_8009043c->updateSequence(0xb); ps1ControllerActor->updateSequence(0x16); return 0; diff --git a/engines/dragons/minigame5.cpp b/engines/dragons/minigame5.cpp index 242f6c03696..dc3dfec9f52 100644 --- a/engines/dragons/minigame5.cpp +++ b/engines/dragons/minigame5.cpp @@ -99,7 +99,7 @@ void Minigame5::run() { local_76 = _vm->_scene->getSceneId(); local_78 = _vm->_dragonINIResource->getFlickerRecord(); local_78->actor->setFlag(ACTOR_FLAG_100); - local_78->actor->priorityLayer = 0; + local_78->actor->_priorityLayer = 0; savedEngineFlags = _vm->getMultipleFlags(ENGINE_FLAG_8 | ENGINE_FLAG_10 | ENGINE_FLAG_20 | ENGINE_FLAG_80); _vm->clearFlags(ENGINE_FLAG_8); _vm->clearFlags(ENGINE_FLAG_10); @@ -108,14 +108,14 @@ void Minigame5::run() { _vm->_dragonINIResource->setFlickerRecord(_vm->_dragonINIResource->getRecord(DAT_80063a40 - 1)); flickerActor = _vm->_dragonINIResource->getFlickerRecord()->actor; flickerActor->_flags = flickerActor->_flags | 0x380; - flickerActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - flickerActor->priorityLayer = 4; + flickerActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + flickerActor->_priorityLayer = 4; flickerActor->_sequenceID2 = -1; flickerActor->updateSequence(0x19); currentState = 0; local_10 = 0; - local_850 = flickerActor->x_pos; - uVar1 = flickerActor->y_pos; + local_850 = flickerActor->_x_pos; + uVar1 = flickerActor->_y_pos; local_74 = 0; // DisableVSyncEvent(); pusherActor = _vm->_actorManager->loadActor @@ -125,10 +125,10 @@ void Minigame5::run() { error("Couldn't alloc pusher!"); } pusherActor->_flags = pusherActor->_flags | 0x380; - pusherActor->x_pos = flickerActor->x_pos + -0xe; - pusherActor->y_pos = flickerActor->y_pos + 7; - pusherActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - pusherActor->priorityLayer = 6; + pusherActor->_x_pos = flickerActor->_x_pos + -0xe; + pusherActor->_y_pos = flickerActor->_y_pos + 7; + pusherActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + pusherActor->_priorityLayer = 6; // DisableVSyncEvent(); wheelsActor = _vm->_actorManager->loadActor(7,0x11,0,0); // EnableVSyncEvent(); @@ -136,10 +136,10 @@ void Minigame5::run() { error("Couldn't alloc wheels!"); } wheelsActor->_flags = wheelsActor->_flags | 0x380; - wheelsActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - wheelsActor->x_pos = flickerActor->x_pos; - wheelsActor->y_pos = flickerActor->y_pos; - wheelsActor->priorityLayer = 5; + wheelsActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + wheelsActor->_x_pos = flickerActor->_x_pos; + wheelsActor->_y_pos = flickerActor->_y_pos; + wheelsActor->_priorityLayer = 5; wheelsActor->updateSequence(0x11); local_62 = 0; // DisableVSyncEvent(); @@ -149,8 +149,8 @@ void Minigame5::run() { error("Couldn't alloc bomb!"); } bombActor->_flags = bombActor->_flags | 0x380; - bombActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - bombActor->priorityLayer = 0; + bombActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + bombActor->_priorityLayer = 0; // DisableVSyncEvent(); dustActor = _vm->_actorManager->loadActor(8,8,100,100,0); // EnableVSyncEvent(); @@ -158,10 +158,10 @@ void Minigame5::run() { error("Couldn't alloc dust sprite!"); } dustActor->_flags = dustActor->_flags | 0x380; - dustActor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + dustActor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; local_4e = _vm->_dragonINIResource->getRecord(DAT_80063a48 + -1)->actor; local_4c = 0; - local_4a = local_4e->field_c; + local_4a = local_4e->_field_c; _vm->setFlags(ENGINE_FLAG_4000000); currentState = 1; local_66 = 0; @@ -207,8 +207,8 @@ void Minigame5::run() { local_74 = 0; } else { - pusherActor->x_pos = flickerActor->x_pos + -0xe; - pusherActor->y_pos = flickerActor->y_pos + 7; + pusherActor->_x_pos = flickerActor->_x_pos + -0xe; + pusherActor->_y_pos = flickerActor->_y_pos + 7; if (local_74 < 0x168) { local_74 = local_74 + 1; if (local_74 < 0x14) { @@ -275,14 +275,14 @@ void Minigame5::run() { (short)((int)((uint)local_850 << 7) / 0x2a); } local_60 = local_850 << 7; - bombActor->x_pos = local_850 & 0x1ff; + bombActor->_x_pos = local_850 & 0x1ff; local_5e = 0x2d00; local_5a = (local_72 + 3) * 0x80; - bombActor->y_pos = 0x5a; + bombActor->_y_pos = 0x5a; bombScale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - bombActor->scale = bombScale; + bombActor->_scale = bombScale; _vm->playOrStopSound(10); - bombActor->priorityLayer = 3; + bombActor->_priorityLayer = 3; flickerActor->updateSequence(8); currentState = 3; } @@ -310,10 +310,10 @@ void Minigame5::run() { local_5a = 0; } } - bombActor->x_pos = local_60 >> 7; - bombActor->y_pos = local_5e >> 7; + bombActor->_x_pos = local_60 >> 7; + bombActor->_y_pos = local_5e >> 7; bombScale = bombScale - 3; - bombActor->scale = bombScale; + bombActor->_scale = bombScale; if (bombScale == 0x7f) { if (((local_60 >> 7 < local_30[0]) || (local_30[1] < local_60 >> 7)) || (local_72 != local_30[2])) { @@ -331,26 +331,26 @@ void Minigame5::run() { ((local_72 == 3 && (((0x3c < local_60 >> 7 && (local_60 >> 7 < 0x46)) || ((0x101 < local_60 >> 7 && (local_60 >> 7 < 0x10a)))))))) { - bombActor->priorityLayer = 0; - dustActor->priorityLayer = 4; - dustActor->x_pos = bombActor->x_pos; - dustActor->y_pos = bombActor->y_pos; + bombActor->_priorityLayer = 0; + dustActor->_priorityLayer = 4; + dustActor->_x_pos = bombActor->_x_pos; + dustActor->_y_pos = bombActor->_y_pos; dustActor->updateSequence(9); currentState = 4; } } else { - local_4e->field_c = 2; + local_4e->_field_c = 2; local_4c = 0x3c; - bombActor->priorityLayer = 0; + bombActor->_priorityLayer = 0; currentState = 8; } } if (bombScale < 0x7f) { - bombActor->priorityLayer = 2; + bombActor->_priorityLayer = 2; } if ((0xc < bombScale) && (bombScale < 0x41)) { - bombActor->priorityLayer = 0; + bombActor->_priorityLayer = 0; } if ((short)bombScale < 2) { currentState = 5; @@ -382,7 +382,7 @@ void Minigame5::run() { case 7: break; case 8: - bombActor->priorityLayer = 0; + bombActor->_priorityLayer = 0; pusherActor->updateSequence(0); _vm->_dragonINIResource->getRecord(DAT_80063bd0 + -1)->actor->updateSequence(2); _vm->waitForFrames(0x12); @@ -402,7 +402,7 @@ void Minigame5::run() { default: debug("undefined state!"); currentState = 1; - bombActor->priorityLayer = 0; + bombActor->_priorityLayer = 0; break; } if ((local_10 == 0) && (currentState != 2)) { @@ -413,12 +413,12 @@ void Minigame5::run() { && (pusherActor->_sequenceID != 6)))) { pusherActor->updateSequence((uint)local_66); if (local_50 == 0) { - pusherActor->x_pos = flickerActor->x_pos + -0xe; - pusherActor->y_pos = flickerActor->y_pos + 7; + pusherActor->_x_pos = flickerActor->_x_pos + -0xe; + pusherActor->_y_pos = flickerActor->_y_pos + 7; } else { - pusherActor->x_pos = flickerActor->x_pos + 2; - pusherActor->y_pos = flickerActor->y_pos; + pusherActor->_x_pos = flickerActor->_x_pos + 2; + pusherActor->_y_pos = flickerActor->_y_pos; } } } @@ -443,13 +443,13 @@ void Minigame5::run() { else { local_62 = local_62 - 1; } - flickerActor->x_pos = local_850; - wheelsActor->x_pos = local_850; + flickerActor->_x_pos = local_850; + wheelsActor->_x_pos = local_850; if ((uint)wheelsActor->_sequenceID != (uint)local_62 / 3 + 0x11) { wheelsActor->updateSequence((uint)local_62 / 3 + 0x11); } - pusherActor->x_pos = flickerActor->x_pos + 2; - pusherActor->y_pos = flickerActor->y_pos; + pusherActor->_x_pos = flickerActor->_x_pos + 2; + pusherActor->_y_pos = flickerActor->_y_pos; } } else { @@ -469,24 +469,24 @@ void Minigame5::run() { } local_62 = (short)((uint)local_62 + 1) + (short)((int)((uint)local_62 + 1) / 6 >> 1) * -0xc; - flickerActor->x_pos = local_850; - wheelsActor->x_pos = local_850; + flickerActor->_x_pos = local_850; + wheelsActor->_x_pos = local_850; if ((uint)wheelsActor->_sequenceID != (uint)local_62 / 3 + 0x11) { wheelsActor->updateSequence((uint)local_62 / 3 + 0x11); } - pusherActor->x_pos = flickerActor->x_pos + -2; - pusherActor->y_pos = flickerActor->y_pos; + pusherActor->_x_pos = flickerActor->_x_pos + -2; + pusherActor->_y_pos = flickerActor->_y_pos; } } } while (local_10 == 0); - if ((local_10 == 2) || (0x117 < flickerActor->x_pos)) break; - flickerActor->x_pos = flickerActor->x_pos + 2; + if ((local_10 == 2) || (0x117 < flickerActor->_x_pos)) break; + flickerActor->_x_pos = flickerActor->_x_pos + 2; if (pusherActor->_sequenceID != 2) { pusherActor->updateSequence(2); } - pusherActor->x_pos = flickerActor->x_pos + 2; - pusherActor->y_pos = flickerActor->y_pos; - wheelsActor->x_pos = wheelsActor->x_pos + 2; + pusherActor->_x_pos = flickerActor->_x_pos + 2; + pusherActor->_y_pos = flickerActor->_y_pos; + wheelsActor->_x_pos = wheelsActor->_x_pos + 2; if (local_62 == 0) { local_62 = 0xb; } @@ -512,8 +512,8 @@ void Minigame5::run() { local_44 = 0; if (local_10 == 2) { // DisableVSyncEvent(); - local_46 = pusherActor->x_pos; - local_44 = pusherActor->y_pos; + local_46 = pusherActor->_x_pos; + local_44 = pusherActor->_y_pos; pusherActor->reset_maybe(); // EnableVSyncEvent(); } @@ -527,13 +527,13 @@ void Minigame5::run() { } _vm->_dragonINIResource->setFlickerRecord(local_78); if (local_10 == 2) { - local_78->actor->x_pos = local_46; + local_78->actor->_x_pos = local_46; local_78->actor->setFlag(ACTOR_FLAG_100); - local_78->actor->priorityLayer = 5; + local_78->actor->_priorityLayer = 5; } else { local_78->actor->clearFlag(ACTOR_FLAG_100); - local_78->actor->priorityLayer = 2; + local_78->actor->_priorityLayer = 2; } _vm->clearFlags(ENGINE_FLAG_4000000); _vm->setFlags(savedEngineFlags); diff --git a/engines/dragons/scene.cpp b/engines/dragons/scene.cpp index ea8d6296a3e..563386088b8 100644 --- a/engines/dragons/scene.cpp +++ b/engines/dragons/scene.cpp @@ -228,12 +228,12 @@ void Scene::loadSceneData(uint32 sceneId, uint32 cameraPointId) { if (actor) { ini->actor = actor; if (ini->field_1a_flags_maybe & 0x1000) { - actor->frame_flags |= 0x10; + actor->_frame_flags |= 0x10; } else { if (ini->field_1a_flags_maybe & 0x2000) { - actor->frame_flags |= 0x20; + actor->_frame_flags |= 0x20; } else { - actor->frame_flags &= ~0x10; + actor->_frame_flags &= ~0x10; } } @@ -264,8 +264,8 @@ void Scene::loadSceneData(uint32 sceneId, uint32 cameraPointId) { } // // Graphics::Surface *s = actor->getCurrentFrame(); -// int x = ini->x - actor->frame_vram_x; -// int y = ini->y - actor->frame_vram_y; +// int x = ini->x - actor->_frame_vram_x; +// int y = ini->y - actor->_frame_vram_y; // if (x >= 0 && y >= 0 && x + s->w < 320 && y + s->h < 200) { // debug("Actor %d, %d %d (%d, %d)", actor->_actorID, ini->actorResourceId, ini->field_1a_flags_maybe, ini->x, ini->y); // _stage->getFgLayer()->copyRectToSurface(*s, x, y, Common::Rect(s->w, s->h)); @@ -285,7 +285,7 @@ void Scene::loadSceneData(uint32 sceneId, uint32 cameraPointId) { DragonINI *ini = _vm->getINI(1); if (ini->actor && _vm->_dragonINIResource->getFlickerRecord() && _vm->_dragonINIResource->getFlickerRecord()->sceneId == _currentSceneId) { ini->actor->setFlag(Dragons::ACTOR_FLAG_100); - ini->actor->priorityLayer = 0; + ini->actor->_priorityLayer = 0; } @@ -358,29 +358,29 @@ void Scene::draw() { for (int16 i = 0; i < DRAGONS_ENGINE_NUM_ACTORS; i++) { Actor *actor = _actorManager->getActorByDisplayOrder(i); - if (actor->x_pos == -100 && actor->y_pos == 100) { - actor->priorityLayer = 0; + if (actor->_x_pos == -100 && actor->_y_pos == 100) { + actor->_priorityLayer = 0; continue; } if (actor->_flags & Dragons::ACTOR_FLAG_40 && !(actor->_flags & Dragons::ACTOR_FLAG_400) && - actor->surface && - actor->frame->width != 0 && - actor->frame->height != 0 + actor->_surface && + actor->_frame->width != 0 && + actor->_frame->height != 0 ) { - Graphics::Surface *s = actor->surface; - if (actor->priorityLayer == priority) { //} && x + s->w < 320 && y + s->h < 200) { + Graphics::Surface *s = actor->_surface; + if (actor->_priorityLayer == priority) { //} && x + s->w < 320 && y + s->h < 200) { if (!actor->isFlagSet(ACTOR_FLAG_80)) { - actor->scale = _stage->getScaleLayer()->getScale(actor->y_pos); + actor->_scale = _stage->getScaleLayer()->getScale(actor->_y_pos); } - int x = actor->x_pos - (actor->frame->xOffset * actor->scale / DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE) - (actor->isFlagSet(ACTOR_FLAG_200) ? 0 : _camera.x); - int y = actor->y_pos - (actor->frame->yOffset * actor->scale / DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE) - (actor->isFlagSet(ACTOR_FLAG_200) ? 0 : _camera.y); + int x = actor->_x_pos - (actor->_frame->xOffset * actor->_scale / DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE) - (actor->isFlagSet(ACTOR_FLAG_200) ? 0 : _camera.x); + int y = actor->_y_pos - (actor->_frame->yOffset * actor->_scale / DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE) - (actor->isFlagSet(ACTOR_FLAG_200) ? 0 : _camera.y); debug(4, "Actor %d %s (%d, %d) w:%d h:%d Priority: %d Scale: %d", actor->_actorID, actor->_actorResource->getFilename(), x, y, - s->w, s->h, actor->priorityLayer, actor->scale); - _screen->copyRectToSurface8bpp(*s, actor->getPalette(), x, y, Common::Rect(s->w, s->h), (bool)(actor->frame->flags & Dragons::FRAME_FLAG_FLIP_X), actor->isFlagSet(ACTOR_FLAG_8000) ? NONE : NORMAL, actor->scale); + s->w, s->h, actor->_priorityLayer, actor->_scale); + _screen->copyRectToSurface8bpp(*s, actor->getPalette(), x, y, Common::Rect(s->w, s->h), (bool)(actor->_frame->flags & Dragons::FRAME_FLAG_FLIP_X), actor->isFlagSet(ACTOR_FLAG_8000) ? NONE : NORMAL, actor->_scale); if (_vm->isDebugMode()) { _screen->drawRect(0x7fff, Common::Rect(x, y, x + s->w, y + s->h), actor->_actorID); drawActorNumber(x + s->w, y + 8, actor->_actorID); @@ -455,8 +455,8 @@ void Scene::setSceneId(int16 newSceneId) { void Scene::resetActorFrameFlags() { for (int i = 0; i < 0x17; i++) { Actor *actor = _vm->_actorManager->getActor(i); - actor->frame_flags &= ~ACTOR_FRAME_FLAG_10; - actor->frame_flags &= ~ACTOR_FRAME_FLAG_20; + actor->_frame_flags &= ~ACTOR_FRAME_FLAG_10; + actor->_frame_flags &= ~ACTOR_FRAME_FLAG_20; } } diff --git a/engines/dragons/scriptopcodes.cpp b/engines/dragons/scriptopcodes.cpp index cbc769abde3..a7dcee50a1d 100644 --- a/engines/dragons/scriptopcodes.cpp +++ b/engines/dragons/scriptopcodes.cpp @@ -636,9 +636,9 @@ void ScriptOpcodes::opUnkE(ScriptOpCall &scriptOpCall) { } else { ini->x = point.x; - ini->actor->x_pos = point.x; + ini->actor->_x_pos = point.x; ini->y = point.y; - ini->actor->y_pos = point.y; + ini->actor->_y_pos = point.y; if (field4 != field6) { ini->actor->_walkSpeed = field4; @@ -690,9 +690,9 @@ void ScriptOpcodes::opUnkF(ScriptOpCall &scriptOpCall) { } else { assert(ini->actor); ini->x = field8; - ini->actor->x_pos = field8; + ini->actor->_x_pos = field8; ini->y = fieldA; - ini->actor->y_pos = fieldA; + ini->actor->_y_pos = fieldA; if (field4 != field6) { ini->actor->_walkSpeed = field4; @@ -730,19 +730,19 @@ void ScriptOpcodes::opUnk10(ScriptOpCall &scriptOpCall) { IMG *firstDragonImg1 = _vm->_dragonIMG->getIMG(firstIni->field_2); int16 newXPos1 = firstDragonImg1->field_a + firstIni->field_1c; secondIni->x = newXPos1; - secondIni->actor->x_pos = newXPos1; + secondIni->actor->_x_pos = newXPos1; int16 newYPos1 = firstDragonImg1->field_c + firstIni->field_1e; secondIni->y = newYPos1; - secondIni->actor->y_pos = newYPos1; + secondIni->actor->_y_pos = newYPos1; } } else { - int16 newYPos2 = firstIni->actor->y_pos + firstIni->field_1e; + int16 newYPos2 = firstIni->actor->_y_pos + firstIni->field_1e; firstIni->y = newYPos2; - secondIni->actor->y_pos = newYPos2; - someXParam = firstIni->actor->x_pos + firstIni->field_1c; + secondIni->actor->_y_pos = newYPos2; + someXParam = firstIni->actor->_x_pos + firstIni->field_1c; secondIni->x = someXParam; - secondIni->actor->x_pos = someXParam; + secondIni->actor->_x_pos = someXParam; } if (field6 != -1) { secondIni->actor->_walkSpeed = -1; @@ -782,8 +782,8 @@ void ScriptOpcodes::opUnk10(ScriptOpCall &scriptOpCall) { } } else { - newXPosAgain = firstIni->actor->x_pos + firstIni->field_1c; - newYPosAgain = firstIni->actor->y_pos + firstIni->field_1e; + newXPosAgain = firstIni->actor->_x_pos + firstIni->field_1c; + newYPosAgain = firstIni->actor->_y_pos + firstIni->field_1e; if (_vm->_dragonINIResource->isFlicker(secondIni)) { someBooleanFlag = 0; } @@ -881,8 +881,8 @@ void ScriptOpcodes::opCodeActorTalk(ScriptOpCall &scriptOpCall) { } else { _vm->_talk->FUN_8003239c(dialog, - (int)(((uint)ini->actor->x_pos - (uint)_vm->_scene->_camera.x) * 0x10000) >> 0x13, - (int)(((ini->actor->y_pos - ini->actor->frame->yOffset) - (uint)_vm->_scene->_camera.y) * 0x10000) >> 0x13, + (int)(((uint)ini->actor->_x_pos - (uint)_vm->_scene->_camera.x) * 0x10000) >> 0x13, + (int)(((ini->actor->_y_pos - ini->actor->_frame->yOffset) - (uint)_vm->_scene->_camera.y) * 0x10000) >> 0x13, READ_LE_INT16(_vm->_dragonOBD->getFromOpt(iniId) + 6), 1, ini->actor, startSequenceId, endSequenceId, textIndex); @@ -940,7 +940,7 @@ void ScriptOpcodes::opCode_UnkA_setsProperty(ScriptOpCall &scriptOpCall) { if (field2 == 0x1a && ini->field_1a_flags_maybe & 1 && ini->sceneId == _vm->getCurrentSceneId()) { if (s1 & 2) { ini->actor->_flags |= Dragons::ACTOR_FLAG_80; - ini->actor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + ini->actor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; } else { ini->actor->_flags &= ~Dragons::ACTOR_FLAG_80; } @@ -1238,19 +1238,19 @@ void ScriptOpcodes::opCode_Unk7(ScriptOpCall &scriptOpCall) { if (_vm->_inventory->getType() == 1) { Actor *actor = _vm->_inventory->getInventoryItemActor(_vm->_cursor->iniItemInHand); actor->_flags = 0; - actor->priorityLayer = 0; - actor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + actor->_priorityLayer = 0; + actor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; actor->updateSequence((_vm->getINI(_vm->_cursor->iniItemInHand - 1)->field_8 * 2 + 10) & 0xfffe); actor->setFlag(ACTOR_FLAG_40); actor->setFlag(ACTOR_FLAG_80); actor->setFlag(ACTOR_FLAG_100); actor->setFlag(ACTOR_FLAG_200); - actor->priorityLayer = 6; + actor->_priorityLayer = 6; } } DragonINI *flicker = _vm->_dragonINIResource->getFlickerRecord(); - _vm->_cursor->updatePosition(flicker->actor->x_pos - _vm->_scene->_camera.x, - flicker->actor->y_pos - (_vm->_scene->_camera.y + 0x1e)); + _vm->_cursor->updatePosition(flicker->actor->_x_pos - _vm->_scene->_camera.x, + flicker->actor->_y_pos - (_vm->_scene->_camera.y + 0x1e)); _vm->_cursor->data_800728b0_cursor_seqID = 5; _vm->_cursor->_sequenceID = 5; _vm->_cursor->data_8007283c = _vm->getINI(field2 - 1)->field_8 * 2 + 10; diff --git a/engines/dragons/sequenceopcodes.cpp b/engines/dragons/sequenceopcodes.cpp index 5e5ffc77a7a..28475ecbe05 100644 --- a/engines/dragons/sequenceopcodes.cpp +++ b/engines/dragons/sequenceopcodes.cpp @@ -118,7 +118,7 @@ void SequenceOpcodes::opSetFramePointer(Actor *actor, OpCall &opCall) { debug(4, "set frame pointer %X", framePointer); actor->loadFrame((uint16)framePointer); actor->_flags |= Dragons::ACTOR_FLAG_2; - actor->sequenceTimer = actor->field_c; + actor->_sequenceTimer = actor->_field_c; updateReturn(opCall, 1); } @@ -141,15 +141,15 @@ void SequenceOpcodes::opJmp(Actor *actor, OpCall &opCall) { void SequenceOpcodes::opSetFieldC(Actor *actor, OpCall &opCall) { ARG_INT16(newFieldC); - actor->field_c = (uint16)newFieldC; + actor->_field_c = (uint16)newFieldC; debug(5, "set fieldC: %d", newFieldC); updateReturn(opCall, 1); } void SequenceOpcodes::opSetSequenceTimer(Actor *actor, OpCall &opCall) { ARG_INT16(newSeqTimer); - actor->sequenceTimer = (uint16)newSeqTimer; - debug(5, "set sequenceTimer: %d", newSeqTimer); + actor->_sequenceTimer = (uint16)newSeqTimer; + debug(5, "set _sequenceTimer: %d", newSeqTimer); updateReturn(opCall, 1); opCall._result = 0; } @@ -157,11 +157,11 @@ void SequenceOpcodes::opSetSequenceTimer(Actor *actor, OpCall &opCall) { void SequenceOpcodes::opUpdateXYResetSeqTimer(Actor *actor, OpCall &opCall) { ARG_INT8(xOffset); ARG_INT8(yOffset); - actor->x_pos += xOffset; - actor->y_pos += yOffset; - actor->sequenceTimer = actor->field_c; + actor->_x_pos += xOffset; + actor->_y_pos += yOffset; + actor->_sequenceTimer = actor->_field_c; - debug(5, "update actor %d XY offset (%d,%d) new values (%d, %d) %d", actor->_actorID, xOffset, yOffset, actor->x_pos, actor->y_pos, actor->sequenceTimer); + debug(5, "update actor %d XY offset (%d,%d) new values (%d, %d) %d", actor->_actorID, xOffset, yOffset, actor->_x_pos, actor->_y_pos, actor->_sequenceTimer); updateReturn(opCall, 1); } @@ -195,7 +195,7 @@ void SequenceOpcodes::opChangeSequence(Actor *actor, OpCall &opCall) { void SequenceOpcodes::opSetField7a(Actor *actor, OpCall &opCall) { ARG_INT16(newValue); - actor->field_7a = (uint16)newValue; + actor->_field_7a = (uint16)newValue; updateReturn(opCall, 1); } @@ -217,8 +217,8 @@ void SequenceOpcodes::opPlaySound(Actor *actor, OpCall &opCall) { void SequenceOpcodes::opSetXY(Actor *actor, OpCall &opCall) { ARG_INT16(x); ARG_INT16(y); - actor->x_pos = x; - actor->y_pos = y; + actor->_x_pos = x; + actor->_y_pos = y; updateReturn(opCall, 2); } diff --git a/engines/dragons/specialopcodes.cpp b/engines/dragons/specialopcodes.cpp index 074c295ba18..ac3ab0f7c6f 100644 --- a/engines/dragons/specialopcodes.cpp +++ b/engines/dragons/specialopcodes.cpp @@ -303,7 +303,7 @@ void SpecialOpcodes::spcUnk9() { flicker->field_1a_flags_maybe |= Dragons::INI_FLAG_20; assert(flicker->actor); flicker->actor->_flags |= Dragons::ACTOR_FLAG_100; - flicker->actor->priorityLayer = 0; + flicker->actor->_priorityLayer = 0; _vm->getINI(1)->field_1a_flags_maybe |= Dragons::INI_FLAG_20; } @@ -461,14 +461,14 @@ void SpecialOpcodes::spcWalkOnStilts() { flickerOnStilts->_walkSlopeY = flickerOnStilts->_walkSlopeY / 3; while (flickerOnStilts->isFlagSet(ACTOR_FLAG_10)) { - if (flickerOnStilts->frame->field_c == 0) { + if (flickerOnStilts->_frame->field_c == 0) { isInWater = false; } else { - if (!isInWater && flickerOnStilts->y_pos >= 0x6a && flickerOnStilts->y_pos < 0x96) { + if (!isInWater && flickerOnStilts->_y_pos >= 0x6a && flickerOnStilts->_y_pos < 0x96) { isInWater = true; - waterRipples->x_pos = flickerOnStilts->x_pos - flickerOnStilts->frame->field_e; - waterRipples->y_pos = flickerOnStilts->y_pos - flickerOnStilts->frame->field_10; + waterRipples->_x_pos = flickerOnStilts->_x_pos - flickerOnStilts->_frame->field_e; + waterRipples->_y_pos = flickerOnStilts->_y_pos - flickerOnStilts->_frame->field_10; waterRipples->updateSequence(9); } } @@ -506,12 +506,12 @@ void SpecialOpcodes::spcStGeorgeDragonLanded() { // DisableVSyncEvent(); DragonINI *ini121 = _vm->_dragonINIResource->getRecord(0x121); Actor *origActor = ini121->actor; - ini121->actor = _vm->_actorManager->loadActor(0x48, 4, ini121->actor->x_pos, ini121->actor->y_pos); + ini121->actor = _vm->_actorManager->loadActor(0x48, 4, ini121->actor->_x_pos, ini121->actor->_y_pos); origActor->reset_maybe(); //TODO reset_actor_maybe(); ini121->actor->setFlag(ACTOR_FLAG_80); - ini121->actor->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; - ini121->actor->priorityLayer = 2; + ini121->actor->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + ini121->actor->_priorityLayer = 2; ini121->actorResourceId = 0x48; _vm->updateActorSequences(); @@ -535,7 +535,7 @@ void SpecialOpcodes::spcClearEngineFlag0x200000() { } void SpecialOpcodes::spcFlickerSetPriority2() { - _vm->_dragonINIResource->getFlickerRecord()->actor->priorityLayer = 2; + _vm->_dragonINIResource->getFlickerRecord()->actor->_priorityLayer = 2; } void SpecialOpcodes::spcMenInMinesSceneLogic() { @@ -625,7 +625,7 @@ void SpecialOpcodes::spcCastleGateMoatDrainedSceneLogic() { void SpecialOpcodes::spcUnk34() { Actor *flicker = _vm->_dragonINIResource->getFlickerRecord()->actor; flicker->setFlag(ACTOR_FLAG_80); - flicker->scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; + flicker->_scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE; } void SpecialOpcodes::spcFlickerClearFlag0x80() { @@ -1037,7 +1037,7 @@ void SpecialOpcodes::spcLoadFileS10a7act() { void SpecialOpcodes::spcFlickerPutOnStGeorgeArmor() { Actor *actor = _vm->_dragonINIResource->getRecord(0x21f)->actor; actor->setFlag(ACTOR_FLAG_100); - actor->priorityLayer = 1; + actor->_priorityLayer = 1; } void SpecialOpcodes::spc82CallResetDataMaybe() { @@ -1234,14 +1234,14 @@ void SpecialOpcodes::pizzaMakerStopWorking() { if (actorf4->_sequenceID == 1) { actorf4->waitUntilFlag8And4AreSet(); actorf4->updateSequence(2); - actorf5->x_pos = 0x115; - actorf5->y_pos = 0x5c; + actorf5->_x_pos = 0x115; + actorf5->_y_pos = 0x5c; actorf5->updateSequence(7); _vm->waitForFrames(0x78); actorf5->updateSequence(8); actorf5->waitUntilFlag8And4AreSet(); - actorf5->x_pos = 0xff9c; - actorf5->y_pos = 100; + actorf5->_x_pos = 0xff9c; + actorf5->_y_pos = 100; actorf4->updateSequence(3); } else { @@ -1249,8 +1249,8 @@ void SpecialOpcodes::pizzaMakerStopWorking() { _vm->waitForFrames(0x78); actorf5->updateSequence(8); actorf5->waitUntilFlag8And4AreSet(); - actorf5->x_pos = 0xff9c; - actorf5->y_pos = 100; + actorf5->_x_pos = 0xff9c; + actorf5->_y_pos = 100; actorf4->updateSequence(3); } else { @@ -1294,7 +1294,7 @@ void SpecialOpcodes::setupTableBasedSceneUpdateFunction(uint16 initialCounter, u void SpecialOpcodes::spcUnk80FlickerArmorOn() { Actor *actor = _vm->_dragonINIResource->getRecord(0x21f)->actor; - actor->priorityLayer = 2; + actor->_priorityLayer = 2; actor->clearFlag(ACTOR_FLAG_100); } @@ -1325,8 +1325,8 @@ void pizzaUpdateFunction() { } else { if (actorf4->_sequenceID == 1) { actorf4->updateSequence(2); - actorf5->x_pos = 0x115; - actorf5->y_pos = 0x5c; + actorf5->_x_pos = 0x115; + actorf5->_y_pos = 0x5c; actorf5->updateSequence(7); counter = 0x2d; return; @@ -1334,8 +1334,8 @@ void pizzaUpdateFunction() { if (actorf4->_sequenceID == 2) { if ((actorf5->_sequenceID == 8) && (actorf5->isFlagSet(ACTOR_FLAG_4))) { - actorf5->x_pos = -100; - actorf5->y_pos = 100; + actorf5->_x_pos = -100; + actorf5->_y_pos = 100; actorf4->updateSequence(3); } else { if (actorf5->_sequenceID == 8) { @@ -1746,19 +1746,19 @@ void caveOfDilemmaUpdateFunction() { if (counter == 0) { oldManActor = vm->_dragonINIResource->getRecord(0x161)->actor; cloudChairActor = vm->_dragonINIResource->getRecord(0x160)->actor; - if (oldManActor->y_pos < 0x53) { - oldManActor->y_pos = 0x52; - cloudChairActor->y_pos = 0x52; + if (oldManActor->_y_pos < 0x53) { + oldManActor->_y_pos = 0x52; + cloudChairActor->_y_pos = 0x52; direction = 1; } - if (0x5b < oldManActor->y_pos) { - oldManActor->y_pos = 0x5c; - cloudChairActor->y_pos = 0x5c; + if (0x5b < oldManActor->_y_pos) { + oldManActor->_y_pos = 0x5c; + cloudChairActor->_y_pos = 0x5c; direction = -1; } yOffset = direction * 2; - oldManActor->y_pos = oldManActor->y_pos + yOffset; - cloudChairActor->y_pos = cloudChairActor->y_pos + yOffset; + oldManActor->_y_pos = oldManActor->_y_pos + yOffset; + cloudChairActor->_y_pos = cloudChairActor->_y_pos + yOffset; counter = 10; } else { diff --git a/engines/dragons/talk.cpp b/engines/dragons/talk.cpp index d166e2bbc93..e20fd1d8404 100644 --- a/engines/dragons/talk.cpp +++ b/engines/dragons/talk.cpp @@ -506,10 +506,10 @@ Talk::displayDialogAroundPoint(uint16 *dialogText, uint16 x, uint16 y, uint16 pa } void Talk::displayDialogAroundActor(Actor *actor, uint16 param_2, uint16 *dialogText, uint32 textIndex) { - int16 frameYOffset = actor->frame ? actor->frame->yOffset : 0; + int16 frameYOffset = actor->_frame ? actor->_frame->yOffset : 0; displayDialogAroundPoint - (dialogText,(uint16)((int)(((uint)actor->x_pos - _vm->_scene->_camera.x) * 0x10000) >> 0x13), - (short)((int)((((uint)actor->y_pos - (uint)frameYOffset) - (uint)_vm->_scene->_camera.y) * 0x10000) >> 0x13) - 3, + (dialogText,(uint16)((int)(((uint)actor->_x_pos - _vm->_scene->_camera.x) * 0x10000) >> 0x13), + (short)((int)((((uint)actor->_y_pos - (uint)frameYOffset) - (uint)_vm->_scene->_camera.y) * 0x10000) >> 0x13) - 3, param_2,1,textIndex); } @@ -638,8 +638,8 @@ bool Talk::talkToActor(ScriptOpCall &scriptOpCall) { } while (_vm->_scriptOpcodes->_data_80071f5c == 0); _vm->_scriptOpcodes->_data_80071f5c--; // LAB_80029bc0: -// actors[0].x_pos = cursor_x_var; -// actors[0].y_pos = cursor_y_var; +// actors[0]._x_pos = cursor_x_var; +// actors[0]._y_pos = cursor_y_var; exitTalkMenu(isFlag8Set, isFlag100Set, dialogEntries); return true;