Beispiel #1
0
void Scene::loadAnimation(const Common::String &resName, int trigger) {
	// WORKAROUND: If there's already a previous active animation used by the
	// scene, then free it before we create the new one
	if (_activeAnimation)
		freeAnimation();

	DepthSurface depthSurface;
	UserInterface interfaceSurface(_vm);

	_activeAnimation = Animation::init(_vm, this);
	_activeAnimation->load(interfaceSurface, depthSurface, resName,
		_vm->_dithering ? ANIMFLAG_DITHER : 0, nullptr, nullptr);
	_activeAnimation->startAnimation(trigger);
}
Beispiel #2
0
int Scene::loadAnimation(const Common::String &resName, int trigger) {
	// WORKAROUND: If there's already a previous active animation used by the
	// scene, then free it before we create the new one
	if ((_vm->getGameID() == GType_RexNebular) && _animation[0])
		freeAnimation(0);

	DepthSurface depthSurface;
	UserInterface interfaceSurface(_vm);

	for (int i = 0; i < 10; i++) {
		if (!_animation[i]) {
			_animation[i] = Animation::init(_vm, this);
			_animation[i]->load(interfaceSurface, depthSurface, resName,
				_vm->_dithering ? ANIMFLAG_DITHER : 0, nullptr, nullptr);
			_animation[i]->startAnimation(trigger);

			return i;
		}
	}

	error("Unable to find an available animation slot");

	return -1;
}