예제 #1
0
Parallaction_br::~Parallaction_br() {
	freeFonts();
	freeCharacter();

	destroyInventory();

	delete _objects;

	delete _locationParser;
	delete _programParser;

	_location._animations.remove(_char._ani);

	delete _walker;
}
예제 #2
0
void Parallaction_br::cleanupGame() {
	freeLocation(true);

	freeCharacter();

	delete _globalFlagsNames;
	delete _objectsNames;
	delete _countersNames;

	_globalFlagsNames = 0;
	_objectsNames = 0;
	_countersNames = 0;

	_numLocations = 0;
	_globalFlags = 0;
	memset(_localFlags, 0, sizeof(_localFlags));
	memset(_locationNames, 0, sizeof(_locationNames));
	memset(_zoneFlags, 0, sizeof(_zoneFlags));
}
예제 #3
0
Parallaction_ns::~Parallaction_ns() {
	freeFonts();

	// TODO: we may want to add a ~Character instead
	freeCharacter();
	_char._ani.reset();

	destroyInventory();

	delete _locationParser;
	delete _programParser;
	freeLocation(true);

	_location._animations.remove(_char._ani);

	delete _walker;

	destroyTestResultLabels();
}
예제 #4
0
void Parallaction_br::changeCharacter(const char *name) {

	const char *charName = _char.getName();

	if (scumm_stricmp(charName, name)) {
		freeCharacter();

		debugC(1, kDebugExec, "changeCharacter(%s)", name);

		_char.setName(name);
		_char._ani->gfxobj = _gfx->loadCharacterAnim(name);
		_char._talk = _disk->loadTalk(name);

		/* TODO: adjust inventories as following
		 * 1) if not on game load, then copy _inventory to the right slot of _charInventories
		 * 2) copy the new inventory from the right slot of _charInventories
		 */
	}

	_char._ani->_flags |= kFlagsActive;
}
예제 #5
0
void Parallaction_ns::changeCharacter(const char *name) {
	debugC(1, kDebugExec, "changeCharacter(%s)", name);

	_char.setName(name);

	if (!scumm_stricmp(_char.getFullName(), _characterName1)) {
		debugC(3, kDebugExec, "changeCharacter: nothing done");
		return;
	}

	freeCharacter();

	_char._ani->gfxobj = _gfx->loadCharacterAnim(_char.getFullName());

	if (!_char.dummy()) {
		_char._head = _disk->loadHead(_char.getBaseName());
		_char._talk = _disk->loadTalk(_char.getBaseName());
		_objects = _disk->loadObjects(_char.getBaseName());
		_objectsNames = _disk->loadTable(_char.getBaseName());

		if (!_intro) {
			// prevent music changes during the introduction
			_soundManI->playCharacterMusic(_char.getBaseName());
		}

		// The original engine used to reload 'common' only on loadgames. We are reloading here since 'common'
		// contains character specific stuff. This causes crashes like bug #1816899, because parseLocation tries
		// to reload scripts but the data archive selected is occasionally wrong. This has been solved by having
		// parseLocation only load scripts when they aren't already loaded - which it should have done since the
		// beginning nevertheless.
		if (!(getFeatures() & GF_DEMO))
			parseLocation("common");
	}

	strcpy(_characterName1, _char.getFullName());

	debugC(3, kDebugExec, "changeCharacter: switch completed");

	return;
}