551 |
Surface *s = image_cache.get(filename); |
Surface *s = image_cache.get(filename); |
552 |
return s; |
return s; |
553 |
} |
} |
554 |
|
|
555 |
|
|
556 |
|
//---------------------------------------- |
557 |
|
// Random numbers |
558 |
|
//---------------------------------------- |
559 |
|
void enigma::Randomize (unsigned seed) |
560 |
|
{ |
561 |
|
srand (seed); |
562 |
|
} |
563 |
|
|
564 |
|
int enigma::IntegerRand (int min, int max) |
565 |
|
{ |
566 |
|
int r = int((max-min+1) * (rand()/(RAND_MAX+1.0))); |
567 |
|
return r+min; |
568 |
|
} |
569 |
|
|
570 |
|
double enigma::DoubleRand (double min, double max) |
571 |
|
{ |
572 |
|
return min + double(rand())/RAND_MAX * (max-min); |
573 |
|
} |