From 81e0dd1444ea2550800d344a03cccbc8135054c1 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sat, 18 Jun 2011 16:32:59 +0200 Subject: SCUMM: regenerate 16bit palette after loading a savegame in LOOM PCE (this avoids isssues when using savegames from different ports with different 16bit color modes) --- engines/scumm/saveload.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'engines/scumm') diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 2be032d496..f9a6b211c3 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -1497,6 +1497,16 @@ void ScummEngine_v5::saveOrLoad(Serializer *s) { resetCursors(); } } + + // Regenerate 16bit palette after loading. + // This avoids color issues when loading savegames that have been saved with a different ScummVM port + // that uses a different 16bit color mode than the ScummVM port which is currently used. +#ifdef USE_RGB_COLOR + if (_game.platform == Common::kPlatformPCEngine && s->isLoading()) { + for (int i = 0; i < 256; ++i) + _16BitPalette[i] = get16BitColor(_currentPalette[i * 3 + 0], _currentPalette[i * 3 + 1], _currentPalette[i * 3 + 2]); + } +#endif } #ifdef ENABLE_SCUMM_7_8 -- cgit v1.2.3