start hi-res work

This commit is contained in:
ehouse 2004-03-13 14:18:54 +00:00
parent c3e1dd4077
commit dc5e2980cc
2 changed files with 50 additions and 6 deletions

View file

@ -25,7 +25,6 @@
#include <Window.h>
#include <Form.h>
#include <Menu.h>
#include <CharAttr.h>
#include <IrLib.h>
/* #include <TextMgr.h> */
/* #include <UIControls.h> */
@ -840,6 +839,40 @@ doCallbackReg( PalmAppGlobals* globals, XP_Bool reg )
}
} /* doCallbackReg */
static void
initGlobals( PalmAppGlobals* globals )
{
#ifdef FEATURE_HIGHRES
Err err;
XP_U32 vers;
err = FtrGet( sysFtrCreator, sysFtrNumWinVersion, &vers );
globals->hasHiRes = ( err == errNone && vers >= 4 );
XP_LOGF( "hasHiRes = %d", globals->hasHiRes );
if ( globals->hasHiRes ) {
XP_U32 tmp;
if ( WinScreenGetAttribute( winScreenWidth, &tmp ) == errNone ) {
globals->width = tmp;
} else {
globals->width = 160;
}
if ( WinScreenGetAttribute( winScreenHeight, &tmp ) == errNone ) {
globals->height = tmp;
} else {
globals->height = 160;
}
XP_LOGF( "using width=%d, height=%d",
globals->width, globals->height );
}
#endif
} /* initGlobals */
/*****************************************************************************
*
****************************************************************************/
@ -868,6 +901,8 @@ startApplication( PalmAppGlobals** globalsP )
XP_MEMSET( globals, 0, sizeof(PalmAppGlobals) );
MPASSIGN( globals->mpool, mpool );
initGlobals( globals );
globals->vtMgr = make_vtablemgr( MPPARM_NOCOMMA(globals->mpool) );
globals->romVersion = romVersion();

View file

@ -72,17 +72,21 @@ typedef struct PalmDrawCtx {
GraphicsAbility able;
#ifdef FEATURE_HIGHRES
XP_Bool doHiRes;
#endif
union {
struct {
struct {
/* IndexedColorType black; */
/* IndexedColorType white; */
/* IndexedColorType playerColors[MAX_NUM_PLAYERS]; */
/* IndexedColorType bonusColors[BONUS_LAST-1]; */
XP_U8 reserved; /* make CW compiler happy */
} clr;
struct {
CustomPatternType valuePatterns[4];
} bnw;
} clr;
struct {
CustomPatternType valuePatterns[4];
} bnw;
} u;
MPSLOT
} PalmDrawCtx;
@ -269,6 +273,11 @@ struct PalmAppGlobals {
ProgressCtxt progress;
#endif
#ifdef FEATURE_HIGHRES
XP_Bool hasHiRes;
XP_U16 width, height;
#endif
CurGameInfo gameInfo; /* for the currently open, or new, game */
/* dialog/forms state */