mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-05 00:36:57 +00:00
DIRECTOR: Refactor scoreCachedPaletteId
to frames loading
Move caching logic of scoreCachedPaletteId from Score to Frame.
This commit is contained in:
parent
e13eba2162
commit
b1da9423b9
@ -210,6 +210,8 @@ void Frame::readMainChannelsD2(Common::MemoryReadStreamEndian &stream, uint16 of
|
||||
} else {
|
||||
_mainChannels.palette.paletteId = CastMemberID(paletteId, DEFAULT_CAST_LIB);
|
||||
}
|
||||
if (!_mainChannels.palette.paletteId.isNull())
|
||||
_mainChannels.scoreCachedPaletteId = _mainChannels.palette.paletteId;
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
@ -463,6 +465,8 @@ void Frame::readMainChannelsD4(Common::MemoryReadStreamEndian &stream, uint16 of
|
||||
} else {
|
||||
_mainChannels.palette.paletteId = CastMemberID(paletteId, DEFAULT_CAST_LIB);
|
||||
}
|
||||
if (!_mainChannels.palette.paletteId.isNull())
|
||||
_mainChannels.scoreCachedPaletteId = _mainChannels.palette.paletteId;
|
||||
}
|
||||
break;
|
||||
case 22:
|
||||
@ -740,6 +744,8 @@ void Frame::readMainChannelsD5(Common::MemoryReadStreamEndian &stream, uint16 of
|
||||
int16 paletteCastLib = stream.readSint16();
|
||||
int16 paletteId = stream.readSint16(); // 26
|
||||
_mainChannels.palette.paletteId = CastMemberID(paletteId, paletteCastLib);
|
||||
if (!_mainChannels.palette.paletteId.isNull())
|
||||
_mainChannels.scoreCachedPaletteId = _mainChannels.palette.paletteId;
|
||||
}
|
||||
break;
|
||||
case 28:
|
||||
|
@ -1528,12 +1528,6 @@ bool Score::readOneFrame() {
|
||||
debugC(4, kDebugLoading, "%s", _currentFrame->formatChannelInfo().c_str());
|
||||
}
|
||||
|
||||
// Precache the current palette ID, as this carries forward to frames to the right
|
||||
// of the instruction
|
||||
if (!_currentFrame->_mainChannels.palette.paletteId.isNull())
|
||||
_currentPaletteId = _currentFrame->_mainChannels.palette.paletteId;
|
||||
_currentFrame->_mainChannels.scoreCachedPaletteId = _currentPaletteId;
|
||||
|
||||
debugC(8, kDebugLoading, "Score::readOneFrame(): Frame %d actionId: %s", _curFrameNumber, _currentFrame->_mainChannels.actionId.asString().c_str());
|
||||
return true;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user