aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rwxr-xr-xsrc/survive_vive.c34
2 files changed, 26 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index cb8f780..ed33e2b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,10 @@ windows/calibrate.exe
windows/calinfo/1.json.gz
windows/calibrate.def
windows/calinfo/3.json.gz
+windows/calinfo/WM1_points.csv
+windows/calinfo/HMD_normals.csv
+windows/calinfo/WM0_points.csv
+windows/calinfo/WM1_normals.csv
+windows/calinfo/HMD_points.csv
+windows/calinfo/WM0_normals.csv
+windows/calinfo/2.json.gz
diff --git a/src/survive_vive.c b/src/survive_vive.c
index 12d8c16..c3967cd 100755
--- a/src/survive_vive.c
+++ b/src/survive_vive.c
@@ -1082,24 +1082,28 @@ void survive_data_cb( SurviveUSBInterface * si )
case USB_IF_LIGHTCAP:
{
int i;
- #ifdef HIDAPI
- for( i = 0; i < 7; i++ )
+
+ if( si->buffer[0] == 0x25 ) //Once the valve drivers run, they somehow put the HMD into 7-byte-width messages.
{
- LightcapElement le;
- le.sensor_id = POP1;
- le.type = 0xfe;
- le.length = POP2;
- le.timestamp = POP4;
- if( le.sensor_id == 0xff ) break;
- handle_lightcap( obj, &le );
- }
- #else
- for( i = 0; i < 7; i++ )
+ for( i = 0; i < 9; i++ )
+ {
+ LightcapElement le;
+ le.sensor_id = POP1;
+ le.type = 0xfe;
+ le.length = POP2;
+ le.timestamp = POP4;
+ if( le.sensor_id == 0xff ) break;
+ handle_lightcap( obj, &le );
+ }
+ }
+ else //Otherwise, we're in the old mode.
{
- handle_lightcap( obj, (LightcapElement*)&readdata[i*8] );
+ for( i = 0; i < 7; i++ )
+ {
+ handle_lightcap( obj, (LightcapElement*)&readdata[i*8] );
+ }
+ break;
}
- break;
- #endif
}
}
}