mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-10 21:03:31 +00:00
SAGA2: Load schemeList with stream
This commit is contained in:
parent
796c3a0f7d
commit
127299672b
@ -1905,7 +1905,7 @@ void Actor::getColorTranslation(ColorTable map) {
|
||||
if (appearance
|
||||
&& appearance->schemeList) {
|
||||
buildColorTable(map,
|
||||
(appearance->schemeList)[colorScheme].bank,
|
||||
appearance->schemeList->_schemes[colorScheme]->bank,
|
||||
11);
|
||||
} else memcpy(map, identityColors, 256);
|
||||
}
|
||||
|
@ -1194,7 +1194,7 @@ Speech *SpeechTaskList::newTask(ObjectID id, uint16 flags) {
|
||||
else if (a->appearance
|
||||
&& a->appearance->schemeList) {
|
||||
sp->penColor =
|
||||
a->appearance->schemeList[a->colorScheme].speechColor + 9;
|
||||
a->appearance->schemeList->_schemes[a->colorScheme]->speechColor + 9;
|
||||
} else sp->penColor = 4 + 9;
|
||||
} else {
|
||||
sp->penColor = 4 + 9;
|
||||
|
@ -641,6 +641,7 @@ ActorAppearance *LoadActorAppearance(uint32 id, int16 banksNeeded) {
|
||||
const int colorSchemeSize = 44;
|
||||
int poseListSize;
|
||||
int schemeListSize;
|
||||
Common::SeekableReadStream *stream;
|
||||
|
||||
// Search the table for either a matching appearance,
|
||||
// or for an empty one.
|
||||
@ -682,7 +683,7 @@ ActorAppearance *LoadActorAppearance(uint32 id, int16 banksNeeded) {
|
||||
aa->poseList = nullptr;
|
||||
|
||||
if (aa->schemeList)
|
||||
delete[] aa->schemeList;
|
||||
delete aa->schemeList;
|
||||
aa->schemeList = nullptr;
|
||||
|
||||
// Set ID and use count
|
||||
@ -704,9 +705,9 @@ ActorAppearance *LoadActorAppearance(uint32 id, int16 banksNeeded) {
|
||||
error("Could not load scheme list");
|
||||
|
||||
schemeListSize = schemeRes->size(id) / colorSchemeSize;
|
||||
aa->schemeList = new ColorScheme[schemeListSize];
|
||||
for (int i = 0; i < schemeListSize; ++i)
|
||||
readColorScheme(schemeRes, aa->schemeList[i]);
|
||||
stream = loadResourceToStream(schemeRes, id, "scheme list");
|
||||
aa->schemeList = new ColorSchemeList(schemeListSize, stream);
|
||||
delete stream;
|
||||
|
||||
return aa;
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ public:
|
||||
uint32 id;
|
||||
|
||||
ActorAnimSet *poseList; // list of action sequences
|
||||
ColorScheme *schemeList; // color remapping info
|
||||
ColorSchemeList *schemeList; // color remapping info
|
||||
|
||||
// Table of sprite sets. Each entry in the table
|
||||
// represents a different "bank" of sprites
|
||||
|
Loading…
x
Reference in New Issue
Block a user