aboutsummaryrefslogtreecommitdiff
path: root/engines/cine
diff options
context:
space:
mode:
authorKari Salminen2008-08-17 20:53:18 +0000
committerKari Salminen2008-08-17 20:53:18 +0000
commit95aa2ce56f9e16b1ab76faebe4b4c25ed4625975 (patch)
treee5dd68726a1123b9064c0367f931afcc83b7d094 /engines/cine
parent19b6334418e403491796a398b615a512aad04c5a (diff)
downloadscummvm-rg350-95aa2ce56f9e16b1ab76faebe4b4c25ed4625975.tar.gz
scummvm-rg350-95aa2ce56f9e16b1ab76faebe4b4c25ed4625975.tar.bz2
scummvm-rg350-95aa2ce56f9e16b1ab76faebe4b4c25ed4625975.zip
Added some documentation about how data is unpacked in gfxConvertSpriteToRaw (Learned this from trying to implement convertPI1_2 i.e. gfxConvertSpriteToRaw myself to see if that was the problem with the Operation Stealth's labyrinth arcade sequence).
svn-id: r33976
Diffstat (limited to 'engines/cine')
-rw-r--r--engines/cine/gfx.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 5aa94d8b7f..5a94d57311 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -1667,6 +1667,16 @@ void gfxResetRawPage(byte *pageRaw) {
}
void gfxConvertSpriteToRaw(byte *dst, const byte *src, uint16 w, uint16 h) {
+ // Output is 4 bits per pixel.
+ // Pixels are in 16 pixel chunks (8 bytes of source per 16 pixels of output).
+ // The source data is interleaved so that
+ // 1st big-endian 16-bit value contains all bit position 0 values for 16 pixels,
+ // 2nd big-endian 16-bit value contains all bit position 1 values for 16 pixels,
+ // 3rd big-endian 16-bit value contains all bit position 2 values for 16 pixels,
+ // 4th big-endian 16-bit value contains all bit position 3 values for 16 pixels.
+ // 1st pixel's bits are in the 16th bits,
+ // 2nd pixel's bits are in the 15th bits,
+ // 3rd pixel's bits are in the 14th bits etc.
for (int y = 0; y < h; ++y) {
for (int x = 0; x < w / 8; ++x) {
for (int bit = 0; bit < 16; ++bit) {