aboutsummaryrefslogtreecommitdiff
path: root/saga/scene.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'saga/scene.cpp')
-rw-r--r--saga/scene.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/saga/scene.cpp b/saga/scene.cpp
index a4244a6b5f..1a852b65e2 100644
--- a/saga/scene.cpp
+++ b/saga/scene.cpp
@@ -730,7 +730,7 @@ int Scene::loadSceneResourceList(uint32 reslist_rn) {
int Scene::processSceneResources() {
byte *resourceData;
- size_t resourceDataLength;
+ uint16 resourceDataLength;
const byte *pal_p;
int i;
@@ -863,6 +863,22 @@ int Scene::processSceneResources() {
case SAGA_FACES:
_vm->_interface->loadScenePortraits(_resList[i].res_number);
break;
+ case SAGA_PALETTE:
+ {
+ PALENTRY pal[PAL_ENTRIES];
+ byte *palPtr = resourceData;
+
+ if (resourceDataLength < 3 * PAL_ENTRIES)
+ error("Too small scene palette: %d", resourceDataLength);
+
+ for (uint16 c = 0; c < PAL_ENTRIES; c++) {
+ pal[c].red = *palPtr++;
+ pal[c].green = *palPtr++;
+ pal[c].blue = *palPtr++;
+ }
+ _vm->_gfx->setPalette(pal);
+ }
+ break;
default:
warning("Scene::ProcessSceneResources(): Encountered unknown resource type: %d", _resList[i].res_type);
break;