Exemplo n.º 1
0
GameLoader::GameLoader() {
    _interactionController = new InteractionController();
    _inputController = new InputController();

    _gameProject = 0;

    addMessageHandlerByIndex(global_messageHandler2, 0, 0);
    insertMessageHandler(global_messageHandler3, 0, 128);
    insertMessageHandler(global_messageHandler4, 0, 1);

    _field_FA = 0;
    _field_F8 = 0;
    _sceneSwitcher = 0;
    _preloadCallback = 0;
    _savegameCallback = 0;
    _gameVar = 0;
    _preloadSceneId = 0;
    _preloadEntranceId = 0;
    _updateCounter = 0;

    g_fp->_msgX = 0;
    g_fp->_msgY = 0;
    g_fp->_msgObjectId2 = 0;
    g_fp->_msgId = 0;
}
Exemplo n.º 2
0
bool FullpipeEngine::loadGam(const char *fname, int scene) {
	_gameLoader = new GameLoader();

	if (!_gameLoader->loadFile(fname))
		return false;

	_currSoundListCount = 0;
	initObjectStates();
	// set_g_messageQueueCallback1(messageQueueCallback1); // substituted with direct call

	addMessageHandlerByIndex(global_messageHandler1, 0, 4);

	_inventory = getGameLoaderInventory();
	_inventory->setItemFlags(ANI_INV_MAP, 0x10003);
	_inventory->addItem(ANI_INV_MAP, 1);

	_inventory->rebuildItemRects();

	for (PtrList::iterator p = _inventory->getScene()->_picObjList.begin(); p != _inventory->getScene()->_picObjList.end(); ++p) {
		((MemoryObject *)((PictureObject *)*p)->_picture)->load();
	}

	// _sceneSwitcher = sceneSwitcher; // substituted with direct call
	_gameLoader->_preloadCallback = preloadCallback;
	// _readSavegameCallback = gameLoaderReadSavegameCallback; // TODO

	_aniMan = accessScene(SC_COMMON)->getAniMan();
	_scene2 = 0;

	_movTable = _aniMan->countMovements();

	_aniMan->setSpeed(1);

	PictureObject *pic = accessScene(SC_INV)->getPictureObjectById(PIC_INV_MENU, 0);

	pic->setFlags(pic->_flags & 0xFFFB);

	// Not used in full game
	//_evalVersionPic = accessScene(SC_COMMON)->getPictureObjectById(PIC_CMN_EVAL, 0);

	initMap();
	initCursors();

	setMusicAllowed(_gameLoader->_gameVar->getSubVarAsInt("MUSIC_ALLOWED"));

	if (scene) {
		_gameLoader->loadScene(726);
		_gameLoader->gotoScene(726, TrubaLeft);

		if (scene != 726)
			_gameLoader->preloadScene(726, getSceneEntrance(scene));
	} else {
		if (_flgPlayIntro) {
			_gameLoader->loadScene(SC_INTRO1);
			_gameLoader->gotoScene(SC_INTRO1, TrubaUp);
		} else {
			_gameLoader->loadScene(SC_1);
			_gameLoader->gotoScene(SC_1, TrubaLeft);
		}
	}

	if (!_currentScene)
		return false;

	return true;
}
Exemplo n.º 3
0
bool FullpipeEngine::loadGam(const char *fname, int scene) {
	_gameLoader.reset(new GameLoader());

	if (!_gameLoader->loadFile(fname))
		return false;

	_currSoundListCount = 0;
	initObjectStates();
	// set_g_messageQueueCallback1(messageQueueCallback1); // substituted with direct call

	addMessageHandlerByIndex(global_messageHandler1, 0, 4);

	_inventory = getGameLoaderInventory();

	if (isDemo() && getLanguage() == Common::RU_RUS) {
		_inventory->addItem(ANI_INV_HAMMER, 1);
	} else {
		_inventory->setItemFlags(ANI_INV_MAP, 0x10003);
		_inventory->addItem(ANI_INV_MAP, 1);
	}

	_inventory->rebuildItemRects();

	for (uint i = 0; i < _inventory->getScene()->_picObjList.size(); i++)
		_inventory->getScene()->_picObjList[i]->_picture->MemoryObject::load();

	// _sceneSwitcher = sceneSwitcher; // substituted with direct call
	_gameLoader->_preloadCallback = preloadCallback;
	_gameLoader->_savegameCallback = gameLoaderSavegameCallback;

	_aniMan = accessScene(SC_COMMON)->getAniMan();
	_scene2 = 0;

	_movTable.reset(_aniMan->countMovements());

	_aniMan->setSpeed(1);

	PictureObject *pic = accessScene(SC_INV)->getPictureObjectById(PIC_INV_MENU, 0);

	pic->setFlags(pic->_flags & 0xFFFB);

	// Not used in full game
	//_evalVersionPic = accessScene(SC_COMMON)->getPictureObjectById(PIC_CMN_EVAL, 0);

	initMap();
	initCursors();

	setMusicAllowed(_gameLoader->_gameVar->getSubVarAsInt("MUSIC_ALLOWED"));

	if (scene == -1)
		return true;

	if (scene) {
		_gameLoader->loadScene(726);
		_gameLoader->gotoScene(726, TrubaLeft);

		if (scene != 726)
			_gameLoader->preloadScene(726, getSceneEntrance(scene));
	} else {
		if (_flgPlayIntro) {
			_gameLoader->loadScene(SC_INTRO1);
			_gameLoader->gotoScene(SC_INTRO1, TrubaUp);
		} else {
			if (g_fp->isDemo() && g_fp->getLanguage() == Common::RU_RUS) {
				_gameLoader->loadScene(SC_9);
				_gameLoader->gotoScene(SC_9, TrubaDown);
			} else {
				_gameLoader->loadScene(SC_1);
				_gameLoader->gotoScene(SC_1, TrubaLeft);
			}
		}
	}

	if (!_currentScene)
		return false;

	return true;
}