Terminology: Pan distributes a mono signal between left and right stereo outputs. Balance distributes a stereo output between left and right stereo speakers.
Monthly Archives: March 2012
Programmer Humor
A back and forth between cohorts:
Semaphore lock/unlock was chewing up 30% of total execution time. Synchronized list access took up another 20%. Switched to unprotected arrays + stupid simple access methods and quadrupled framerate. Fuck thread safety.
Which yielded the following response:
Silly Problems
Latest lamentation on why entity/entity collisions weren’t working:
// Do collisions in O(n^2) for(int i=0; i < numEntities-1; ++i) { if(entities[i] == null || !(entities[i] instanceof Touchable)) { continue; } Touchable a = (Touchable)entities[i]; for(int j=i+1; j < numEntities; ++j) { if(entities[j] != null || !(entities[j] instanceof Touchable)) { continue; } Touchable b = (Touchable)entities[j]; if(a != b && a.collides(b)) { a.touchedBy(entities[j]); b.touchedBy(entities[i]); } } }
See if you can spot the problem with the above (almost) pseudocode. See it?
if(entities[j] != null) { DERP! }
I’m going to bed.