Changeset 331 in flair-src for trunk/tools/VrpnLite/src
- Timestamp:
- Oct 1, 2019, 4:45:02 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/VrpnLite/src/VrpnLite.cpp
r330 r331 53 53 if(rcv>0) { 54 54 string object=msg; 55 uint16_t* idPtr=(uint16_t*)&msg[rcv-2]; 56 dataSocket->HostToNetwork((char*)idPtr,sizeof(uint16_t)); 55 uint16_t id; 56 memcpy(&id,&msg[rcv-2],sizeof(id)); 57 dataSocket->HostToNetwork((char*)&id,sizeof(id)); 57 58 //assume we receive it in the good order 58 if( *idPtr==vrpnobjects.size()) {59 Printf("adding object %s with id %i\n",object.c_str(), *idPtr);59 if(id==vrpnobjects.size()) { 60 Printf("adding object %s with id %i\n",object.c_str(),id); 60 61 VrpnObject* vrpnobject = new VrpnObject(object,vrpnclient->GetTabWidget()); 61 62 vrpnobjects.push_back(vrpnobject); 62 63 }else { 63 Err("adding object %s failed, expected id %i, got %i\n",object.c_str(),vrpnobjects.size(), *idPtr);64 Err("adding object %s failed, expected id %i, got %i\n",object.c_str(),vrpnobjects.size(),id); 64 65 } 65 66 }
Note:
See TracChangeset
for help on using the changeset viewer.