示例#1
0
void HiRes4Engine_Atari::loadCommonData() {
	_messages.clear();
	StreamPtr stream(createReadStream(_boot, 0x0a, 0x4, 0x00, 3));
	loadMessages(*stream, IDI_HR4_NUM_MESSAGES);

	_pictures.clear();
	stream.reset(createReadStream(_boot, 0x05, 0xe, 0x80));
	loadPictures(*stream);

	_itemPics.clear();
	stream.reset(createReadStream(_boot, 0x09, 0xe, 0x05));
	loadItemPictures(*stream, IDI_HR4_NUM_ITEM_PICS);
}
示例#2
0
TPicturesProject::TPicturesProject(const QString & dirPath):
    dir(dirPath)
{
    if (!dir.exists()) {
        assert(false);
    }

    QDir goodDir(dir.absoluteFilePath("good"));
    if (!goodDir.exists()) {
        return;
    }

    QStringList pictureNameList = goodDir.entryList(QDir::Files, QDir::Name);
    loadPictures(goodDir, pictureNameList);

    QFile goodDatFile(dir.absoluteFilePath("good.dat"));
    if (!goodDatFile.exists()) {
        return;
    }

    readGoodDatFile(goodDatFile);

    for (TMarkedPictures::reverse_iterator it = markedPictures.rbegin(); it != markedPictures.rend(); ++it) {

        TUnmarkedPictures::iterator unmarkedPicturesEnd = unmarkedPictures.end();
        TUnmarkedPictures::iterator findedIt = std::find_if(
                    unmarkedPictures.begin(),
                    unmarkedPicturesEnd,
                    TFinder((*it).name));

        if (findedIt == unmarkedPicturesEnd) {
            markedPictures.erase(it.base());
            continue;
        }

        (*it).picture = (*findedIt).picture;
        unmarkedPictures.erase(findedIt);
    }
}
示例#3
0
void GhostRoom::run() {
	CursorMan.showMouse(false);
	_vm->_graphics->saveScreen();
	_vm->fadeOut();
	_vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlack); // Black out the whole screen.
	_vm->fadeIn();

	// Only load the pictures if it's our first time walking into the room.
	// After that we simply use the already loaded images.
	if (!_wasLoaded) {
		loadPictures();
		_wasLoaded = true;
	}

	// Avvy walks over:
	_glerkStage = 0;
	_batX = 277;
	_batY = 40;
	_batCount = 0;

	for (int x = 500; x >= 217; x--) {
		// The floating eyeballs:
		int xBound = x % 30;
		if ((22 <= xBound) && (xBound <= 27)) {
			if (xBound == 27)
				_vm->_graphics->drawFilledRectangle(Common::Rect(x, 135, x + 17, 137), kColorBlack);
			_vm->_graphics->ghostDrawPicture(_eyes[0], x, 136);
			_vm->_graphics->drawDot(x + 16, 137, kColorBlack);
		} else {
			if (xBound == 21)
				_vm->_graphics->drawFilledRectangle(Common::Rect(x, 137, x + 18, 139), kColorBlack);
			_vm->_graphics->ghostDrawPicture(_eyes[0], x, 135);
			_vm->_graphics->drawDot(x + 16, 136, kColorBlack); // Eyes would leave a trail 1 pixel high behind them.
		}
		
		// Plot the Glerk:
		if ((x % 10) == 0) {
			if (_glerkStage > 25)
				break;

			_vm->_graphics->ghostDrawGlerk(_glerk[kGlerkFade[_glerkStage]], 456, 14);
			_glerkStage++;
		}

		doBat();

		_vm->_graphics->refreshScreen();

		wait(15);
	}
	
	// Blank out the Glerk's space.
	_vm->_graphics->drawFilledRectangle(Common::Rect(456, 14, 530, 50), kColorBlack);
	_vm->_graphics->refreshScreen();

	
	// Here comes the descending ghost:
	for (int y = -64; y <= 103; y++) {
		_vm->_graphics->ghostDrawGhost(_ghost[1 + (abs(y / 7) % 2) * 3], 0, y);
		if (y > 0)
			_vm->_graphics->drawFilledRectangle(Common::Rect(0, y - 1, 26 * 8, y), kColorBlack);
		_vm->_graphics->refreshScreen();

		wait(27);
	}

	// Then it waves:
	_aarghCount = -15;

	for (int i = 0; i < 4; i++) {
		for (int j = 0; j < 5; j++) {
			_vm->_graphics->drawFilledRectangle(Common::Rect(0, 96, 26 * 8, 169), kColorBlack);
			_vm->_graphics->ghostDrawGhost(_ghost[kWaveOrder[j]], 0, 96 + kAdjustment[j]);

			_aarghCount++;

			if (_aarghCount >= 0) {
				for (int k = 0; k <= _aarghCount; k++)
					_vm->_graphics->ghostDrawPicture(_aargh[k], _aarghWhere[k].x, _aarghWhere[k].y);
			}

			_vm->_graphics->refreshScreen();

			wait(177);
		}
	}

	// The exclamation mark appears:
	_vm->_graphics->ghostDrawPicture(_exclamation, 246, 127);
	_vm->_graphics->refreshScreen();
	wait(777);

	// Erase "aargh":
	_vm->_graphics->drawFilledRectangle(Common::Rect(172, 78, 348, 112), kColorBlack); 
	_vm->_graphics->refreshScreen();

	for (int i = 4; i >= 0; i--) {
		wait(377);
		bigGreenEyes(i);
	}

	// Erase the exclamation mark:
	_vm->_graphics->drawFilledRectangle(Common::Rect(246, 127, 252, 134), kColorBlack); 
	_vm->_graphics->refreshScreen();

	// Avvy hurries back:
	_glerkStage = 0;
	_greldetCount = 18;
	_redGreldet = false;
	
	for (int x = 217; x <= 479; x++) {
		// The floating eyeballs again:
		int xBound = x % 30;
		if ((22 <= xBound) && (xBound <= 27)) {
			if (xBound == 22)
				_vm->_graphics->drawFilledRectangle(Common::Rect(x + 22, 134, x + 38, 138), kColorBlack);
			_vm->_graphics->ghostDrawPicture(_eyes[1], x + 23, 136);
			_vm->_graphics->drawDot(x + 22, 137, kColorBlack);
		} else {
			if (xBound == 28)
				_vm->_graphics->drawFilledRectangle(Common::Rect(x + 22, 135, x + 38, 139), kColorBlack);
			_vm->_graphics->ghostDrawPicture(_eyes[1], x + 23, 135);
			_vm->_graphics->drawDot(x + 22, 136, kColorBlack); // Eyes would leave a trail 1 pixel high behind them.
		}

		// Plot the Green Eyes:
		if ((x % 53) == 5) {
			bigGreenEyes(_glerkStage);
			_glerkStage++;
		}

		// Plot the Greldet:
		if (_greldetCount == 18) {
			_greldetX = _vm->_rnd->getRandomNumber(599);
			_greldetY = _vm->_rnd->getRandomNumber(79);
			_greldetCount = 0;
			_redGreldet = !_redGreldet;
		}
		
		_vm->_graphics->ghostDrawPicture(_greldet[kGreldetFade[_greldetCount]][_redGreldet], _greldetX, _greldetY);
		_greldetCount++;

		_vm->_graphics->refreshScreen();

		wait(10);
	}

	CursorMan.showMouse(true);
	
	_vm->fadeOut();
	_vm->_graphics->restoreScreen();
	_vm->_graphics->removeBackup();
	_vm->_animation->animLink();
	_vm->fadeIn();
}
示例#4
0
void Map::loadCharactersTextures()
{
    loadPictures(PictureKind::Characters, m_texturesCharacters);
}