mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-06 20:45:54 +01:00
Turn on BitBlt scrolling.
This commit is contained in:
parent
765638289b
commit
33c94620fb
1 changed files with 34 additions and 42 deletions
|
@ -936,50 +936,42 @@ DLSTATIC XP_Bool
|
||||||
DRAW_FUNC_NAME(vertScrollBoard)( DrawCtx* p_dctx, XP_Rect* rect,
|
DRAW_FUNC_NAME(vertScrollBoard)( DrawCtx* p_dctx, XP_Rect* rect,
|
||||||
XP_S16 dist )
|
XP_S16 dist )
|
||||||
{
|
{
|
||||||
#if 0 /* don't turn this on until after ship? */
|
XP_Bool success = XP_FALSE;
|
||||||
if ( dist < 0 ) {
|
/* board passes in the whole board rect, so we need to subtract from it
|
||||||
return XP_FALSE;
|
the height of the area to be overwritten. If dist is negative, the
|
||||||
|
dest is above the src. Otherwise it's below. */
|
||||||
|
|
||||||
|
CEDrawCtx* dctx = (CEDrawCtx*)p_dctx;
|
||||||
|
CEAppGlobals* globals = dctx->globals;
|
||||||
|
int destY, srcY;
|
||||||
|
XP_Bool down = dist <= 0;
|
||||||
|
|
||||||
|
if ( down ) {
|
||||||
|
srcY = rect->top;
|
||||||
|
dist = -dist; /* make it positive */
|
||||||
|
destY = srcY + dist;
|
||||||
} else {
|
} else {
|
||||||
XP_Bool success = XP_FALSE;
|
destY = rect->top;
|
||||||
/* board passes in the whole board rect, so we need to subtract from it
|
srcY = destY + dist;
|
||||||
the height of the area to be overwritten. If dist is negative, the
|
|
||||||
dest is above the src. Otherwise it's below. */
|
|
||||||
|
|
||||||
CEDrawCtx* dctx = (CEDrawCtx*)p_dctx;
|
|
||||||
CEAppGlobals* globals = dctx->globals;
|
|
||||||
int destY, srcY;
|
|
||||||
XP_Bool down = dist <= 0;
|
|
||||||
|
|
||||||
if ( down ) {
|
|
||||||
srcY = rect->top;
|
|
||||||
dist = -dist; /* make it positive */
|
|
||||||
destY = srcY + dist;
|
|
||||||
} else {
|
|
||||||
destY = rect->top;
|
|
||||||
srcY = destY + dist;
|
|
||||||
}
|
|
||||||
|
|
||||||
success = BitBlt( globals->hdc, /* HDC hdcDest, */
|
|
||||||
rect->left, /* int nXDest */
|
|
||||||
destY,
|
|
||||||
rect->width, /* width */
|
|
||||||
rect->height - dist, /* int nHeight */
|
|
||||||
globals->hdc, /* HDC hdcSrc */
|
|
||||||
rect->left, /* int nXSrc */
|
|
||||||
srcY,
|
|
||||||
SRCCOPY ); /* DWORD dwRop */
|
|
||||||
/* need to return the rect that must still be redrawn */
|
|
||||||
if ( success ) {
|
|
||||||
if ( !down ) {
|
|
||||||
rect->top += rect->height - dist;
|
|
||||||
}
|
|
||||||
rect->height = dist;
|
|
||||||
}
|
|
||||||
return success;
|
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
return XP_FALSE;
|
success = FALSE != BitBlt( globals->hdc, /* HDC hdcDest, */
|
||||||
#endif
|
rect->left, /* int nXDest */
|
||||||
|
destY,
|
||||||
|
rect->width, /* width */
|
||||||
|
rect->height - dist, /* int nHeight */
|
||||||
|
globals->hdc, /* HDC hdcSrc */
|
||||||
|
rect->left, /* int nXSrc */
|
||||||
|
srcY,
|
||||||
|
SRCCOPY ); /* DWORD dwRop */
|
||||||
|
/* need to return the rect that must still be redrawn */
|
||||||
|
if ( success ) {
|
||||||
|
if ( !down ) {
|
||||||
|
rect->top += rect->height - dist;
|
||||||
|
}
|
||||||
|
rect->height = dist;
|
||||||
|
}
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
#else /* #ifdef DRAW_LINK_DIRECT */
|
#else /* #ifdef DRAW_LINK_DIRECT */
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Reference in a new issue