diff options
author | Travis Howell | 2005-04-01 06:30:46 +0000 |
---|---|---|
committer | Travis Howell | 2005-04-01 06:30:46 +0000 |
commit | cdd21c361b1c194a6c0b7f6ef480463d02fcc87c (patch) | |
tree | 1c5717b09fd4ace8b9664729dab1e9108015b362 /scumm | |
parent | 65596240d70869900df61ece1812d080c5acd22f (diff) | |
download | scummvm-rg350-cdd21c361b1c194a6c0b7f6ef480463d02fcc87c.tar.gz scummvm-rg350-cdd21c361b1c194a6c0b7f6ef480463d02fcc87c.tar.bz2 scummvm-rg350-cdd21c361b1c194a6c0b7f6ef480463d02fcc87c.zip |
Remove resource type argument in wizImage functions, it is always rtImage.
Rename sprite flags/functions
Remove unused sprite flags
Switch sprite flags back to hex. for easier comparison
svn-id: r17319
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 14 | ||||
-rw-r--r-- | scumm/script_v100he.cpp | 15 | ||||
-rw-r--r-- | scumm/script_v72he.cpp | 4 | ||||
-rw-r--r-- | scumm/script_v80he.cpp | 7 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 8 | ||||
-rw-r--r-- | scumm/sprite_he.cpp | 22 | ||||
-rw-r--r-- | scumm/sprite_he.h | 46 | ||||
-rw-r--r-- | scumm/wiz_he.cpp | 32 |
8 files changed, 62 insertions, 86 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 6b50e1566d..c26ef2ce50 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -743,9 +743,9 @@ protected: void displayWizComplexImage(const WizParameters *params); void drawWizComplexPolygon(int resnum, int state, int po_x, int po_y, int arg14, int angle, int zoom, const Common::Rect *r); - void captureWizImage(int restype, int resnum, const Common::Rect& r, bool frontBuffer, int compType); + void captureWizImage(int resnum, const Common::Rect& r, bool frontBuffer, int compType); void getWizImageDim(int resnum, int state, int32 &w, int32 &h); - uint8 *drawWizImage(int restype, const WizImage *pwi); + uint8 *drawWizImage(const WizImage *pwi); void drawWizPolygon(int resnum, int state, int id, int flags); void flushWizBuffer(); @@ -826,7 +826,7 @@ protected: virtual const char *getOpcodeDesc(byte i); void loadImgSpot(int resId, int state, int16 &x, int16 &y); - void loadWizCursor(int resId, int resType, bool state); + void loadWizCursor(int resId); /* HE version 80 script opcodes */ void o80_loadSBNG(); @@ -896,8 +896,8 @@ protected: void fillWizRect(const WizParameters *params); void processWizImage(const WizParameters *params); int getWizImageStates(int resnum); - int isWizPixelNonTransparent(int restype, int resnum, int state, int x, int y, int flags); - uint8 getWizPixelColor(int restype, int resnum, int state, int x, int y, int flags); + int isWizPixelNonTransparent(int resnum, int state, int x, int y, int flags); + uint8 getWizPixelColor(int resnum, int state, int x, int y, int flags); int computeWizHistogram(int resnum, int state, int x, int y, int w, int h); uint8 *getHEPalette(int palSlot); @@ -919,7 +919,7 @@ protected: int spriteInfoGet_flagActive(int spriteId); int spriteInfoGet_flagNeedPaletteRemap(int spriteId); int spriteInfoGet_flags_22(int spriteId); - int spriteInfoGet_flags_23(int spriteId); + int spriteInfoGet_flagMarkDirty(int spriteId); int spriteInfoGet_flagHasImage(int spriteId); int spriteInfoGet_resId(int spriteId); int spriteInfoGet_resState(int spriteId); @@ -969,7 +969,7 @@ protected: void spriteInfoSet_flagActive(int spriteId, int value); void spriteInfoSet_flagNeedPaletteRemap(int spriteId, int value); void spriteInfoSet_flag22(int spriteId, int value); - void spriteInfoSet_flag23(int spriteId, int value); + void spriteInfoSet_flagMarkDirty(int spriteId, int value); void spriteInfoSet_flagHasImage(int spriteId, int value); void spriteInfoSet_delay(int spriteId, int value); void spriteInfoSet_setClassFlags(int spriteId, int value); diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp index 74a226888d..bd5ddc94f6 100644 --- a/scumm/script_v100he.cpp +++ b/scumm/script_v100he.cpp @@ -2028,7 +2028,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - spriteInfoSet_flag23(spriteId, args[0]); + spriteInfoSet_flagMarkDirty(spriteId, args[0]); break; case 83: args[1] = pop(); @@ -2118,17 +2118,14 @@ void ScummEngine_v100he::o100_cursorCommand() { _charsetColorMap[i] = _charsetData[_string[1]._default.charset][i] = (unsigned char)args[i]; break; case 0x80: - a = pop(); - loadWizCursor(a, rtInventory, 0); - break; case 0x81: a = pop(); - loadWizCursor(a, rtInventory, 0); + loadWizCursor(a); break; case 0x82: pop(); a = pop(); - loadWizCursor(a, rtInventory, 1); + loadWizCursor(a); break; case 0x86: // SO_CURSOR_ON Turn cursor on _cursor.state = 1; @@ -2362,7 +2359,7 @@ void ScummEngine_v100he::o100_getWizData() { x = pop(); state = pop(); resId = pop(); - push(getWizPixelColor(rtImage, resId, state, x, y, 0)); + push(getWizPixelColor(resId, state, x, y, 0)); break; case 6: resId = pop(); @@ -2373,7 +2370,7 @@ void ScummEngine_v100he::o100_getWizData() { x = pop(); state = pop(); resId = pop(); - push(isWizPixelNonTransparent(rtImage, resId, state, x, y, 0)); + push(isWizPixelNonTransparent(resId, state, x, y, 0)); break; case 19: state = pop(); @@ -2696,7 +2693,7 @@ void ScummEngine_v100he::o100_getSpriteInfo() { case 82: spriteId = pop(); if (spriteId) - push(spriteInfoGet_flags_23(spriteId)); + push(spriteInfoGet_flagMarkDirty(spriteId)); else push(0); break; diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 0b2f390e0a..ef0312f186 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -783,7 +783,7 @@ void ScummEngine_v72he::o72_captureWizImage() { grab.right = pop() + 1; grab.top = pop(); grab.left = pop(); - captureWizImage(rtImage, pop(), grab, false, true); + captureWizImage(pop(), grab, false, true); } void ScummEngine_v72he::o72_getTimer() { @@ -887,7 +887,7 @@ void ScummEngine_v72he::o72_printWizImage() { wi.x1 = wi.y1 = 0; wi.state = 0; wi.flags = kWIFPrint; - drawWizImage(rtImage, &wi); + drawWizImage(&wi); } void ScummEngine_v72he::o72_getArrayDimSize() { diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp index ebdb6da233..96576f1ac1 100644 --- a/scumm/script_v80he.cpp +++ b/scumm/script_v80he.cpp @@ -510,13 +510,10 @@ void ScummEngine_v80he::o80_cursorCommand() { byte subOp = fetchScriptByte(); switch (subOp) { - case 0x13: // Loads cursors from another resource - a = pop(); - loadWizCursor(a, rtInventory, 0); - break; + case 0x13: case 0x14: a = pop(); - loadWizCursor(a, rtInventory, 1); + loadWizCursor(a); break; case 0x90: // SO_CURSOR_ON Turn cursor on _cursor.state = 1; diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index 2c34067973..5504207e6c 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -951,7 +951,7 @@ void ScummEngine_v90he::o90_getSpriteInfo() { case 94: spriteId = pop(); if (spriteId) - push(spriteInfoGet_flags_23(spriteId)); + push(spriteInfoGet_flagMarkDirty(spriteId)); else push(0); break; @@ -1248,7 +1248,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - spriteInfoSet_flag23(spriteId, args[0]); + spriteInfoSet_flagMarkDirty(spriteId, args[0]); break; case 91: n = getStackList(args, ARRAYSIZE(args)); @@ -1604,14 +1604,14 @@ void ScummEngine_v90he::o90_getWizData() { x = pop(); state = pop(); resId = pop(); - push(isWizPixelNonTransparent(rtImage, resId, state, x, y, 0)); + push(isWizPixelNonTransparent(resId, state, x, y, 0)); break; case 36: y = pop(); x = pop(); state = pop(); resId = pop(); - push(getWizPixelColor(rtImage, resId, state, x, y, 0)); + push(getWizPixelColor(resId, state, x, y, 0)); break; case 100: h = pop(); diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index 507b36cac0..9bb492f4ae 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -200,7 +200,7 @@ int ScummEngine_v90he::findSpriteWithClassOf(int x_pos, int y_pos, int spriteGro y += h / 2; } - if(isWizPixelNonTransparent(rtImage, resId, state, x, y, spi->imgFlags)) + if(isWizPixelNonTransparent(resId, state, x, y, spi->imgFlags)) return spi->id; } } @@ -267,10 +267,10 @@ int ScummEngine_v90he::spriteInfoGet_flags_22(int spriteId) { return ((_spriteTable[spriteId].flags & kSFDelayed) != 0) ? 1 : 0; } -int ScummEngine_v90he::spriteInfoGet_flags_23(int spriteId) { +int ScummEngine_v90he::spriteInfoGet_flagMarkDirty(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return ((_spriteTable[spriteId].flags & kSF23) != 0) ? 1 : 0; + return ((_spriteTable[spriteId].flags & kSFMarkDirty) != 0) ? 1 : 0; } int ScummEngine_v90he::spriteInfoGet_flagHasImage(int spriteId) { @@ -667,13 +667,13 @@ void ScummEngine_v90he::spriteInfoSet_flag22(int spriteId, int value) { _spriteTable[spriteId].flags &= ~kSFDelayed; } -void ScummEngine_v90he::spriteInfoSet_flag23(int spriteId, int value) { +void ScummEngine_v90he::spriteInfoSet_flagMarkDirty(int spriteId, int value) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); if (value) - _spriteTable[spriteId].flags |= kSF23 | kSFBlitDirectly; + _spriteTable[spriteId].flags |= kSFMarkDirty | kSFBlitDirectly; else - _spriteTable[spriteId].flags &= ~(kSF23 | kSFBlitDirectly); + _spriteTable[spriteId].flags &= ~(kSFMarkDirty | kSFBlitDirectly); } void ScummEngine_v90he::spriteInfoSet_flagHasImage(int spriteId, int value) { @@ -768,7 +768,7 @@ void ScummEngine_v90he::spriteAddImageToList(int spriteId, int imageNum, int *sp if (_spriteTable[spriteId].res_id) { _spriteTable[spriteId].res_wiz_states = getWizImageStates(_spriteTable[spriteId].res_id); - _spriteTable[spriteId].flags |= kSFActive | kSFDelayed | kSF23 | kSFBlitDirectly; + _spriteTable[spriteId].flags |= kSFActive | kSFDelayed | kSFMarkDirty | kSFBlitDirectly; if (_spriteTable[spriteId].res_id != origResId || _spriteTable[spriteId].res_wiz_states != origResWizStates) _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; @@ -835,9 +835,9 @@ void ScummEngine_v90he::spriteGroupSet_case0_3(int spriteGroupId, int value) { for (int i = 1; i < _varNumSprites; i++) { if (_spriteTable[i].group_num == spriteGroupId) { if (value) - _spriteTable[i].flags |= kSF23 | kSFBlitDirectly; + _spriteTable[i].flags |= kSFMarkDirty | kSFBlitDirectly; else - _spriteTable[i].flags &= ~(kSF23 | kSFBlitDirectly); + _spriteTable[i].flags &= ~(kSFMarkDirty | kSFBlitDirectly); } } } @@ -1099,7 +1099,7 @@ void ScummEngine_v90he::spritesMarkDirty(bool unkFlag) { for (int i = 0; i < _numSpritesToProcess; ++i) { SpriteInfo *spi = _activeSpritesTable[i]; if (!(spi->flags & (kSFNeedRedraw | kSF30))) { - if ((!unkFlag || spi->zorderPriority >= 0) && (spi->flags & kSF23)) { + if ((!unkFlag || spi->zorderPriority >= 0) && (spi->flags & kSFMarkDirty)) { bool needRedraw = false; int lp = MIN(79, spi->bbox.left / 8); int rp = MIN(79, (spi->bbox.right + 7) / 8); @@ -1174,7 +1174,7 @@ void ScummEngine_v90he::spritesSortActiveSprites() { SpriteInfo *spi = &_spriteTable[i]; if (spi->flags & kSFActive) { - if (!(spi->flags & kSF23)) { + if (!(spi->flags & kSFMarkDirty)) { if (!(spi->flags & kSF30)) spi->flags |= kSFNeedRedraw; if (!(spi->flags & kSFImageless)) diff --git a/scumm/sprite_he.h b/scumm/sprite_he.h index b1036cba88..bc950b16df 100644 --- a/scumm/sprite_he.h +++ b/scumm/sprite_he.h @@ -26,38 +26,20 @@ namespace Scumm { enum SpriteFlags { - kSFChanged = (1 << 0), - kSFNeedRedraw = (1 << 1), - kSF03 = (1 << 2), - kSF04 = (1 << 3), - kSFZoomed = (1 << 4), - kSFRotated = (1 << 5), - kSF07 = (1 << 6), - kSF08 = (1 << 7), - kSF09 = (1 << 8), - kSF10 = (1 << 9), - kSF11 = (1 << 10), - kSF12 = (1 << 11), - kSFDoubleBuffered = (1 << 12), - kSFYFlipped = (1 << 13), - kSFXFlipped = (1 << 14), - kSFActive = (1 << 15), - kSF17 = (1 << 16), - kSF18 = (1 << 17), - kSF19 = (1 << 18), - kSFNeedPaletteRemap = (1 << 19), - kSF21 = (1 << 20), - kSFDelayed = (1 << 21), - kSF23 = (1 << 22), - kSF24 = (1 << 23), - kSF25 = (1 << 24), - kSFBlitDirectly = (1 << 25), - kSF27 = (1 << 26), - kSF28 = (1 << 27), - kSF29 = (1 << 28), - kSF30 = (1 << 29), - kSFImageless = (1 << 30), - kSF32 = (1 << 31) + kSFChanged = 0x1, + kSFNeedRedraw = 0x2, + kSFZoomed = 0x10, + kSFRotated = 0x20, + kSFDoubleBuffered = 0x1000, + kSFYFlipped = 0x2000, + kSFXFlipped = 0x4000, + kSFActive = 0x8000, + kSFNeedPaletteRemap = 0x80000, + kSFDelayed = 0x200000, + kSFMarkDirty = 0x400000, + kSFBlitDirectly = 0x2000000, + kSF30 = 0x20000000, + kSFImageless = 0x40000000 }; enum SpriteGroupFlags { diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp index 86fc85de94..2954be28ee 100644 --- a/scumm/wiz_he.cpp +++ b/scumm/wiz_he.cpp @@ -773,8 +773,8 @@ static int wizPackType0(uint8 *dst, const uint8 *src, int srcPitch, const Common return size; } -void ScummEngine_v72he::captureWizImage(int resType, int resNum, const Common::Rect& r, bool frontBuffer, int compType) { - debug(1, "ScummEngine_v72he::captureWizImage(%d, %d, %d, [%d,%d,%d,%d])", resType, resNum, compType, r.left, r.top, r.right, r.bottom); +void ScummEngine_v72he::captureWizImage(int resNum, const Common::Rect& r, bool frontBuffer, int compType) { + debug(1, "ScummEngine_v72he::captureWizImage(%d, %d, [%d,%d,%d,%d])", resNum, compType, r.left, r.top, r.right, r.bottom); uint8 *src = NULL; VirtScreen *pvs = &virtscr[kMainVirtScreen]; if (frontBuffer) { @@ -810,7 +810,7 @@ void ScummEngine_v72he::captureWizImage(int resType, int resNum, const Common::R dataSize = (dataSize + 1) & ~1; int wizSize = headerSize + dataSize; // write header - uint8 *wizImg = createResource(resType, resNum, dataSize + headerSize); + uint8 *wizImg = createResource(rtImage, resNum, dataSize + headerSize); *(uint32 *)(wizImg + 0x00) = MKID('AWIZ'); *(uint32 *)(wizImg + 0x04) = TO_BE_32(wizSize); *(uint32 *)(wizImg + 0x08) = MKID('WIZH'); @@ -859,10 +859,10 @@ void ScummEngine_v72he::getWizImageDim(int resnum, int state, int32 &w, int32 &h h = READ_LE_UINT32(wizh + 0x8); } -uint8 *ScummEngine_v72he::drawWizImage(int restype, const WizImage *pwi) { - debug(1, "drawWizImage(%d, %d, %d, %d, 0x%X)", restype, pwi->resNum, pwi->x1, pwi->y1, pwi->flags); +uint8 *ScummEngine_v72he::drawWizImage(const WizImage *pwi) { + debug(1, "drawWizImage(%d, %d, %d, 0x%X)", pwi->resNum, pwi->x1, pwi->y1, pwi->flags); uint8 *dst = NULL; - uint8 *dataPtr = getResourceAddress(restype, pwi->resNum); + uint8 *dataPtr = getResourceAddress(rtImage, pwi->resNum); if (dataPtr) { uint8 *rmap = NULL; uint8 *xmap = findWrappedBlock(MKID('XMAP'), dataPtr, pwi->state, 0); @@ -1046,7 +1046,7 @@ void ScummEngine_v72he::drawWizPolygon(int resnum, int state, int id, int flags) wi.state = state; wi.x1 = wi.y1 = 0; wi.flags = kWIFBlitToMemBuffer; - uint8 *srcWizBuf = drawWizImage(rtImage, &wi); + uint8 *srcWizBuf = drawWizImage(&wi); if (srcWizBuf) { uint8 *dst; VirtScreen *pvs = &virtscr[kMainVirtScreen]; @@ -1131,7 +1131,7 @@ void ScummEngine_v72he::flushWizBuffer() { if (pwi->flags & kWIFIsPolygon) { drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags); } else { - drawWizImage(rtImage, pwi); + drawWizImage(pwi); } } _wiz._imagesNum = 0; @@ -1150,7 +1150,7 @@ void ScummEngine_v80he::loadImgSpot(int resId, int state, int16 &x, int16 &y) { } } -void ScummEngine_v80he::loadWizCursor(int resId, int resType, bool state) { +void ScummEngine_v80he::loadWizCursor(int resId) { int16 x, y; loadImgSpot(resId, 0, x, y); if (x < 0) { @@ -1169,7 +1169,7 @@ void ScummEngine_v80he::loadWizCursor(int resId, int resType, bool state) { wi.x1 = wi.y1 = 0; wi.state = 0; wi.flags = kWIFBlitToMemBuffer; - uint8 *cursor = drawWizImage(rtImage, &wi); + uint8 *cursor = drawWizImage(&wi); int32 cw, ch; getWizImageDim(resId, 0, cw, ch); setCursorFromBuffer(cursor, cw, ch, cw); @@ -1288,7 +1288,7 @@ void ScummEngine_v72he::displayWizComplexImage(const WizParameters *params) { wi.flags = flags; wi.unk = unk; wi.paletteNum = paletteNum; - drawWizImage(rtImage, &wi); + drawWizImage(&wi); } } @@ -1408,7 +1408,7 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) { displayWizComplexImage(params); break; case 2: - captureWizImage(rtImage, params->img.resNum, params->box, (params->img.flags & kWIFBlitToFrontVideoBuffer) == kWIFBlitToFrontVideoBuffer, params->compType); + captureWizImage(params->img.resNum, params->box, (params->img.flags & kWIFBlitToFrontVideoBuffer) == kWIFBlitToFrontVideoBuffer, params->compType); break; case 3: if (params->processFlags & kWPFUseFile) { @@ -1528,9 +1528,9 @@ int ScummEngine_v90he::getWizImageStates(int resnum) { } } -int ScummEngine_v90he::isWizPixelNonTransparent(int restype, int resnum, int state, int x, int y, int flags) { +int ScummEngine_v90he::isWizPixelNonTransparent(int resnum, int state, int x, int y, int flags) { int ret = 0; - uint8 *data = getResourceAddress(restype, resnum); + uint8 *data = getResourceAddress(rtImage, resnum); assert(data); uint8 *wizh = findWrappedBlock(MKID('WIZH'), data, state, 0); assert(wizh); @@ -1555,9 +1555,9 @@ int ScummEngine_v90he::isWizPixelNonTransparent(int restype, int resnum, int sta return ret; } -uint8 ScummEngine_v90he::getWizPixelColor(int restype, int resnum, int state, int x, int y, int flags) { +uint8 ScummEngine_v90he::getWizPixelColor(int resnum, int state, int x, int y, int flags) { uint8 color; - uint8 *data = getResourceAddress(restype, resnum); + uint8 *data = getResourceAddress(rtImage, resnum); assert(data); uint8 *wizh = findWrappedBlock(MKID('WIZH'), data, state, 0); assert(wizh); |