Skip to content

Commit

Permalink
Merge pull request #919 from exokitxr/node-12-fix
Browse files Browse the repository at this point in the history
Node 12 compatibility fixes
  • Loading branch information
Avaer Kazmer committed Apr 15, 2019
2 parents 43fa344 + 58b3186 commit 363aad1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions deps/oculus/src/oculus-bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ Local<Object> makeOculusVR() {
v8::EscapableHandleScope scope(Isolate::GetCurrent());

Local<Object> exports = Object::New(Isolate::GetCurrent());

exports->Set(Nan::New("Oculus_Init").ToLocalChecked(), Nan::New<v8::FunctionTemplate>(Oculus_Init)->GetFunction());
exports->Set(Nan::New("Oculus_IsHmdPresent").ToLocalChecked(), Nan::New<v8::FunctionTemplate>(Oculus_IsHmdPresent)->GetFunction());

Nan::SetMethod(exports, "Oculus_Init", Oculus_Init);
Nan::SetMethod(exports, "Oculus_IsHmdPresent", Oculus_IsHmdPresent);
return scope.Escape(exports);
}
8 changes: 4 additions & 4 deletions deps/oculus/src/ovrsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ NAN_METHOD(OVRSession::GetControllersInputState) {
return;
}

uint32_t hand = info[0]->Uint32Value();
uint32_t hand = TO_UINT32(info[0])
Local<Float32Array> buttons = Local<Float32Array>::Cast(info[1]);
buttons->Set(0, Number::New(Isolate::GetCurrent(), std::numeric_limits<float>::quiet_NaN()));

Expand Down Expand Up @@ -420,9 +420,9 @@ NAN_METHOD(OVRSession::Submit)
}

WebGLRenderingContext *gl = node::ObjectWrap::Unwrap<WebGLRenderingContext>(Local<Object>::Cast(info[0]));
GLuint fboIdSource = info[1]->Uint32Value();
int width = info[2]->Uint32Value();
int height = info[3]->Uint32Value();
GLuint fboIdSource = TO_UINT32(info[1]);
int width = TO_INT32(info[2]);
int height = TO_UINT32(info[3]);

ovrPosef *eyeRenderPoses = &*ObjectWrap::Unwrap<OVRSession>(info.Holder())->eyeRenderPoses;
int *frameIndex = &ObjectWrap::Unwrap<OVRSession>(info.Holder())->frameIndex;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"express": "^4.16.3",
"find": "^0.2.9",
"mocha": "^6.0.0-1",
"ndb": "^1.0.23",
"ndb": "^1.0.44",
"serve": "^9.4.0",
"shx": "^0.3.2",
"sinon": "^6.1.4"
Expand Down

0 comments on commit 363aad1

Please sign in to comment.