mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
Root cause of crash isolated to setRaveGloveMode(), so some disabled code has been re-enabled
This commit is contained in:
parent
002a62d31e
commit
858738a10a
1 changed files with 2 additions and 15 deletions
|
@ -111,8 +111,6 @@ int HandData::encodeRemoteData(unsigned char* destinationBuffer) {
|
|||
return destinationBuffer - startPosition;
|
||||
}
|
||||
|
||||
#define DISABLE_RECEIVE // Temporary measure while a crash is being traced
|
||||
|
||||
int HandData::decodeRemoteData(unsigned char* sourceBuffer) {
|
||||
const unsigned char* startPosition = sourceBuffer;
|
||||
|
||||
|
@ -121,10 +119,8 @@ int HandData::decodeRemoteData(unsigned char* sourceBuffer) {
|
|||
unsigned int numHands = *sourceBuffer++;
|
||||
|
||||
for (unsigned int handIndex = 0; handIndex < numHands; ++handIndex) {
|
||||
#ifndef DISABLE_RECEIVE
|
||||
if (handIndex >= getNumPalms())
|
||||
addNewPalm();
|
||||
#endif
|
||||
if (handIndex < getNumPalms()) {
|
||||
PalmData& palm = getPalms()[handIndex];
|
||||
|
||||
|
@ -134,11 +130,9 @@ int HandData::decodeRemoteData(unsigned char* sourceBuffer) {
|
|||
sourceBuffer += unpackFloatVec3FromSignedTwoByteFixed(sourceBuffer, handNormal, fingerVectorRadix);
|
||||
unsigned int numFingers = *sourceBuffer++;
|
||||
|
||||
#ifndef DISABLE_RECEIVE
|
||||
palm.setRawPosition(handPosition);
|
||||
palm.setRawNormal(handNormal);
|
||||
palm.setActive(true);
|
||||
#endif
|
||||
for (unsigned int fingerIndex = 0; fingerIndex < numFingers; ++fingerIndex) {
|
||||
if (fingerIndex < palm.getNumFingers()) {
|
||||
FingerData& finger = palm.getFingers()[fingerIndex];
|
||||
|
@ -148,34 +142,27 @@ int HandData::decodeRemoteData(unsigned char* sourceBuffer) {
|
|||
sourceBuffer += unpackFloatVec3FromSignedTwoByteFixed(sourceBuffer, tipPosition, fingerVectorRadix);
|
||||
sourceBuffer += unpackFloatVec3FromSignedTwoByteFixed(sourceBuffer, rootPosition, fingerVectorRadix);
|
||||
|
||||
#ifndef DISABLE_RECEIVE
|
||||
finger.setRawTipPosition(tipPosition);
|
||||
finger.setRawRootPosition(rootPosition);
|
||||
finger.setActive(true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// Turn off any fingers which weren't used.
|
||||
for (unsigned int fingerIndex = numFingers; fingerIndex < palm.getNumFingers(); ++fingerIndex) {
|
||||
FingerData& finger = palm.getFingers()[fingerIndex];
|
||||
#ifndef DISABLE_RECEIVE
|
||||
finger.setActive(false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
// Turn off any hands which weren't used.
|
||||
for (unsigned int handIndex = numHands; handIndex < getNumPalms(); ++handIndex) {
|
||||
PalmData& palm = getPalms()[handIndex];
|
||||
#ifndef DISABLE_RECEIVE
|
||||
palm.setActive(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef DISABLE_RECEIVE
|
||||
setRaveGloveActive((gloveFlags & GLOVE_FLAG_RAVE) != 0);
|
||||
setRaveGloveMode(effectsMode);
|
||||
#endif
|
||||
// This is disabled for crash tracing.
|
||||
// setRaveGloveMode(effectsMode);
|
||||
|
||||
// One byte for error checking safety.
|
||||
unsigned char requiredLength = (unsigned char)(sourceBuffer - startPosition);
|
||||
|
|
Loading…
Reference in a new issue