Example #1
0
void DreamWebEngine::dumpCurrent() {
	uint8 *pal = _startPal;

	waitForVSync();
	processEvents();
	setPalette(pal, 0, 128);

	pal += 128 * 3;

	waitForVSync();
	processEvents();
	setPalette(pal, 128, 128);
}
Example #2
0
void DreamWebEngine::fadeDOS() {
	return; // FIXME later

	waitForVSync();
	//processEvents will be called from vsync
	uint8 *dst = _startPal;
	getPalette(dst, 0, 64);
	for (int fade = 0; fade < 64; ++fade) {
		for (int c = 0; c < 768; ++c) { //original sources decrement 768 values -> 256 colors
			if (dst[c]) {
				--dst[c];
			}
		}
		setPalette(dst, 0, 64);
		waitForVSync();
	}
}
Example #3
0
uint16 DreamWebEngine::waitFrames() {
	readMouse();
	showPointer();
	waitForVSync();
	dumpPointer();
	delPointer();
	return _mouseButton;
}
Example #4
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);
}
Example #5
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();
}
Example #6
0
const char *DreamWebEngine::monPrint(const char *string) {
	_kerning = 1;
	uint16 x = _monAdX;
	const char *iterator = string;
	bool done = false;
	while (!done) {

		uint16 count = getNumber(_monitorCharset, (const uint8 *)iterator, 166, false, &x);
		do {
			char c = *iterator++;
			if (c == ':')
				break;
			if ((c == 0) || (c == '"') || (c == '=')) {
				done = true;
				break;
			}
			if (c == '%') {
				_vars._lastTrigger = *iterator;
				iterator += 2;
				done = true;
				break;
			}
			c = modifyChar(c);
			printChar(_monitorCharset, &x, _monAdY, c, 0, NULL, NULL);
			_cursLocX = x;
			_cursLocY = _monAdY;
			_mainTimer = 1;
			printCurs();
			waitForVSync();
			lockMon();
			delCurs();
		} while (--count);

		x = _monAdX;
		scrollMonitor();
		_cursLocX = _monAdX;
	}

	_kerning = 0;
	return iterator;
}
Example #7
0
void DreamWebEngine::selectLocation() {
	_inMapArea = 0;
	clearBeforeLoad();
	_getBack = 0;
	_pointerFrame = 22;
	readCityPic();
	showCity();
	_cityGraphics.clear();
	readDestIcon();
	loadTravelText();
	showPanel();
	showMan();
	showArrows();
	showExit();
	locationPic();
	underTextLine();
	_commandType = 255;
	readMouse();
	_pointerFrame = 0;
	showPointer();
	workToScreen();
	_sound->playChannel0(9, 255);
	_newLocation = 255;

	while (_newLocation == 255) {
		if (_quitRequested)
			break;

		delPointer();
		readMouse();
		showPointer();
		waitForVSync();
		dumpPointer();
		dumpTextLine();

		if (_getBack == 1)
			break;

		RectWithCallback destList[] = {
			{ 238,258,4,44,&DreamWebEngine::nextDest },
			{ 104,124,4,44,&DreamWebEngine::lastDest },
			{ 280,308,4,44,&DreamWebEngine::lookAtPlace },
			{ 104,216,138,192,&DreamWebEngine::destSelect },
			{ 273,320,157,198,&DreamWebEngine::getBack1 },
			{ 0,320,0,200,&DreamWebEngine::blank },
			{ 0xFFFF,0,0,0,0 }
		};
		checkCoords(destList);
	}

	if (_quitRequested || _getBack == 1 || _newLocation == _vars._location) {
		_newLocation = _realLocation;
		_getBack = 0;
	}

	_newplaceGraphics.clear();
	_newplaceGraphics2.clear();
	_newplaceGraphics3.clear();

	_travelText.clear();
}
Example #8
0
void DreamWebEngine::examineOb(bool examineAgain) {
	_pointerMode = 0;
	_timeCount = 0;

	while (true) {
		if (examineAgain) {
			_inMapArea = 0;
			_examAgain = 0;
			_openedOb = 255;
			_openedType = 255;
			_invOpen = 0;
			_objectType = _commandType;
			_itemFrame = 0;
			_pointerFrame = 0;
			createPanel();
			showPanel();
			showMan();
			showExit();
			obIcons();
			obPicture();
			describeOb();
			underTextLine();
			_commandType = 255;
			readMouse();
			showPointer();
			workToScreen();
			delPointer();
			examineAgain = false;
		}

		readMouse();
		showPointer();
		waitForVSync();
		dumpPointer();
		dumpTextLine();
		delPointer();
		_getBack = 0;

		switch (_invOpen) {
		case 0: {
			RectWithCallback examList[] = {
				{ 273,320,157,198,&DreamWebEngine::getBackFromOb },
				{ 260,300,0,44,&DreamWebEngine::useObject },
				{ 210,254,0,44,&DreamWebEngine::selectOpenOb },
				{ 144,176,64,96,&DreamWebEngine::setPickup },
				{ 0,50,50,200,&DreamWebEngine::examineInventory },
				{ 0,320,0,200,&DreamWebEngine::blank },
				{ 0xFFFF,0,0,0,0 }
			};
			checkCoords(examList);
			break;
		}
		case 1: {
			// Note: This table contains the non-constant _openChangeSize!
			RectWithCallback invList1[] = {
				{ 273,320,157,198,&DreamWebEngine::getBackFromOb },
				{ 255,294,0,24,&DreamWebEngine::dropObject },
				{ kInventx+167,kInventx+167+(18*3),kInventy-18,kInventy-2,&DreamWebEngine::incRyanPage },
				{ kInventx,_openChangeSize,kInventy+100,kInventy+100+kItempicsize,&DreamWebEngine::useOpened },
				{ kInventx,kInventx+(5*kItempicsize),kInventy,kInventy+(2*kItempicsize),&DreamWebEngine::inToInv },
				{ 0,320,0,200,&DreamWebEngine::blank },
				{ 0xFFFF,0,0,0,0 }
			};
			checkCoords(invList1);
			break;
		}
		default: {
			RectWithCallback withList1[] = {
				{ 273,320,157,198,&DreamWebEngine::getBackFromOb },
				{ kInventx+167,kInventx+167+(18*3),kInventy-18,kInventy-2,&DreamWebEngine::incRyanPage },
				{ kInventx,kInventx+(5*kItempicsize), kInventy,kInventy+(2*kItempicsize),&DreamWebEngine::selectOb },
				{ 0,320,0,200,&DreamWebEngine::blank },
				{ 0xFFFF,0,0,0,0 }
			};
			checkCoords(withList1);
			break;
		}
		}

		if (_quitRequested)
			break;
		if (_examAgain != 0)
			examineAgain = true;
		else if (_getBack != 0)
			break;
	}

	_pickUp = 0;
	if (_vars._watchingTime != 0 || _newLocation == 255) {
		// isWatching
		makeMainScreen();
	}

	_invOpen = 0;
	_openedOb = 255;
}