Skip to content

Commit

Permalink
strange event type error initialize event type to none before get all…
Browse files Browse the repository at this point in the history
… events
  • Loading branch information
lijinlong committed Mar 29, 2022
1 parent 1cacdcc commit 19c6614
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Binary file modified Content/Demo/DemoMap.umap
Binary file not shown.
Binary file modified Content/Demo/DemoMap_BuiltData.uasset
Binary file not shown.
5 changes: 5 additions & 0 deletions Source/NeuronLiveLink/Private/MocapStructs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ bool UMocapApp::PollEvents()

PrepareAndSendMocapCommand(mcpApplication);

//std::vector<MocapApi::MCPEvent_t> events;
TArray<MocapApi::MCPEvent_t> events;
uint32_t unEvent = 0;

Expand All @@ -263,11 +264,15 @@ bool UMocapApp::PollEvents()
//retrive event data
if (hasUnhandledEvents) {
events.AddUninitialized(unEvent);
//events.resize(unEvent);
for (auto & e : events) {
e.size = sizeof(MocapApi::MCPEvent_t);
e.eventType = MocapApi::MCPEvent_None;
}
mcpError = mcpApplication->PollApplicationNextEvent(events.GetData(), &unEvent, appcliation);
ReturnFalseIFError("PollApplicationNextEvent");
hasUnhandledEvents = unEvent > 0;
events.SetNum(unEvent);
}
if (hasUnhandledEvents) {
FScopeLock Lock(&CriticalSection);
Expand Down

0 comments on commit 19c6614

Please sign in to comment.