MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / blit

Method blit

src/Engine/Surface.cpp:501–522  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

499 * @param surface Pointer to surface to blit onto.
500 */
501void 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.

Callers

nothing calls this directly

Calls 1

getSurfaceMethod · 0.45

Tested by

no test coverage detected