You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
(8) |
2
(8) |
3
(8) |
4
|
|
5
|
6
|
7
|
8
|
9
|
10
|
11
(6) |
|
12
(2) |
13
|
14
|
15
|
16
|
17
|
18
|
|
19
|
20
|
21
|
22
|
23
(6) |
24
|
25
|
|
26
|
27
(1) |
28
|
29
(2) |
30
(1) |
31
(2) |
|
|
From: Brian M. <ma...@us...> - 2003-01-23 21:38:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv31735 Modified Files: org_lwjgl_input_Controller.cpp Log Message: added rotational axis too Index: org_lwjgl_input_Controller.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Controller.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Controller.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_input_Controller.cpp 23 Jan 2003 21:14:04 -0000 1.3 +++ org_lwjgl_input_Controller.cpp 23 Jan 2003 21:38:33 -0000 1.4 @@ -56,8 +56,11 @@ int buttoncount = 0; // Temporary buttoncount bool hasx; // Temporary xaxis check +bool hasrx; // Temporary rotational xaxis check bool hasy; // Temporary yaxis check +bool hasry; // Temporary rotational yaxis check bool hasz; // Temporary zaxis check +bool hasrz; // Temporary rotational zaxis check bool haspov; // Temporary pov check bool hasslider; // Temporary slider check @@ -69,14 +72,20 @@ jclass clsController; jfieldID fidButtonCount; jfieldID fidHasXAxis; +jfieldID fidHasRXAxis; jfieldID fidHasYAxis; +jfieldID fidHasRYAxis; jfieldID fidHasZAxis; +jfieldID fidHasRZAxis; jfieldID fidHasPOV; jfieldID fidHasSlider; jfieldID fidButtons; jfieldID fidX; +jfieldID fidRX; jfieldID fidY; +jfieldID fidRY; jfieldID fidZ; +jfieldID fidRZ; jfieldID fidPOV; jfieldID fidSlider; @@ -271,6 +280,12 @@ haspov = true; } else if (lpddoi->guidType == GUID_Slider){ hasslider = true; + } else if (lpddoi->guidType == GUID_RxAxis) { + hasrx = true; + } else if (lpddoi->guidType == GUID_RyAxis) { + hasry = true; + } else if (lpddoi->guidType == GUID_RzAxis) { + hasrz = true; #if _DEBUG } else { printf("Unhandled object found: %s\n", lpddoi->tszName); @@ -316,18 +331,19 @@ create_success = false; return; } - - // set X-axis range to (-1000 ... +1000) + + // set range to (-1000 ... +1000) // This lets us test against 0 to see which way the stick is pointed. DIPROPRANGE diprg; diprg.diph.dwSize = sizeof(diprg); diprg.diph.dwHeaderSize = sizeof(diprg.diph); - diprg.diph.dwObj = DIJOFS_X; diprg.diph.dwHow = DIPH_BYOFFSET; diprg.lMin = AXISMIN; diprg.lMax = AXISMAX; + // set X-axis if(hasx) { + diprg.diph.dwObj = DIJOFS_X; if(lpDIDevice->SetProperty(DIPROP_RANGE, &diprg.diph) != DI_OK) { #if _DEBUG printf("SetProperty(DIJOFS_X) failed\n"); @@ -337,9 +353,20 @@ } } - // - // And again for Y-axis range - // + // set RX-axis + if(hasrx) { + diprg.diph.dwObj = DIJOFS_RX; + if(lpDIDevice->SetProperty(DIPROP_RANGE, &diprg.diph) != DI_OK) { +#if _DEBUG + printf("SetProperty(DIJOFS_RX) failed\n"); +#endif + create_success = false; + return; + } + } + + + // set Y-axis if(hasy) { diprg.diph.dwObj = DIJOFS_Y; if(lpDIDevice->SetProperty(DIPROP_RANGE, &diprg.diph) != DI_OK) { @@ -351,9 +378,19 @@ } } - // - // And again for Z-axis range - // + // set RY-axis + if(hasry) { + diprg.diph.dwObj = DIJOFS_RY; + if(lpDIDevice->SetProperty(DIPROP_RANGE, &diprg.diph) != DI_OK) { +#if _DEBUG + printf("SetProperty(DIJOFS_RY) failed\n"); +#endif + create_success = false; + return; + } + } + + // set Z-axis if(hasz) { diprg.diph.dwObj = DIJOFS_Z; if(lpDIDevice->SetProperty(DIPROP_RANGE, &diprg.diph) != DI_OK) { @@ -365,6 +402,19 @@ } } + + // set RZ-axis + if(hasrz) { + diprg.diph.dwObj = DIJOFS_RZ; + if(lpDIDevice->SetProperty(DIPROP_RANGE, &diprg.diph) != DI_OK) { +#if _DEBUG + printf("SetProperty(DIJOFS_RZ) failed\n"); +#endif + create_success = false; + return; + } + } + // // Lastly slider // using z axis since we're running dx 5 @@ -414,17 +464,30 @@ //axis's if(hasx) { - environment->SetStaticIntField(clsController, fidX, js.lX); + environment->SetStaticIntField(clsController, fidX, js.lX); } if(hasy) { - environment->SetStaticIntField(clsController, fidY, js.lY); + environment->SetStaticIntField(clsController, fidY, js.lY); } if(hasz) { environment->SetStaticIntField(clsController, fidZ, js.lZ); } + //rotational axis + if(hasrx) { + environment->SetStaticIntField(clsController, fidRX, js.lRx); + } + + if(hasry) { + environment->SetStaticIntField(clsController, fidRY, js.lRy); + } + + if(hasrz) { + environment->SetStaticIntField(clsController, fidRZ, js.lRz); + } + //buttons jbooleanArray buttonsArray = (jbooleanArray) environment->GetStaticObjectField(clsController, fidButtons); BYTE * buttons = (BYTE *) environment->GetPrimitiveArrayCritical(buttonsArray, NULL); @@ -454,6 +517,11 @@ environment->SetStaticIntField(clsController, fidHasYAxis, hasy); environment->SetStaticIntField(clsController, fidHasZAxis, hasz); + //set rotational axis + environment->SetStaticIntField(clsController, fidHasRXAxis, hasrx); + environment->SetStaticIntField(clsController, fidHasRYAxis, hasry); + environment->SetStaticIntField(clsController, fidHasRZAxis, hasrz); + //set pov environment->SetStaticIntField(clsController, fidHasPOV, haspov); @@ -467,14 +535,20 @@ void CacheFields() { fidButtonCount = environment->GetStaticFieldID(clsController, "buttonCount", "I"); fidHasXAxis = environment->GetStaticFieldID(clsController, "hasXAxis", "Z"); + fidHasRXAxis = environment->GetStaticFieldID(clsController, "hasRXAxis", "Z"); fidHasYAxis = environment->GetStaticFieldID(clsController, "hasYAxis", "Z"); + fidHasRYAxis = environment->GetStaticFieldID(clsController, "hasRYAxis", "Z"); fidHasZAxis = environment->GetStaticFieldID(clsController, "hasZAxis", "Z"); + fidHasRZAxis = environment->GetStaticFieldID(clsController, "hasRZAxis", "Z"); fidHasPOV = environment->GetStaticFieldID(clsController, "hasPOV", "Z"); fidHasSlider = environment->GetStaticFieldID(clsController, "hasSlider", "Z"); fidButtons = environment->GetStaticFieldID(clsController, "buttons", "[Z"); fidX = environment->GetStaticFieldID(clsController, "x", "I"); + fidRX = environment->GetStaticFieldID(clsController, "rx", "I"); fidY = environment->GetStaticFieldID(clsController, "y", "I"); + fidRY = environment->GetStaticFieldID(clsController, "ry", "I"); fidZ = environment->GetStaticFieldID(clsController, "z", "I"); + fidRZ = environment->GetStaticFieldID(clsController, "rz", "I"); fidPOV = environment->GetStaticFieldID(clsController, "pov", "I"); fidSlider = environment->GetStaticFieldID(clsController, "slider", "I"); } |
|
From: Brian M. <ma...@us...> - 2003-01-23 21:38:23
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1:/tmp/cvs-serv31627 Modified Files: Controller.java Log Message: added rotational axis too Index: Controller.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Controller.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Controller.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Controller.java 3 Jan 2003 18:47:41 -0000 1.1 +++ Controller.java 23 Jan 2003 21:38:18 -0000 1.2 @@ -67,13 +67,22 @@ /** X position, range -1000 to 1000 */ public static int x = 0; - + + /** X rotational position, range -1000 to 1000 */ + public static int rx = 0; + /** Y position, range -1000 to 1000 */ public static int y = 0; - + + /** Y rotational position, range -1000 to 1000 */ + public static int ry = 0; + /** Z position, range -1000 to 1000 */ public static int z = 0; + /** Z rotational position, range -1000 to 1000 */ + public static int rz = 0; + /** Position of Point of View from -1 to 27000 (360 degrees) */ public static int pov; @@ -98,8 +107,11 @@ /* Controller capabilities */ public static int buttonCount = -1; public static boolean hasXAxis = false; + public static boolean hasRXAxis = false; public static boolean hasYAxis = false; - public static boolean hasZAxis = false; + public static boolean hasRYAxis = false; + public static boolean hasZAxis = false; + public static boolean hasRZAxis = false; public static boolean hasPOV = false; public static boolean hasSlider = false; |
|
From: Brian M. <ma...@us...> - 2003-01-23 21:38:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1:/tmp/cvs-serv31491 Modified Files: ControllerTest.java Log Message: added rotational axis too Index: ControllerTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ControllerTest.java 23 Jan 2003 21:11:16 -0000 1.2 +++ ControllerTest.java 23 Jan 2003 21:38:06 -0000 1.3 @@ -95,18 +95,33 @@ if(Controller.hasXAxis) { g.drawString("x : " + Controller.x, x, y); y += 20; - } + } + + if(Controller.hasRXAxis) { + g.drawString("rx : " + Controller.rx, x, y); + y += 20; + } if(Controller.hasYAxis) { g.drawString("y : " + Controller.y, x, y); y += 20; } + if(Controller.hasRYAxis) { + g.drawString("ry : " + Controller.ry, x, y); + y += 20; + } + if (Controller.hasZAxis) { g.drawString("z : " + Controller.z, x, y); y += 20; } + if (Controller.hasRZAxis) { + g.drawString("rz : " + Controller.rz, x, y); + y += 20; + } + if (Controller.hasPOV) { g.drawString("pov: " + Controller.pov, x, y); y += 20; |
|
From: Brian M. <ma...@us...> - 2003-01-23 21:14:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv18579 Modified Files: org_lwjgl_input_Controller.cpp Log Message: small comment on using z axis as slider Index: org_lwjgl_input_Controller.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Controller.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Controller.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_input_Controller.cpp 23 Jan 2003 21:11:01 -0000 1.2 +++ org_lwjgl_input_Controller.cpp 23 Jan 2003 21:14:04 -0000 1.3 @@ -367,6 +367,7 @@ // // Lastly slider + // using z axis since we're running dx 5 // if(hasslider) { diprg.diph.dwObj = DIJOFS_Z; |
|
From: Brian M. <ma...@us...> - 2003-01-23 21:11:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1:/tmp/cvs-serv17129 Modified Files: ControllerTest.java Log Message: new and improved version - w00t Index: ControllerTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ControllerTest.java 3 Jan 2003 18:47:41 -0000 1.1 +++ ControllerTest.java 23 Jan 2003 21:11:16 -0000 1.2 @@ -91,18 +91,31 @@ y += 20; g.drawString("-----------------------------------------------", x, y); y += 20; - g.drawString("x : " + Controller.x, x, y); - y += 20; - g.drawString("y : " + Controller.y, x, y); - y += 20; - if (Controller.hasZAxis) { + + if(Controller.hasXAxis) { + g.drawString("x : " + Controller.x, x, y); + y += 20; + } + + if(Controller.hasYAxis) { + g.drawString("y : " + Controller.y, x, y); + y += 20; + } + + if (Controller.hasZAxis) { g.drawString("z : " + Controller.z, x, y); y += 20; } - if (Controller.hasPOV) { + + if (Controller.hasPOV) { g.drawString("pov: " + Controller.pov, x, y); y += 20; } + + if (Controller.hasSlider) { + g.drawString("slder: " + Controller.slider, x, y); + y += 20; + } //paint buttons g.drawString("btn: ", x, y); |
|
From: Brian M. <ma...@us...> - 2003-01-23 21:11:09
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv16966 Modified Files: org_lwjgl_input_Controller.cpp Log Message: new and improved version - w00t Index: org_lwjgl_input_Controller.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Controller.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Controller.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_input_Controller.cpp 3 Jan 2003 18:47:42 -0000 1.1 +++ org_lwjgl_input_Controller.cpp 23 Jan 2003 21:11:01 -0000 1.2 @@ -55,8 +55,11 @@ DIJOYSTATE2 js; // State of Controller int buttoncount = 0; // Temporary buttoncount +bool hasx; // Temporary xaxis check +bool hasy; // Temporary yaxis check bool hasz; // Temporary zaxis check bool haspov; // Temporary pov check +bool hasslider; // Temporary slider check JNIEnv* environment; // JNIEnvironment copy @@ -65,13 +68,17 @@ // Cached fields of Controller.java jclass clsController; jfieldID fidButtonCount; +jfieldID fidHasXAxis; +jfieldID fidHasYAxis; jfieldID fidHasZAxis; jfieldID fidHasPOV; +jfieldID fidHasSlider; jfieldID fidButtons; jfieldID fidX; jfieldID fidY; jfieldID fidZ; jfieldID fidPOV; +jfieldID fidSlider; // Function prototypes (defined in the cpp file, since header file is generic across platforms void EnumerateCapabilities(); @@ -106,6 +113,9 @@ HRESULT hr; hr = DirectInputCreate(GetModuleHandle(NULL), DIRECTINPUT_VERSION, &lpDI, NULL); if (FAILED(hr)) { +#if _DEBUG + printf("DirectInputCreate failed\n"); +#endif Shutdown(); return JNI_FALSE; } @@ -113,6 +123,9 @@ /* Find all Controllers */ EnumerateControllers(); if (!create_success) { +#if _DEBUG + printf("EnumerateControllers failed\n"); +#endif Shutdown(); return JNI_FALSE; } @@ -120,10 +133,18 @@ /* Enumerate capabilities of Controller */ EnumerateCapabilities(); if (!create_success) { +#if _DEBUG + printf("EnumerateCapabilities failed\n"); +#endif Shutdown(); return JNI_FALSE; } + if(create_success) { + /* Do setup of Controller */ + SetupController(); + } + /* Initialize any fields on the Controller */ InitializeFields(); @@ -133,10 +154,12 @@ /* Aquire the Controller */ hr = lpDIDevice->Acquire(); if(FAILED(hr)) { +#if _DEBUG + printf("Acquire failed\n"); +#endif Shutdown(); return JNI_FALSE; } - return create_success; } @@ -193,6 +216,9 @@ HRESULT hr; hr = lpDIDevice->EnumObjects(EnumControllerObjectsCallback, NULL, DIDFT_ALL); if FAILED(hr) { +#if _DEBUG + printf("EnumObjects failed\n"); +#endif create_success = false; return; } @@ -206,6 +232,9 @@ HRESULT hr; hr = lpDI->EnumDevices(DIDEVTYPE_JOYSTICK, EnumControllerCallback, 0, DIEDFL_ATTACHEDONLY); if FAILED(hr) { +#if _DEBUG + printf("EnumDevices failed\n"); +#endif create_success = false; return; } @@ -218,10 +247,6 @@ BOOL CALLBACK EnumControllerCallback(LPCDIDEVICEINSTANCE pdinst, LPVOID pvRef) { /* Add the Controller */ CreateController(pdinst); - if(create_success) { - /* Do setup of Controller */ - SetupController(); - } /* just stop after 1st Controller */ return DIENUM_STOP; @@ -231,16 +256,23 @@ * Callback from EnumObjects. Called for each "object" on the Controller. */ BOOL CALLBACK EnumControllerObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef) { +#if _DEBUG + printf("found %s\n", lpddoi->tszName); +#endif if(lpddoi->guidType == GUID_Button) { buttoncount++; - } else if(lpddoi->guidType == GUID_XAxis || lpddoi->guidType == GUID_YAxis) { - //do nothing - } else if(lpddoi->guidType == GUID_ZAxis || strcmp("Throttle", lpddoi->tszName) == 0){ + } else if(lpddoi->guidType == GUID_XAxis) { + hasx = true; + } else if(lpddoi->guidType == GUID_YAxis) { + hasy = true; + } else if(lpddoi->guidType == GUID_ZAxis){ hasz = true; } else if (lpddoi->guidType == GUID_POV){ haspov = true; + } else if (lpddoi->guidType == GUID_Slider){ + hasslider = true; +#if _DEBUG } else { -#ifdef _DEBUG printf("Unhandled object found: %s\n", lpddoi->tszName); #endif } @@ -254,6 +286,9 @@ HRESULT hr; hr = lpDI->CreateDevice(lpddi->guidInstance, (LPDIRECTINPUTDEVICE*) &lpDIDevice, NULL); if FAILED(hr) { +#if _DEBUG + printf("CreateDevice failed\n"); +#endif create_success = false; return; } @@ -266,12 +301,18 @@ void SetupController() { // set Controller data format if(lpDIDevice->SetDataFormat(&c_dfDIJoystick2) != DI_OK) { +#if _DEBUG + printf("SetDataFormat failed\n"); +#endif create_success = false; return; } // set the cooperative level if(lpDIDevice->SetCooperativeLevel(hwnd, DISCL_NONEXCLUSIVE | DISCL_BACKGROUND) != DI_OK) { +#if _DEBUG + printf("SetCooperativeLevel failed\n"); +#endif create_success = false; return; } @@ -286,30 +327,56 @@ diprg.lMin = AXISMIN; diprg.lMax = AXISMAX; - if(lpDIDevice->SetProperty(DIPROP_RANGE, &diprg.diph) != DI_OK) { - create_success = false; - return; + if(hasx) { + if(lpDIDevice->SetProperty(DIPROP_RANGE, &diprg.diph) != DI_OK) { +#if _DEBUG + printf("SetProperty(DIJOFS_X) failed\n"); +#endif + create_success = false; + return; + } } // // And again for Y-axis range // - diprg.diph.dwObj = DIJOFS_Y; - - if(lpDIDevice->SetProperty(DIPROP_RANGE, &diprg.diph) != DI_OK) - { - create_success = false; - return; + if(hasy) { + diprg.diph.dwObj = DIJOFS_Y; + if(lpDIDevice->SetProperty(DIPROP_RANGE, &diprg.diph) != DI_OK) { +#if _DEBUG + printf("SetProperty(DIJOFS_Y) failed\n"); +#endif + create_success = false; + return; + } } // - // And again for z-axis range (throttle) + // And again for Z-axis range // - diprg.diph.dwObj = DIJOFS_Z; + if(hasz) { + diprg.diph.dwObj = DIJOFS_Z; + if(lpDIDevice->SetProperty(DIPROP_RANGE, &diprg.diph) != DI_OK) { +#if _DEBUG + printf("SetProperty(DIJOFS_Z) failed\n"); +#endif + create_success = false; + return; + } + } - if(lpDIDevice->SetProperty(DIPROP_RANGE, &diprg.diph) != DI_OK) { - create_success = false; - return; + // + // Lastly slider + // + if(hasslider) { + diprg.diph.dwObj = DIJOFS_Z; + if(lpDIDevice->SetProperty(DIPROP_RANGE, &diprg.diph) != DI_OK) { +#if _DEBUG + printf("SetProperty(DIJOFS_Z(SLIDER)) failed\n"); +#endif + create_success = false; + return; + } } create_success = true; } @@ -338,15 +405,21 @@ if(hRes == DIERR_INPUTLOST) { lpDIDevice->Acquire(); #if _DEBUG - printf("DIERR_INPUTLOST, reaquiring input\n"); + printf("DIERR_INPUTLOST, reaquiring input : create_success=%d\n", create_success); #endif } return; } //axis's - environment->SetStaticIntField(clsController, fidX, js.lX); - environment->SetStaticIntField(clsController, fidY, js.lY); + if(hasx) { + environment->SetStaticIntField(clsController, fidX, js.lX); + } + + if(hasy) { + environment->SetStaticIntField(clsController, fidY, js.lY); + } + if(hasz) { environment->SetStaticIntField(clsController, fidZ, js.lZ); } @@ -361,6 +434,11 @@ if(haspov) { environment->SetStaticIntField(clsController, fidPOV, js.rgdwPOV[0]); } + + //slider + if(hasslider) { + environment->SetStaticIntField(clsController, fidSlider, js.lZ); + } } /** @@ -370,11 +448,16 @@ //set buttoncount environment->SetStaticIntField(clsController, fidButtonCount, buttoncount); - //set z axis + //set axis + environment->SetStaticIntField(clsController, fidHasXAxis, hasx); + environment->SetStaticIntField(clsController, fidHasYAxis, hasy); environment->SetStaticIntField(clsController, fidHasZAxis, hasz); //set pov environment->SetStaticIntField(clsController, fidHasPOV, haspov); + + //set slider + environment->SetStaticIntField(clsController, fidHasSlider, hasslider); } /** @@ -382,11 +465,15 @@ */ void CacheFields() { fidButtonCount = environment->GetStaticFieldID(clsController, "buttonCount", "I"); + fidHasXAxis = environment->GetStaticFieldID(clsController, "hasXAxis", "Z"); + fidHasYAxis = environment->GetStaticFieldID(clsController, "hasYAxis", "Z"); fidHasZAxis = environment->GetStaticFieldID(clsController, "hasZAxis", "Z"); fidHasPOV = environment->GetStaticFieldID(clsController, "hasPOV", "Z"); + fidHasSlider = environment->GetStaticFieldID(clsController, "hasSlider", "Z"); fidButtons = environment->GetStaticFieldID(clsController, "buttons", "[Z"); fidX = environment->GetStaticFieldID(clsController, "x", "I"); fidY = environment->GetStaticFieldID(clsController, "y", "I"); fidZ = environment->GetStaticFieldID(clsController, "z", "I"); fidPOV = environment->GetStaticFieldID(clsController, "pov", "I"); + fidSlider = environment->GetStaticFieldID(clsController, "slider", "I"); } |