aboutsummaryrefslogtreecommitdiff
path: root/scumm/smush
diff options
context:
space:
mode:
authorPaweł Kołodziejski2003-11-16 20:52:57 +0000
committerPaweł Kołodziejski2003-11-16 20:52:57 +0000
commitd5eddef057f1e39c2685304502a7cf2753d5bb65 (patch)
tree27db48606bf0c6402b6cf9c0f13df5235b929fc2 /scumm/smush
parenta169876a2f450eb022fb35ad16f3546ee4003f38 (diff)
downloadscummvm-rg350-d5eddef057f1e39c2685304502a7cf2753d5bb65.tar.gz
scummvm-rg350-d5eddef057f1e39c2685304502a7cf2753d5bb65.tar.bz2
scummvm-rg350-d5eddef057f1e39c2685304502a7cf2753d5bb65.zip
changed some shift operators to *, /
svn-id: r11315
Diffstat (limited to 'scumm/smush')
-rw-r--r--scumm/smush/codec37.cpp6
-rw-r--r--scumm/smush/codec47.cpp6
-rw-r--r--scumm/smush/imuse_channel.cpp4
-rw-r--r--scumm/smush/smush_font.cpp2
-rw-r--r--scumm/smush/smush_player.cpp6
5 files changed, 12 insertions, 12 deletions
diff --git a/scumm/smush/codec37.cpp b/scumm/smush/codec37.cpp
index 0a748036a4..20ab542985 100644
--- a/scumm/smush/codec37.cpp
+++ b/scumm/smush/codec37.cpp
@@ -243,7 +243,7 @@ void Codec37Decoder::maketable(int pitch, int index) {
assert(index + 254 < (int32)(sizeof(maketable_bytes) / 2));
for (int32 i = 0; i < 255; i++) {
- int32 j = (i + index) << 1;
+ int32 j = (i + index) * 2;
_offsetTable[i] = maketable_bytes[j + 1] * pitch + maketable_bytes[j];
}
}
@@ -443,8 +443,8 @@ void Codec37Decoder::proc4WithoutFDFE(byte *dst, const byte *src, int32 next_off
}
void Codec37Decoder::decode(byte *dst, const byte *src) {
- int32 bw = (_width + 3) >> 2, bh = (_height + 3) >> 2;
- int32 pitch = bw << 2;
+ int32 bw = (_width + 3) / 4, bh = (_height + 3) / 4;
+ int32 pitch = bw * 4;
int16 seq_nb = READ_LE_UINT16(src + 2);
int32 decoded_size = READ_LE_UINT32(src + 4);
diff --git a/scumm/smush/codec47.cpp b/scumm/smush/codec47.cpp
index e331f95f92..d68392efb6 100644
--- a/scumm/smush/codec47.cpp
+++ b/scumm/smush/codec47.cpp
@@ -309,7 +309,7 @@ void Codec47Decoder::makeTables47(int width) {
int16 tmp;
for (int l = 0; l < 512; l += 2) {
- _table[l >> 1] = (int16)(codec47_table[l + 1] * width + codec47_table[l]);
+ _table[l / 2] = (int16)(codec47_table[l + 1] * width + codec47_table[l]);
}
a = 0;
@@ -496,8 +496,8 @@ void Codec47Decoder::level1(byte *d_dst) {
void Codec47Decoder::decode2(byte *dst, const byte *src, int width, int height, const byte *param_ptr) {
_d_src = src;
_paramPtr = param_ptr - 0xf8;
- int bw = (width + 7) >> 3;
- int bh = (height + 7) >> 3;
+ int bw = (width + 7) / 8;
+ int bh = (height + 7) / 8;
int next_line = width * 7;
_d_pitch = width;
diff --git a/scumm/smush/imuse_channel.cpp b/scumm/smush/imuse_channel.cpp
index 8b99a44935..c599191da1 100644
--- a/scumm/smush/imuse_channel.cpp
+++ b/scumm/smush/imuse_channel.cpp
@@ -58,8 +58,8 @@ bool ImuseChannel::setParameters(int32 nb, int32 size, int32 flags, int32 unk1)
// 2 - Background music
// 0, 3-511 - SFX and volume
// FIXME: this should be better
- if ((flags != 1) && (flags != 2) && ((flags >> 2) != 0)) {
- _volume = 300 - ((flags >> 3) << 2);
+ if ((flags != 1) && (flags != 2) && ((flags / 4) != 0)) {
+ _volume = 300 - ((flags / 8) * 4);
}
else {
_volume = 127;
diff --git a/scumm/smush/smush_font.cpp b/scumm/smush/smush_font.cpp
index 90a1738fd3..67526dbc5e 100644
--- a/scumm/smush/smush_font.cpp
+++ b/scumm/smush/smush_font.cpp
@@ -304,7 +304,7 @@ void SmushFont::drawStringWrapCentered(const char *str, byte *buffer, int dst_wi
y = dst_height - height;
}
- max_width = (max_width + 1) >> 1;
+ max_width = (max_width + 1) / 2;
x = left + width / 2;
if (x < left + max_width)
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp
index 1326d9683f..d7ce370c9a 100644
--- a/scumm/smush/smush_player.cpp
+++ b/scumm/smush/smush_player.cpp
@@ -446,7 +446,7 @@ void SmushPlayer::handleImuseAction(Chunk &b) {
d_src2 += 2;
int32 count = 1024;
byte variable1 = *d_src2++;
- byte variable2 = variable1 >> 4;
+ byte variable2 = variable1 / 16;
variable1 &= 0x0f;
do {
value = *(d_src2++);
@@ -464,7 +464,7 @@ void SmushPlayer::handleImuseAction(Chunk &b) {
*dst++ = *d_src2++;
} else {
int16 val = (int8)value << variable1;
- *dst++ = val>> 8;
+ *dst++ = val >> 8;
*dst++ = (byte)(val);
}
} while (--count);
@@ -640,7 +640,7 @@ void SmushPlayer::readPalette(byte *out, Chunk &in) {
}
static byte delta_color(byte org_color, int16 delta_color) {
- int t = ((org_color << 7) + org_color + delta_color) >> 7;
+ int t = (org_color * 129 + delta_color) / 128;
if (t > 255)
t = 255;
if (t < 0)