diff options
author | Max Horn | 2004-10-07 16:10:51 +0000 |
---|---|---|
committer | Max Horn | 2004-10-07 16:10:51 +0000 |
commit | 3f842b201727daad422a20740d0b89c218769b80 (patch) | |
tree | eddbfa395d02a792fa04a991a1d580ff99df2269 | |
parent | f52893217e0c886b0b3c8c5c9bdad7809fc45454 (diff) | |
download | scummvm-rg350-3f842b201727daad422a20740d0b89c218769b80.tar.gz scummvm-rg350-3f842b201727daad422a20740d0b89c218769b80.tar.bz2 scummvm-rg350-3f842b201727daad422a20740d0b89c218769b80.zip |
Simplify calling drawBomp a littl
svn-id: r15448
-rw-r--r-- | scumm/akos.cpp | 5 | ||||
-rw-r--r-- | scumm/bomp.cpp | 22 | ||||
-rw-r--r-- | scumm/bomp.h | 2 | ||||
-rw-r--r-- | scumm/gfx.h | 2 | ||||
-rw-r--r-- | scumm/object.cpp | 12 |
5 files changed, 15 insertions, 28 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp index b03a3d710b..b3b2719402 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -983,11 +983,6 @@ byte AkosRenderer::codec5(int xmoveCur, int ymoveCur) { bdd.scale_y = 255; bdd.shadowMode = _shadow_mode; - bdd.scalingXPtr = NULL; - bdd.scalingYPtr = NULL; - bdd.scaleRight = 0; - bdd.scaleBottom = 0; - if (!_mirror) { bdd.x = (_actorX - xmoveCur - _width) + 1; } else { diff --git a/scumm/bomp.cpp b/scumm/bomp.cpp index b453d9025e..65464fc093 100644 --- a/scumm/bomp.cpp +++ b/scumm/bomp.cpp @@ -27,6 +27,8 @@ namespace Scumm { +static int32 setupBompScale(byte *scaling, int32 size, byte scale); + static void bompScaleFuncX(byte *line_buffer, byte *scaling_x_ptr, byte skip, int32 size); static void bompApplyShadow0(const byte *shadowPalette, const byte *line_buffer, byte *dst, int32 size, byte transparency, byte HE7Check); @@ -200,10 +202,12 @@ void ScummEngine::drawBomp(const BompDrawData &bd, bool mirror) { byte *dst; byte *mask = 0; Common::Rect clip; - byte *scalingYPtr = bd.scalingYPtr; + byte *scalingYPtr = 0; byte skip_y_bits = 0x80; byte skip_y_new = 0; byte tmp; + byte bomp_scaling_x[64]; + byte bomp_scaling_y[64]; if (bd.x < 0) { @@ -240,21 +244,23 @@ void ScummEngine::drawBomp(const BompDrawData &bd, bool mirror) { // Setup vertical scaling if (bd.scale_y != 255) { - assert(scalingYPtr); + int scaleBottom = setupBompScale(bomp_scaling_y, bd.srcheight, bd.scale_y); + scalingYPtr = bomp_scaling_y; skip_y_new = *scalingYPtr++; skip_y_bits = 0x80; - if (clip.bottom > bd.scaleBottom) { - clip.bottom = bd.scaleBottom; + if (clip.bottom > scaleBottom) { + clip.bottom = scaleBottom; } } // Setup horizontal scaling if (bd.scale_x != 255) { - assert(bd.scalingXPtr); - if (clip.right > bd.scaleRight) { - clip.right = bd.scaleRight; + int scaleRight = setupBompScale(bomp_scaling_x, bd.srcwidth, bd.scale_x); + + if (clip.right > scaleRight) { + clip.right = scaleRight; } } @@ -296,7 +302,7 @@ void ScummEngine::drawBomp(const BompDrawData &bd, bool mirror) { // Perform horizontal scaling if (bd.scale_x != 255) { - bompScaleFuncX(line_buffer, bd.scalingXPtr, 0x80, bd.srcwidth); + bompScaleFuncX(line_buffer, bomp_scaling_x, 0x80, bd.srcwidth); } // The first clip.top lines are to be clipped, i.e. not drawn diff --git a/scumm/bomp.h b/scumm/bomp.h index d497d6329e..742a002f2e 100644 --- a/scumm/bomp.h +++ b/scumm/bomp.h @@ -26,8 +26,6 @@ namespace Scumm { -int32 setupBompScale(byte *scaling, int32 size, byte scale); - void bompApplyMask(byte *line_buffer, byte *mask, byte maskbit, int32 size, byte transparency); void bompApplyShadow(int shadowMode, const byte *shadowPalette, const byte *line_buffer, byte *dst, int32 size, byte transparency, byte HE7Check = false); diff --git a/scumm/gfx.h b/scumm/gfx.h index 00e8e27a49..ae46abfc6a 100644 --- a/scumm/gfx.h +++ b/scumm/gfx.h @@ -193,8 +193,6 @@ struct BompDrawData { int srcwidth, srcheight; uint16 shadowMode; - int32 scaleRight, scaleBottom; - byte *scalingXPtr, *scalingYPtr; byte *maskPtr; BompDrawData() { memset(this, 0, sizeof(*this)); } diff --git a/scumm/object.cpp b/scumm/object.cpp index 273c6d261f..4eac7590b3 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -1519,21 +1519,11 @@ void ScummEngine::drawBlastObject(BlastObject *eo) { bdd.maskPtr = NULL; if ((bdd.scale_x != 255) || (bdd.scale_y != 255)) { - byte bomp_scaling_x[64], bomp_scaling_y[64]; - bdd.scalingXPtr = bomp_scaling_x; - bdd.scalingYPtr = bomp_scaling_y; - bdd.scaleRight = setupBompScale(bomp_scaling_x, bdd.srcwidth, bdd.scale_x); - bdd.scaleBottom = setupBompScale(bomp_scaling_y, bdd.srcheight, bdd.scale_y); bdd.shadowMode = 0; - drawBomp(bdd, false); } else { - bdd.scalingXPtr = NULL; - bdd.scalingYPtr = NULL; - bdd.scaleRight = 0; - bdd.scaleBottom = 0; bdd.shadowMode = eo->mode; - drawBomp(bdd, false); } + drawBomp(bdd, false); markRectAsDirty(vs->number, bdd.x, bdd.x + bdd.srcwidth, bdd.y, bdd.y + bdd.srcheight); } |