mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-27 06:10:28 +01:00
DroidFish: Renamed NativePipedProcess to StockFishJNI.
This commit is contained in:
parent
4f4d1d95d7
commit
04a0b68f1a
|
@ -2,8 +2,8 @@ LOCAL_PATH := $(call my-dir)
|
|||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := jni
|
||||
LOCAL_SRC_FILES := jni.cpp
|
||||
LOCAL_MODULE := stockfishjni
|
||||
LOCAL_SRC_FILES := stockfishjni.cpp
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-mandroid \
|
||||
|
|
|
@ -34,11 +34,11 @@ static int fdToChild = -1;
|
|||
static int childpid = -1;
|
||||
|
||||
/*
|
||||
* Class: org_petero_droidfish_engine_NativePipedProcess
|
||||
* Class: org_petero_droidfish_engine_StockFishJNI
|
||||
* Method: startProcess
|
||||
* Signature: ()V
|
||||
*/
|
||||
extern "C" JNIEXPORT void JNICALL Java_org_petero_droidfish_engine_NativePipedProcess_startProcess
|
||||
extern "C" JNIEXPORT void JNICALL Java_org_petero_droidfish_engine_StockFishJNI_startProcess
|
||||
(JNIEnv* env, jobject obj)
|
||||
{
|
||||
if (childpid != -1)
|
||||
|
@ -110,11 +110,11 @@ static bool getNextChar(int& c, int timeoutMillis) {
|
|||
|
||||
static std::vector<char> lineBuf;
|
||||
/*
|
||||
* Class: org_petero_droidfish_engine_NativePipedProcess
|
||||
* Class: org_petero_droidfish_engine_StockFishJNI
|
||||
* Method: readFromProcess
|
||||
* Signature: (I)Ljava/lang/String;
|
||||
*/
|
||||
extern "C" JNIEXPORT jstring JNICALL Java_org_petero_droidfish_engine_NativePipedProcess_readFromProcess
|
||||
extern "C" JNIEXPORT jstring JNICALL Java_org_petero_droidfish_engine_StockFishJNI_readFromProcess
|
||||
(JNIEnv* env, jobject obj, jint timeoutMillis)
|
||||
{
|
||||
struct timeval tv0, tv1;
|
||||
|
@ -147,11 +147,11 @@ extern "C" JNIEXPORT jstring JNICALL Java_org_petero_droidfish_engine_NativePipe
|
|||
}
|
||||
|
||||
/*
|
||||
* Class: org_petero_droidfish_engine_NativePipedProcess
|
||||
* Class: org_petero_droidfish_engine_StockFishJNI
|
||||
* Method: writeToProcess
|
||||
* Signature: (Ljava/lang/String;)V
|
||||
*/
|
||||
extern "C" JNIEXPORT void JNICALL Java_org_petero_droidfish_engine_NativePipedProcess_writeToProcess
|
||||
extern "C" JNIEXPORT void JNICALL Java_org_petero_droidfish_engine_StockFishJNI_writeToProcess
|
||||
(JNIEnv* env, jobject obj, jstring msg)
|
||||
{
|
||||
const char* str = (*env).GetStringUTFChars(msg, NULL);
|
||||
|
@ -169,11 +169,11 @@ extern "C" JNIEXPORT void JNICALL Java_org_petero_droidfish_engine_NativePipedPr
|
|||
}
|
||||
|
||||
/*
|
||||
* Class: org_petero_droidfish_engine_NativePipedProcess
|
||||
* Class: org_petero_droidfish_engine_StockFishJNI
|
||||
* Method: getNPhysicalProcessors
|
||||
* Signature: ()I
|
||||
*/
|
||||
extern "C" JNIEXPORT jint JNICALL Java_org_petero_droidfish_engine_NativePipedProcess_getNPhysicalProcessors
|
||||
extern "C" JNIEXPORT jint JNICALL Java_org_petero_droidfish_engine_StockFishJNI_getNPhysicalProcessors
|
||||
(JNIEnv *, jclass)
|
||||
{
|
||||
return sysconf(_SC_NPROCESSORS_ONLN);
|
|
@ -546,7 +546,7 @@ public class DroidComputerPlayer {
|
|||
if ("cuckoochess".equals(searchRequest.engine))
|
||||
uciEngine = new CuckooChessEngine();
|
||||
else
|
||||
uciEngine = new NativePipedProcess();
|
||||
uciEngine = new StockFishJNI();
|
||||
uciEngine.initialize();
|
||||
|
||||
engineMonitor = new Thread(new Runnable() {
|
||||
|
@ -911,7 +911,7 @@ public class DroidComputerPlayer {
|
|||
nCPUsFromProc = nCPUs;
|
||||
} catch (IOException e) {
|
||||
}
|
||||
int nCPUsFromOS = NativePipedProcess.getNPhysicalProcessors();
|
||||
int nCPUsFromOS = StockFishJNI.getNPhysicalProcessors();
|
||||
return Math.max(nCPUsFromProc, nCPUsFromOS);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
package org.petero.droidfish.engine;
|
||||
|
||||
public class NativePipedProcess extends UCIEngineBase {
|
||||
public class StockFishJNI extends UCIEngineBase {
|
||||
static {
|
||||
System.loadLibrary("jni");
|
||||
System.loadLibrary("stockfishjni");
|
||||
}
|
||||
|
||||
@Override
|
Loading…
Reference in New Issue
Block a user