100% Probability = 0% Probability
Status: Beta
Brought to you by:
thomas_sidor
The code "if ( rand() < (int)(RAND_MAX * p) ) vs[i+WIDTH] = type;" in the Emit function fails to work properly for p = 1.0f. My guess is that (int)(RAND_MAX * p) is equal to 1 higher than the maximum integer. Changing the code to "if ( rand() < (unsigned int)(RAND_MAX * p) ) vs[i+WIDTH] = type;" fixes this bug. It is possible that some machines might cast int to a larger primitive, preventing this bug from occuring.