From 796e1194d13bfa16f41676d81f7d9cdb4b9fc96f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 24 Apr 2014 11:56:22 -0400 Subject: mouse events on walls (prism box) --- assets/javascripts/util.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'assets/javascripts/util.js') diff --git a/assets/javascripts/util.js b/assets/javascripts/util.js index 8a0e5ba..89889c4 100644 --- a/assets/javascripts/util.js +++ b/assets/javascripts/util.js @@ -155,3 +155,9 @@ function invert_hash (h) { return k } +function bitcount(v) { + v = v - ((v >>> 1) & 0x55555555); + v = (v & 0x33333333) + ((v >>> 2) & 0x33333333); + return ((v + (v >>> 4) & 0xF0F0F0F) * 0x1010101) >>> 24; +} + -- cgit v1.2.3-70-g09d2