mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-27 02:01:16 +00:00
More accurate pointer math for the 16-bit case
This commit is contained in:
parent
b31e64892c
commit
ddddc9d5d2
@ -318,7 +318,10 @@ void MxTransitionManager::Transition_Pixelation()
|
|||||||
} else {
|
} else {
|
||||||
MxU32 new_color = MAKELONG(sample, sample);
|
MxU32 new_color = MAKELONG(sample, sample);
|
||||||
|
|
||||||
MxU8 *pos = surface + k * ddsd.lPitch + x_shift;
|
// You might expect a cast to MxU16* instead, but lPitch is
|
||||||
|
// bytes/scanline, not pixels/scanline. Therefore, we just
|
||||||
|
// need to double the x_shift to get to the right spot.
|
||||||
|
MxU8 *pos = surface + k * ddsd.lPitch + 2*x_shift;
|
||||||
MxU32 *dest = (MxU32*)pos;
|
MxU32 *dest = (MxU32*)pos;
|
||||||
// Sets 10 pixels (20 bytes)
|
// Sets 10 pixels (20 bytes)
|
||||||
dest[0] = new_color;
|
dest[0] = new_color;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user