diff options
| author | Eric Fry | 2018-05-07 08:36:39 +1000 | 
|---|---|---|
| committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 | 
| commit | 6e09cd7e0899052a927bb65ba13219a4cd53c814 (patch) | |
| tree | fdf3492f3a6e4ba8a0cc87f44f7cd8fbdc5d9994 | |
| parent | c66b2208e0f8aa35288da64ce3903edc5a8205cd (diff) | |
| download | scummvm-rg350-6e09cd7e0899052a927bb65ba13219a4cd53c814.tar.gz scummvm-rg350-6e09cd7e0899052a927bb65ba13219a4cd53c814.tar.bz2 scummvm-rg350-6e09cd7e0899052a927bb65ba13219a4cd53c814.zip | |
ILLUSIONS: Rename some actor flags
| -rw-r--r-- | engines/illusions/actor.cpp | 42 | ||||
| -rw-r--r-- | engines/illusions/actor.h | 12 | ||||
| -rw-r--r-- | engines/illusions/bbdou/illusions_bbdou.cpp | 2 | ||||
| -rw-r--r-- | engines/illusions/cursor.cpp | 4 | ||||
| -rw-r--r-- | engines/illusions/duckman/illusions_duckman.cpp | 2 | ||||
| -rw-r--r-- | engines/illusions/illusions.cpp | 2 | ||||
| -rw-r--r-- | engines/illusions/sequenceopcodes.cpp | 20 | 
7 files changed, 42 insertions, 42 deletions
| diff --git a/engines/illusions/actor.cpp b/engines/illusions/actor.cpp index d24ec7b904..4ebce4160e 100644 --- a/engines/illusions/actor.cpp +++ b/engines/illusions/actor.cpp @@ -252,7 +252,7 @@ void Control::unpause() {  void Control::appearActor() {  	if (_vm->getGameId() == kGameIdDuckman) {  		_flags |= 1; -		_actor->_flags |= Illusions::ACTOR_FLAG_1; +		_actor->_flags |= Illusions::ACTOR_FLAG_IS_VISIBLE;  		if (_objectId == 0x40004) {  			if (_actor->_frameIndex) {  				_actor->_flags |= Illusions::ACTOR_FLAG_2000; @@ -265,7 +265,7 @@ void Control::appearActor() {  			_vm->showCursor();  		} else {  			if (_actor->_frameIndex || _actorTypeId == 0x50004) -				_actor->_flags |= Illusions::ACTOR_FLAG_1; +				_actor->_flags |= Illusions::ACTOR_FLAG_IS_VISIBLE;  			else  				_actor->_flags |= Illusions::ACTOR_FLAG_1000;  			for (uint i = 0; i < kSubObjectsCount; ++i) @@ -280,12 +280,12 @@ void Control::appearActor() {  void Control::disappearActor() {  	if (_vm->getGameId() == kGameIdDuckman) {  		_flags &= ~1; -		_actor->_flags &= ~Illusions::ACTOR_FLAG_1; +		_actor->_flags &= ~Illusions::ACTOR_FLAG_IS_VISIBLE;  	} else {  		if (_objectId == 0x40004) {  			_vm->hideCursor();  		} else { -			_actor->_flags &= ~Illusions::ACTOR_FLAG_1; +			_actor->_flags &= ~Illusions::ACTOR_FLAG_IS_VISIBLE;  			_actor->_flags &= ~Illusions::ACTOR_FLAG_1000;  			for (uint i = 0; i < kSubObjectsCount; ++i)  				if (_actor->_subobjects[i]) { @@ -297,7 +297,7 @@ void Control::disappearActor() {  }  bool Control::isActorVisible() { -	return (_actor->_flags & Illusions::ACTOR_FLAG_1) != 0; +	return (_actor->_flags & Illusions::ACTOR_FLAG_IS_VISIBLE) != 0;  }  void Control::activateObject() { @@ -578,8 +578,8 @@ void Control::stopSequenceActor() {  	if (_actor->_flags & Illusions::ACTOR_FLAG_40) {  		stopActor();  		_actor->_frameIndex = 0; -		if ((_actor->_flags & Illusions::ACTOR_FLAG_1) || (_actor->_flags & Illusions::ACTOR_FLAG_1000)) { -			_actor->_flags &= ~Illusions::ACTOR_FLAG_1; +		if ((_actor->_flags & Illusions::ACTOR_FLAG_IS_VISIBLE) || (_actor->_flags & Illusions::ACTOR_FLAG_1000)) { +			_actor->_flags &= ~Illusions::ACTOR_FLAG_IS_VISIBLE;  			_actor->_flags |= Illusions::ACTOR_FLAG_1000;  		}  	} @@ -594,7 +594,7 @@ void Control::startTalkActor(uint32 sequenceId, byte *entryTblPtr, uint32 thread  	bool doSeq = true;  	if (_actor->_linkIndex2) {  		Control *subControl = _vm->_dict->getObjectControl(_actor->_subobjects[_actor->_linkIndex2 - 1]); -		if (subControl->_actor->_flags & Illusions::ACTOR_FLAG_1) { +		if (subControl->_actor->_flags & Illusions::ACTOR_FLAG_IS_VISIBLE) {  			if (_actor->_pathNode) {  				doSeq = false;  				subControl->_actor->_notifyThreadId2 = threadId; @@ -646,7 +646,7 @@ void Control::sequenceActor() {  		//debug(1, "New frame %d", _actor->_newFrameIndex);  		setActorFrameIndex(_actor->_newFrameIndex);  		if (_vm->getGameId() == kGameIdBBDOU && -			!(_actor->_flags & Illusions::ACTOR_FLAG_1) && (_actor->_flags & Illusions::ACTOR_FLAG_1000) && (_objectId != 0x40004)) { +			!(_actor->_flags & Illusions::ACTOR_FLAG_IS_VISIBLE) && (_actor->_flags & Illusions::ACTOR_FLAG_1000) && (_objectId != 0x40004)) {  			appearActor();  			_actor->_flags &= ~Illusions::ACTOR_FLAG_1000;  		} @@ -766,8 +766,8 @@ void Control::startMoveActor(uint32 sequenceId, Common::Point destPt, uint32 cal  }  PointArray *Control::createPath(Common::Point destPt) { -	PointArray *walkPoints = (_actor->_flags & Illusions::ACTOR_FLAG_2) ? _actor->_pathWalkPoints->_points : 0; -	PathLines *walkRects = (_actor->_flags & Illusions::ACTOR_FLAG_10) ? _actor->_pathWalkRects->_rects : 0; +	PointArray *walkPoints = (_actor->_flags & Illusions::ACTOR_FLAG_HAS_WALK_POINTS) ? _actor->_pathWalkPoints->_points : 0; +	PathLines *walkRects = (_actor->_flags & Illusions::ACTOR_FLAG_HAS_WALK_RECTS) ? _actor->_pathWalkRects->_rects : 0;  	PathFinder pathFinder;  	WidthHeight bgDimensions = _vm->_backgroundInstances->getMasterBgDimensions();  	PointArray *path = pathFinder.findPath(_actor->_position, destPt, walkPoints, walkRects, bgDimensions); @@ -1067,27 +1067,27 @@ void Controls::placeActor(uint32 actorTypeId, Common::Point placePt, uint32 sequ  	BackgroundResource *bgRes = _vm->_backgroundInstances->getActiveBgResource();  	if (actorType->_pathWalkPointsIndex) {  		actor->_pathWalkPoints = bgRes->getPathWalkPoints(actorType->_pathWalkPointsIndex - 1); -		actor->_flags |= Illusions::ACTOR_FLAG_2; +		actor->_flags |= Illusions::ACTOR_FLAG_HAS_WALK_POINTS;  	}  	if (actorType->_scaleLayerIndex) {  		actor->_scaleLayer = bgRes->getScaleLayer(actorType->_scaleLayerIndex - 1); -		actor->_flags |= Illusions::ACTOR_FLAG_4; +		actor->_flags |= Illusions::ACTOR_FLAG_SCALED;  	}  	if (actorType->_pathWalkRectIndex) {  		actor->_pathWalkRects = bgRes->getPathWalkRects(actorType->_pathWalkRectIndex - 1); -		actor->_flags |= Illusions::ACTOR_FLAG_10; +		actor->_flags |= Illusions::ACTOR_FLAG_HAS_WALK_RECTS;  	}  	if (actorType->_priorityLayerIndex) {  		actor->_priorityLayer = bgRes->getPriorityLayer(actorType->_priorityLayerIndex - 1); -		actor->_flags |= Illusions::ACTOR_FLAG_8; +		actor->_flags |= Illusions::ACTOR_FLAG_PRIORITY;  	}  	if (actorType->_regionLayerIndex) {  		actor->_regionLayer = bgRes->getRegionLayer(actorType->_regionLayerIndex - 1); -		actor->_flags |= Illusions::ACTOR_FLAG_20; +		actor->_flags |= Illusions::ACTOR_FLAG_REGION;  	}  	actor->_pathCtrY = 140; @@ -1291,7 +1291,7 @@ bool Controls::getOverlappedObject(Control *control, Common::Point pt, Control *  		Control *testControl = *it;  		if (testControl != control && testControl->_pauseCtr == 0 &&  			(testControl->_flags & 1) && !(testControl->_flags & 0x10) && -			(!testControl->_actor || (testControl->_actor->_flags & Illusions::ACTOR_FLAG_1))) { +			(!testControl->_actor || (testControl->_actor->_flags & Illusions::ACTOR_FLAG_IS_VISIBLE))) {  			Common::Rect collisionRect;  			testControl->getCollisionRect(collisionRect);  			if (!collisionRect.isEmpty() && collisionRect.contains(pt)) { @@ -1325,7 +1325,7 @@ bool Controls::getOverlappedObjectAccurate(Control *control, Common::Point pt, C  		Control *testControl = *it;  		if (testControl != control && testControl->_pauseCtr == 0 &&  			(testControl->_flags & 1) && !(testControl->_flags & 0x10) && -			(!testControl->_actor || (testControl->_actor->_flags & Illusions::ACTOR_FLAG_1))) { +			(!testControl->_actor || (testControl->_actor->_flags & Illusions::ACTOR_FLAG_IS_VISIBLE))) {  			Common::Rect collisionRect;  			testControl->getCollisionRectAccurate(collisionRect);  			if (!collisionRect.isEmpty() && collisionRect.contains(pt) && @@ -1413,18 +1413,18 @@ void Controls::actorControlRoutine(Control *control, uint32 deltaTime) {  		actor->_seqCodeValue1 = 100 * deltaTime;  	} -	if (actor->_flags & Illusions::ACTOR_FLAG_4) { +	if (actor->_flags & Illusions::ACTOR_FLAG_SCALED) {  		int scale = actor->_scaleLayer->getScale(actor->_position);  		control->setActorScale(scale);  	} -	if (actor->_flags & Illusions::ACTOR_FLAG_8) { +	if (actor->_flags & Illusions::ACTOR_FLAG_PRIORITY) {  		int16 priority = actor->_priorityLayer->getPriority(actor->_position);  		if (priority)  			control->setPriority(priority + 1);  	} -	if (actor->_flags & Illusions::ACTOR_FLAG_20) { +	if (actor->_flags & Illusions::ACTOR_FLAG_REGION) {  		// Update transition sequence  		int regionIndex = actor->_regionLayer->getRegionIndex(actor->_position);  		if (actor->_regionIndex != regionIndex) { diff --git a/engines/illusions/actor.h b/engines/illusions/actor.h index e590cac501..7fb99ced81 100644 --- a/engines/illusions/actor.h +++ b/engines/illusions/actor.h @@ -40,12 +40,12 @@ class SequenceOpcodes;  struct OpCall;  enum ActorFlags { -	ACTOR_FLAG_1 = 1, -	ACTOR_FLAG_2 = 2, -	ACTOR_FLAG_4 = 4, -	ACTOR_FLAG_8 = 8, -	ACTOR_FLAG_10 = 0x10, -	ACTOR_FLAG_20 = 0x20, +	ACTOR_FLAG_IS_VISIBLE = 1, +	ACTOR_FLAG_HAS_WALK_POINTS = 2, +	ACTOR_FLAG_SCALED = 4, +	ACTOR_FLAG_PRIORITY = 8, +	ACTOR_FLAG_HAS_WALK_RECTS = 0x10, +	ACTOR_FLAG_REGION = 0x20,  	ACTOR_FLAG_40 = 0x40,  	ACTOR_FLAG_80 = 0x80,  	ACTOR_FLAG_100 = 0x100, diff --git a/engines/illusions/bbdou/illusions_bbdou.cpp b/engines/illusions/bbdou/illusions_bbdou.cpp index 4d54eb4edb..b0353c2096 100644 --- a/engines/illusions/bbdou/illusions_bbdou.cpp +++ b/engines/illusions/bbdou/illusions_bbdou.cpp @@ -410,7 +410,7 @@ void IllusionsEngine_BBDOU::hideCursor() {  void IllusionsEngine_BBDOU::cursorControlRoutine(Control *control, uint32 deltaTime) {  	control->_actor->_seqCodeValue1 = 100 * deltaTime; -	if (control->_actor->_flags & Illusions::ACTOR_FLAG_1) { +	if (control->_actor->_flags & Illusions::ACTOR_FLAG_IS_VISIBLE) {  		switch (_cursor->_status) {  		case 2:  			// Unused nullsub_1(control); diff --git a/engines/illusions/cursor.cpp b/engines/illusions/cursor.cpp index 0cb6ff7ed8..da8a83b71e 100644 --- a/engines/illusions/cursor.cpp +++ b/engines/illusions/cursor.cpp @@ -62,7 +62,7 @@ void Cursor::show() {  	++_visibleCtr;  	if (_visibleCtr > 0) {  		_control->_flags |= 1; -		_control->_actor->_flags |= Illusions::ACTOR_FLAG_1; +		_control->_actor->_flags |= Illusions::ACTOR_FLAG_IS_VISIBLE;  		if (_control->_actor->_frameIndex) {  			_control->_actor->_flags |= Illusions::ACTOR_FLAG_2000;  			_control->_actor->_flags |= Illusions::ACTOR_FLAG_4000; @@ -75,7 +75,7 @@ void Cursor::hide() {  	--_visibleCtr;  	if (_visibleCtr <= 0) {  		_control->_flags &= ~1; -		_control->_actor->_flags &= ~Illusions::ACTOR_FLAG_1; +		_control->_actor->_flags &= ~Illusions::ACTOR_FLAG_IS_VISIBLE;  	}  } diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp index d917a35620..9407812c99 100644 --- a/engines/illusions/duckman/illusions_duckman.cpp +++ b/engines/illusions/duckman/illusions_duckman.cpp @@ -692,7 +692,7 @@ void IllusionsEngine_Duckman::stopCursorHoldingObject() {  void IllusionsEngine_Duckman::cursorControlRoutine(Control *control, uint32 deltaTime) {  	control->_actor->_seqCodeValue1 = 100 * deltaTime; -	if (control->_actor->_flags & Illusions::ACTOR_FLAG_1) { +	if (control->_actor->_flags & Illusions::ACTOR_FLAG_IS_VISIBLE) {  		switch (_cursor._gameState) {  		case 2:  			updateGameState2(); diff --git a/engines/illusions/illusions.cpp b/engines/illusions/illusions.cpp index 2317bd34ac..11ef6d0ac7 100644 --- a/engines/illusions/illusions.cpp +++ b/engines/illusions/illusions.cpp @@ -188,7 +188,7 @@ int IllusionsEngine::updateGraphics(uint flags) {  	for (Controls::ItemsIterator it = _controls->_controls.begin(); it != _controls->_controls.end(); ++it) {  		Control *control = *it;  		Actor *actor = control->_actor; -		if (control->_pauseCtr == 0 && actor && (actor->_flags & Illusions::ACTOR_FLAG_1) && !(actor->_flags & Illusions::ACTOR_FLAG_200)) { +		if (control->_pauseCtr == 0 && actor && (actor->_flags & Illusions::ACTOR_FLAG_IS_VISIBLE) && !(actor->_flags & Illusions::ACTOR_FLAG_200)) {  			Common::Point drawPosition = control->calcPosition(panPoint);  			if (actor->_flags & Illusions::ACTOR_FLAG_2000) {  				Frame *frame = &(*actor->_frames)[actor->_frameIndex - 1]; diff --git a/engines/illusions/sequenceopcodes.cpp b/engines/illusions/sequenceopcodes.cpp index c394537607..21152097d9 100644 --- a/engines/illusions/sequenceopcodes.cpp +++ b/engines/illusions/sequenceopcodes.cpp @@ -295,64 +295,64 @@ void SequenceOpcodes::opSetPathCtrY(Control *control, OpCall &opCall) {  void SequenceOpcodes::opSetPathWalkPoints(Control *control, OpCall &opCall) {  	ARG_INT16(pathWalkPointsIndex);  	BackgroundResource *bgRes = _vm->_backgroundInstances->getActiveBgResource(); -	control->_actor->_flags |= Illusions::ACTOR_FLAG_2; +	control->_actor->_flags |= Illusions::ACTOR_FLAG_HAS_WALK_POINTS;  	control->_actor->_pathWalkPoints = bgRes->getPathWalkPoints(pathWalkPointsIndex - 1);  }  void SequenceOpcodes::opDisableAutoScale(Control *control, OpCall &opCall) {  	// Keep current scale but don't autoscale -	control->_actor->_flags &= ~Illusions::ACTOR_FLAG_4; +	control->_actor->_flags &= ~Illusions::ACTOR_FLAG_SCALED;  }  void SequenceOpcodes::opSetScale(Control *control, OpCall &opCall) {  	ARG_INT16(scale); -	control->_actor->_flags &= ~Illusions::ACTOR_FLAG_4; +	control->_actor->_flags &= ~Illusions::ACTOR_FLAG_SCALED;  	control->setActorScale(scale);  }  void SequenceOpcodes::opSetScaleLayer(Control *control, OpCall &opCall) {  	ARG_INT16(scaleLayerIndex);  	BackgroundResource *bgRes = _vm->_backgroundInstances->getActiveBgResource(); -	control->_actor->_flags |= Illusions::ACTOR_FLAG_4; +	control->_actor->_flags |= Illusions::ACTOR_FLAG_SCALED;  	control->_actor->_scaleLayer = bgRes->getScaleLayer(scaleLayerIndex - 1);  	int scale = control->_actor->_scaleLayer->getScale(control->_actor->_position);  	control->setActorScale(scale);  }  void SequenceOpcodes::opDeactivatePathWalkRects(Control *control, OpCall &opCall) { -	control->_actor->_flags &= ~Illusions::ACTOR_FLAG_10; +	control->_actor->_flags &= ~Illusions::ACTOR_FLAG_HAS_WALK_RECTS;  }  void SequenceOpcodes::opSetPathWalkRects(Control *control, OpCall &opCall) {  	ARG_INT16(pathWalkRectsIndex);  	BackgroundResource *bgRes = _vm->_backgroundInstances->getActiveBgResource(); -	control->_actor->_flags |= Illusions::ACTOR_FLAG_10; +	control->_actor->_flags |= Illusions::ACTOR_FLAG_HAS_WALK_RECTS;  	control->_actor->_pathWalkRects = bgRes->getPathWalkRects(pathWalkRectsIndex - 1);  }  void SequenceOpcodes::opSetPriority(Control *control, OpCall &opCall) {  	ARG_INT16(priority); -	control->_actor->_flags &= ~Illusions::ACTOR_FLAG_8; +	control->_actor->_flags &= ~Illusions::ACTOR_FLAG_PRIORITY;  	control->setPriority(priority);  }  void SequenceOpcodes::opSetPriorityLayer(Control *control, OpCall &opCall) {  	ARG_INT16(priorityLayerIndex);  	BackgroundResource *bgRes = _vm->_backgroundInstances->getActiveBgResource(); -	control->_actor->_flags |= Illusions::ACTOR_FLAG_8; +	control->_actor->_flags |= Illusions::ACTOR_FLAG_PRIORITY;  	control->_actor->_priorityLayer = bgRes->getPriorityLayer(priorityLayerIndex - 1);  	int priority = control->_actor->_priorityLayer->getPriority(control->_actor->_position);  	control->setPriority(priority);  }  void SequenceOpcodes::opDisableAutoRegionLayer(Control *control, OpCall &opCall) { -	control->_actor->_flags &= ~Illusions::ACTOR_FLAG_20; +	control->_actor->_flags &= ~Illusions::ACTOR_FLAG_REGION;  }  void SequenceOpcodes::opSetRegionLayer(Control *control, OpCall &opCall) {  	ARG_INT16(regionLayerIndex);  	BackgroundResource *bgRes = _vm->_backgroundInstances->getActiveBgResource(); -	control->_actor->_flags |= Illusions::ACTOR_FLAG_20; +	control->_actor->_flags |= Illusions::ACTOR_FLAG_REGION;  	control->_actor->_regionLayer = bgRes->getRegionLayer(regionLayerIndex - 1);  } | 
