mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-14 08:01:38 +01:00
pass dict name into jni along with its bytes
This commit is contained in:
parent
c2c463171c
commit
ceff1cde8b
4 changed files with 20 additions and 16 deletions
|
@ -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
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue