mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
catch up with recent API changes; fix bug in newgame dialog.
This commit is contained in:
parent
9239d34f19
commit
a292e33c03
6 changed files with 30 additions and 25 deletions
|
@ -42,20 +42,21 @@ ceControlsToAddrRec( HWND hDlg, CeConnDlgState* cState )
|
|||
static void
|
||||
ceControlsFromAddrRec( HWND hDlg, const CeConnDlgState* cState )
|
||||
{
|
||||
wchar_t* str;
|
||||
XP_U16 i;
|
||||
wchar_t* strs[] = { L"WiFi/Cellular data"
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
, L"Bluetooth"
|
||||
#endif
|
||||
};
|
||||
|
||||
switch( cState->addrRec.conType ) {
|
||||
case COMMS_CONN_RELAY:
|
||||
str = L"WiFi/Cellular data";
|
||||
break;
|
||||
default:
|
||||
XP_LOGF( "conType is %d", cState->addrRec.conType );
|
||||
XP_ASSERT( 0 );
|
||||
str = L"bad conType";
|
||||
break;
|
||||
for ( i = 0; i < sizeof(strs)/sizeof(strs[0]); ++i ) {
|
||||
SendDlgItemMessage( hDlg, IDC_CONNECTCOMBO, CB_ADDSTRING,
|
||||
0, (LPARAM)strs[i] );
|
||||
}
|
||||
SendDlgItemMessage( hDlg, IDC_CONNECTCOMBO, CB_ADDSTRING, 0, (LPARAM)str );
|
||||
SendDlgItemMessage( hDlg, IDC_CONNECTCOMBO, CB_SETCURSEL, 0, 0L );
|
||||
XP_ASSERT( cState->addrRec.conType == COMMS_CONN_RELAY
|
||||
|| cState->addrRec.conType == COMMS_CONN_BT );
|
||||
SendDlgItemMessage( hDlg, IDC_CONNECTCOMBO, CB_SETCURSEL,
|
||||
cState->addrRec.conType - COMMS_CONN_RELAY, 0L );
|
||||
|
||||
ceSetDlgItemText( hDlg, RELAYNAME_EDIT, cState->addrRec.u.ip_relay.hostName );
|
||||
ceSetDlgItemNum( hDlg, RELAYPORT_EDIT, cState->addrRec.u.ip_relay.port );
|
||||
|
|
|
@ -36,7 +36,7 @@ typedef struct CEDictionaryCtxt {
|
|||
} CEDictionaryCtxt;
|
||||
|
||||
static void ce_dict_destroy( DictionaryCtxt* dict );
|
||||
static XP_UCHAR* ce_dict_getShortName( DictionaryCtxt* dict );
|
||||
static XP_UCHAR* ce_dict_getShortName( const DictionaryCtxt* dict );
|
||||
static void ceLoadSpecialData( CEDictionaryCtxt* ctxt, XP_U8** ptrp );
|
||||
static XP_U16 ceCountSpecials( CEDictionaryCtxt* ctxt );
|
||||
static XP_Bitmap* ceMakeBitmap( CEDictionaryCtxt* ctxt, XP_U8** ptrp );
|
||||
|
@ -186,7 +186,7 @@ ce_dictionary_make( CEAppGlobals* globals, XP_UCHAR* dictName )
|
|||
|
||||
setBlankTile( (DictionaryCtxt*)ctxt );
|
||||
|
||||
ctxt->super.name = copyString(MPPARM(globals->mpool) dictName);
|
||||
ctxt->super.name = copyString(globals->mpool, dictName);
|
||||
break; /* exit phony while loop */
|
||||
}
|
||||
return (DictionaryCtxt*)ctxt;
|
||||
|
@ -428,7 +428,7 @@ ce_dict_destroy( DictionaryCtxt* dict )
|
|||
} // ce_dict_destroy
|
||||
|
||||
static XP_UCHAR*
|
||||
ce_dict_getShortName( DictionaryCtxt* dict )
|
||||
ce_dict_getShortName( const DictionaryCtxt* dict )
|
||||
{
|
||||
XP_UCHAR* name = dict_getName( dict );
|
||||
return bname( name );
|
||||
|
|
|
@ -215,7 +215,7 @@ stateToGameInfo( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState )
|
|||
giState->newDictName,
|
||||
sizeof(giState->newDictName), NULL, NULL );
|
||||
}
|
||||
replaceStringIfDifferent( MPPARM(globals->mpool) &gi->dictName,
|
||||
replaceStringIfDifferent( globals->mpool, &gi->dictName,
|
||||
giState->newDictName );
|
||||
}
|
||||
|
||||
|
@ -416,18 +416,20 @@ ceSetAttrProc(void* closure, NewGameAttr attr, const NGValue value )
|
|||
{
|
||||
GameInfoState* giState = (GameInfoState*)closure;
|
||||
XP_U16 resID = resIDForAttr( attr );
|
||||
XP_U16 val = value.ng_u16;
|
||||
|
||||
LOG_FUNC();
|
||||
|
||||
switch ( attr ) {
|
||||
case NG_ATTR_NPLAYERS:
|
||||
--val; /* adjust: it's 1-based */
|
||||
SendDlgItemMessage( giState->hDlg, resID, CB_SETCURSEL,
|
||||
value.ng_u16 - 1, 0L );
|
||||
break;
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
case NG_ATTR_ROLE:
|
||||
#endif
|
||||
SendDlgItemMessage( giState->hDlg, resID, CB_SETCURSEL, val, 0L );
|
||||
SendDlgItemMessage( giState->hDlg, resID, CB_SETCURSEL,
|
||||
value.ng_role, 0L );
|
||||
break;
|
||||
#endif
|
||||
case NG_ATTR_NPLAYHEADER:
|
||||
ceSetDlgItemText( giState->hDlg, resID, value.ng_cp );
|
||||
break;
|
||||
|
|
|
@ -77,7 +77,7 @@ typedef struct FileWriteState {
|
|||
|
||||
/* forward util function decls */
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
static XP_S16 ce_send_proc( XP_U8* buf, XP_U16 len,
|
||||
static XP_S16 ce_send_proc( const XP_U8* buf, XP_U16 len,
|
||||
const CommsAddrRec* addr,
|
||||
void* closure );
|
||||
#define CE_SEND_PROC ce_send_proc
|
||||
|
@ -704,7 +704,8 @@ ceInitAndStartBoard( CEAppGlobals* globals, XP_Bool newGame, CeGamePrefs* gp,
|
|||
dict_destroy( dict );
|
||||
dict = NULL;
|
||||
} else {
|
||||
replaceStringIfDifferent( MEMPOOL &globals->gameInfo.dictName,
|
||||
replaceStringIfDifferent( globals->mpool,
|
||||
&globals->gameInfo.dictName,
|
||||
curDictName );
|
||||
}
|
||||
}
|
||||
|
@ -2381,7 +2382,8 @@ got_data_proc( XP_U8* data, XP_U16 len, void* closure )
|
|||
} /* got_data_proc */
|
||||
|
||||
static XP_S16
|
||||
ce_send_proc( XP_U8* buf, XP_U16 len, const CommsAddrRec* addr, void* closure )
|
||||
ce_send_proc( const XP_U8* buf, XP_U16 len, const CommsAddrRec* addr,
|
||||
void* closure )
|
||||
{
|
||||
CEAppGlobals* globals = (CEAppGlobals*)closure;
|
||||
XP_LOGF( "ce_send_proc called" );
|
||||
|
|
|
@ -413,7 +413,7 @@ ce_sockwrap_delete( CeSocketWrapper* self )
|
|||
} /* ce_sockwrap_delete */
|
||||
|
||||
XP_U16
|
||||
ce_sockwrap_send( CeSocketWrapper* self, XP_U8* buf, XP_U16 len,
|
||||
ce_sockwrap_send( CeSocketWrapper* self, const XP_U8* buf, XP_U16 len,
|
||||
const CommsAddrRec* addr )
|
||||
{
|
||||
XP_U8* packet;
|
||||
|
|
|
@ -30,7 +30,7 @@ typedef void (*DataRecvProc)( XP_U8* data, XP_U16 len, void* closure );
|
|||
CeSocketWrapper* ce_sockwrap_new( MPFORMAL DataRecvProc proc, void* closure );
|
||||
void ce_sockwrap_delete( CeSocketWrapper* self );
|
||||
|
||||
XP_U16 ce_sockwrap_send( CeSocketWrapper* self, XP_U8* buf, XP_U16 len,
|
||||
XP_U16 ce_sockwrap_send( CeSocketWrapper* self, const XP_U8* buf, XP_U16 len,
|
||||
const CommsAddrRec* addr );
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue