mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +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();
|
CommonPrefs cp = CommonPrefs.get();
|
||||||
if ( null == stream ||
|
if ( null == stream ||
|
||||||
! XwJNI.game_makeFromStream( m_jniGamePtr, stream,
|
! XwJNI.game_makeFromStream( m_jniGamePtr, stream,
|
||||||
m_gi, dictBytes, this,
|
m_gi, dictBytes,
|
||||||
m_jniu, m_view, cp,
|
m_gi.dictName,this, m_jniu,
|
||||||
m_xport ) ) {
|
m_view, cp, m_xport ) ) {
|
||||||
XwJNI.game_makeNewGame( m_jniGamePtr, m_gi, this, m_jniu,
|
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
|
m_jniThread = new
|
||||||
|
|
|
@ -776,14 +776,15 @@ public class GameConfig extends Activity implements View.OnClickListener {
|
||||||
madeGame = XwJNI.game_makeFromStream( gamePtr, stream,
|
madeGame = XwJNI.game_makeFromStream( gamePtr, stream,
|
||||||
JNIUtilsImpl.get(),
|
JNIUtilsImpl.get(),
|
||||||
new CurGameInfo(this),
|
new CurGameInfo(this),
|
||||||
dictBytes, m_cp );
|
dictBytes, m_gi.dictName,
|
||||||
|
m_cp );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( forceNew || !madeGame ) {
|
if ( forceNew || !madeGame ) {
|
||||||
m_gi.setInProgress( false );
|
m_gi.setInProgress( false );
|
||||||
m_gi.fixup();
|
m_gi.fixup();
|
||||||
XwJNI.game_makeNewGame( gamePtr, m_gi, JNIUtilsImpl.get(),
|
XwJNI.game_makeNewGame( gamePtr, m_gi, JNIUtilsImpl.get(),
|
||||||
m_cp, dictBytes );
|
m_cp, dictBytes, m_gi.dictName );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( null != m_car ) {
|
if ( null != m_car ) {
|
||||||
|
|
|
@ -151,7 +151,7 @@ public class Utils {
|
||||||
|
|
||||||
gamePtr = XwJNI.initJNI();
|
gamePtr = XwJNI.initJNI();
|
||||||
XwJNI.game_makeNewGame( gamePtr, gi, JNIUtilsImpl.get(),
|
XwJNI.game_makeNewGame( gamePtr, gi, JNIUtilsImpl.get(),
|
||||||
CommonPrefs.get(), dictBytes );
|
CommonPrefs.get(), dictBytes, gi.dictName );
|
||||||
if ( null != addr ) {
|
if ( null != addr ) {
|
||||||
XwJNI.comms_setAddr( gamePtr, addr );
|
XwJNI.comms_setAddr( gamePtr, addr );
|
||||||
}
|
}
|
||||||
|
@ -185,12 +185,12 @@ public class Utils {
|
||||||
byte[] dictBytes = Utils.openDict( context, gi.dictName );
|
byte[] dictBytes = Utils.openDict( context, gi.dictName );
|
||||||
|
|
||||||
boolean madeGame = XwJNI.game_makeFromStream( gamePtr, stream,
|
boolean madeGame = XwJNI.game_makeFromStream( gamePtr, stream,
|
||||||
JNIUtilsImpl.get(),
|
JNIUtilsImpl.get(), gi,
|
||||||
gi, dictBytes,
|
dictBytes, gi.dictName,
|
||||||
CommonPrefs.get() );
|
CommonPrefs.get() );
|
||||||
if ( !madeGame ) {
|
if ( !madeGame ) {
|
||||||
XwJNI.game_makeNewGame( gamePtr, gi, JNIUtilsImpl.get(),
|
XwJNI.game_makeNewGame( gamePtr, gi, JNIUtilsImpl.get(),
|
||||||
CommonPrefs.get(), dictBytes );
|
CommonPrefs.get(), dictBytes, gi.dictName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,12 +50,13 @@ public class XwJNI {
|
||||||
JNIUtils jniu,
|
JNIUtils jniu,
|
||||||
DrawCtx draw, CommonPrefs cp,
|
DrawCtx draw, CommonPrefs cp,
|
||||||
TransportProcs procs,
|
TransportProcs procs,
|
||||||
byte[] dict );
|
byte[] dict, String dictName );
|
||||||
|
|
||||||
public static native boolean game_makeFromStream( int gamePtr,
|
public static native boolean game_makeFromStream( int gamePtr,
|
||||||
byte[] stream,
|
byte[] stream,
|
||||||
CurGameInfo gi,
|
CurGameInfo gi,
|
||||||
byte[] dict,
|
byte[] dict,
|
||||||
|
String dictName,
|
||||||
UtilCtxt util,
|
UtilCtxt util,
|
||||||
JNIUtils jniu,
|
JNIUtils jniu,
|
||||||
DrawCtx draw,
|
DrawCtx draw,
|
||||||
|
@ -66,19 +67,20 @@ public class XwJNI {
|
||||||
// played
|
// played
|
||||||
public static void game_makeNewGame( int gamePtr, CurGameInfo gi,
|
public static void game_makeNewGame( int gamePtr, CurGameInfo gi,
|
||||||
JNIUtils jniu, CommonPrefs cp,
|
JNIUtils jniu, CommonPrefs cp,
|
||||||
byte[] dict ) {
|
byte[] dict, String dictName ) {
|
||||||
game_makeNewGame( gamePtr, gi, (UtilCtxt)null, jniu,
|
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,
|
public static boolean game_makeFromStream( int gamePtr,
|
||||||
byte[] stream,
|
byte[] stream,
|
||||||
JNIUtils jniu,
|
JNIUtils jniu,
|
||||||
CurGameInfo gi,
|
CurGameInfo gi,
|
||||||
byte[] dict,
|
byte[] dict, String dictName,
|
||||||
CommonPrefs cp ) {
|
CommonPrefs cp ) {
|
||||||
return game_makeFromStream( gamePtr, stream, gi, dict, (UtilCtxt)null,
|
return game_makeFromStream( gamePtr, stream, gi, dict, dictName,
|
||||||
jniu, (DrawCtx)null, cp,
|
(UtilCtxt)null, jniu, (DrawCtx)null, cp,
|
||||||
(TransportProcs)null );
|
(TransportProcs)null );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue