aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/graphics.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2008-07-28 06:06:35 +0000
committerNicola Mettifogo2008-07-28 06:06:35 +0000
commitdf50b8ee68fd24afcdf4c882d653fbd9d78a3e0e (patch)
tree4c82842212d5c2e6d449a434c0af53922c08590e /engines/parallaction/graphics.cpp
parent1d1fc64c663060888347fa4c4efc4402c3f755d2 (diff)
downloadscummvm-rg350-df50b8ee68fd24afcdf4c882d653fbd9d78a3e0e.tar.gz
scummvm-rg350-df50b8ee68fd24afcdf4c882d653fbd9d78a3e0e.tar.bz2
scummvm-rg350-df50b8ee68fd24afcdf4c882d653fbd9d78a3e0e.zip
Inventory is now properly rendered. Item selection is not yet working.
svn-id: r33355
Diffstat (limited to 'engines/parallaction/graphics.cpp')
-rw-r--r--engines/parallaction/graphics.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index 7195d1c126..50bf059145 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -153,6 +153,13 @@ void Palette::setEntry(uint index, int red, int green, int blue) {
_data[index*3+2] = blue & 0xFF;
}
+void Palette::getEntry(uint index, int &red, int &green, int &blue) {
+ assert(index < _colors);
+ red = _data[index*3];
+ green = _data[index*3+1];
+ blue = _data[index*3+2];
+}
+
void Palette::makeGrayscale() {
byte v;
for (uint16 i = 0; i < _colors; i++) {
@@ -797,6 +804,14 @@ Gfx::Gfx(Parallaction* vm) :
registerVar("draw_path_zones", 0);
+ if ((_vm->getGameType() == GType_BRA) && (_vm->getPlatform() == Common::kPlatformPC)) {
+ // this loads the backup palette needed by the PC version of BRA (see setBackground()).
+ BackgroundInfo paletteInfo;
+ _disk->loadSlide(paletteInfo, "pointer");
+ _backupPal.clone(paletteInfo.palette);
+ paletteInfo.free();
+ }
+
return;
}
@@ -867,6 +882,18 @@ void Gfx::setBackground(uint type, const char* name, const char* mask, const cha
if (type == kBackgroundLocation) {
_disk->loadScenery(_backgroundInfo, name, mask, path);
+
+ // The PC version of BRA needs the entries 20-31 of the palette to be constant, but
+ // the background resource files are screwed up. The right colors come from an unused
+ // bitmap (pointer.bmp). Nothing is known about the Amiga version so far.
+ if ((_vm->getGameType() == GType_BRA) && (_vm->getPlatform() == Common::kPlatformPC)) {
+ int r, g, b;
+ for (uint i = 16; i < 32; i++) {
+ _backupPal.getEntry(i, r, g, b);
+ _backgroundInfo.palette.setEntry(i, r, g, b);
+ }
+ }
+
setPalette(_backgroundInfo.palette);
_palette.clone(_backgroundInfo.palette);
} else {