pass dict name into jni along with its bytes

This commit is contained in:
eehouse 2010-04-23 08:34:58 +00:00
parent c2c463171c
commit ceff1cde8b
4 changed files with 20 additions and 16 deletions

View file

@ -589,11 +589,12 @@ public class BoardActivity extends Activity implements UtilCtxt {
CommonPrefs cp = CommonPrefs.get();
if ( null == stream ||
! XwJNI.game_makeFromStream( m_jniGamePtr, stream,
m_gi, dictBytes, this,
m_jniu, m_view, cp,
m_xport ) ) {
m_gi, dictBytes,
m_gi.dictName,this, m_jniu,
m_view, cp, m_xport ) ) {
XwJNI.game_makeNewGame( m_jniGamePtr, m_gi, this, m_jniu,
m_view, cp, m_xport, dictBytes );
m_view, cp, m_xport,
dictBytes, m_gi.dictName );
}
m_jniThread = new

View file

@ -776,14 +776,15 @@ public class GameConfig extends Activity implements View.OnClickListener {
madeGame = XwJNI.game_makeFromStream( gamePtr, stream,
JNIUtilsImpl.get(),
new CurGameInfo(this),
dictBytes, m_cp );
dictBytes, m_gi.dictName,
m_cp );
}
if ( forceNew || !madeGame ) {
m_gi.setInProgress( false );
m_gi.fixup();
XwJNI.game_makeNewGame( gamePtr, m_gi, JNIUtilsImpl.get(),
m_cp, dictBytes );
m_cp, dictBytes, m_gi.dictName );
}
if ( null != m_car ) {

View file

@ -151,7 +151,7 @@ public class Utils {
gamePtr = XwJNI.initJNI();
XwJNI.game_makeNewGame( gamePtr, gi, JNIUtilsImpl.get(),
CommonPrefs.get(), dictBytes );
CommonPrefs.get(), dictBytes, gi.dictName );
if ( null != addr ) {
XwJNI.comms_setAddr( gamePtr, addr );
}
@ -185,12 +185,12 @@ public class Utils {
byte[] dictBytes = Utils.openDict( context, gi.dictName );
boolean madeGame = XwJNI.game_makeFromStream( gamePtr, stream,
JNIUtilsImpl.get(),
gi, dictBytes,
JNIUtilsImpl.get(), gi,
dictBytes, gi.dictName,
CommonPrefs.get() );
if ( !madeGame ) {
XwJNI.game_makeNewGame( gamePtr, gi, JNIUtilsImpl.get(),
CommonPrefs.get(), dictBytes );
CommonPrefs.get(), dictBytes, gi.dictName );
}
}

View file

@ -50,12 +50,13 @@ public class XwJNI {
JNIUtils jniu,
DrawCtx draw, CommonPrefs cp,
TransportProcs procs,
byte[] dict );
byte[] dict, String dictName );
public static native boolean game_makeFromStream( int gamePtr,
byte[] stream,
CurGameInfo gi,
byte[] dict,
String dictName,
UtilCtxt util,
JNIUtils jniu,
DrawCtx draw,
@ -66,19 +67,20 @@ public class XwJNI {
// played
public static void game_makeNewGame( int gamePtr, CurGameInfo gi,
JNIUtils jniu, CommonPrefs cp,
byte[] dict ) {
byte[] dict, String dictName ) {
game_makeNewGame( gamePtr, gi, (UtilCtxt)null, jniu,
(DrawCtx)null, cp, (TransportProcs)null, dict );
(DrawCtx)null, cp, (TransportProcs)null,
dict, dictName );
}
public static boolean game_makeFromStream( int gamePtr,
byte[] stream,
JNIUtils jniu,
CurGameInfo gi,
byte[] dict,
byte[] dict, String dictName,
CommonPrefs cp ) {
return game_makeFromStream( gamePtr, stream, gi, dict, (UtilCtxt)null,
jniu, (DrawCtx)null, cp,
return game_makeFromStream( gamePtr, stream, gi, dict, dictName,
(UtilCtxt)null, jniu, (DrawCtx)null, cp,
(TransportProcs)null );
}