* Copy information from one screenbuffer to the other. * @param xSrc The X-coordinate on the source. * @param ySrc The Y-coordinate on the source. * @param xDst The X-coordinate on the destination. * @param yDst The Y-coordinate on the destination. * @param width The width. * @param height The height. * @param screenSrc The ID of the source screen. * @param screenDst The ID of the destinat
| 402 | * @param screenDst The ID of the destination screen. |
| 403 | */ |
| 404 | void GFX_Screen_Copy(int16 xSrc, int16 ySrc, int16 xDst, int16 yDst, int16 width, int16 height, Screen screenSrc, Screen screenDst) |
| 405 | { |
| 406 | uint8 *src; |
| 407 | uint8 *dst; |
| 408 | |
| 409 | if (xSrc >= SCREEN_WIDTH) return; |
| 410 | if (xSrc < 0) xSrc = 0; |
| 411 | |
| 412 | if (ySrc >= SCREEN_HEIGHT) return; |
| 413 | if (ySrc < 0) ySrc = 0; |
| 414 | |
| 415 | if (xDst >= SCREEN_WIDTH) return; |
| 416 | if (xDst < 0) xDst = 0; |
| 417 | |
| 418 | if ((yDst + height) > SCREEN_HEIGHT) { |
| 419 | height = SCREEN_HEIGHT - 1 - yDst; |
| 420 | } |
| 421 | if (height <= 0) return; |
| 422 | |
| 423 | if (yDst >= SCREEN_HEIGHT) return; |
| 424 | if (yDst < 0) yDst = 0; |
| 425 | |
| 426 | if (width <= 0 || width > SCREEN_WIDTH) return; |
| 427 | |
| 428 | src = GFX_Screen_Get_ByIndex(screenSrc); |
| 429 | dst = GFX_Screen_Get_ByIndex(screenDst); |
| 430 | |
| 431 | src += xSrc + ySrc * SCREEN_WIDTH; |
| 432 | dst += xDst + yDst * SCREEN_WIDTH; |
| 433 | |
| 434 | GFX_Screen_SetDirty(screenDst, xDst, yDst, xDst + width, yDst + height); |
| 435 | |
| 436 | if (width == SCREEN_WIDTH) { |
| 437 | memmove(dst, src, height * SCREEN_WIDTH); |
| 438 | } else { |
| 439 | while (height-- != 0) { |
| 440 | memmove(dst, src, width); |
| 441 | dst += SCREEN_WIDTH; |
| 442 | src += SCREEN_WIDTH; |
| 443 | } |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | /** |
| 448 | * Clears the screen. |
no test coverage detected