Viewport: Cache landscape pixels in map mode
Avoid invalidating landscape pixels for non-landscape updates (vehicles, overlays, etc.)
This commit is contained in:
@@ -31,24 +31,29 @@ void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int
|
||||
});
|
||||
}
|
||||
|
||||
void Blitter_32bppBase::SetLine(void *video, int x, int y, uint8 *colours, uint width)
|
||||
void Blitter_32bppBase::SetRect(void *video, int x, int y, const uint8 *colours, uint lines, uint width, uint pitch)
|
||||
{
|
||||
Colour *dst = (Colour *)video + x + y * _screen.pitch;
|
||||
do {
|
||||
*dst = LookupColourInPalette(*colours);
|
||||
dst++;
|
||||
colours++;
|
||||
} while (--width);
|
||||
uint w = width;
|
||||
do {
|
||||
*dst = LookupColourInPalette(*colours);
|
||||
dst++;
|
||||
colours++;
|
||||
} while (--w);
|
||||
dst += _screen.pitch - width;
|
||||
colours += pitch - width;
|
||||
} while (--lines);
|
||||
}
|
||||
|
||||
void Blitter_32bppBase::SetLine32(void *video, int x, int y, uint32 *colours, uint width)
|
||||
void Blitter_32bppBase::SetRect32(void *video, int x, int y, const uint32 *colours, uint lines, uint width, uint pitch)
|
||||
{
|
||||
Colour *dst = (Colour *)video + x + y * _screen.pitch;
|
||||
uint32 *dst = (uint32 *)video + x + y * _screen.pitch;
|
||||
do {
|
||||
*dst = *colours;
|
||||
dst++;
|
||||
colours++;
|
||||
} while (--width);
|
||||
memcpy(dst, colours, width * sizeof(uint32));
|
||||
dst += _screen.pitch;
|
||||
colours += pitch;
|
||||
} while (--lines);
|
||||
}
|
||||
|
||||
void Blitter_32bppBase::DrawRect(void *video, int width, int height, uint8 colour)
|
||||
|
||||
Reference in New Issue
Block a user