From b3da969a478b25ac15f6a5498a898f36ce5754e0 Mon Sep 17 00:00:00 2001 From: ehouse Date: Tue, 2 Nov 2004 06:05:23 +0000 Subject: [PATCH] more tweaks to high-res drawing -- and don't call WinSetScalingMode when it's not available! --- palm/palmdraw.c | 17 +++++++++++++---- palm/palmmain.h | 9 ++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/palm/palmdraw.c b/palm/palmdraw.c index 297e1bab9..5b365afab 100644 --- a/palm/palmdraw.c +++ b/palm/palmdraw.c @@ -305,10 +305,14 @@ palm_common_draw_drawCell( DrawCtx* p_dctx, XP_Rect* rect, if ( len > 0 ) { XP_S16 strWidth = FntCharsWidth( (const char*)letters, len ); XP_U16 x = localR.left + ((localR.width-strWidth) / 2); + XP_U16 y = localR.top-1; if ( len == 1 ) { ++x; } - WinDrawChars( (const char*)letters, len, x, localR.top-1 ); + if ( dctx->doHiRes ) { + --y; + } + WinDrawChars( (const char*)letters, len, x, y ); showBonus = XP_FALSE; empty = XP_FALSE; @@ -492,7 +496,7 @@ palm_draw_drawTile( DrawCtx* p_dctx, XP_Rect* rect, if ( 0 ) { #ifdef FEATURE_HIGHRES - } else if ( dctx->doHiRes ) { + } else if ( dctx->doHiRes && dctx->oneDotFiveAvail ) { UInt32 oldMode = WinSetScalingMode( kTextScalingOff ); FontID curFont = FntGetFont(); FntSetFont( boldFont ); @@ -607,10 +611,16 @@ palm_draw_drawBoardArrow( DrawCtx* p_dctx, XP_Rect* rectP, XWBonusType cursorBonus, XP_Bool vertical ) { PalmDrawCtx* dctx = (PalmDrawCtx*)p_dctx; + RectangleType oldClip; Int16 resID = vertical? DOWN_ARROW_RESID:RIGHT_ARROW_RESID; + WinGetClip( &oldClip ); + WinSetClip( (RectangleType*)rectP ); + bitmapInRect( dctx, resID, rectP ); + + WinSetClip( &oldClip ); } /* palm_draw_drawBoardArrow */ #ifdef COLOR_SUPPORT @@ -921,8 +931,6 @@ palm_draw_score_pendingScore( DrawCtx* p_dctx, XP_Rect* rect, XP_S16 score, HIGHRES_PUSH_LOC(dctx); - str = (*dctx->getResStrFunc)( dctx->globals, STR_PTS ); - WinGetClip( &oldClip ); RctGetIntersection( &oldClip, (RectangleType*)rect, &newClip ); if ( newClip.extent.y > 0 ) { @@ -1305,6 +1313,7 @@ palm_drawctxt_make( MPFORMAL GraphicsAbility able, } dctx->fntHeight = FntBaseLine(); + dctx->oneDotFiveAvail = globals->oneDotFiveAvail; return (DrawCtx*)dctx; } /* palm_drawctxt_make */ diff --git a/palm/palmmain.h b/palm/palmmain.h index 363987ba9..79676057f 100644 --- a/palm/palmmain.h +++ b/palm/palmmain.h @@ -77,15 +77,12 @@ typedef struct PalmDrawCtx { #ifdef FEATURE_HIGHRES UInt16 oldCoord; XP_Bool doHiRes; + XP_Bool oneDotFiveAvail; #endif union { struct { -/* IndexedColorType black; */ -/* IndexedColorType white; */ -/* IndexedColorType playerColors[MAX_NUM_PLAYERS]; */ -/* IndexedColorType bonusColors[BONUS_LAST-1]; */ - XP_U8 reserved; /* make CW compiler happy */ + XP_U8 reserved; /* make CW compiler happy */ } clr; struct { CustomPatternType valuePatterns[4]; @@ -286,6 +283,8 @@ struct PalmAppGlobals { XP_U16 sonyLibRef; XP_Bool doVSK; XP_Bool hasHiRes; + XP_Bool oneDotFiveAvail; + XP_Bool useHiRes; #endif #ifdef XWFEATURE_SEARCHLIMIT