Merge branch 'master' into jgrpp

# Conflicts:
#	src/saveload/station_sl.cpp
#	src/saveload/town_sl.cpp
#	src/spritecache.cpp
#	src/timetable_gui.cpp
This commit is contained in:
Jonathan G Rennison
2023-01-06 20:02:04 +00:00
19 changed files with 112 additions and 65 deletions

View File

@@ -526,7 +526,7 @@ void Blitter_32bppAnim::CopyFromBuffer(void *video, const void *src, int width,
dst += _screen.pitch;
/* Copy back the anim-buffer */
memcpy(anim_line, usrc, width * sizeof(uint16));
usrc = (const uint32 *)((const uint16 *)usrc + width);
usrc = (const uint32 *)&((const uint16 *)usrc)[width];
anim_line += this->anim_buf_pitch;
/* Okay, it is *very* likely that the image we stored is using
@@ -565,7 +565,7 @@ void Blitter_32bppAnim::CopyToBuffer(const void *video, void *dst, int width, in
udst += width;
/* Copy the anim-buffer */
memcpy(udst, anim_line, width * sizeof(uint16));
udst = (uint32 *)((uint16 *)udst + width);
udst = (uint32 *)&((uint16 *)udst)[width];
anim_line += this->anim_buf_pitch;
}
}

View File

@@ -329,8 +329,9 @@ template <bool Tpal_to_rgb> Sprite *Blitter_32bppOptimized::EncodeInternal(const
const SpriteLoader::CommonPixel *src = (const SpriteLoader::CommonPixel *)src_orig->data;
for (uint y = src_orig->height; y > 0; y--) {
Colour *dst_px = (Colour *)(dst_px_ln + 1);
uint16 *dst_n = (uint16 *)(dst_n_ln + 1);
/* Index 0 of dst_px and dst_n is left as space to save the length of the row to be filled later. */
Colour *dst_px = (Colour *)&dst_px_ln[1];
uint16 *dst_n = (uint16 *)&dst_n_ln[1];
uint16 *dst_len = dst_n++;