SAGA2: Load schemeList with stream

This commit is contained in:
a/ 2021-06-17 18:58:03 +09:00 committed by Eugene Sandulenko
parent 796c3a0f7d
commit 127299672b
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
4 changed files with 8 additions and 7 deletions

View File

@ -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);
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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