Exemple #1
0
void Walk::start() {
	Movement::start();

	updatePath();
	changeItemAnim();

	Resources::Location *location = StarkGlobal->getCurrent()->getLocation();
	location->startFollowingCharacter();
}
Exemple #2
0
bool Console::Cmd_ListLocations(int argc, const char **argv) {
	ArchiveLoader *archiveLoader = new ArchiveLoader();

	// Temporarily replace the global archive loader with our instance
	ArchiveLoader *gameArchiveLoader = StarkArchiveLoader;
	StarkArchiveLoader = archiveLoader;

	archiveLoader->load("x.xarc");
	Resources::Root *root = archiveLoader->useRoot<Resources::Root>("x.xarc");

	// Find all the levels
	Common::Array<Resources::Level *> levels = root->listChildren<Resources::Level>();

	// Loop over the levels
	for (uint i = 0; i < levels.size(); i++) {
		Resources::Level *level = levels[i];

		Common::String levelArchive = archiveLoader->buildArchiveName(level);
		debugPrintf("%s - %s\n", levelArchive.c_str(), level->getName().c_str());

		// Load the detailed level archive
		archiveLoader->load(levelArchive);
		level = archiveLoader->useRoot<Resources::Level>(levelArchive);

		Common::Array<Resources::Location *> locations = level->listChildren<Resources::Location>();

		// Loop over the locations
		for (uint j = 0; j < locations.size(); j++) {
			Resources::Location *location = locations[j];

			Common::String roomArchive = archiveLoader->buildArchiveName(level, location);
			debugPrintf("%s - %s\n", roomArchive.c_str(), location->getName().c_str());
		}

		archiveLoader->returnRoot(levelArchive);
		archiveLoader->unloadUnused();
	}

	// Restore the global archive loader
	StarkArchiveLoader = gameArchiveLoader;

	delete archiveLoader;

	return true;
}
void GameWindow::onRender() {
	// List the items to render
	Resources::Location *location = StarkGlobal->getCurrent()->getLocation();
	_renderEntries = location->listRenderEntries();
	Gfx::LightEntryArray lightEntries = location->listLightEntries();

	// Render all the scene items
	Gfx::RenderEntryArray::iterator element = _renderEntries.begin();
	while (element != _renderEntries.end()) {
		// Draw the current element
		(*element)->render(lightEntries);

		// Go for the next one
		element++;
	}

	if (_displayExit) {
		Common::Array<Common::Point> exitPositions = StarkGameInterface->listExitPositions();

		for (uint i = 0; i < exitPositions.size(); ++i) {
			Common::Point pos = exitPositions[i];
			VisualImageXMG *exitImage = nullptr;

			if (pos.x < _exitLeftBoundary) {
				pos.x = _exitLeftBoundary;
				exitImage = _exitArrowLeft;
			} else if (pos.x > _exitRightBoundary) {
				pos.x = _exitRightBoundary;
				exitImage = _exitArrowRight;
			} else {
				exitImage = _exitArrow;
			}

			exitImage->render(pos, false);
		}
	}

	float fadeLevel = StarkScene->getFadeLevel();
	if ((1.0f - fadeLevel) > 0.00001f) {
		_fadeRenderer->render(fadeLevel);
	}
}
Exemple #4
0
void GameWindow::onRender() {
	// List the items to render
	Resources::Location *location = StarkGlobal->getCurrent()->getLocation();
	_renderEntries = location->listRenderEntries();
	Gfx::LightEntryArray lightEntries = location->listLightEntries();

	// Render all the scene items
	Gfx::RenderEntryArray::iterator element = _renderEntries.begin();
	while (element != _renderEntries.end()) {
		// Draw the current element
		(*element)->render(lightEntries);

		// Go for the next one
		element++;
	}

	float fadeLevel = StarkScene->getFadeLevel();
	if ((1.0f - fadeLevel) > 0.00001f) {
		_fadeRenderer->render(fadeLevel);
	}
}
Exemple #5
0
bool Console::Cmd_TestDecompiler(int argc, const char **argv) {
	_testDecompilerTotalScripts = 0;
	_testDecompilerOKScripts = 0;

	ArchiveLoader *archiveLoader = new ArchiveLoader();

	// Temporarily replace the global archive loader with our instance
	ArchiveLoader *gameArchiveLoader = StarkArchiveLoader;
	StarkArchiveLoader = archiveLoader;

	archiveLoader->load("x.xarc");
	Resources::Root *root = archiveLoader->useRoot<Resources::Root>("x.xarc");

	// Find all the levels
	Common::Array<Resources::Level *> levels = root->listChildren<Resources::Level>();

	// Loop over the levels
	for (uint i = 0; i < levels.size(); i++) {
		Resources::Level *level = levels[i];

		Common::String levelArchive = archiveLoader->buildArchiveName(level);
		debug("%s - %s", levelArchive.c_str(), level->getName().c_str());

		// Load the detailed level archive
		archiveLoader->load(levelArchive);
		level = archiveLoader->useRoot<Resources::Level>(levelArchive);

		// Decompile all the scripts in the level archive
		decompileScriptChildren(level);

		Common::Array<Resources::Location *> locations = level->listChildren<Resources::Location>();

		// Loop over the locations
		for (uint j = 0; j < locations.size(); j++) {
			Resources::Location *location = locations[j];

			Common::String locationArchive = archiveLoader->buildArchiveName(level, location);
			debug("%s - %s", locationArchive.c_str(), location->getName().c_str());

			// Load the detailed location archive
			archiveLoader->load(locationArchive);
			location = archiveLoader->useRoot<Resources::Location>(locationArchive);

			// Decompile all the scripts in the location archive
			decompileScriptChildren(location);

			archiveLoader->returnRoot(locationArchive);
			archiveLoader->unloadUnused();
		}

		archiveLoader->returnRoot(levelArchive);
		archiveLoader->unloadUnused();
	}

	// Restore the global archive loader
	StarkArchiveLoader = gameArchiveLoader;

	delete archiveLoader;

	debugPrintf("Successfully decompiled %d scripts out of %d\n", _testDecompilerOKScripts, _testDecompilerTotalScripts);

	return true;
}
void ResourceProvider::setScrollInitialPosition() {
	Current *current = _global->getCurrent();
	Resources::Location *location = current->getLocation();
	location->scrollToCharacterImmediate();
}