aboutsummaryrefslogtreecommitdiff
path: root/kyra/palette.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2005-07-30 21:11:48 +0000
committerEugene Sandulenko2005-07-30 21:11:48 +0000
commit6b4484472b79dc7ea7d1ce545a28fba7d3b7696f (patch)
treec44c4e61f18ddd537f7082cb48869cf33d422fbd /kyra/palette.cpp
parent86ab70b149e5cd00cf54f2e41896e2c4e16795e4 (diff)
downloadscummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.tar.gz
scummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.tar.bz2
scummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.zip
Remove trailing whitespaces.
svn-id: r18604
Diffstat (limited to 'kyra/palette.cpp')
-rw-r--r--kyra/palette.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/kyra/palette.cpp b/kyra/palette.cpp
index 9136666634..b1099f72dc 100644
--- a/kyra/palette.cpp
+++ b/kyra/palette.cpp
@@ -31,39 +31,39 @@ Palette::Palette(uint8* data, uint32 size) {
if (!data) {
error("resource created without data");
}
-
+
if (size != 768) {
Common::MemoryReadStream datastream(data, size);
-
+
datastream.readSint32LE();
int imageSize = datastream.readSint16LE();
-
+
if (imageSize != 768) {
error("decompresed palette is not 768 byte long!");
}
-
+
// lets uncompress this palette :)
_palette = new uint8[imageSize];
assert(_palette);
-
+
// made decompression
if (Compression::decode80(data + 10, _palette) != 768) {
error("decode80 decompressesize != 768 bytes");
}
-
+
delete [] data;
data = _palette;
}
-
+
// hmm.. common/system.h Docu is wrong or SDL Backend has a bug :)
// a palette should have this order:
// R1-G1-B1-A1-R2-G2-B2-A2-...
// so we need 4 bytes per color
_palette = new uint8[256 * 4];
-
+
uint8* currentpossrc = &data[0];
uint8* currentposdst = &_palette[0];
-
+
// creates the original pallette (only first 6 bits are used)
for (uint32 i = 0; i < 256; i++) {
currentposdst[0] = currentpossrc[0] << 2;
@@ -72,7 +72,7 @@ Palette::Palette(uint8* data, uint32 size) {
currentpossrc += 3;
currentposdst += 4;
}
-
+
delete [] data;
}