mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
protect changeDict feature with compile-time flags (since it can't be
used on Android)
This commit is contained in:
parent
c69dbda36f
commit
13c74cfbd5
4 changed files with 14 additions and 3 deletions
|
@ -44,8 +44,9 @@ assertUtilOK( XW_UtilCtxt* util )
|
|||
# define assertUtilOK(u)
|
||||
#endif
|
||||
|
||||
#ifdef XWFEATURE_CHANGEDICT
|
||||
static void gi_setDict( MPFORMAL CurGameInfo* gi, const DictionaryCtxt* dict );
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
checkServerRole( CurGameInfo* gi, XP_U16* nPlayersHere, XP_U16* nPlayersTotal )
|
||||
|
@ -186,6 +187,7 @@ game_reset( MPFORMAL XWGame* game, CurGameInfo* gi,
|
|||
board_prefsChanged( game->board, cp );
|
||||
} /* game_reset */
|
||||
|
||||
#ifdef XWFEATURE_CHANGEDICT
|
||||
void
|
||||
game_changeDict( MPFORMAL XWGame* game, CurGameInfo* gi, DictionaryCtxt* dict )
|
||||
{
|
||||
|
@ -194,6 +196,7 @@ game_changeDict( MPFORMAL XWGame* game, CurGameInfo* gi, DictionaryCtxt* dict )
|
|||
gi_setDict( MPPARM(mpool) gi, dict );
|
||||
server_resetEngines( game->server );
|
||||
}
|
||||
#endif
|
||||
|
||||
XP_Bool
|
||||
game_makeFromStream( MPFORMAL XWStreamCtxt* stream, XWGame* game,
|
||||
|
@ -572,6 +575,7 @@ gi_writeToStream( XWStreamCtxt* stream, const CurGameInfo* gi )
|
|||
}
|
||||
} /* gi_writeToStream */
|
||||
|
||||
#ifdef XWFEATURE_CHANGEDICT
|
||||
static void
|
||||
gi_setDict( MPFORMAL CurGameInfo* gi, const DictionaryCtxt* dict )
|
||||
{
|
||||
|
@ -583,6 +587,7 @@ gi_setDict( MPFORMAL CurGameInfo* gi, const DictionaryCtxt* dict )
|
|||
XP_FREEP( mpool, &pl->dictName );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
XP_Bool
|
||||
player_hasPasswd( LocalPlayer* player )
|
||||
|
|
|
@ -1581,6 +1581,7 @@ server_getEngineFor( ServerCtxt* server, XP_U16 playerNum )
|
|||
return engine;
|
||||
} /* server_getEngineFor */
|
||||
|
||||
#ifdef XWFEATURE_CHANGEDICT
|
||||
void
|
||||
server_resetEngines( ServerCtxt* server )
|
||||
{
|
||||
|
@ -1589,6 +1590,7 @@ server_resetEngines( ServerCtxt* server )
|
|||
server_resetEngine( server, nPlayers );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
server_resetEngine( ServerCtxt* server, XP_U16 playerNum )
|
||||
|
|
|
@ -108,6 +108,8 @@ DEFINES += -DXWFEATURE_TRAYUNDO_ONE
|
|||
DEFINES += -DXWFEATURE_BONUSALL
|
||||
# DEFINES += -DXWFEATURE_BONUSALLHINT
|
||||
DEFINES += -DXWFEATURE_HILITECELL
|
||||
# allow change dict inside running game
|
||||
DEFINES += -DXWFEATURE_CHANGEDICT
|
||||
|
||||
# MAX_ROWS controls STREAM_VERS_BIGBOARD and with it move hashing
|
||||
DEFINES += -DMAX_ROWS=32
|
||||
|
|
|
@ -861,6 +861,7 @@ save_game( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* XP_UNUSED(globals) )
|
|||
{
|
||||
} /* save_game */
|
||||
|
||||
#ifdef XWFEATURE_CHANGEDICT
|
||||
static void
|
||||
change_dictionary( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* globals )
|
||||
{
|
||||
|
@ -877,6 +878,7 @@ change_dictionary( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* globals )
|
|||
}
|
||||
g_slist_free( dicts );
|
||||
} /* change_dictionary */
|
||||
#endif
|
||||
|
||||
static void
|
||||
handle_undo( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* XP_UNUSED(globals) )
|
||||
|
@ -1020,10 +1022,10 @@ makeMenus( GtkAppGlobals* globals, int XP_UNUSED(argc),
|
|||
GTK_SIGNAL_FUNC(load_game), globals );
|
||||
(void)createAddItem( fileMenu, "Save game",
|
||||
GTK_SIGNAL_FUNC(save_game), globals );
|
||||
|
||||
#ifdef XWFEATURE_CHANGEDICT
|
||||
(void)createAddItem( fileMenu, "Change dictionary",
|
||||
GTK_SIGNAL_FUNC(change_dictionary), globals );
|
||||
|
||||
#endif
|
||||
(void)createAddItem( fileMenu, "Cancel trade",
|
||||
GTK_SIGNAL_FUNC(handle_trade_cancel), globals );
|
||||
|
||||
|
|
Loading…
Reference in a new issue