aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/smush/codec47.cpp71
1 files changed, 9 insertions, 62 deletions
diff --git a/scumm/smush/codec47.cpp b/scumm/smush/codec47.cpp
index bb2c564ab6..b920f91f1e 100644
--- a/scumm/smush/codec47.cpp
+++ b/scumm/smush/codec47.cpp
@@ -223,61 +223,6 @@ static int16 codec47_table[] = {
-6, 43, 1, 43, 0, 0, 0, 0, 0, 0
};
-static const uint32 codec47_delta[] = {
- 0x0, 0x1010101, 0x2020202, 0x3030303, 0x4040404,
- 0x5050505, 0x6060606, 0x7070707, 0x8080808, 0x9090909,
- 0x0A0A0A0A, 0x0B0B0B0B, 0x0C0C0C0C, 0x0D0D0D0D, 0x0E0E0E0E,
- 0x0F0F0F0F, 0x10101010, 0x11111111, 0x12121212, 0x13131313,
- 0x14141414, 0x15151515, 0x16161616, 0x17171717, 0x18181818,
- 0x19191919, 0x1A1A1A1A, 0x1B1B1B1B, 0x1C1C1C1C, 0x1D1D1D1D,
- 0x1E1E1E1E, 0x1F1F1F1F, 0x20202020, 0x21212121, 0x22222222,
- 0x23232323, 0x24242424, 0x25252525, 0x26262626, 0x27272727,
- 0x28282828, 0x29292929, 0x2A2A2A2A, 0x2B2B2B2B, 0x2C2C2C2C,
- 0x2D2D2D2D, 0x2E2E2E2E, 0x2F2F2F2F, 0x30303030, 0x31313131,
- 0x32323232, 0x33333333, 0x34343434, 0x35353535, 0x36363636,
- 0x37373737, 0x38383838, 0x39393939, 0x3A3A3A3A, 0x3B3B3B3B,
- 0x3C3C3C3C, 0x3D3D3D3D, 0x3E3E3E3E, 0x3F3F3F3F, 0x40404040,
- 0x41414141, 0x42424242, 0x43434343, 0x44444444, 0x45454545,
- 0x46464646, 0x47474747, 0x48484848, 0x49494949, 0x4A4A4A4A,
- 0x4B4B4B4B, 0x4C4C4C4C, 0x4D4D4D4D, 0x4E4E4E4E, 0x4F4F4F4F,
- 0x50505050, 0x51515151, 0x52525252, 0x53535353, 0x54545454,
- 0x55555555, 0x56565656, 0x57575757, 0x58585858, 0x59595959,
- 0x5A5A5A5A, 0x5B5B5B5B, 0x5C5C5C5C, 0x5D5D5D5D, 0x5E5E5E5E,
- 0x5F5F5F5F, 0x60606060, 0x61616161, 0x62626262, 0x63636363,
- 0x64646464, 0x65656565, 0x66666666, 0x67676767, 0x68686868,
- 0x69696969, 0x6A6A6A6A, 0x6B6B6B6B, 0x6C6C6C6C, 0x6D6D6D6D,
- 0x6E6E6E6E, 0x6F6F6F6F, 0x70707070, 0x71717171, 0x72727272,
- 0x73737373, 0x74747474, 0x75757575, 0x76767676, 0x77777777,
- 0x78787878, 0x79797979, 0x7A7A7A7A, 0x7B7B7B7B, 0x7C7C7C7C,
- 0x7D7D7D7D, 0x7E7E7E7E, 0x7F7F7F7F, 0x80808080, 0x81818181,
- 0x82828282, 0x83838383, 0x84848484, 0x85858585, 0x86868686,
- 0x87878787, 0x88888888, 0x89898989, 0x8A8A8A8A, 0x8B8B8B8B,
- 0x8C8C8C8C, 0x8D8D8D8D, 0x8E8E8E8E, 0x8F8F8F8F, 0x90909090,
- 0x91919191, 0x92929292, 0x93939393, 0x94949494, 0x95959595,
- 0x96969696, 0x97979797, 0x98989898, 0x99999999, 0x9A9A9A9A,
- 0x9B9B9B9B, 0x9C9C9C9C, 0x9D9D9D9D, 0x9E9E9E9E, 0x9F9F9F9F,
- 0x0A0A0A0A0, 0x0A1A1A1A1, 0x0A2A2A2A2, 0x0A3A3A3A3, 0x0A4A4A4A4,
- 0x0A5A5A5A5, 0x0A6A6A6A6, 0x0A7A7A7A7, 0x0A8A8A8A8, 0x0A9A9A9A9,
- 0x0AAAAAAAA, 0x0ABABABAB, 0x0ACACACAC, 0x0ADADADAD, 0x0AEAEAEAE,
- 0x0AFAFAFAF, 0x0B0B0B0B0, 0x0B1B1B1B1, 0x0B2B2B2B2, 0x0B3B3B3B3,
- 0x0B4B4B4B4, 0x0B5B5B5B5, 0x0B6B6B6B6, 0x0B7B7B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ec47_subgfx_lev3() {
- int32 tmp, tmp2;
+ int32 tmp2;
byte code = *d_src;
if (code < 0xF8) {
d_src++;
@@ -775,7 +720,8 @@ static void codec47_subgfx_lev3() {
return;
}
if (code == 0xFE) {
- int32 val = codec47_delta[*(d_src + 1)];
+ byte t = *(d_src + 1);
+ int32 val = t << 24 | t << 16 | t << 8 | t;
d_src += 2;
*(uint32*)(d_dst + (d_pitch * 0)) = val;
*(uint32*)(d_dst + (d_pitch * 1)) = val;
@@ -812,9 +758,9 @@ static void codec47_subgfx_lev3() {
*(uint32*)(d_dst + (d_pitch * 1)) = *(uint32*)(d_dst + (d_pitch * 1) + tmp2);
return;
}
- tmp = *(codec47_decode2_param_ptr + code);
d_src++;
- int32 val = codec47_delta[tmp];
+ byte t = *(codec47_decode2_param_ptr + code);
+ int32 val = t << 24 | t << 16 | t << 8 | t;
*(uint32*)(d_dst + (d_pitch * 0)) = val;
*(uint32*)(d_dst + (d_pitch * 1)) = val;
*(uint32*)(d_dst + (d_pitch * 2)) = val;
@@ -860,7 +806,8 @@ static void codec47_subgfx_lev2() {
return;
}
if (code == 0xFE) {
- int32 val = codec47_delta[*(d_src + 1)];
+ byte t = *(d_src + 1);
+ int32 val = t << 24 | t << 16 | t << 8 | t;
d_src += 2;
byte * dst2 = d_dst + d_pitch * 4;
*(uint32*)(dst2 + (d_pitch * 0)) = val;
@@ -926,9 +873,9 @@ static void codec47_subgfx_lev2() {
*(uint32*)(d_dst + (d_pitch * 3) + 4) = *(uint32*)(d_dst + (d_pitch * 3) + 4 + tmp2);
return;
}
- tmp = *(codec47_decode2_param_ptr + code);
d_src++;
- int32 val = codec47_delta[tmp];
+ byte t = *(codec47_decode2_param_ptr + code);
+ int32 val = t << 24 | t << 16 | t << 8 | t;
byte * dst2 = d_dst + d_pitch * 4;
*(uint32*)(dst2 + (d_pitch * 0)) = val;
*(uint32*)(d_dst + (d_pitch * 0)) = val;