diff options
-rw-r--r-- | scumm/actor.cpp | 6 | ||||
-rw-r--r-- | scumm/akos.cpp | 6 | ||||
-rw-r--r-- | scumm/bomp.cpp | 10 | ||||
-rw-r--r-- | scumm/bundle.cpp | 58 | ||||
-rw-r--r-- | scumm/camera.cpp | 10 | ||||
-rw-r--r-- | scumm/costume.cpp | 18 | ||||
-rw-r--r-- | scumm/gfx.cpp | 72 | ||||
-rw-r--r-- | scumm/imuse.cpp | 4 | ||||
-rw-r--r-- | scumm/imuse_player.cpp | 2 | ||||
-rw-r--r-- | scumm/object.cpp | 50 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 16 | ||||
-rw-r--r-- | scumm/script_v5.cpp | 14 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 4 | ||||
-rw-r--r-- | scumm/smush/codec37.cpp | 6 | ||||
-rw-r--r-- | scumm/smush/codec47.cpp | 6 | ||||
-rw-r--r-- | scumm/smush/imuse_channel.cpp | 4 | ||||
-rw-r--r-- | scumm/smush/smush_font.cpp | 2 | ||||
-rw-r--r-- | scumm/smush/smush_player.cpp | 6 | ||||
-rw-r--r-- | scumm/string.cpp | 18 | ||||
-rw-r--r-- | scumm/verbs.cpp | 14 |
20 files changed, 163 insertions, 163 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index c38e9833a7..cc3e05a2b5 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -1045,7 +1045,7 @@ void Actor::animateLimb(int limb, int f) { aksq = _vm->findResourceData(MKID('AKSQ'), akos); akfo = _vm->findResourceData(MKID('AKFO'), akos); - size = _vm->getResourceDataSize(akfo) >> 1; + size = _vm->getResourceDataSize(akfo) / 2; while (f--) { if (cost.active[limb] != 0) @@ -1103,10 +1103,10 @@ void ScummEngine::resetActorBgs() { int ScummEngine::getActorFromPos(int x, int y) { int i; - if (!testGfxAnyUsageBits(x >> 3)) + if (!testGfxAnyUsageBits(x / 8)) return 0; for (i = 1; i < _numActors; i++) { - if (testGfxUsageBit(x >> 3, i) && !getClass(i, kObjectClassUntouchable) + if (testGfxUsageBit(x / 8, i) && !getClass(i, kObjectClassUntouchable) && y >= _actors[i].top && y <= _actors[i].bottom) { if (_version > 2 || i != VAR(VAR_EGO)) return i; diff --git a/scumm/akos.cpp b/scumm/akos.cpp index f4459f5def..9dd2d08e2f 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -357,7 +357,7 @@ void AkosRenderer::codec1_genericDecode() { scaleytab = &v1.scaletable[v1.scaleYindex]; maskbit = revBitMask[v1.x & 7]; - mask = v1.mask_ptr + (v1.x >> 3); + mask = v1.mask_ptr + v1.x / 8; if (len) goto StartPos; @@ -418,7 +418,7 @@ void AkosRenderer::codec1_genericDecode() { skip_column = true; v1.scaleXindex += v1.scaleXstep; dst = v1.destptr; - mask = v1.mask_ptr + (v1.x >> 3); + mask = v1.mask_ptr + v1.x / 8; } StartPos:; } while (--len); @@ -1067,7 +1067,7 @@ bool ScummEngine::akos_increaseAnims(const byte *akos, Actor *a) { aksq = findResourceData(MKID('AKSQ'), akos); akfo = findResourceData(MKID('AKFO'), akos); - size = getResourceDataSize(akfo) >> 1; + size = getResourceDataSize(akfo) / 2; result = false; for (i = 0; i < 16; i++) { diff --git a/scumm/bomp.cpp b/scumm/bomp.cpp index 5d94886349..adcebb1a85 100644 --- a/scumm/bomp.cpp +++ b/scumm/bomp.cpp @@ -239,7 +239,7 @@ void ScummEngine::drawBomp(const BompDrawData &bd, bool mirror) { // Also mask against any additionally imposed mask if (bd.maskPtr) { - mask = bd.maskPtr + (bd.y * gdi._numStrips) + ((bd.x + clip_left) >> 3); + mask = bd.maskPtr + (bd.y * gdi._numStrips) + ((bd.x + clip_left) / 8); } // Setup vertical scaling @@ -287,7 +287,7 @@ void ScummEngine::drawBomp(const BompDrawData &bd, bool mirror) { tmp = skip_y_new & skip_y_bits; // Advance the scale-skip bit mask, if it's 0, get the next scale-skip byte - skip_y_bits >>= 1; + skip_y_bits /= 2; if (skip_y_bits == 0) { skip_y_bits = 0x80; skip_y_new = *scalingYPtr++; @@ -357,11 +357,11 @@ int32 setupBompScale(byte *scaling, int32 size, byte scale) { byte ret_value = 0; const int offsets[8] = { 3, 2, 1, 0, 7, 6, 5, 4 }; - count = (256 - (size >> 1)); + count = (256 - size / 2); assert(0 <= count && count < 768); tmp_ptr = defaultScaleTable + count; - count = (size + 7) >> 3; + count = (size + 7) / 8; while (count--) { a = 0; for (int i = 0; i < 8; i++) { @@ -379,7 +379,7 @@ int32 setupBompScale(byte *scaling, int32 size, byte scale) { *(tmp_scaling - 1) |= revBitMask[size & 7]; } - count = (size + 7) >> 3; + count = (size + 7) / 8; while (count--) { tmp = *scaling++; ret_value += bitCount[tmp]; diff --git a/scumm/bundle.cpp b/scumm/bundle.cpp index c9176a1f4f..cf0deae08a 100644 --- a/scumm/bundle.cpp +++ b/scumm/bundle.cpp @@ -125,10 +125,10 @@ void Bundle::initializeImcTables() { int32 imcTable1Pos = 0; do { byte put = 1; - int32 tableValue = ((imcTable[imcTable1Pos] << 2) / 7) >> 1; + int32 tableValue = ((imcTable[imcTable1Pos] * 4) / 7) / 2; if (tableValue != 0) { do { - tableValue >>= 1; + tableValue /= 2; put++; } while (tableValue != 0); } @@ -155,8 +155,8 @@ void Bundle::initializeImcTables() { if ((count & n) != 0) { put += tableValue; } - count >>= 1; - tableValue >>= 1; + count /= 2; + tableValue /= 2; } while (count != 0); _destImcTable2[destTablePos] = put; destTablePos += 64; @@ -526,13 +526,13 @@ int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, s = 0; j = 0; do { - ptr = src + length + (k >> 1); + ptr = src + length + k / 2; if (k & 1) { - r = c >> 3; + r = c / 8; t_table[r + 2] = ((src[j] & 0x0f) << 4) | (ptr[1] >> 4); t_table[r + 1] = (src[j] & 0xf0) | (t_table[r + 1]); } else { - r = s >> 3; + r = s / 8; t_table[r + 0] = ((src[j] & 0x0f) << 4) | (ptr[0] & 0x0f); t_table[r + 1] = src[j] >> 4; } @@ -569,13 +569,13 @@ int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, j = 1; if (t > k) { do { - ptr = src + length + (k >> 1); + ptr = src + length + k / 2; if (k & 1) { - r = c >> 3; + r = c / 8; t_table[r + 0] = (src[j - 1] & 0xf0) | t_table[r]; t_table[r + 1] = ((src[j - 1] & 0x0f) << 4) | (ptr[0] & 0x0f); } else { - r = s >> 3; + r = s / 8; t_table[r + 0] = src[j - 1] >> 4; t_table[r - 1] = ((src[j - 1] & 0x0f) << 4) | (ptr[0] >> 4); } @@ -611,13 +611,13 @@ int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, t = length - 1; if (t > 0) { do { - ptr = src + length + (k >> 1); + ptr = src + length + k / 2; if (k & 1) { - r = s >> 3; + r = s / 8; t_table[r + 2] = (src[j] & 0xf0) | *(t_table + r + 2); t_table[r + 3] = ((src[j] & 0x0f) << 4) | (ptr[0] >> 4); } else { - r = c >> 3; + r = c / 8; t_table[r + 2] = src[j] >> 4; t_table[r + 1] = ((src[j] & 0x0f) << 4) | (ptr[0] & 0x0f); } @@ -663,15 +663,15 @@ int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, c = -12; s = 0; do { - j = length + (k >> 1); + j = length + k / 2; if (k & 1) { - r = c >> 3; + r = c / 8; t_tmp1 = t_table[k]; t_tmp2 = t_table[j + 1]; src[r + 2] = ((t_tmp1 & 0x0f) << 4) | (t_tmp2 >> 4); src[r + 1] = (src[r + 1]) | (t_tmp1 & 0xf0); } else { - r = s >> 3; + r = s / 8; t_tmp1 = t_table[k]; t_tmp2 = t_table[j]; src[r + 0] = ((t_tmp1 & 0x0f) << 4) | (t_tmp2 & 0x0f); @@ -722,15 +722,15 @@ int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, t = length + k; if (t > k) { do { - j = length + (k / 2); + j = length + k / 2; if (k & 1) { - r = c >> 3; + r = c / 8; t_tmp1 = t_table[k - 1]; t_tmp2 = t_table[j]; src[r + 0] = (src[r]) | (t_tmp1 & 0xf0); src[r + 1] = ((t_tmp1 & 0x0f) << 4) | (t_tmp2 & 0x0f); } else { - r = s >> 3; + r = s / 8; t_tmp1 = t_table[k - 1]; t_tmp2 = t_table[j]; src[r + 0] = t_tmp1 >> 4; @@ -779,15 +779,15 @@ int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, t = length - 1; if (t > 0) { do { - j = length + (k >> 1); + j = length + k / 2; if (k & 1) { - r = s >> 3; + r = s / 8; t_tmp1 = t_table[k]; t_tmp2 = t_table[j]; src[r + 2] = (src[r + 2]) | (t_tmp1 & 0xf0); src[r + 3] = ((t_tmp1 & 0x0f) << 4) | (t_tmp2 >> 4); } else { - r = c >> 3; + r = c / 8; t_tmp1 = t_table[k]; t_tmp2 = t_table[j]; src[r + 2] = t_tmp1 >> 4; @@ -842,8 +842,8 @@ int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, left = 0x2000 - firstWord; output_size = left; } else { - left = 0x1000 - (firstWord >> 1); - output_size = left << 1; + left = 0x1000 - firstWord / 2; + output_size = left * 2; } } else { startPos = 1; @@ -875,14 +875,14 @@ int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, if (channels == 2) { if (l == 0) left++; - left >>= 1; + left /= 2; } while (left--) { curTableEntry = _destImcTable[curTablePos]; decompTable = (byte)(curTableEntry - 2); bitMask = 2 << decompTable; - readPos = src + (tableEntrySum >> 3); + readPos = src + tableEntrySum / 8; // FIXME - it seems the decoder often reads exactly one byte too // far - that is, it reads 2 bytes at once, and the second byte @@ -897,7 +897,7 @@ int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, if (readPos + 1 > comp_input + input_size || curTableEntry + (tableEntrySum & 7) > 8) { error("decompressCodec: input buffer overflow: %d bytes over (we need %d bits of data)", - (int)((readPos+1) - (comp_input+input_size))+1, + (int)((readPos + 1) - (comp_input + input_size)) + 1, curTableEntry + (tableEntrySum & 7) ); } @@ -906,7 +906,7 @@ int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, otherTablePos = (byte)(readWord >> (16 - curTableEntry)); tableEntrySum += curTableEntry; esiReg = ((imxShortTable[curTableEntry] & otherTablePos) - << (7 - curTableEntry)) + (curTablePos << 6); + << (7 - curTableEntry)) + (curTablePos * 64); imcTableEntry >>= (curTableEntry - 1); adder = imcTableEntry + _destImcTable2[esiReg]; if ((otherTablePos & bitMask) != 0) { @@ -931,7 +931,7 @@ int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, curTablePos = 0; imcTableEntry = imcTable[curTablePos]; - destPos += channels << 1; + destPos += channels * 2; } } } diff --git a/scumm/camera.cpp b/scumm/camera.cpp index a59bd4ec57..0357392ce9 100644 --- a/scumm/camera.cpp +++ b/scumm/camera.cpp @@ -99,7 +99,7 @@ void ScummEngine::setCameraFollows(Actor *a) { setCameraAt(camera._cur.x, 0); } - t = (a->_pos.x >> 3); + t = a->_pos.x / 8; if (t - _screenStartStrip < camera._leftTrigger || t - _screenStartStrip > camera._rightTrigger) setCameraAt(a->_pos.x, 0); @@ -178,7 +178,7 @@ void ScummEngine::moveCamera() { a = derefActor(camera._follows, "moveCamera"); actorx = a->_pos.x; - t = (actorx >> 3) - _screenStartStrip; + t = actorx / 8 - _screenStartStrip; if (t < camera._leftTrigger || t > camera._rightTrigger) { if (VAR_CAMERA_FAST_X != 0xFF && VAR(VAR_CAMERA_FAST_X)) { @@ -212,7 +212,7 @@ void ScummEngine::moveCamera() { } /* a is set a bit above */ - if (camera._movingToActor && (camera._cur.x >> 3) == (a->_pos.x >> 3)) { + if (camera._movingToActor && (camera._cur.x / 8) == (a->_pos.x / 8)) { camera._movingToActor = false; } @@ -330,13 +330,13 @@ void ScummEngine::cameraMoved() { if (_features & GF_NEW_CAMERA) { _screenLeft = camera._cur.x - (_screenWidth / 2); } else { - _screenLeft = _screenStartStrip << 3; + _screenLeft = _screenStartStrip * 8; } #ifdef V7_SMOOTH_SCROLLING_HACK virtscr[0].xstart = _screenLeft; #else - virtscr[0].xstart = _screenStartStrip << 3; + virtscr[0].xstart = _screenStartStrip * 8; #endif if (_charset->_hasMask && (_version >= 4 && _gameId != GID_LOOM256)) { diff --git a/scumm/costume.cpp b/scumm/costume.cpp index 98049255d5..e303dadd5d 100644 --- a/scumm/costume.cpp +++ b/scumm/costume.cpp @@ -298,7 +298,7 @@ void CostumeRenderer::c64_ignorePakCols(int num) { // uint height = _height; - num >>= 3; + num /= 8; while (num > 0) { v1.replen = *_srcptr++; @@ -335,14 +335,14 @@ static const int v1_mm_actor_palatte_2[25] = { }; #define MASK_AT(xoff) \ - (mask && (mask[((v1.x+xoff) >> 3) + v1.imgbufoffs] & revBitMask[(v1.x+xoff) & 7])) + (mask && (mask[((v1.x + xoff) / 8) + v1.imgbufoffs] & revBitMask[(v1.x + xoff) & 7])) #define LINE(c,p) \ pcolor = (color >> c) & 3; \ if (pcolor) { \ if (!MASK_AT(p)) \ dst[p] = palette[pcolor]; \ - if (!MASK_AT(p+1)) \ - dst[p+1] = palette[pcolor]; \ + if (!MASK_AT(p + 1)) \ + dst[p + 1] = palette[pcolor]; \ } void CostumeRenderer::procC64(int actor) { @@ -360,7 +360,7 @@ void CostumeRenderer::procC64(int actor) { color = v1.repcolor; height = _height; - v1.skip_width >>= 3; + v1.skip_width /= 8; // Set up the palette data byte palette[4] = { 0, 0, 0, 0 }; @@ -436,7 +436,7 @@ void CostumeRenderer::proc3() { scaleytab = &v1.scaletable[_scaleIndexY]; maskbit = revBitMask[v1.x & 7]; - mask = v1.mask_ptr + (v1.x >> 3); + mask = v1.mask_ptr + v1.x / 8; if (len) goto StartPos; @@ -486,7 +486,7 @@ void CostumeRenderer::proc3() { } _scaleIndexX += v1.scaleXstep; dst = v1.destptr; - mask = v1.mask_ptr + (v1.x >> 3); + mask = v1.mask_ptr + v1.x / 8; } StartPos:; } while (--len); @@ -502,7 +502,7 @@ void CostumeRenderer::proc3_ami() { bool masked; int oldXpos, oldScaleIndexX; - mask = v1.mask_ptr + (v1.x >> 3); + mask = v1.mask_ptr + v1.x / 8; dst = v1.destptr; height = _height; width = _width; @@ -532,7 +532,7 @@ void CostumeRenderer::proc3_ami() { maskbit = revBitMask[v1.x & 7]; } _scaleIndexX += v1.scaleXstep; - mask = v1.mask_ptr + (v1.x >> 3); + mask = v1.mask_ptr + v1.x / 8; } if (!--width) { if (!--height) diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 05dd039263..a71727d77f 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -330,19 +330,19 @@ void ScummEngine::updateDirtyRect(int virt, int left, int right, int top, int bo bottom = vs->height; if (virt == 0 && dirtybit) { - lp = (left >> 3) + _screenStartStrip; + lp = left / 8 + _screenStartStrip; if (lp < 0) lp = 0; if (_version >= 7) { #ifdef V7_SMOOTH_SCROLLING_HACK - rp = (right + vs->xstart) >> 3; + rp = (right + vs->xstart) / 8; #else - rp = (right >> 3) + _screenStartStrip; + rp = right / 8 + _screenStartStrip; #endif if (rp > 409) rp = 409; } else { - rp = (right >> 3) + _screenStartStrip; + rp = right / 8 + _screenStartStrip; if (rp >= 200) rp = 200; } @@ -351,8 +351,8 @@ void ScummEngine::updateDirtyRect(int virt, int left, int right, int top, int bo } // The following code used to be in the separate method setVirtscreenDirty - lp = left >> 3; - rp = right >> 3; + lp = left / 8; + rp = right / 8; if ((lp >= gdi._numStrips) || (rp < 0)) return; @@ -416,7 +416,7 @@ void Gdi::updateDirtyScreen(VirtScreen *vs) { return; if (_vm->_features & GF_NEW_CAMERA && (_vm->camera._cur.y != _vm->camera._last.y)) { - drawStripToScreen(vs, 0, _numStrips << 3, 0, vs->height); + drawStripToScreen(vs, 0, _numStrips * 8, 0, vs->height); } else { int i; int start, w, top, bottom; @@ -500,7 +500,7 @@ void Gdi::resetBackground(int top, int bottom, int strip) { if (bottom > vs->bdirty[strip]) vs->bdirty[strip] = bottom; - offs = (top * _numStrips + _vm->_screenStartStrip + strip) << 3; + offs = (top * _numStrips + _vm->_screenStartStrip + strip) * 8; byte *mask_ptr = _vm->getMaskBuffer(strip * 8, top, 0); bgbak_ptr = _vm->getResourceAddress(rtBuffer, 5) + offs; backbuff_ptr = vs->screenPtr + offs; @@ -508,7 +508,7 @@ void Gdi::resetBackground(int top, int bottom, int strip) { numLinesToProcess = bottom - top; if (numLinesToProcess) { if ((_vm->_features & GF_NEW_OPCODES) || (_vm->VAR(_vm->VAR_CURRENT_LIGHTS) & LIGHTMODE_screen)) { - if (_vm->hasCharsetMask(strip << 3, top, (strip + 1) << 3, bottom)) + if (_vm->hasCharsetMask(strip * 8, top, (strip + 1) * 8, bottom)) draw8ColWithMasking(backbuff_ptr, bgbak_ptr, numLinesToProcess, mask_ptr); else draw8Col(backbuff_ptr, bgbak_ptr, numLinesToProcess); @@ -761,7 +761,7 @@ void ScummEngine::redrawBGAreas() { } if (_features & GF_NEW_CAMERA) { - diff = (camera._cur.x >> 3) - (camera._last.x >> 3); + diff = camera._cur.x / 8 - camera._last.x / 8; if (_fullRedraw == 0 && diff == 1) { val = 2; redrawBGStrip(gdi._numStrips - 1, 1); @@ -864,10 +864,10 @@ void ScummEngine::restoreBG(Common::Rect rect, byte backColor) { if (vs->number == 0 && _charset->_hasMask && height) { byte *mask; // Note: At first sight it may look as if this could - // be optimized to (rect.right - rect.left) >> 3 and - // thus to width >> 3, but that's not the case since + // be optimized to (rect.right - rect.left) / 8 and + // thus to width * 8, but that's not the case since // we are dealing with integer math here. - int mask_width = (rect.right >> 3) - (rect.left >> 3); + int mask_width = (rect.right / 8) - (rect.left / 8); if (rect.right & 0x07) mask_width++; @@ -1008,7 +1008,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int wi sx = x; if (vs->scrollable) - sx -= vs->xstart >> 3; + sx -= vs->xstart / 8; // // Since V3, all graphics data was encoded in strips, which is very efficient @@ -1026,8 +1026,8 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int wi mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + (y * _numStrips + x) + _imgBufOffs[1]; - const int left = (stripnr << 3); - const int right = left + (numstrip << 3); + const int left = (stripnr * 8); + const int right = left + (numstrip * 8); byte *dst = bgbak_ptr; const byte *src; byte color, data = 0; @@ -1166,7 +1166,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int wi CHECK_HEAP; if (vs->alloctwobuffers) { - if (_vm->hasCharsetMask(sx << 3, y, (sx + 1) << 3, bottom)) { + if (_vm->hasCharsetMask(sx * 8, y, (sx + 1) * 8, bottom)) { if (flag & dbClear || !lightsOn) clear8ColWithMasking(backbuff_ptr, height, mask_ptr); else @@ -1360,7 +1360,7 @@ StripTable *Gdi::generateStripTable(const byte *src, int width, int height, Stri void Gdi::drawStripC64Background(byte *dst, int stripnr, int height) { int charIdx; - height >>= 3; + height /= 8; for (int y = 0; y < height; y++) { _C64Colors[3] = (_C64ColorMap[y + stripnr * height] & 7); // Check for room color change in V1 zak @@ -1383,8 +1383,8 @@ void Gdi::drawStripC64Background(byte *dst, int stripnr, int height) { void Gdi::drawStripC64Object(byte *dst, int stripnr, int width, int height) { int charIdx; - height >>= 3; - width >>= 3; + height /= 8; + width /= 8; for (int y = 0; y < height; y++) { _C64Colors[3] = (_C64ObjectMap[(y + height) * width + stripnr] & 7); charIdx = _C64ObjectMap[y * width + stripnr] * 8; @@ -1401,8 +1401,8 @@ void Gdi::drawStripC64Object(byte *dst, int stripnr, int width, int height) { void Gdi::drawStripC64Mask(byte *dst, int stripnr, int width, int height) { int maskIdx; - height >>= 3; - width >>= 3; + height /= 8; + width /= 8; for (int y = 0; y < height; y++) { if (_C64ObjectMode) maskIdx = _C64ObjectMap[(y + 2 * height) * width + stripnr] * 8; @@ -1466,7 +1466,7 @@ void Gdi::decodeStripEGA(byte *dst, const byte *src, int height) { run = *src++; } for (z = 0; z < run; z++) { - *(dst + y * _vm->_screenWidth + x) = (z&1) ? _roomPalette[color & 0xf] : _roomPalette[color >> 4]; + *(dst + y * _vm->_screenWidth + x) = (z & 1) ? _roomPalette[color & 0xf] : _roomPalette[color >> 4]; y++; if (y >= height) { @@ -1794,7 +1794,7 @@ void Gdi::unkDecodeA(byte *dst, const byte *src, int height) { cl -= 3; bits >>= 3; if (incm) { - color = (byte)((color+incm)&0xFF); + color = (byte)((color + incm) & 0xFF); } else { FILL_BITS; reps = bits & 0xFF; @@ -2297,11 +2297,11 @@ void ScummEngine::transitionEffect(int a) { delta[i] = transitionEffects[a].deltaTable[i]; j = transitionEffects[a].stripTable[i]; if (j == 24) - j = (virtscr[0].height >> 3) - 1; + j = virtscr[0].height / 8 - 1; tab_2[i] = j; } - bottom = virtscr[0].height >> 3; + bottom = virtscr[0].height / 8; for (j = 0; j < transitionEffects[a].numOfIterations; j++) { for (i = 0; i < 4; i++) { l = tab_2[i * 4]; @@ -2311,8 +2311,8 @@ void ScummEngine::transitionEffect(int a) { if (t == b) { while (l <= r) { if (l >= 0 && l < gdi._numStrips && (uint) t < (uint) bottom) { - virtscr[0].tdirty[l] = t << 3; - virtscr[0].bdirty[l] = (t + 1) << 3; + virtscr[0].tdirty[l] = t * 8; + virtscr[0].bdirty[l] = (t + 1) * 8; } l++; } @@ -2323,8 +2323,8 @@ void ScummEngine::transitionEffect(int a) { b = bottom; if (t < 0) t = 0; - virtscr[0].tdirty[l] = t << 3; - virtscr[0].bdirty[l] = (b + 1) << 3; + virtscr[0].tdirty[l] = t * 8; + virtscr[0].bdirty[l] = (b + 1) * 8; } updateDirtyScreen(0); } @@ -3330,7 +3330,7 @@ const byte *ScummEngine::findPalInPals(const byte *pal, int idx) { if (offs == NULL) return NULL; - size = getResourceDataSize(offs) >> 2; + size = getResourceDataSize(offs) / 4; if ((uint32)idx >= (uint32)size) return NULL; @@ -3456,8 +3456,8 @@ void ScummEngine::useIm01Cursor(const byte *im, int w, int h) { const byte *src; int i; - w <<= 3; - h <<= 3; + w *= 8; + h *= 8; dst = buf = (byte *) malloc(w * h); src = vs->screenPtr + vs->xstart; @@ -3472,7 +3472,7 @@ void ScummEngine::useIm01Cursor(const byte *im, int w, int h) { vs->alloctwobuffers = false; gdi.disableZBuffer(); - gdi.drawBitmap(im, vs, _screenStartStrip, 0, w, h, 0, w >> 3, 0); + gdi.drawBitmap(im, vs, _screenStartStrip, 0, w, h, 0, w / 8, 0); vs->alloctwobuffers = true; gdi.enableZBuffer(); @@ -3524,8 +3524,8 @@ void ScummEngine::animateCursor() { void ScummEngine::useBompCursor(const byte *im, int width, int height) { uint size; - width <<= 3; - height <<= 3; + width *= 8; + height *= 8; size = width * height; if (size > sizeof(_grabbedCursor)) diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index 02ccb729da..5aa49de322 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -404,7 +404,7 @@ void IMuseInternal::handle_marker(uint id, byte data) { int IMuseInternal::get_channel_volume(uint a) { if (a < 8) return _channel_volume_eff[a]; - return (_master_volume * _music_volume / 255) >> 1; + return (_master_volume * _music_volume / 255) / 2; } Part *IMuseInternal::allocate_part(byte pri, MidiDriver *midi) { @@ -697,7 +697,7 @@ int32 IMuseInternal::doCommand (int numargs, int a[]) { } case 7: warning ("IMuse doCommand(7) - getMasterVolume (%d)", a[1]); - return _master_volume >> 1; // Convert from 0-255 to 0-127 + return _master_volume / 2; // Convert from 0-255 to 0-127 case 8: return startSound(a[1]) ? 0 : -1; case 9: diff --git a/scumm/imuse_player.cpp b/scumm/imuse_player.cpp index 19764b031c..84c14e724e 100644 --- a/scumm/imuse_player.cpp +++ b/scumm/imuse_player.cpp @@ -879,7 +879,7 @@ int Player::setVolume(byte vol) { return -1; _volume = vol; - _vol_eff = _se->get_channel_volume(_vol_chan) *(vol + 1) >> 7; + _vol_eff = _se->get_channel_volume(_vol_chan) * (vol + 1) >> 7; for (part = _parts; part; part = part->_next) { part->volume(part->_vol); diff --git a/scumm/object.cpp b/scumm/object.cpp index 4e16016b80..78eece354c 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -408,10 +408,10 @@ void ScummEngine::drawObject(int obj, int arg) { checkRange(_numGlobalObjects - 1, 0, od.obj_nr, "Object %d out of range in drawObject"); - xpos = od.x_pos >> 3; + xpos = od.x_pos / 8; ypos = od.y_pos; - width = od.width >> 3; + width = od.width / 8; height = od.height &= 0xFFFFFFF8; // Mask out last 3 bits if (width == 0 || xpos > _screenEndStrip || xpos + width < _screenStartStrip) @@ -447,13 +447,13 @@ void ScummEngine::drawObject(int obj, int arg) { byte flags = Gdi::dbAllowMaskOr; if (_version == 1) { gdi._C64ObjectMode = true; - gdi.decodeC64Gfx(ptr, gdi._C64ObjectMap, width * (height >> 3) * 3); + gdi.decodeC64Gfx(ptr, gdi._C64ObjectMap, width * (height / 8) * 3); } // Sam & Max needs this to fix object-layering problems with // the inventory and conversation icons. if ((_version >= 7 || _gameId == GID_SAMNMAX) && getClass(od.obj_nr, kObjectClassIgnoreBoxes)) flags |= Gdi::dbDrawMaskOnAll; - gdi.drawBitmap(ptr, &virtscr[0], x, ypos, width << 3, height, x - xpos, numstrip, flags); + gdi.drawBitmap(ptr, &virtscr[0], x, ypos, width * 8, height, x - xpos, numstrip, flags); } } @@ -692,14 +692,14 @@ void ScummEngine::setupRoomObject(ObjectData *od, const byte *room, const byte * od->obj_nr = READ_LE_UINT16(ptr + 6); - od->x_pos = *(ptr + 9) << 3; - od->y_pos = ((*(ptr + 10)) & 0x7F) << 3; + od->x_pos = *(ptr + 9) * 8; + od->y_pos = ((*(ptr + 10)) & 0x7F) * 8; od->parentstate = (*(ptr + 10) & 0x80) ? 1 : 0; if (_version <= 2) - od->parentstate <<= 3; + od->parentstate *= 8; - od->width = *(ptr + 11) << 3; + od->width = *(ptr + 11) * 8; od->parent = *(ptr + 12); @@ -773,10 +773,10 @@ void ScummEngine::setupRoomObject(ObjectData *od, const byte *room, const byte * } else { od->obj_nr = READ_LE_UINT16(&(cdhd->v5.obj_id)); - od->width = cdhd->v5.w << 3; - od->height = cdhd->v5.h << 3; - od->x_pos = cdhd->v5.x << 3; - od->y_pos = cdhd->v5.y << 3; + od->width = cdhd->v5.w * 8; + od->height = cdhd->v5.h * 8; + od->x_pos = cdhd->v5.x * 8; + od->y_pos = cdhd->v5.y * 8; if (cdhd->v5.flags == 0x80) { od->parentstate = 1; } else { @@ -857,8 +857,8 @@ void ScummEngine::removeObjectFromRoom(int obj) { for (i = 1; i < _numLocalObjects; i++) { if (_objs[i].obj_nr == (uint16)obj) { if (_objs[i].width != 0) { - for (j = 0; j < _objs[i].width >> 3; j++) { - strip = (_objs[i].x_pos >> 3) + j; + for (j = 0; j < _objs[i].width / 8; j++) { + strip = (_objs[i].x_pos / 8) + j; // Clip value if (strip < _screenStartStrip) @@ -1299,8 +1299,8 @@ void ScummEngine::setObjectState(int obj, int state, int x, int y) { } if (x != -1) { - _objs[i].x_pos = x << 3; - _objs[i].y_pos = y << 3; + _objs[i].x_pos = x * 8; + _objs[i].y_pos = y * 8; } addObjectToDrawQue(i); @@ -1334,7 +1334,7 @@ int ScummEngine::getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2, y2 = f; } - return getDist(x, y, x2, y2) * 0xFF / ((i + j) >> 1); + return getDist(x, y, x2, y2) * 0xFF / ((i + j) / 2); } void ScummEngine::setCursorImg(uint img, uint room, uint imgindex) { @@ -1351,18 +1351,18 @@ void ScummEngine::setCursorImg(uint img, uint room, uint imgindex) { if (_version == 8) { setCursorHotspot(READ_LE_UINT32(&foir.imhd->v8.hotspot[0].x), READ_LE_UINT32(&foir.imhd->v8.hotspot[0].y)); - w = READ_LE_UINT32(&foir.imhd->v8.width) >> 3; - h = READ_LE_UINT32(&foir.imhd->v8.height) >> 3; + w = READ_LE_UINT32(&foir.imhd->v8.width) / 8; + h = READ_LE_UINT32(&foir.imhd->v8.height) / 8; } else if (_version == 7) { setCursorHotspot(READ_LE_UINT16(&foir.imhd->v7.hotspot[0].x), READ_LE_UINT16(&foir.imhd->v7.hotspot[0].y)); - w = READ_LE_UINT16(&foir.imhd->v7.width) >> 3; - h = READ_LE_UINT16(&foir.imhd->v7.height) >> 3; + w = READ_LE_UINT16(&foir.imhd->v7.width) / 8; + h = READ_LE_UINT16(&foir.imhd->v7.height) / 8; } else { setCursorHotspot(READ_LE_UINT16(&foir.imhd->old.hotspot[0].x), READ_LE_UINT16(&foir.imhd->old.hotspot[0].y)); - w = READ_LE_UINT16(&foir.cdhd->v6.w) >> 3; - h = READ_LE_UINT16(&foir.cdhd->v6.h) >> 3; + w = READ_LE_UINT16(&foir.cdhd->v6.w) / 8; + h = READ_LE_UINT16(&foir.cdhd->v6.h) / 8; } dataptr = getObjectImage(foir.obim, imgindex); @@ -1555,8 +1555,8 @@ void ScummEngine::removeBlastObject(BlastObject *eo) { if (right > vs->width) right = vs->width; - left_strip = left >> 3; - right_strip = (right - 1) >> 3; + left_strip = left / 8; + right_strip = (right - 1) / 8; if (left_strip < 0) left_strip = 0; diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 501f5689af..fcb1ec7002 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -743,10 +743,10 @@ void ScummEngine_v2::o2_drawObject() { od = &_objs[idx]; if (xpos != 0xFF) { - od->walk_x += (xpos << 3) - od->x_pos; - od->x_pos = xpos << 3; - od->walk_y += (ypos << 3) - od->y_pos; - od->y_pos = ypos << 3; + od->walk_x += (xpos * 8) - od->x_pos; + od->x_pos = xpos * 8; + od->walk_y += (ypos * 8) - od->y_pos; + od->y_pos = ypos * 8; } addObjectToDrawQue(idx); @@ -819,8 +819,8 @@ void ScummEngine_v2::o2_verbOps() { break; default: { // New Verb - int x = fetchScriptByte() << 3; - int y = fetchScriptByte() << 3; + int x = fetchScriptByte() * 8; + int y = fetchScriptByte() * 8; slot = getVarOrDirectByte(PARAM_1) + 1; int prep = fetchScriptByte(); // Only used in V1? // V1 Maniac verbs are relative to the 'verb area' - under the sentence @@ -1496,10 +1496,10 @@ void ScummEngine_v2::o2_setObjectName() { } while (i < size) { - work[i-1] = '@'; + work[i - 1] = '@'; i++; } - work[i-1] = 0; + work[i - 1] = 0; memcpy(name, work, i); runInventoryScript(0); diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index 025597fce2..eee77f28ce 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -837,10 +837,10 @@ void ScummEngine_v5::o5_drawObject() { od = &_objs[idx]; if (xpos != 0xFF) { - od->walk_x += (xpos << 3) - od->x_pos; - od->x_pos = xpos << 3; - od->walk_y += (ypos << 3) - od->y_pos; - od->y_pos = ypos << 3; + od->walk_x += (xpos * 8) - od->x_pos; + od->x_pos = xpos * 8; + od->walk_y += (ypos * 8) - od->y_pos; + od->y_pos = ypos * 8; } addObjectToDrawQue(idx); @@ -1967,9 +1967,9 @@ void ScummEngine_v5::o5_roomOps() { int len = 256, cnt = 0; ptr = (byte *)malloc(len); while (ptr) { - int r = file->read(ptr+cnt, len-cnt); + int r = file->read(ptr + cnt, len - cnt); if ((cnt += r) < len) break; - ptr = (byte *)realloc(ptr, len<<=1); + ptr = (byte *)realloc(ptr, len *= 2); } ptr[cnt] = '\0'; loadPtrToResource(rtString, a, ptr); @@ -2584,7 +2584,7 @@ void ScummEngine_v5::o5_wait() { break; return; case 3: // SO_WAIT_FOR_CAMERA - if (camera._cur.x >> 3 != camera._dest.x >> 3) + if (camera._cur.x / 8 != camera._dest.x / 8) break; return; case 4: // SO_WAIT_FOR_SENTENCE diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 3d17daa8da..c1a2ea0e95 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -1550,7 +1550,7 @@ void ScummEngine_v6::o6_roomOps() { case 181: // SO_ROOM_FADE a = pop(); if (a) { - _switchRoomEffect = (byte)(a&0xFF); + _switchRoomEffect = (byte)(a & 0xFF); _switchRoomEffect2 = (byte)(a >> 8); } else { fadeIn(_newEffect); @@ -2090,7 +2090,7 @@ void ScummEngine_v6::o6_wait() { if (camera._dest != camera._cur) break; } else { - if (camera._cur.x >> 3 != camera._dest.x >> 3) + if (camera._cur.x / 8 != camera._dest.x / 8) break; } 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) diff --git a/scumm/string.cpp b/scumm/string.cpp index 1e614f8d4f..aa0da5ce66 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -100,7 +100,7 @@ void ScummEngine::CHARSET_1() { return; if (!(_features & GF_NEW_CAMERA) && !(_gameId == GID_ZAK256 && VAR(VAR_TALK_ACTOR) == 0xff)) { - if ((camera._dest.x >> 3) != (camera._cur.x >> 3) || camera._cur.x != camera._last.x) + if ((camera._dest.x / 8) != (camera._cur.x / 8) || camera._cur.x != camera._last.x) return; } @@ -114,20 +114,20 @@ void ScummEngine::CHARSET_1() { if (VAR(VAR_V5_TALK_STRING_Y) < 0) { s = (a->scaley * (int)VAR(VAR_V5_TALK_STRING_Y)) / 0xFF; - _string[0].ypos = (int)(((VAR(VAR_V5_TALK_STRING_Y) - s) >> 1) + s - a->elevation + a->_pos.y); + _string[0].ypos = (int)(((VAR(VAR_V5_TALK_STRING_Y) - s) / 2) + s - a->elevation + a->_pos.y); } else { _string[0].ypos = (int)VAR(VAR_V5_TALK_STRING_Y); } } else { s = a->scaley * a->talkPosY / 0xFF; - _string[0].ypos = ((a->talkPosY - s) >> 1) + s - a->elevation + a->_pos.y; + _string[0].ypos = ((a->talkPosY - s) / 2) + s - a->elevation + a->_pos.y; if (_string[0].ypos < _screenTop) _string[0].ypos = _screenTop; s = a->scalex * a->talkPosX / 0xFF; - _string[0].xpos = ((a->talkPosX - s) >> 1) + s + a->_pos.x - camera._cur.x + (_screenWidth / 2); + _string[0].xpos = ((a->talkPosX - s) / 2) + s + a->_pos.x - camera._cur.x + (_screenWidth / 2); } if (_string[0].ypos < 1) @@ -207,7 +207,7 @@ void ScummEngine::CHARSET_1() { if (_charset->_center) { if (t > _charset->_nextLeft) t = _charset->_nextLeft; - t <<= 1; + t /= 2; } buffer = _charsetBuffer + _charsetBufPos; @@ -215,7 +215,7 @@ void ScummEngine::CHARSET_1() { _charset->addLinebreaks(0, buffer, 0, t); if (_charset->_center) { - _charset->_nextLeft -= _charset->getStringWidth(0, buffer) >> 1; + _charset->_nextLeft -= _charset->getStringWidth(0, buffer) / 2; if (_charset->_nextLeft < 0) _charset->_nextLeft = 0; } @@ -235,7 +235,7 @@ void ScummEngine::CHARSET_1() { newLine:; _charset->_nextLeft = _string[0].xpos; if (_charset->_center) { - _charset->_nextLeft -= _charset->getStringWidth(0, buffer) >> 1; + _charset->_nextLeft -= _charset->getStringWidth(0, buffer) / 2; } _charset->_nextTop += _charset->getFontHeight(); if (_version > 3) { @@ -390,7 +390,7 @@ void ScummEngine::drawString(int a) { if (space) *space = '\0'; if (_charset->_center) { - _charset->_left -= _charset->getStringWidth(a, buf) >> 1; + _charset->_left -= _charset->getStringWidth(a, buf) / 2; } if (_version < 7) @@ -713,7 +713,7 @@ void ScummEngine::drawBlastTexts() { // Center text if necessary if (_charset->_center) { - _charset->_nextLeft -= _charset->getStringWidth(0, buf) >> 1; + _charset->_nextLeft -= _charset->getStringWidth(0, buf) / 2; if (_charset->_nextLeft < 0) _charset->_nextLeft = 0; } diff --git a/scumm/verbs.cpp b/scumm/verbs.cpp index 756f17c57f..a2ac184317 100644 --- a/scumm/verbs.cpp +++ b/scumm/verbs.cpp @@ -451,29 +451,29 @@ void ScummEngine::drawVerbBitmap(int verb, int x, int y) { twobufs = vs->alloctwobuffers; vs->alloctwobuffers = 0; - xstrip = x >> 3; + xstrip = x / 8; ydiff = y - vs->topline; obim = getResourceAddress(rtVerb, verb); assert(obim); if (_features & GF_OLD_BUNDLE) { imgw = obim[0]; - imgh = obim[1] >> 3; + imgh = obim[1] / 8; imptr = obim + 2; } else if (_features & GF_SMALL_HEADER) { size = READ_LE_UINT32(obim); imgw = (*(obim + size + 11)); - imgh = (*(obim + size + 17)) >> 3; + imgh = (*(obim + size + 17)) / 8; imptr = getObjectImage(obim, 1); } else { imhd = (const ImageHeader *)findResourceData(MKID('IMHD'), obim); if (_version >= 7) { - imgw = READ_LE_UINT16(&imhd->v7.width) >> 3; - imgh = READ_LE_UINT16(&imhd->v7.height) >> 3; + imgw = READ_LE_UINT16(&imhd->v7.width) / 8; + imgh = READ_LE_UINT16(&imhd->v7.height) / 8; } else { - imgw = READ_LE_UINT16(&imhd->old.width) >> 3; - imgh = READ_LE_UINT16(&imhd->old.height) >> 3; + imgw = READ_LE_UINT16(&imhd->old.width) / 8; + imgh = READ_LE_UINT16(&imhd->old.height) / 8; } imptr = getObjectImage(obim, 1); } |