[Scummvm-tracker] [ScummVM :: Bugs] #15222: SCI: PEPPER: The carrier pigeon is barely visible when flying to Penn Mansion
ScummVM :: Bugs
trac at scummvm.org
Fri Jul 5 09:14:34 UTC 2024
#15222: SCI: PEPPER: The carrier pigeon is barely visible when flying to Penn
Mansion
-------------------------+------------------------------------------
Reporter: eriktorbjorn | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: Engine: SCI
Version: | Resolution:
Keywords: | Game: Pepper's Adventures in Time
-------------------------+------------------------------------------
Comment (by eriktorbjorn):
With the old scaling algorithm, the scaled size can be 1x1, 1x2, and
sometimes 2x2 pixels. As far as I can tell, the algorithm is basically
just:
{{{
scaledWidth = (celInfo->width * scaleX) >> 7;
scaledHeight = (celInfo->height * scaleY) >> 7;
}}}
The smallest celInfo size is 4x4 pixels. The scale factors start at 47,
and are gradually decreased to 32. Another sign that originally a larger
bird sprite was displayed, perhaps?
So even in the worst case, we have (4 * 32) >> 7 = 1.
With the new scaling algorithm, the scaled size can be 0x0, 0x2, and
sometimes 2x2 pixels.
The celInfo size and scale factors are the same, of course. The scaled
size is calculated by createScalingTable().
It uses the same formula as the old algorithm:
{{{
const int16 scaledSize = (celSize * scale) >> 7;
}}}
But then stepCount is scaledSize - 1, which means it can easily be 0. And
then we fall into this case:
{{{
if (stepCount <= 0) {
table.clear();
return;
}
}}}
The final scaled size is the size of the scale table, so that's why we get
0 here. But if I just try to initialize table[0] to something, ScummVM
crashes. I guess I just haven't managed to wrap my head around how that
scale table works...
--
Ticket URL: <https://bugs.scummvm.org/ticket/15222#comment:6>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list