Simplify calling drawBomp a littl

svn-id: r15448
This commit is contained in:
Max Horn 2004-10-07 16:10:51 +00:00
parent f52893217e
commit 3f842b2017
5 changed files with 15 additions and 28 deletions

View File

@ -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 {

View File

@ -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

View File

@ -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);

View File

@ -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)); }

View File

@ -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);
}