components/prboom/v_video.c
//
// V_CopyRect
//
// Copies a source rectangle in a screen buffer to a destination
// rectangle in another screen buffer. Source origin in srcx,srcy,
// destination origin in destx,desty, common size in width and height.
// Source buffer specfified by srcscrn, destination buffer by destscrn.
//
// Marks the destination rectangle on the screen dirty.
//
// No return.
//
V_CopyRect
Copies a source rectangle in a screen buffer to a destination
rectangle in another screen buffer. Source origin in srcx,srcy,
destination origin in destx,desty, common size in width and height.
Source buffer specfified by srcscrn, destination buffer by destscrn.

Marks the destination rectangle on the screen dirty.

No return.
V_CopyRect Copies a source rectangle in a screen buffer to a destination rectangle in another screen buffer . Source origin in srcx srcy destination origin in destx desty common size in width and height . Source buffer specfified by srcscrn destination buffer by destscrn . Marks the destination rectangle on the screen dirty . No return .
static void FUNC_V_CopyRect(int srcx, int srcy, int srcscrn, int width,
                int height, int destx, int desty, int destscrn,
                enum patch_translation_e flags)
{
  byte *src;
  byte *dest;
  if (flags & VPT_STRETCH)
  {
    srcx=srcx*SCREENWIDTH/320;
    srcy=srcy*SCREENHEIGHT/200;
    width=width*SCREENWIDTH/320;
    height=height*SCREENHEIGHT/200;
    destx=destx*SCREENWIDTH/320;
    desty=desty*SCREENHEIGHT/200;
  }
#ifdef RANGECHECK
  if (srcx<0
      ||srcx+width >SCREENWIDTH
      || srcy<0
      || srcy+height>SCREENHEIGHT
      ||destx<0||destx+width >SCREENWIDTH
      || desty<0
      || desty+height>SCREENHEIGHT)
    I_Error ("V_CopyRect: Bad arguments");
#endif
  src = screens[srcscrn].data+screens[srcscrn].byte_pitch*srcy+srcx*V_GetPixelDepth();
  dest = screens[destscrn].data+screens[destscrn].byte_pitch*desty+destx*V_GetPixelDepth();
  for ( ; height>0 ; height--)
    {
      memcpy (dest, src, width*V_GetPixelDepth());
      src += screens[srcscrn].byte_pitch;
      dest += screens[destscrn].byte_pitch;
    }
}
static void FUNC_V_CopyRect ( int srcx , int srcy , int srcscrn , int width , int height , int destx , int desty , int destscrn , enum patch_translation_e flags ) { byte * src ; byte * dest ; if ( flags & VPT_STRETCH ) { srcx = srcx * SCREENWIDTH / 320 ; srcy = srcy * SCREENHEIGHT / 200 ; width = width * SCREENWIDTH / 320 ; height = height * SCREENHEIGHT / 200 ; destx = destx * SCREENWIDTH / 320 ; desty = desty * SCREENHEIGHT / 200 ; } #ifdef RANGECHECK if ( srcx < 0 || srcx + width > SCREENWIDTH || srcy < 0 || srcy + height > SCREENHEIGHT || destx < 0 || destx + width > SCREENWIDTH || desty < 0 || desty + height > SCREENHEIGHT ) I_Error ( " " ) ; #endif src = screens [ srcscrn ] . data + screens [ srcscrn ] . byte_pitch * srcy + srcx * V_GetPixelDepth ( ) ; dest = screens [ destscrn ] . data + screens [ destscrn ] . byte_pitch * desty + destx * V_GetPixelDepth ( ) ; for ( ; height > 0 ; height -- ) { memcpy ( dest , src , width * V_GetPixelDepth ( ) ) ; src += screens [ srcscrn ] . byte_pitch ; dest += screens [ destscrn ] . byte_pitch ; } }
V_CopyRect
Copies a source rectangle in a screen buffer to a destination
rectangle in another screen buffer.
V_CopyRect Copies a source rectangle in a screen buffer to a destination rectangle in another screen buffer .