get rid of gameID param. This change breaks all other platforms...

This commit is contained in:
eehouse 2010-01-31 21:35:07 +00:00
parent caa5d6a55f
commit 9f250c99ef
5 changed files with 14 additions and 13 deletions

View file

@ -260,8 +260,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_initJNI
JNIEXPORT void JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_game_1makeNewGame
( JNIEnv* env, jclass C, jint gamePtr, jobject j_gi, jobject j_util,
jobject j_draw, jint gameID, jobject j_cp, jobject j_procs,
jbyteArray jDictBytes )
jobject j_draw, jobject j_cp, jobject j_procs, jbyteArray jDictBytes )
{
XWJNI_START();
CurGameInfo* gi = makeGI( MPPARM(mpool) env, j_gi );
@ -276,8 +275,8 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1makeNewGame
loadCommonPrefs( env, &cp, j_cp );
XP_LOGF( "calling game_makeNewGame" );
game_makeNewGame( MPPARM(mpool) &state->game, gi, util, dctx, gameID,
&cp, globals->xportProcs );
game_makeNewGame( MPPARM(mpool) &state->game, gi, util, dctx, &cp,
globals->xportProcs );
DictionaryCtxt* dict = makeDict( MPPARM(mpool) env, util, jDictBytes );
#ifdef STUBBED_DICT

View file

@ -146,7 +146,7 @@ public class BoardActivity extends Activity implements UtilCtxt {
m_gi, dictBytes, this,
m_view, Utils.getCP(),
m_xport ) ) {
XwJNI.game_makeNewGame( m_jniGamePtr, m_gi, this, m_view, 0,
XwJNI.game_makeNewGame( m_jniGamePtr, m_gi, this, m_view,
Utils.getCP(), m_xport, dictBytes );
}

View file

@ -28,8 +28,7 @@ public class XwJNI {
public static native void game_makeNewGame( int gamePtr,
CurGameInfo gi,
UtilCtxt util,
DrawCtx draw, int gameID,
CommonPrefs cp,
DrawCtx draw, CommonPrefs cp,
TransportProcs procs,
byte[] dict );
public static native boolean game_makeFromStream( int gamePtr,

View file

@ -73,14 +73,17 @@ checkServerRole( CurGameInfo* gi, XP_U16* nPlayersHere, XP_U16* nPlayersTotal )
void
game_makeNewGame( MPFORMAL XWGame* game, CurGameInfo* gi,
XW_UtilCtxt* util, DrawCtx* draw,
XP_U16 gameID, CommonPrefs* cp,
const TransportProcs* procs )
CommonPrefs* cp, const TransportProcs* procs )
{
XP_U16 gameID = 0;
XP_U16 nPlayersHere, nPlayersTotal;
assertUtilOK( util );
checkServerRole( gi, &nPlayersHere, &nPlayersTotal );
while ( 0 == gameID ) {
gameID = util_getCurSeconds( util );
}
gi->gameID = gameID;
game->model = model_make( MPPARM(mpool) (DictionaryCtxt*)NULL, util,
@ -112,11 +115,11 @@ game_makeNewGame( MPFORMAL XWGame* game, CurGameInfo* gi,
void
game_reset( MPFORMAL XWGame* game, CurGameInfo* gi,
XW_UtilCtxt* XP_UNUSED_STANDALONE(util),
XP_U16 gameID, CommonPrefs* cp,
const TransportProcs* procs )
CommonPrefs* cp, const TransportProcs* procs )
{
XP_U16 i;
XP_U16 nPlayersHere, nPlayersTotal;
XP_U16 gameID = 0;
XP_ASSERT( !!game->model );
XP_ASSERT( !!gi );

View file

@ -85,10 +85,10 @@ typedef struct XWGame {
} XWGame;
void game_makeNewGame( MPFORMAL XWGame* game, CurGameInfo* gi,
XW_UtilCtxt* util, DrawCtx* draw, XP_U16 gameID,
XW_UtilCtxt* util, DrawCtx* draw,
CommonPrefs* cp, const TransportProcs* procs );
void game_reset( MPFORMAL XWGame* game, CurGameInfo* gi, XW_UtilCtxt* util,
XP_U16 gameID, CommonPrefs* cp, const TransportProcs* procs );
CommonPrefs* cp, const TransportProcs* procs );
XP_Bool game_makeFromStream( MPFORMAL XWStreamCtxt* stream, XWGame* game,
CurGameInfo* gi,