mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-11-16 07:48:07 +01:00
Get rid of WinCopyRect-based method of drawing letters and values in
tray tiles, since it seems not to work on all versions of PalmOS. Simply drawing seems fine where tested; will try close clipping if erasure happens elsewhere. Draw board-top stuff one pixel higher on highres devices, and fix scoreboard being too narrow on high-res devices.
This commit is contained in:
parent
fc4fd3ea93
commit
84ec7e38f2
4 changed files with 15 additions and 32 deletions
|
@ -156,8 +156,6 @@ VFSFileOpen
|
|||
VFSGetDefaultDirectory
|
||||
VFSImportDatabaseFromFile
|
||||
VFSVolumeEnumerate
|
||||
WinCopyRectangle
|
||||
WinCreateOffscreenWindow
|
||||
WinDeleteWindow
|
||||
WinDrawBitmap
|
||||
WinDrawChars
|
||||
|
|
|
@ -649,32 +649,16 @@ palm_draw_drawTile( DrawCtx* p_dctx, XP_Rect* rect,
|
|||
|
||||
if ( !!letters ) {
|
||||
if ( *letters != LETTER_NONE ) { /* blank */
|
||||
RectangleType charRect = {{0,0},
|
||||
{CHARRECT_WIDTH*2, CHARRECT_HEIGHT*2}};
|
||||
WinHandle curWind;
|
||||
WinHandle offScreenCharWin = dctx->offScreenCharWin;
|
||||
FontID curFont = FntSetFont( largeFont );
|
||||
|
||||
XP_ASSERT( !!offScreenCharWin );
|
||||
curWind = WinSetDrawWindow( offScreenCharWin );
|
||||
HIGHRES_PUSH_LOC( dctx );
|
||||
|
||||
WinEraseRectangle( &charRect, 0 );
|
||||
|
||||
WinDrawChars( (char*)letters, 1, 0, 0 );
|
||||
width = FntCharsWidth( letters, 1 );
|
||||
|
||||
(void)WinSetDrawWindow( curWind );
|
||||
WinDrawChars( (char*)letters, 1,
|
||||
localR.left + (1*doubler),
|
||||
localR.top + (0*doubler) );
|
||||
|
||||
HIGHRES_POP_LOC(dctx);
|
||||
|
||||
charRect.extent.x = width;
|
||||
|
||||
WinCopyRectangle( offScreenCharWin, 0, &charRect,
|
||||
localR.left + (1*doubler),
|
||||
localR.top + (0*doubler),
|
||||
winOverlay );
|
||||
|
||||
FntSetFont( curFont );
|
||||
}
|
||||
} else if ( !!bitmap ) {
|
||||
|
@ -908,6 +892,11 @@ palmMeasureDrawText( PalmDrawCtx* dctx, XP_Rect* bounds, XP_UCHAR* txt,
|
|||
y += 1;
|
||||
} else {
|
||||
y -= 2;
|
||||
#ifdef FEATURE_HIGHRES
|
||||
if ( dctx->doHiRes ) {
|
||||
--y; /* tweak it up one high-res pixel */
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
WinDrawChars( (const char*)txt, len, x, y );
|
||||
|
@ -1160,7 +1149,7 @@ palm_draw_drawTimer( DrawCtx* p_dctx, XP_Rect* rInner, XP_Rect* rOuter,
|
|||
XP_UCHAR buf[10];
|
||||
XP_Rect localR = *rInner;
|
||||
RectangleType saveClip;
|
||||
XP_U16 len, width;
|
||||
XP_U16 len, width, y;
|
||||
|
||||
HIGHRES_PUSH_LOC(dctx);
|
||||
|
||||
|
@ -1176,8 +1165,11 @@ palm_draw_drawTimer( DrawCtx* p_dctx, XP_Rect* rInner, XP_Rect* rOuter,
|
|||
localR.width = width;
|
||||
}
|
||||
|
||||
y = localR.top - 2;
|
||||
#ifdef FEATURE_HIGHRES
|
||||
if ( !dctx->doHiRes ) {
|
||||
if ( dctx->doHiRes ) {
|
||||
y -= 1; /* tweak it up one high-res pixel */
|
||||
} else {
|
||||
localR.height += 1;
|
||||
}
|
||||
#endif
|
||||
|
@ -1185,7 +1177,7 @@ palm_draw_drawTimer( DrawCtx* p_dctx, XP_Rect* rInner, XP_Rect* rOuter,
|
|||
WinGetClip( &saveClip );
|
||||
WinSetClip( (RectangleType*)&localR );
|
||||
|
||||
WinDrawChars( (const char*)buf, len, localR.left, localR.top - 2 );
|
||||
WinDrawChars( (const char*)buf, len, localR.left, y );
|
||||
WinSetClip( &saveClip );
|
||||
|
||||
HIGHRES_POP_LOC(dctx);
|
||||
|
@ -1386,7 +1378,6 @@ palm_drawctxt_make( MPFORMAL GraphicsAbility able,
|
|||
PalmDrawCtx* dctx;
|
||||
XP_U16 i;
|
||||
XP_U16 cWinWidth, cWinHeight;
|
||||
Err ignore;
|
||||
|
||||
dctx = XP_MALLOC( mpool, sizeof(PalmDrawCtx) );
|
||||
XP_MEMSET( dctx, 0, sizeof(PalmDrawCtx) );
|
||||
|
@ -1468,8 +1459,6 @@ palm_drawctxt_make( MPFORMAL GraphicsAbility able,
|
|||
cWinHeight *= 2;
|
||||
}
|
||||
#endif
|
||||
dctx->offScreenCharWin = WinCreateOffscreenWindow( cWinWidth, cWinHeight,
|
||||
nativeFormat, &ignore );
|
||||
|
||||
if ( able == COLOR ) {
|
||||
} else {
|
||||
|
@ -1493,9 +1482,6 @@ palm_drawctxt_destroy( DrawCtx* p_dctx )
|
|||
{
|
||||
PalmDrawCtx* dctx = (PalmDrawCtx*)p_dctx;
|
||||
|
||||
XP_ASSERT( !!dctx->offScreenCharWin );
|
||||
WinDeleteWindow( dctx->offScreenCharWin, false );
|
||||
|
||||
XP_FREE( dctx->mpool, p_dctx->vtable );
|
||||
#ifdef TALL_FONTS
|
||||
if ( !!dctx->fontHtInfo ) {
|
||||
|
|
|
@ -418,7 +418,7 @@ positionBoard( PalmAppGlobals* globals )
|
|||
boardTop = PALM_BOARD_TOP;
|
||||
scoreLeft = PALM_SCORE_LEFT;
|
||||
scoreTop = PALM_SCORE_TOP;
|
||||
scoreWidth = (bWidth/doubler) - PALM_SCORE_LEFT - timerWidth;
|
||||
scoreWidth = (bWidth/doubler) - PALM_SCORE_LEFT - (timerWidth/doubler);
|
||||
scoreHeight = PALM_SCORE_HEIGHT;
|
||||
} else {
|
||||
boardTop = PALM_GRIDLESS_BOARD_TOP;
|
||||
|
|
|
@ -77,7 +77,6 @@ typedef struct PalmDrawCtx {
|
|||
|
||||
RectangleType oldScoreClip;
|
||||
RectangleType oldTrayClip;
|
||||
WinHandle offScreenCharWin;
|
||||
|
||||
XP_S16 trayOwner;
|
||||
XP_U16 fntHeight;
|
||||
|
|
Loading…
Reference in a new issue