コード例 #1
0
ファイル: command.cpp プロジェクト: Botje/residualvm
void DefinitionRegistry::registerReference(const ResourceReference &reference) {
	if (!reference.canResolve()) {
		// The reference uses archives that are not currently loaded
		return;
	}

	Resources::Object *object = reference.resolve<Resources::Object>();
	if (!_definitions.contains(object)) {
		// TODO: There is no guarantee the definition is unique
		_definitions[object] = object->getType().getName() + stringToCamelCase(object->getName());;
	}
}
コード例 #2
0
ファイル: console.cpp プロジェクト: Botje/residualvm
bool Console::Cmd_ListScripts(int argc, const char **argv) {
	Common::Array<Resources::Script *> scripts = listAllLocationScripts();

	for (uint i = 0; i < scripts.size(); i++) {
		Resources::Script *script = scripts[i];

		debugPrintf("%d: %s - enabled: %d", i, script->getName().c_str(), script->isEnabled());

		// Print which resource is causing the script to wait
		if (script->isSuspended()) {
			Resources::Object *suspending = script->getSuspendingResource();
			if (suspending) {
				debugPrintf(", waiting for: %s (%s)", suspending->getName().c_str(), suspending->getType().getName());
			} else {
				debugPrintf(", paused");
			}
		}

		debugPrintf("\n");
	}

	return true;
}