home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-06-25 | 1.5 KB | 55 lines | [TEXT/CWIE] |
- // ===========================================================================
- // CDuplicateBehavior.cp ©1999 Eric Traut
- // ===========================================================================
-
- #include "CDuplicateBehavior.h"
- #include "CShadowWindow.h"
-
-
- // ---------------------------------------------------------------------------
- // • CNewCardBehavior
- // ---------------------------------------------------------------------------
-
- CDuplicateBehavior::CDuplicateBehavior(
- CShadowWindow & inShadowWindow)
- : COffscreenBehavior(inShadowWindow, true)
- {
- }
-
-
- // ---------------------------------------------------------------------------
- // • RenderToGWorld
- // ---------------------------------------------------------------------------
-
- Boolean
- CDuplicateBehavior::RenderToGWorld(
- StGWorldLocker & inBackingLocker,
- StGWorldLocker & inRenderingLocker)
- {
- // Split the blit into two halves.
- Rect destRect;
- UInt32 gworldWidth = mGWorldRect.right - mGWorldRect.left;
-
- destRect = mGWorldRect;
- destRect.right = destRect.left + (mGWorldRect.right - mGWorldRect.left) / 2;
- ::CopyBits( reinterpret_cast<BitMap *>(*inBackingLocker.GetPixMap()),
- reinterpret_cast<BitMap *>(*inRenderingLocker.GetPixMap()),
- &mGWorldRect,
- &destRect,
- srcCopy,
- NULL);
-
- ::OffsetRect(&destRect, (mGWorldRect.right - mGWorldRect.left) / 2, 0);
- ::CopyBits( reinterpret_cast<BitMap *>(*inBackingLocker.GetPixMap()),
- reinterpret_cast<BitMap *>(*inRenderingLocker.GetPixMap()),
- &mGWorldRect,
- &destRect,
- srcCopy,
- NULL);
-
- return true;
- }
-
-
-
-