| 367 | |
| 368 | static UINT32 seed = 12345; |
| 369 | float rndf() //expected 0..1 |
| 370 | { |
| 371 | // UINT16 Rand = 0; |
| 372 | // AsmRdRand16(&Rand); //it's a pity panic |
| 373 | // return (float)Rand / 65536.f; |
| 374 | seed = seed * 214013 + 2531011; |
| 375 | float x = (float)seed / 4294967296.0f; |
| 376 | return x; |
| 377 | } |
| 378 | |
| 379 | int dither(float x, int level) |
| 380 | { |