281 |
|
// From video_blit.cpp |
282 |
|
extern void (*Screen_blit)(uint8 * dest, const uint8 * source, uint32 length); |
283 |
|
extern bool Screen_blitter_init(XVisualInfo * visual_info, bool native_byte_order, video_depth mac_depth); |
284 |
+ |
extern uint32 ExpandMap[256]; |
285 |
|
|
286 |
|
/* How can we deal with array overrun conditions ? |
287 |
|
|
337 |
|
const int y2 = mainBuffer.pageInfo[page - 1].bottom; |
338 |
|
const int height = y2 - y1 + 1; |
339 |
|
|
339 |
– |
const int bytes_per_row = VideoMonitor.mode.bytes_per_row; |
340 |
– |
const int bytes_per_pixel = VideoMonitor.mode.bytes_per_row / VideoMonitor.mode.x; |
341 |
– |
int i = y1 * bytes_per_row, j; |
342 |
– |
|
340 |
|
if (VideoMonitor.mode.depth == VDEPTH_1BIT) { |
341 |
|
|
342 |
|
// Update the_host_buffer and copy of the_buffer |
343 |
+ |
const int bytes_per_row = VideoMonitor.mode.bytes_per_row; |
344 |
+ |
int i = y1 * bytes_per_row, j; |
345 |
|
for (j = y1; j <= y2; j++) { |
346 |
|
Screen_blit(the_host_buffer + i, the_buffer + i, VideoMonitor.mode.x >> 3); |
347 |
|
i += bytes_per_row; |
350 |
|
} else { |
351 |
|
|
352 |
|
// Update the_host_buffer and copy of the_buffer |
353 |
+ |
const int src_bytes_per_row = VideoMonitor.mode.bytes_per_row; |
354 |
+ |
const int dst_bytes_per_row = drv->img->bytes_per_line; |
355 |
+ |
const int bytes_per_pixel = src_bytes_per_row / VideoMonitor.mode.x; |
356 |
+ |
int i1 = y1 * src_bytes_per_row, i2 = y1 * dst_bytes_per_row, j; |
357 |
|
for (j = y1; j <= y2; j++) { |
358 |
< |
Screen_blit(the_host_buffer + i, the_buffer + i, bytes_per_pixel * VideoMonitor.mode.x); |
359 |
< |
i += bytes_per_row; |
358 |
> |
Screen_blit(the_host_buffer + i2, the_buffer + i1, bytes_per_pixel * VideoMonitor.mode.x); |
359 |
> |
i1 += src_bytes_per_row; |
360 |
> |
i2 += dst_bytes_per_row; |
361 |
|
} |
362 |
|
} |
363 |
|
|