minor change
This commit is contained in:
1 parent
1e54c2d16f
commit
c629a1d5d5
1 file changed
+1
-1
@@ -106,7 +106,7 @@ StreamView *streamView;
|
|||||||
+ (void)populatePointerId:(UITouch*)touch{
|
+ (void)populatePointerId:(UITouch*)touch{
|
||||||
uint64_t eventAddrValue = (uint64_t)touch;
|
uint64_t eventAddrValue = (uint64_t)touch;
|
||||||
uint32_t randomPointerId = arc4random_uniform(UINT32_MAX); // generate pointerId from eletronic noise.
|
uint32_t randomPointerId = arc4random_uniform(UINT32_MAX); // generate pointerId from eletronic noise.
|
||||||
while(true){
|
for(;;){
|
||||||
if([pointerIdSet containsObject:@(randomPointerId)]) randomPointerId = arc4random_uniform(UINT32_MAX); // in case of new pointerId collides with existing ones, generate again.
|
if([pointerIdSet containsObject:@(randomPointerId)]) randomPointerId = arc4random_uniform(UINT32_MAX); // in case of new pointerId collides with existing ones, generate again.
|
||||||
else{ // populate pointerId into NSDict & NSSet.
|
else{ // populate pointerId into NSDict & NSSet.
|
||||||
[pointerIdDict setObject:@(randomPointerId) forKey:@(eventAddrValue)];
|
[pointerIdDict setObject:@(randomPointerId) forKey:@(eventAddrValue)];
|
||||||
|
|||||||
Reference in new issue
Block a user