fix crashes when quad-{word,letter} present

This commit is contained in:
Eric House 2022-03-14 18:15:50 +01:00
parent 08310b0179
commit 4b1795cd5b
6 changed files with 26 additions and 10 deletions

View file

@ -1763,6 +1763,12 @@ public class BoardDelegate extends DelegateBase
case BONUS_TRIPLE_WORD:
id = R.string.bonus_w3x;
break;
case BONUS_QUAD_LETTER:
id = R.string.bonus_l4x;
break;
case BONUS_QUAD_WORD:
id = R.string.bonus_w4x;
break;
default:
Assert.failDbg();
}

View file

@ -74,13 +74,7 @@ public interface DrawCtx {
void score_pendingScore( Rect rect, int score, int playerNum,
boolean curTurn, int flags );
public static final int BONUS_NONE = 0;
public static final int BONUS_DOUBLE_LETTER = 1;
public static final int BONUS_DOUBLE_WORD = 2;
public static final int BONUS_TRIPLE_LETTER = 3;
public static final int BONUS_TRIPLE_WORD = 4;
public static final int INTRADE_MW_TEXT = 5;
// typ possibilities are defined in UtilCtxt.java
void objFinished( /*BoardObjectType*/int typ, Rect rect );
void dictChanged( long dictPtr );

View file

@ -28,6 +28,8 @@ public interface UtilCtxt {
static final int BONUS_DOUBLE_WORD = 2;
static final int BONUS_TRIPLE_LETTER = 3;
static final int BONUS_TRIPLE_WORD = 4;
static final int BONUS_QUAD_LETTER = 5;
static final int BONUS_QUAD_WORD = 6;
public static final int TRAY_HIDDEN = 0;
public static final int TRAY_REVERSED = 1;

View file

@ -1,6 +1,7 @@
/* -*-mode: C; fill-column: 78; c-basic-offset: 4; -*- */
/* -*- compile-command: "cd ../linux && make -j5 MEMDEBUG=TRUE"; -*- */
/*
* Copyright 1997 - 2003 by Eric House (xwords@eehouse.org). All rights reserved.
* Copyright 1997 - 2022 by Eric House (xwords@eehouse.org). All rights
* reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -296,6 +297,7 @@ default_draw_score_pendingScore( DrawCtx* dctx,
draw_setClip( dctx, &oldClip, NULL );
} /* default_draw_score_pendingScore */
#ifdef XWFEATURE_MINIWIN
static const XP_UCHAR*
default_draw_getMiniWText( DrawCtx* XP_UNUSED(dctx), XWMiniTextType textHint )
{
@ -310,6 +312,10 @@ default_draw_getMiniWText( DrawCtx* XP_UNUSED(dctx), XWMiniTextType textHint )
str = "Triple letter"; break;
case BONUS_TRIPLE_WORD:
str = "Triple word"; break;
case BONUS_QUAD_LETTER:
str = "Quad letter"; break;
case BONUS_QUAD_WORD:
str = "Quad word"; break;
case INTRADE_MW_TEXT:
str = "Trading tiles;\nclick D when done"; break;
default:
@ -343,6 +349,7 @@ default_draw_drawMiniWindow( DrawCtx* dctx, const XP_UCHAR* text,
draw_setClip( dctx, &oldClip, NULL );
} /* default_draw_drawMiniWindow */
#endif
void
InitDrawDefaults( DrawCtxVTable* vtable )

View file

@ -418,6 +418,10 @@ curses_draw_drawCell( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rect
ch = '^'; break;
case BONUS_TRIPLE_WORD:
ch = '#'; break;
case BONUS_QUAD_LETTER:
ch = '%'; break;
case BONUS_QUAD_WORD:
ch = '&'; break;
default:
break;
} /* switch */

View file

@ -1326,7 +1326,6 @@ gtk_draw_getMiniWText( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
{
/* GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx; */
XP_UCHAR* str;
switch( textHint ) {
case BONUS_DOUBLE_LETTER:
str = "Double letter"; break;
@ -1334,6 +1333,10 @@ gtk_draw_getMiniWText( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
str = "Double word"; break;
case BONUS_TRIPLE_LETTER:
str = "Triple letter"; break;
case BONUS_QUAD_WORD:
str = "Quad word"; break;
case BONUS_QUAD_LETTER:
str = "Quad letter"; break;
case BONUS_TRIPLE_WORD:
str = "Triple word"; break;
case INTRADE_MW_TEXT: