* Blits this surface onto another one, with its position * relative to the top-left corner of the target surface. * The cropping rectangle controls the portion of the surface * that is blitted. * @param surface Pointer to surface to blit onto. */
| 499 | * @param surface Pointer to surface to blit onto. |
| 500 | */ |
| 501 | void Surface::blit(Surface *surface) |
| 502 | { |
| 503 | if (_visible && !_hidden) |
| 504 | { |
| 505 | if (_redraw) |
| 506 | draw(); |
| 507 | |
| 508 | SDL_Rect* cropper; |
| 509 | SDL_Rect target; |
| 510 | if (_crop.w == 0 && _crop.h == 0) |
| 511 | { |
| 512 | cropper = 0; |
| 513 | } |
| 514 | else |
| 515 | { |
| 516 | cropper = &_crop; |
| 517 | } |
| 518 | target.x = getX(); |
| 519 | target.y = getY(); |
| 520 | SDL_BlitSurface(_surface, cropper, surface->getSurface(), &target); |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | /** |
| 525 | * Copies the exact contents of another surface onto this one. |
nothing calls this directly
no test coverage detected