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

Method copy

src/Engine/Surface.cpp:531–539  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

529 * @param surface Pointer to surface to copy from.
530 */
531void 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.

Callers 5

BattlescapeStateMethod · 0.80
GeoscapeStateMethod · 0.80
DogfightStateMethod · 0.80
mouseOverMethod · 0.80
drawTrackMethod · 0.80

Calls 3

getXMethod · 0.45
getYMethod · 0.45
getSurfaceMethod · 0.45

Tested by

no test coverage detected