Skip to content
Permalink
Browse files

SUPERNOVA: Convert 18bit VGA to 24bit CLUT8

Colors on VGA are 6bit per color channel, that is why the colors
were so dark in earlier commits. Shifting the colors left by 2 gives us
an approximated value for CLUT8.
  • Loading branch information...
Joefish committed Jun 12, 2017
1 parent de8ab9b commit cdc59551f77018a87767e209b6cb7e30646ad82d
Showing with 4 additions and 8 deletions.
  1. +4 −8 engines/supernova/graphics.cpp
@@ -36,19 +36,15 @@ bool MSNImageDecoder::loadStream(Common::SeekableReadStream &stream) {
byte flag = stream.readByte();
if (flag == 0) {
pal_diff = 0;
_palette[141] = 0x38;
_palette[142] = 0x38;
_palette[143] = 0x38;
_palette[141] = 0xE0;
_palette[142] = 0xE0;
_palette[143] = 0xE0;
} else {
pal_diff = 1;
for (int i = flag * 3; i != 0; --i) {
_palette[717 - i] = stream.readByte();
_palette[717 - i] = stream.readByte() << 2;
}
}
// 18bit VGA to 24bit CLUT8
for (size_t i = 0; i < 717; ++i) {
_palette[i] <<= 2;
}

byte numSections = stream.readByte();
for (size_t i = 0; i < kMaxSections; ++i) {

0 comments on commit cdc5955

Please sign in to comment.
You can’t perform that action at this time.