コード例 #1
0
ファイル: print.cpp プロジェクト: murgo/scummvm
uint8 DreamWebEngine::printSlow(const uint8 *string, uint16 x, uint16 y, uint8 maxWidth, bool centered) {
	_pointerFrame = 1;
	_pointerMode = 3;
	do {
		uint16 offset = x;
		uint16 charCount = getNumber(_charset1, string, maxWidth, centered, &offset);
		do {
			uint8 c0 = string[0];
			uint8 c1 = string[1];
			uint8 c2 = string[2];
			c0 = modifyChar(c0);
			printBoth(_charset1, &offset, y, c0, c1);
			if ((c1 == 0) || (c1 == ':')) {
				return 0;
			}
			if (charCount != 1) {
				c1 = modifyChar(c1);
				_charShift = 91;
				uint16 offset2 = offset;
				printBoth(_charset1, &offset2, y, c1, c2);
				_charShift = 0;
				for (int i=0; i<2; ++i) {
					uint16 mouseState = waitFrames();
					if (_quitRequested)
						return 0;
					if (mouseState == 0)
						continue;
					if (mouseState != _oldButton) {
						return 1;
					}
				}
			}

			++string;
			--charCount;
		} while (charCount);
		y += 10;
	} while (true);
}
コード例 #2
0
ファイル: logo.cpp プロジェクト: DieInGame/scummvm
void Logo::nextFrame() {
	Screen &screen = *_vm->_screen;

	if (_waitFrames) {
		uint32 currFrame = _frameCounter;
		if (currFrame - _waitStartFrame < _waitFrames) {
			return;
		}
		_waitStartFrame = 0;
		_waitFrames = 0;
	}

	if (_animateFrames) {
		uint32 currFrame = _frameCounter;
		if (currFrame > _animateStartFrame + _animateFrameDelay) {
			AnimationFrame animationFrame = _animateFrames[_animateFrame];
			if (animationFrame.frame) {
				_objects[_animateObject]._frame = animationFrame.frame;
				_objects[_animateObject]._position = Common::Point(animationFrame.x, animationFrame.y);
				_animateStartFrame += _animateFrameDelay;
				_animateFrame++;
			} else {
				_animateObject = 0;
				_animateFrameDelay = 0;
				_animateFrames = NULL;
				_animateStartFrame = 0;
				_animateFrame = 0;
			}
		}
		if (_animateFrames)
			return;
	}

	switch (_counter++) {
	case 0:
		// Load the background and fade it in
		loadBackground();
		fade(_palette1);
		break;

	case 1:
		// First half of square, circle, and triangle arranging themselves
		_objects[0].setVisage(16, 1);
		_objects[0]._frame = 1;
		_objects[0]._position = Common::Point(169, 107);
		_objects[0]._numFrames = 7;
		_objects[0].setAnimMode(true);
		break;

	case 2:
		// Keep waiting until first animation ends
		if (!_objects[0].isAnimEnded()) {
			--_counter;
		} else {
			// Start second half of the shapes animation
			_objects[0].setVisage(16, 2);
			_objects[0]._frame = 1;
			_objects[0]._numFrames = 11;
			_objects[0].setAnimMode(true);
		}
		break;

	case 3:
		// Keep waiting until second animation of shapes ordering themselves ends
		if (!_objects[0].isAnimEnded()) {
			--_counter;
		} else {
			// Fade out the background but keep the shapes visible
			fade(_palette2);
			screen._backBuffer1.clear();
		}
		waitFrames(10);
		break;

	case 4:
		// Load the new palette
		byte palette[PALETTE_SIZE];
		Common::copy(&_palette2[0], &_palette2[PALETTE_SIZE], &palette[0]);
		_lib.getPalette(palette, 12);
		screen.clear();
		screen.setPalette(palette);

		// Morph into the EA logo
		_objects[0].setVisage(12, 1);
		_objects[0]._frame = 1;
		_objects[0]._numFrames = 7;
		_objects[0].setAnimMode(true);
		_objects[0]._position = Common::Point(170, 142);
		_objects[0].setDestination(Common::Point(158, 71));
		break;

	case 5:
		// Wait until the logo has expanded upwards to form EA logo
		if (_objects[0].isMoving())
			--_counter;
		break;

	case 6:
		fade(_palette3, 40);
		break;

	case 7:
		// Show the 'Electronic Arts' company name
		_objects[1].setVisage(14, 1);
		_objects[1]._frame = 1;
		_objects[1]._position = Common::Point(152, 98);
		waitFrames(120);
		break;

	case 8:
		// Start sequence of positioning and size hand cursor in an arc
		_objects[2].setVisage(18, 1);
		startAnimation(2, 5, &handFrames[0]);
		break;

	case 9:
		// Show a highlighting of the company name
		_objects[1].remove();
		_objects[2].erase();
		_objects[2].remove();
		_objects[3].setVisage(19, 1);
		startAnimation(3, 8, &companyFrames[0]);
		break;

	case 10:
		waitFrames(180);
		break;

	case 11:
		_finished = true;
		break;

	default:
		break;
	}
}