Example #1
0
void Menu::loadMenuSelect(uint16 item) {
	// Selecting twice the same item loads it
	if (item == _vm->_state->getMenuSaveLoadSelectedItem()) {
		loadMenuLoad();
		return;
	}

	_vm->_state->setMenuSaveLoadSelectedItem(item);
	int16 page = _vm->_state->getMenuSaveLoadCurrentPage();

	uint16 index = page * 7 + item;

	assert(index < _saveLoadFiles.size());
	Common::String filename = _saveLoadFiles[index];

	// Extract the age to load from the savegame
	GameState *gameState = new GameState(_vm);
	gameState->load(filename);
	_saveLoadAgeName = getAgeLabel(gameState);
	delete gameState;

	// Extract the thumbnail from the save
	Common::InSaveFile *save = _vm->getSaveFileManager()->openForLoading(filename);
	saveGameReadThumbnail(save);
	delete save;
}
Example #2
0
void Menu::loadMenuSelect(uint16 item) {
	// Selecting twice the same item loads it
	if (item == _vm->_state->getMenuSaveLoadSelectedItem()) {
		loadMenuLoad();
		return;
	}

	_vm->_state->setMenuSaveLoadSelectedItem(item);
	int16 page = _vm->_state->getMenuSaveLoadCurrentPage();

	uint16 index = page * 7 + item;

	assert(index < _saveLoadFiles.size());
	Common::String filename = _saveLoadFiles[index];

	// Extract the age to load from the savegame
	GameState *gameState = new GameState(_vm);
	gameState->load(filename);

	// Update the age name
	_saveLoadAgeName = getAgeLabel(gameState);

	// Update the save thumbnail
	if (_saveLoadSpotItem)
		_saveLoadSpotItem->updateData(gameState->getSaveThumbnail());

	delete gameState;
}
Example #3
0
void Menu::saveMenuOpen() {
	_saveLoadFiles = _vm->getSaveFileManager()->listSavefiles("*.m3s");

	// The saves are sorted alphabetically
	Common::sort(_saveLoadFiles.begin(), _saveLoadFiles.end());

	_saveLoadAgeName = getAgeLabel(_vm->_state);
	_saveCaretCounter = kCaretSpeed;

	_vm->_state->setMenuSaveLoadCurrentPage(0);
	saveLoadUpdateVars();

	// Update the thumbnail to display
	if (_saveLoadSpotItem && _saveThumb)
		_saveLoadSpotItem->updateData((uint8 *)_saveThumb->pixels);
}