Fix to compile and work with draw API changes

This commit is contained in:
ehouse 2006-11-12 14:51:47 +00:00
parent f9dcd1820a
commit 539a7b4ab5
2 changed files with 23 additions and 20 deletions

View file

@ -203,7 +203,8 @@ curses_draw_measureScoreText( DrawCtx* XP_UNUSED(p_dctx),
static void
curses_draw_score_pendingScore( DrawCtx* p_dctx, const XP_Rect* rect,
XP_S16 score, XP_U16 XP_UNUSED(playerNum) )
XP_S16 score, XP_U16 XP_UNUSED(playerNum),
CellFlags XP_UNUSED(flags) )
{
CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
char buf[4];
@ -219,7 +220,7 @@ curses_draw_score_pendingScore( DrawCtx* p_dctx, const XP_Rect* rect,
} /* curses_draw_score_pendingScore */
static void
curses_draw_objFinished( DrawCtx* p_dctx, BoardObjectType typ,
curses_draw_objFinished( DrawCtx* p_dctx, BoardObjectType XP_UNUSED(typ),
const XP_Rect* rect, DrawFocusState dfs )
{
CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
@ -251,8 +252,7 @@ curses_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect,
const XP_UCHAR* letter, XP_Bitmap XP_UNUSED(bitmap),
Tile XP_UNUSED(tile), XP_S16 XP_UNUSED(owner),
XWBonusType bonus, HintAtts XP_UNUSED(hintAtts),
XP_Bool XP_UNUSED(isBlank), XP_Bool highlight,
XP_Bool XP_UNUSED(isStar) )
CellFlags flags )
{
CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
XP_UCHAR loc[4];
@ -274,14 +274,14 @@ curses_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect,
} /* switch */
}
if ( highlight ) {
if ( (flags&CELL_HIGHLIGHT) != 0 ) {
wstandout( dctx->boardWin );
}
mvwaddnstr( dctx->boardWin, rect->top, rect->left, loc,
strlen(loc) );
if ( highlight ) {
if ( (flags&CELL_HIGHLIGHT) != 0 ) {
wstandend( dctx->boardWin );
}
@ -307,7 +307,7 @@ curses_stringInTile( CursesDrawCtx* dctx, const XP_Rect* rect,
static void
curses_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect,
const XP_UCHAR* textP, XP_Bitmap XP_UNUSED(bitmap),
XP_S16 val, XP_Bool highlighted )
XP_S16 val, CellFlags flags )
{
char numbuf[5];
char letterbuf[5];
@ -326,14 +326,15 @@ curses_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect,
curses_stringInTile( dctx, rect, letterbuf, nump );
if ( highlighted ) {
if ( (flags&CELL_HIGHLIGHT) != 0 ) {
mvwaddnstr( dctx->boardWin, rect->top+rect->height-1,
rect->left, "*-*", 3 );
}
} /* curses_draw_drawTile */
static void
curses_draw_drawTileBack( DrawCtx* p_dctx, const XP_Rect* rect )
curses_draw_drawTileBack( DrawCtx* p_dctx, const XP_Rect* rect,
CellFlags XP_UNUSED(flags) )
{
CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
curses_stringInTile( dctx, rect, "?", "?" );
@ -352,7 +353,8 @@ curses_draw_drawTrayDivider( DrawCtx* p_dctx, const XP_Rect* rect,
static void
curses_draw_drawBoardArrow( DrawCtx* p_dctx, const XP_Rect* rect,
XWBonusType XP_UNUSED(cursorBonus),
XP_Bool vertical, HintAtts XP_UNUSED(hintAtts) )
XP_Bool vertical, HintAtts XP_UNUSED(hintAtts),
CellFlags XP_UNUSED(flags) )
{
CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
#if 1

View file

@ -305,8 +305,7 @@ drawHintBorders( GtkDrawCtx* dctx, const XP_Rect* rect, HintAtts hintAtts)
static XP_Bool
gtk_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* letter,
XP_Bitmap bitmap, Tile XP_UNUSED(tile), XP_S16 owner,
XWBonusType bonus, HintAtts hintAtts,
XP_Bool isBlank, XP_Bool highlight, XP_Bool isStar )
XWBonusType bonus, HintAtts hintAtts, CellFlags flags )
{
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
XP_Rect rectInset = *rect;
@ -347,7 +346,7 @@ gtk_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* letter,
TRUE,
rectInset.left, rectInset.top,
rectInset.width+1, rectInset.height+1 );
if ( highlight ) {
if ( (flags & CELL_HIGHLIGHT) != 0 ) {
foreground = &dctx->red;
} else {
foreground = &dctx->playerColors[owner];
@ -357,7 +356,7 @@ gtk_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* letter,
&rectInset, XP_GTK_JUST_CENTER,
foreground, NULL );
if ( isBlank ) {
if ( (flags & CELL_ISBLANK) != 0 ) {
gdk_draw_arc( DRAW_WHAT(dctx), dctx->drawGC,
0, /* filled */
rect->left, /* x */
@ -371,7 +370,7 @@ gtk_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* letter,
drawBitmapFromLBS( dctx, bitmap, rect );
}
if ( isStar ) {
if ( (flags & CELL_ISSTAR) != 0 ) {
draw_string_at( dctx, dctx->layout[LAYOUT_SMALL], "*",
rect, XP_GTK_JUST_CENTER,
&dctx->black, NULL );
@ -417,7 +416,7 @@ gtk_draw_trayBegin( DrawCtx* p_dctx, const XP_Rect* rect, XP_U16 owner,
static void
gtk_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* textP,
XP_Bitmap bitmap, XP_S16 val, XP_Bool highlighted )
XP_Bitmap bitmap, XP_S16 val, CellFlags flags )
{
XP_UCHAR numbuf[3];
gint len;
@ -469,7 +468,7 @@ gtk_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* textP,
insetR.left, insetR.top, insetR.width,
insetR.height );
if ( highlighted ) {
if ( (flags & CELL_HIGHLIGHT) != 0 ) {
insetRect( &insetR, 1 );
gdk_draw_rectangle( DRAW_WHAT(dctx),
dctx->drawGC,
@ -480,7 +479,8 @@ gtk_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* textP,
} /* gtk_draw_drawTile */
static void
gtk_draw_drawTileBack( DrawCtx* p_dctx, const XP_Rect* rect )
gtk_draw_drawTileBack( DrawCtx* p_dctx, const XP_Rect* rect,
CellFlags XP_UNUSED(flags) )
{
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
XP_Rect r = *rect;
@ -563,7 +563,7 @@ gtk_draw_clearRect( DrawCtx* p_dctx, const XP_Rect* rectP )
static void
gtk_draw_drawBoardArrow( DrawCtx* p_dctx, const XP_Rect* rectP,
XWBonusType XP_UNUSED(cursorBonus), XP_Bool vertical,
HintAtts hintAtts )
HintAtts hintAtts, CellFlags XP_UNUSED(flags) )
{
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
const char* curs = vertical? "|":"-";
@ -706,7 +706,8 @@ gtk_draw_score_drawPlayer( DrawCtx* p_dctx, const XP_Rect* rInner,
static void
gtk_draw_score_pendingScore( DrawCtx* p_dctx, const XP_Rect* rect,
XP_S16 score, XP_U16 XP_UNUSED(playerNum) )
XP_S16 score, XP_U16 XP_UNUSED(playerNum),
CellFlags XP_UNUSED(flags) )
{
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
char buf[5];