mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-27 07:58:49 +01:00
fix crashes when quad-{word,letter} present
This commit is contained in:
parent
08310b0179
commit
4b1795cd5b
6 changed files with 26 additions and 10 deletions
|
@ -1763,6 +1763,12 @@ public class BoardDelegate extends DelegateBase
|
||||||
case BONUS_TRIPLE_WORD:
|
case BONUS_TRIPLE_WORD:
|
||||||
id = R.string.bonus_w3x;
|
id = R.string.bonus_w3x;
|
||||||
break;
|
break;
|
||||||
|
case BONUS_QUAD_LETTER:
|
||||||
|
id = R.string.bonus_l4x;
|
||||||
|
break;
|
||||||
|
case BONUS_QUAD_WORD:
|
||||||
|
id = R.string.bonus_w4x;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Assert.failDbg();
|
Assert.failDbg();
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,13 +74,7 @@ public interface DrawCtx {
|
||||||
void score_pendingScore( Rect rect, int score, int playerNum,
|
void score_pendingScore( Rect rect, int score, int playerNum,
|
||||||
boolean curTurn, int flags );
|
boolean curTurn, int flags );
|
||||||
|
|
||||||
public static final int BONUS_NONE = 0;
|
// typ possibilities are defined in UtilCtxt.java
|
||||||
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;
|
|
||||||
|
|
||||||
void objFinished( /*BoardObjectType*/int typ, Rect rect );
|
void objFinished( /*BoardObjectType*/int typ, Rect rect );
|
||||||
|
|
||||||
void dictChanged( long dictPtr );
|
void dictChanged( long dictPtr );
|
||||||
|
|
|
@ -28,6 +28,8 @@ public interface UtilCtxt {
|
||||||
static final int BONUS_DOUBLE_WORD = 2;
|
static final int BONUS_DOUBLE_WORD = 2;
|
||||||
static final int BONUS_TRIPLE_LETTER = 3;
|
static final int BONUS_TRIPLE_LETTER = 3;
|
||||||
static final int BONUS_TRIPLE_WORD = 4;
|
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_HIDDEN = 0;
|
||||||
public static final int TRAY_REVERSED = 1;
|
public static final int TRAY_REVERSED = 1;
|
||||||
|
|
|
@ -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
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* 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 );
|
draw_setClip( dctx, &oldClip, NULL );
|
||||||
} /* default_draw_score_pendingScore */
|
} /* default_draw_score_pendingScore */
|
||||||
|
|
||||||
|
#ifdef XWFEATURE_MINIWIN
|
||||||
static const XP_UCHAR*
|
static const XP_UCHAR*
|
||||||
default_draw_getMiniWText( DrawCtx* XP_UNUSED(dctx), XWMiniTextType textHint )
|
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;
|
str = "Triple letter"; break;
|
||||||
case BONUS_TRIPLE_WORD:
|
case BONUS_TRIPLE_WORD:
|
||||||
str = "Triple word"; break;
|
str = "Triple word"; break;
|
||||||
|
case BONUS_QUAD_LETTER:
|
||||||
|
str = "Quad letter"; break;
|
||||||
|
case BONUS_QUAD_WORD:
|
||||||
|
str = "Quad word"; break;
|
||||||
case INTRADE_MW_TEXT:
|
case INTRADE_MW_TEXT:
|
||||||
str = "Trading tiles;\nclick D when done"; break;
|
str = "Trading tiles;\nclick D when done"; break;
|
||||||
default:
|
default:
|
||||||
|
@ -343,6 +349,7 @@ default_draw_drawMiniWindow( DrawCtx* dctx, const XP_UCHAR* text,
|
||||||
|
|
||||||
draw_setClip( dctx, &oldClip, NULL );
|
draw_setClip( dctx, &oldClip, NULL );
|
||||||
} /* default_draw_drawMiniWindow */
|
} /* default_draw_drawMiniWindow */
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
InitDrawDefaults( DrawCtxVTable* vtable )
|
InitDrawDefaults( DrawCtxVTable* vtable )
|
||||||
|
|
|
@ -418,6 +418,10 @@ curses_draw_drawCell( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rect
|
||||||
ch = '^'; break;
|
ch = '^'; break;
|
||||||
case BONUS_TRIPLE_WORD:
|
case BONUS_TRIPLE_WORD:
|
||||||
ch = '#'; break;
|
ch = '#'; break;
|
||||||
|
case BONUS_QUAD_LETTER:
|
||||||
|
ch = '%'; break;
|
||||||
|
case BONUS_QUAD_WORD:
|
||||||
|
ch = '&'; break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
} /* switch */
|
} /* switch */
|
||||||
|
|
|
@ -1326,7 +1326,6 @@ gtk_draw_getMiniWText( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
|
||||||
{
|
{
|
||||||
/* GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx; */
|
/* GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx; */
|
||||||
XP_UCHAR* str;
|
XP_UCHAR* str;
|
||||||
|
|
||||||
switch( textHint ) {
|
switch( textHint ) {
|
||||||
case BONUS_DOUBLE_LETTER:
|
case BONUS_DOUBLE_LETTER:
|
||||||
str = "Double letter"; break;
|
str = "Double letter"; break;
|
||||||
|
@ -1334,6 +1333,10 @@ gtk_draw_getMiniWText( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
|
||||||
str = "Double word"; break;
|
str = "Double word"; break;
|
||||||
case BONUS_TRIPLE_LETTER:
|
case BONUS_TRIPLE_LETTER:
|
||||||
str = "Triple letter"; break;
|
str = "Triple letter"; break;
|
||||||
|
case BONUS_QUAD_WORD:
|
||||||
|
str = "Quad word"; break;
|
||||||
|
case BONUS_QUAD_LETTER:
|
||||||
|
str = "Quad letter"; break;
|
||||||
case BONUS_TRIPLE_WORD:
|
case BONUS_TRIPLE_WORD:
|
||||||
str = "Triple word"; break;
|
str = "Triple word"; break;
|
||||||
case INTRADE_MW_TEXT:
|
case INTRADE_MW_TEXT:
|
||||||
|
|
Loading…
Add table
Reference in a new issue