Calibratie toegevoegd aan WiiuseJ
This commit is contained in:
BIN
lib/wiiuse.lib
BIN
lib/wiiuse.lib
Binary file not shown.
BIN
msvc/WiiUseJ.suo
BIN
msvc/WiiUseJ.suo
Binary file not shown.
@@ -92,6 +92,7 @@
|
||||
<ClInclude Include="..\wiiusej_WiiUseApi.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\wiiusej_Calibration.c" />
|
||||
<ClCompile Include="..\wiiusej_Speaker.c" />
|
||||
<ClCompile Include="..\wiiusej_WiiUseApi.c" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -29,5 +29,8 @@
|
||||
<ClCompile Include="..\wiiusej_Speaker.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\wiiusej_Calibration.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
21
wiiusej_Calibration.c
Normal file
21
wiiusej_Calibration.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "wiiusej_WiiUseApi.h"
|
||||
#include "wiiuse.h"
|
||||
|
||||
static wiimote** wiimotes;
|
||||
static int nbMaxWiimotes;
|
||||
|
||||
|
||||
JNIEXPORT jshortArray JNICALL Java_wiiusej_WiiUseApi_getCalibration
|
||||
(JNIEnv *env, jobject obj, jint id) {
|
||||
struct wiimote_t* wm = wiiuse_get_by_id(wiimotes, nbMaxWiimotes, id);
|
||||
const accel_t* accel = &wm->accel_calib;
|
||||
const vec3b_t* zero = &accel->cal_zero;
|
||||
const vec3b_t* g = &accel->cal_g;
|
||||
short calibration[] = {
|
||||
zero->x, zero->y, zero->z,
|
||||
g->x, g->y, g->z};
|
||||
int size = 6;
|
||||
jshortArray jShorts = (*env)->NewShortArray(env, size);
|
||||
(*env)->SetShortArrayRegion(env, jShorts, 0, size, calibration);
|
||||
return jShorts;
|
||||
}
|
||||
@@ -339,7 +339,7 @@ JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_getStatus
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setTimeout
|
||||
(JNIEnv *env, jobject obj, jint id, jshort normalTimeout, jshort expansionTimeout) {
|
||||
wiiuse_set_timeout(wiimotes, nbMaxWiimotes, normalTimeout, expansionTimeout);
|
||||
wiiuse_set_timeout(wiimotes, nbMaxWiimotes, (byte) normalTimeout, (byte) expansionTimeout);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
EXPORTS
|
||||
Java_wiiusej_WiiUseApi_connect
|
||||
Java_wiiusej_WiiUseApi_find
|
||||
Java_wiiusej_WiiUseApi_init
|
||||
Java_wiiusej_WiiUseApi_closeConnection
|
||||
Java_wiiusej_WiiUseApi_getUnId
|
||||
Java_wiiusej_WiiUseApi_cleanUp
|
||||
Java_wiiusej_WiiUseApi_activateRumble
|
||||
Java_wiiusej_WiiUseApi_deactivateRumble
|
||||
Java_wiiusej_WiiUseApi_activateIRTracking
|
||||
Java_wiiusej_WiiUseApi_deactivateIRTracking
|
||||
Java_wiiusej_WiiUseApi_activateMotionSensing
|
||||
Java_wiiusej_WiiUseApi_deactivateMotionSensing
|
||||
Java_wiiusej_WiiUseApi_setLeds
|
||||
Java_wiiusej_WiiUseApi_setOrientThreshold
|
||||
Java_wiiusej_WiiUseApi_setAccelThreshold
|
||||
Java_wiiusej_WiiUseApi_setAlphaSmoothing
|
||||
Java_wiiusej_WiiUseApi_reSync
|
||||
Java_wiiusej_WiiUseApi_activateSmoothing
|
||||
Java_wiiusej_WiiUseApi_deactivateSmoothing
|
||||
Java_wiiusej_WiiUseApi_activateContinuous
|
||||
Java_wiiusej_WiiUseApi_deactivateContinuous
|
||||
Java_wiiusej_WiiUseApi_setScreenRatio43
|
||||
Java_wiiusej_WiiUseApi_setScreenRatio169
|
||||
Java_wiiusej_WiiUseApi_setSensorBarAboveScreen
|
||||
Java_wiiusej_WiiUseApi_setSensorBarBelowScreen
|
||||
Java_wiiusej_WiiUseApi_setVirtualScreenResolution
|
||||
Java_wiiusej_WiiUseApi_getStatus
|
||||
Java_wiiusej_WiiUseApi_setTimeout
|
||||
Java_wiiusej_WiiUseApi_setIrSensitivity
|
||||
Java_wiiusej_WiiUseApi_setNunchukOrientationThreshold
|
||||
Java_wiiusej_WiiUseApi_setNunchukAccelerationThreshold
|
||||
Java_wiiusej_WiiUseApi_windowsSetBluetoothStack
|
||||
Java_wiiusej_WiiUseApi_specialPoll
|
||||
@@ -273,44 +273,12 @@ JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_specialPoll
|
||||
|
||||
/*
|
||||
* Class: wiiusej_WiiUseApi
|
||||
* Method: activateSpeaker
|
||||
* Signature: (I)V
|
||||
* Method: getCalibration
|
||||
* Signature: (I)[S
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_activateSpeaker
|
||||
JNIEXPORT jshortArray JNICALL Java_wiiusej_WiiUseApi_getCalibration
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: wiiusej_WiiUseApi
|
||||
* Method: deactivateSpeaker
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_deactivateSpeaker
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: wiiusej_WiiUseApi
|
||||
* Method: setSpeakerVolume
|
||||
* Signature: (IS)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerVolume
|
||||
(JNIEnv *, jobject, jint, jshort);
|
||||
|
||||
/*
|
||||
* Class: wiiusej_WiiUseApi
|
||||
* Method: setSpeakerFrequency
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerFrequency
|
||||
(JNIEnv *, jobject, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: wiiusej_WiiUseApi
|
||||
* Method: streamSpeakerData
|
||||
* Signature: (I[S)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_streamSpeakerData
|
||||
(JNIEnv *, jobject, jint, jshortArray);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user