From 63e1069ec1b64686f3d1d1a80a6b440a6adb1e2d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 6 Nov 2002 15:29:49 +0000 Subject: [PATCH] removed more unused variables; cleaned up some spaces svn-id: r5442 --- scumm/akos.cpp | 21 ++++++++++----------- scumm/gfx.cpp | 10 +++++----- scumm/gfx.h | 3 ++- scumm/object.cpp | 16 +++++----------- scumm/scumm.h | 35 +++++++++++++++++------------------ 5 files changed, 39 insertions(+), 46 deletions(-) diff --git a/scumm/akos.cpp b/scumm/akos.cpp index 6328bbee6fd..8f74f57e9aa 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -854,8 +854,6 @@ void AkosRenderer::codec1_ignorePakCols(int num) void AkosRenderer::codec5() { int32 clip_left, clip_right, clip_top, clip_bottom, maxw, maxh, tmp_x, tmp_y; - _vm->_bompShadowMode = shadow_mode; - if (!mirror) { clip_left = (_x - move_x_cur - _width) + 1; } else { @@ -907,6 +905,7 @@ void AkosRenderer::codec5() { bdd.dataptr = srcptr; bdd.scale_x = 255; bdd.scale_y = 255; + bdd.shadowMode = shadow_mode; _vm->_bompScallingXPtr = NULL; _vm->_bompScallingYPtr = NULL; @@ -989,16 +988,16 @@ void AkosRenderer::akos16PutOnScreen(byte * dest, byte * src, byte transparency, } } -#define AKOS16_FILL_BITS() \ - if (akos16.numbits <= 8) { \ - akos16.bits |= (*akos16.dataptr++) << akos16.numbits; \ - akos16.numbits += 8; \ - } +#define AKOS16_FILL_BITS() \ + if (akos16.numbits <= 8) { \ + akos16.bits |= (*akos16.dataptr++) << akos16.numbits; \ + akos16.numbits += 8; \ + } + +#define AKOS16_EAT_BITS(n) \ + akos16.numbits -= (n); \ + akos16.bits >>= (n); -#define AKOS16_EAT_BITS(n) \ - akos16.numbits -= (n); \ - akos16.bits >>= (n); - void AkosRenderer::akos16SkipData(int32 numskip) { uint16 bits, tmp_bits; diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 0a175df3292..56f5ef26ce9 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -3248,11 +3248,11 @@ void Scumm::bompScaleFuncX(byte * line_buffer, byte * scalling_x_ptr, byte skip, void Scumm::drawBomp(BompDrawData * bd, int decode_mode, int mask) { byte skip_y = 128; - byte skip_y_new = 0; // FIXME - is this a sensible default value? - byte bits = 0; // FIXME - is this a sensible default value? + byte skip_y_new = 0; + byte bits = 0; + byte *mask_out = 0; byte tmp; int32 clip_left, clip_right, clip_top, clip_bottom, tmp_x, tmp_y; - byte *mask_out = 0; // FIXME - is this a sensible default value? if (bd->x < 0) { clip_left = -bd->x; @@ -3351,7 +3351,7 @@ void Scumm::drawBomp(BompDrawData * bd, int decode_mode, int mask) { bompApplyActorPalette(line_ptr, clip_right); - switch(_bompShadowMode) { + switch(bd->shadowMode) { case 0: bompApplyShadow0(line_ptr, dst, clip_right); break; @@ -3362,7 +3362,7 @@ void Scumm::drawBomp(BompDrawData * bd, int decode_mode, int mask) { bompApplyShadow3(line_ptr, dst, clip_right); break; default: - error("Unknown _bompShadowMode %d", _bompShadowMode); + error("Unknown bomp shadowMode %d", bd->shadowMode); } labelBompSkip: diff --git a/scumm/gfx.h b/scumm/gfx.h index 3ede0d1bd49..d1df0deaa44 100644 --- a/scumm/gfx.h +++ b/scumm/gfx.h @@ -77,7 +77,7 @@ struct ColorCycle { /* Palette cycles */ }; struct BlastObject { /* BlastObjects to draw */ - uint16 number, areaX, areaY, areaWidth, areaHeight; + uint16 number; int16 posX, posY; uint16 width, height; uint16 scaleX, scaleY; @@ -106,6 +106,7 @@ struct BompDrawData { /* Bomp graphics data */ byte scale_x, scale_y; byte *dataptr; int srcwidth, srcheight; + uint16 shadowMode; }; struct Gdi { diff --git a/scumm/object.cpp b/scumm/object.cpp index 104fa307835..cf67337bd7f 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -1153,7 +1153,7 @@ void Scumm::nukeFlObjects(int min, int max) } void Scumm::enqueueObject(int objectNumber, int objectX, int objectY, int objectWidth, - int objectHeight, int f, int g, int image, int mode) + int objectHeight, int scaleX, int scaleY, int image, int mode) { BlastObject *eo; ObjectData *od; @@ -1165,10 +1165,6 @@ void Scumm::enqueueObject(int objectNumber, int objectX, int objectY, int object eo = &_enqueuedObjects[_enqueuePos++]; eo->number = objectNumber; - eo->areaX = _enqueue_b; - eo->areaY = _enqueue_c; - eo->areaWidth = _enqueue_d; - eo->areaHeight = _enqueue_e; eo->posX = objectX + (camera._cur.x & 7); eo->posY = objectY + (camera._cur.y - (_realHeight / 2)); if (objectWidth == 0) { @@ -1184,8 +1180,8 @@ void Scumm::enqueueObject(int objectNumber, int objectX, int objectY, int object eo->height = objectHeight; } - eo->scaleX = f; - eo->scaleY = g; + eo->scaleX = scaleX; + eo->scaleY = scaleY; eo->image = image; eo->mode = mode; @@ -1253,20 +1249,18 @@ void Scumm::drawBlastObject(BlastObject *eo) byte bomp_scalling_x[64], bomp_scalling_y[64]; - _bompShadowMode = 0; - if ((bdd.scale_x != 255) || (bdd.scale_y != 255)) { _bompScallingXPtr = bomp_scalling_x; _bompScallingYPtr = bomp_scalling_y; _bompScaleRight = setupBompScale(_bompScallingXPtr, bdd.srcwidth, bdd.scale_x); _bompScaleBottom = setupBompScale(_bompScallingYPtr, bdd.srcheight, bdd.scale_y); + bdd.shadowMode = 0; drawBomp(&bdd, 1, 3); } else { - _bompShadowMode = eo->mode; + bdd.shadowMode = eo->mode; drawBomp(&bdd, 1, 0); } - _bompShadowMode = 0; _bompScallingXPtr = NULL; _bompScallingYPtr = NULL; _bompScaleRight = 0; diff --git a/scumm/scumm.h b/scumm/scumm.h index fdcedd8b4d9..75dda4a93b8 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -851,34 +851,33 @@ public: // bomp void decompressBomp(byte *dst, byte *src, int w, int h); - void drawBomp(BompDrawData * bd, int decode_mode, int mask); - int32 setupBompScale(byte * scalling, int32 size, byte scale); - void bompScaleFuncX(byte * line_buffer, byte * scalling_x_ptr, byte skip, int32 size); - int32 bompDecodeLineMode0(byte * src, byte * line_buffer, int32 size); - int32 bompDecodeLineMode1(byte * src, byte * line_buffer, int32 size); - int32 bompDecodeLineMode3(byte * src, byte * line_buffer, int32 size); - void bompApplyMask(byte * line_buffer, byte * mask_out, byte bits, int32 size); - void bompApplyShadow0(byte * line_buffer, byte * dst, int32 size); - void bompApplyShadow1(byte * line_buffer, byte * dst, int32 size); - void bompApplyShadow3(byte * line_buffer, byte * dst, int32 size); - void bompApplyActorPalette(byte * line_buffer, int32 size); + void drawBomp(BompDrawData *bd, int decode_mode, int mask); + int32 setupBompScale(byte *scalling, int32 size, byte scale); + void bompScaleFuncX(byte *line_buffer, byte *scalling_x_ptr, byte skip, int32 size); + int32 bompDecodeLineMode0(byte *src, byte *line_buffer, int32 size); + int32 bompDecodeLineMode1(byte *src, byte *line_buffer, int32 size); + int32 bompDecodeLineMode3(byte *src, byte *line_buffer, int32 size); + void bompApplyMask(byte *line_buffer, byte *mask_out, byte bits, int32 size); + void bompApplyShadow0(byte *line_buffer, byte *dst, int32 size); + void bompApplyShadow1(byte *line_buffer, byte *dst, int32 size); + void bompApplyShadow3(byte *line_buffer, byte *dst, int32 size); + void bompApplyActorPalette(byte *line_buffer, int32 size); - uint16 _bompShadowMode; int32 _bompScaleRight, _bompScaleBottom; - byte * _bompScallingXPtr, * _bompScallingYPtr; - byte * _bompMaskPtr; + byte *_bompScallingXPtr, *_bompScallingYPtr; + byte *_bompMaskPtr; int32 _bompMaskPitch; - byte * _bompActorPalletePtr; + byte *_bompActorPalletePtr; uint _shakeFrame; int _screenStartStrip, _screenEndStrip; int _screenLeft, _screenTop; - uint16 _enqueue_b, _enqueue_c, _enqueue_d, _enqueue_e; int _enqueuePos; BlastObject _enqueuedObjects[128]; - void enqueueObject(int a, int b, int c, int d, int e, int f, int g, int h, int mode); + void enqueueObject(int objectNumber, int objectX, int objectY, int objectWidth, + int objectHeight, int scaleX, int scaleY, int image, int mode); void clearEnqueue() { _enqueuePos = 0; } void drawBlastObjects(); void drawBlastObject(BlastObject *eo); @@ -894,7 +893,7 @@ public: uint32 gfxUsageBits[409]; byte *_shadowPalette; int _shadowPaletteSize; - byte _currentPalette[0x300]; + byte _currentPalette[3 * 256]; byte _proc_special_palette[256]; int _palDirtyMin, _palDirtyMax;