diff options
author | Fabio Battaglia | 2009-04-24 15:14:26 +0000 |
---|---|---|
committer | Fabio Battaglia | 2009-04-24 15:14:26 +0000 |
commit | 10caf646189307ada4eb2070fd31e68d4d18dc83 (patch) | |
tree | 420842a77d594c2784a7ffe7a8f6d549aecd613e | |
parent | d7180316ddeb81fac528424233f843ea788106b4 (diff) | |
download | scummvm-rg350-10caf646189307ada4eb2070fd31e68d4d18dc83.tar.gz scummvm-rg350-10caf646189307ada4eb2070fd31e68d4d18dc83.tar.bz2 scummvm-rg350-10caf646189307ada4eb2070fd31e68d4d18dc83.zip |
tinsel: begin modifying drawing function to support psx 4-bit cluts
svn-id: r40119
-rw-r--r-- | engines/tinsel/graphics.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp index 3e4fc647ed..3682a2dcb3 100644 --- a/engines/tinsel/graphics.cpp +++ b/engines/tinsel/graphics.cpp @@ -223,7 +223,7 @@ static void t0WrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool apply * Straight rendering with transparency support, PSX variant supporting also 4-BIT clut data * TODO: finish supporting 4-bit data */ -static void PsxWrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool applyClipping, bool fourBitClut) { +static void PsxWrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool applyClipping, bool fourBitClut, uint32 palStart) { // Set up the offset between destination blocks int rightClip = applyClipping ? pObj->rightClip : 0; Common::Rect boxBounds; @@ -298,10 +298,10 @@ static void PsxWrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool appl if(!fourBitClut) Common::copy(p + boxBounds.left, p + boxBounds.right + 1, tempDest + (SCREEN_WIDTH * (yp - boxBounds.top))); else { - *(tempDest + SCREEN_WIDTH * (yp - boxBounds.top) + 0) = *p & 0x0f; - *(tempDest + SCREEN_WIDTH * (yp - boxBounds.top) + 1) = (*p & 0xf0) >> 4; - *(tempDest + SCREEN_WIDTH * (yp - boxBounds.top) + 2) = *(p + 1) & 0x0f; - *(tempDest + SCREEN_WIDTH * (yp - boxBounds.top) + 3) = (*(p + 1) & 0xf0) >> 4; + *(tempDest + SCREEN_WIDTH * (yp - boxBounds.top) + 0) = (*p & 0x0f) + palStart; + *(tempDest + SCREEN_WIDTH * (yp - boxBounds.top) + 1) = ((*p & 0xf0) >> 4) + palStart; + *(tempDest + SCREEN_WIDTH * (yp - boxBounds.top) + 2) = (*(p + 1) & 0x0f) + palStart; + *(tempDest + SCREEN_WIDTH * (yp - boxBounds.top) + 3) = ((*(p + 1) & 0xf0) >> 4) + palStart; } } @@ -842,7 +842,7 @@ void DrawObject(DRAWOBJECT *pObj) { case 0x08: case 0x41: case 0x48: - PsxWrtNonZero(pObj, srcPtr, destPtr, typeId >= 0x40, psxFourBitClut); + PsxWrtNonZero(pObj, srcPtr, destPtr, typeId >= 0x40, psxFourBitClut, pObj->pPal->posInDAC); break; case 0x04: |