/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. *//* * Wirzenius wrote this portably, Torvalds fucked it up :-) */
I have similar garbage in my Operating System too.
/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. *//* * Wirzenius wrote this portably, Torvalds fucked it up :-) */
Ball* ball = new Ball();ball->size = BIG; // One of the big ballsif(Balls.size() < 2) // Too little big balls Balls.insert(ball); // Insert the ball in there nicely... Yes, just like that
//This is my version of the large bin lookup.//My direct lookup (with branching) is faster than Lea's convoluted mess of an //algorithm.//And no one knows why he only uses even numbered bins either.//I don't care if he is a computer science professor, he should never be allowed//to touch a computer again.
After a week of work I determined that it wouldn't work anyway, since his algorithm sucks for parallel systems. His mutual exclusion is a complete hack.
Thread of old, arise from thy grave!
While looking through the Quake 2 source code years ago I saw this:
void R_Flash (void)
So I changed it to this:
void R_Flash (void) // AHH-AHH!!!
You have to be a certain age. ;)
Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.
You have to be a certain age. ;)
I must be old enough then :D
I guess..
double d = 0.0d; // lols.. double d's..
:)
---
Cinder Interative - Indie Game Studio | MikeaDev.net - My Blog | Michael Adaixo - My Website.
Here are some funny comments from the source code driving one of those LED displays you see at train stations.
Blending colours
// The question is: Will it Blend?
extern inline unsigned short blendColours( unsigned short colour1, unsigned short colour2, unsigned char startPosition, unsigned char endPosition, unsigned char position, unsigned char blendDistance )
{
return ((((colour1&0xF00)>>8)*(endPosition-position)/blendDistance + ((colour2&0xF00)>>8)*(position-startPosition)/blendDistance)<<8) | ((((colour1&0x0F0)>>4)*(endPosition-position)/blendDistance + ((colour2&0x0F0)>>4)*(position-startPosition)/blendDistance)<<4) | ((colour1&0x00F)*(endPosition-position)/blendDistance + (colour2&0x00F)*(position-startPosition)/blendDistance);
}
Writing to shift registers at high frequency
// output serial data
for( x = 0; x != 8; x++ )
{
// NOTE: my god, I hope the shift registers can handle this without delay. It's torture I say, TORTURE
// NOTE2: On second thought, they *were* a pain to solder. I guess it's only fair to punish them
// output next 6 bits
P3OUT = pixelArray[x][y][currentPWMCycle];
// write them to shift registers
P3OUT |= SHIFT_REGISTER_WRITE;
}