* Copies the exact contents of another surface onto this one. * Only the content that would overlap both surfaces is copied, in * accordance with their positions. This is handy for applying * effects over another surface without modifying the original. * @param surface Pointer to surface to copy from. */
| 529 | * @param surface Pointer to surface to copy from. |
| 530 | */ |
| 531 | void Surface::copy(Surface *surface) |
| 532 | { |
| 533 | SDL_Rect from; |
| 534 | from.x = getX() - surface->getX(); |
| 535 | from.y = getY() - surface->getY(); |
| 536 | from.w = getWidth(); |
| 537 | from.h = getHeight(); |
| 538 | SDL_BlitSurface(surface->getSurface(), &from, _surface, 0); |
| 539 | } |
| 540 | |
| 541 | /** |
| 542 | * Draws a filled rectangle on the surface. |
no test coverage detected