コード例 #1
0
ファイル: ad_actor.cpp プロジェクト: Fyre91/scummvm
bool AdActor::display() {
	if (_active) {
		updateSounds();
	}

	uint32 alpha;
	if (_alphaColor != 0) {
		alpha = _alphaColor;
	} else {
		alpha = _shadowable ? ((AdGame *)_gameRef)->_scene->getAlphaAt(_posX, _posY, true) : 0xFFFFFFFF;
	}

	float scaleX, scaleY;
	getScale(&scaleX, &scaleY);


	float rotate;
	if (_rotatable) {
		if (_rotateValid) {
			rotate = _rotate;
		} else {
			rotate = ((AdGame *)_gameRef)->_scene->getRotationAt(_posX, _posY) + _relativeRotate;
		}
	} else {
		rotate = 0.0f;
	}

	if (_active) {
		displaySpriteAttachments(true);
	}

	if (_currentSprite && _active) {
		bool reg = _registrable;
		if (_ignoreItems && ((AdGame *)_gameRef)->_selectedItem) {
			reg = false;
		}

		_currentSprite->display(_posX,
		                        _posY,
		                        reg ? _registerAlias : nullptr,
		                        scaleX,
		                        scaleY,
		                        alpha,
		                        rotate,
		                        _blendMode);

	}

	if (_active) {
		displaySpriteAttachments(false);
	}
	if (_active && _partEmitter) {
		_partEmitter->display();
	}


	return STATUS_OK;
}
コード例 #2
0
ファイル: ad_entity.cpp プロジェクト: MaddTheSane/scummvm
bool AdEntity::display() {
	if (_active) {
		updateSounds();

		uint32 alpha;
		if (_alphaColor != 0) {
			alpha = _alphaColor;
		} else {
			alpha = _shadowable ? ((AdGame *)_gameRef)->_scene->getAlphaAt(_posX, _posY) : 0xFFFFFFFF;
		}

		float scaleX, scaleY;
		getScale(&scaleX, &scaleY);

		float rotate;
		if (_rotatable) {
			if (_rotateValid) {
				rotate = _rotate;
			} else {
				rotate = ((AdGame *)_gameRef)->_scene->getRotationAt(_posX, _posY) + _relativeRotate;
			}
		} else {
			rotate = 0.0f;
		}


		bool reg = _registrable;
		if (_ignoreItems && ((AdGame *)_gameRef)->_selectedItem) {
			reg = false;
		}

		if (_region && (reg || _editorAlwaysRegister)) {
			_gameRef->_renderer->addRectToList(new BaseActiveRect(_gameRef,  _registerAlias, _region, _gameRef->_offsetX, _gameRef->_offsetY));
		}

		displaySpriteAttachments(true);
		if (_theora && (_theora->isPlaying() || _theora->isPaused())) {
			_theora->display(alpha);
		} else if (_currentSprite) {
			_currentSprite->display(_posX,
			                        _posY,
			                        (reg || _editorAlwaysRegister) ? _registerAlias : nullptr,
			                        scaleX,
			                        scaleY,
			                        alpha,
			                        rotate,
			                        _blendMode);
		}
		displaySpriteAttachments(false);

		if (_partEmitter) {
			_partEmitter->display(_region);
		}

	}
	return STATUS_OK;
}