diff options
-rw-r--r-- | Makefile | 10 | ||||
-rwxr-xr-x | src/survive.c | 4 | ||||
-rwxr-xr-x | src/survive_vive.c | 2 |
3 files changed, 13 insertions, 3 deletions
@@ -8,9 +8,19 @@ LDFLAGS:=-lpthread -lusb-1.0 -lz -lX11 -lm -flto -g POSERS:=src/poser_dummy.o src/poser_daveortho.o src/poser_charlesslow.o REDISTS:=redist/json_helpers.o redist/linmath.o redist/jsmn.o LIBSURVIVE_CORE:=src/survive.o src/survive_usb.o src/survive_data.o src/survive_process.o src/ootx_decoder.o src/survive_driverman.o src/survive_vive.o src/survive_config.o src/survive_cal.o +LIBSURVIVE_CORE:=$(LIBSURVIVE_CORE) LIBSURVIVE_O:=$(POSERS) $(REDISTS) $(LIBSURVIVE_CORE) LIBSURVIVE_C:=$(LIBSURVIVE_O:.o=.c) +#Useful Preprocessor Directives: +# -DUSE_DOUBLE = use double instead of float for most operations. +# -DNOZLIB = use puff.c +# -DTCC = various things needed for TCC. +# -DWINDOWS -DWIN32 = Building for Windows +# -DHIDAPI = Build vive driver to use USBHID instead of interrupt/control messages. +# -DRUNTIME_SYMNUM = Don't assume __attribute__((constructor)) works. Instead comb for anything starting with REGISTER. + + GRAPHICS_LOFI:=redist/DrawFunctions.o redist/XDriver.o # unused: redist/crc32.c diff --git a/src/survive.c b/src/survive.c index 1b5bed1..3c16353 100755 --- a/src/survive.c +++ b/src/survive.c @@ -253,8 +253,8 @@ struct SurviveObject * survive_get_so_by_name( struct SurviveContext * ctx, cons int survive_simple_inflate( struct SurviveContext * ctx, const char * input, int inlen, char * output, int outlen ) { unsigned long ol = outlen; - unsigned long il = inlen; - int ret = puff( output, &ol, input, &il ); + unsigned long il = inlen-2; + int ret = puff( output, &ol, input+2, &il ); if( ret == 0 ) return ol; else diff --git a/src/survive_vive.c b/src/survive_vive.c index fc05647..12d8c16 100755 --- a/src/survive_vive.c +++ b/src/survive_vive.c @@ -711,7 +711,7 @@ int survive_get_config( char ** config, struct SurviveViveData * sv, int devno, int len = survive_simple_inflate( ctx, compressed_data, count, uncompressed_data, sizeof(uncompressed_data)-1 ); if( len <= 0 ) { - SV_INFO( "Error: data for config descriptor %d:%d is bad.", devno, iface ); + SV_INFO( "Error: data for config descriptor %d:%d is bad. (%d)", devno, iface, len ); return -5; } |