Ejemplo n.º 1
0
void DreamWebEngine::doSomeTalk() {
	while (true) {
		const uint8 *str = getPersonText(_character & 0x7F, _talkPos);

		if (*str == 0) {
			// endheartalk
			_pointerMode = 0;
			return;
		}

		createPanel();
		showPanel();
		showMan();
		showExit();
		convIcons();

		printDirect(str, 164, 64, 144, false);

		loadSpeech('R', _realLocation, 'C', (64 * (_character & 0x7F)) + _talkPos);
		if (_speechLoaded)
			playChannel1(62);

		_pointerMode = 3;
		workToScreenM();
		if (hangOnPQ())
			return;

		_talkPos++;

		str = getPersonText(_character & 0x7F, _talkPos);
		if (*str == 0) {
			// endheartalk
			_pointerMode = 0;
			return;
		}

		if (*str != ':' && *str != 32) {
			createPanel();
			showPanel();
			showMan();
			showExit();
			convIcons();
			printDirect(str, 48, 128, 144, false);

			loadSpeech('R', _realLocation, 'C', (64 * (_character & 0x7F)) + _talkPos);
			if (_speechLoaded)
				playChannel1(62);

			_pointerMode = 3;
			workToScreenM();
			if (hangOnPQ())
				return;
		}

		_talkPos++;
	}
}
Ejemplo n.º 2
0
void DreamWebEngine::lookAtPlace() {
	commandOnlyCond(27, 224);

	if (!(_mouseButton & 1) ||
		_mouseButton == _oldButton ||
		_destPos >= 15)
		return; // noinfo

	delPointer();
	delTextLine();
	getUnderCentre();
	showFrame(_newplaceGraphics3, 60, 72, 0, 0);
	showFrame(_newplaceGraphics3, 60, 72 + 55, 4, 0);
	if (_foreignRelease)
		showFrame(_newplaceGraphics3, 60, 72+55+21, 4, 0);

	const uint8 *string = (const uint8 *)_travelText.getString(_destPos);
	findNextColon(&string);
	uint16 y = (_foreignRelease) ? 84 + 4 : 84;
	printDirect(&string, 63, &y, 191, 191 & 1);
	workToScreenM();
	hangOnP(500);
	_pointerMode = 0;
	_pointerFrame = 0;
	putUnderCentre();
	workToScreenM();
}
Ejemplo n.º 3
0
void DreamWebEngine::openOb() {
	uint8 commandLine[64] = "OBJECT NAME ONE                         ";

	copyName(_openedType, _openedOb, commandLine);

	printMessage(kInventx, kInventy+86, 62, 240, false);

	printDirect(commandLine, _lastXPos + 5, kInventy+86, 220, false);

	fillOpen();
	_openChangeSize = getOpenedSlotCount() * kItempicsize + kInventx;
}
Ejemplo n.º 4
0
void DreamWebEngine::startTalk() {
	_talkMode = 0;

	const uint8 *str = getPersonText(_character & 0x7F, 0);
	uint16 y;

	_charShift = 91+91;
	y = 64;
	printDirect(&str, 66, &y, 241, true);

	_charShift = 0;
	y = 80;
	printDirect(&str, 66, &y, 241, true);

	_speechLoaded = false;
	loadSpeech('R', _realLocation, 'C', 64*(_character & 0x7F));
	if (_speechLoaded) {
		_volumeDirection = 1;
		_volumeTo = 6;
		playChannel1(50 + 12);
	}
}
Ejemplo n.º 5
0
void DreamWebEngine::locationPic() {
	const int roomPics[] = { 5, 0, 3, 2, 4, 1, 10, 9, 8, 6, 11, 4, 7, 7, 0 };
	byte picture = roomPics[_destPos];

	if (picture >= 6)
		showFrame(_newplaceGraphics2, 104, 138 + 14, picture - 6, 0);	// Second slot
	else
		showFrame(_newplaceGraphics,  104, 138 + 14, picture + 4, 0);

	if (_destPos == _realLocation)
		showFrame(_newplaceGraphics, 104, 140 + 14, 3, 0);	// Currently in this location

	const uint8 *string = (const uint8 *)_travelText.getString(_destPos);
	printDirect(string, 50, 20, 241, 241 & 1);
}
Ejemplo n.º 6
0
void DreamWebEngine::rollEndCreditsGameLost() {
	multiGet(_mapStore, 25, 20, 160, 160);

	const uint8 *string = getTextInFile1(49);
	const int linespacing = _lineSpacing;

	for (int i = 0; i < 80; ++i) {
		// Output the text, initially with an offset of 10 pixels,
		// then move it up one pixel until we shifted it by a complete
		// line of text.
		for (int j = 0; j < linespacing; ++j) {
			waitForVSync();
			multiPut(_mapStore, 25, 20, 160, 160);
			waitForVSync();

			// Output up to 18 lines of text
			uint16 y = 10 - j;
			const uint8 *tmp_str = string;
			for (int k = 0; k < 18; ++k) {
				printDirect(&tmp_str, 25, &y, 160 + 1, true);
				y += linespacing;
			}

			waitForVSync();
			multiDump(25, 20, 160, 160);

			if (_lastHardKey == 1)
				return;
		}

		// Skip to the next text line
		byte c;
		do {
			c = *string++;
		} while (c != ':' && c != 0);

		if (_lastHardKey == 1)
			return;
	}

	hangOne(120);
}
Ejemplo n.º 7
0
void DreamWebEngine::rollEndCreditsGameWon() {
	_sound->playChannel0(16, 255);
	_sound->volumeSet(7);
	_sound->volumeChange(0, -1);

	multiGet(_mapStore, 75, 20, 160, 160);

	const uint8 *string = getTextInFile1(3);
	const int linespacing = _lineSpacing;

	for (int i = 0; i < 254; ++i) {
		// Output the text, initially with an offset of 10 pixels,
		// then move it up one pixel until we shifted it by a complete
		// line of text.
		for (int j = 0; j < linespacing; ++j) {
			waitForVSync();
			multiPut(_mapStore, 75, 20, 160, 160);
			waitForVSync();

			// Output up to 18 lines of text
			uint16 y = 10 - j;
			const uint8 *tmp_str = string;
			for (int k = 0; k < 18; ++k) {
				printDirect(&tmp_str, 75, &y, 160 + 1, true);
				y += linespacing;
			}

			waitForVSync();
			multiDump(75, 20, 160, 160);
		}

		// Skip to the next text line
		byte c;
		do {
			c = *string++;
		} while (c != ':' && c != 0);
	}

	hangOn(100);
	panelToMap();
	fadeScreenUpHalf();
}
Ejemplo n.º 8
0
uint8 DreamWebEngine::printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered) {
	return printDirect(&string, x, &y, maxWidth, centered);
}