643 |
scr->flush_updates(); |
scr->flush_updates(); |
644 |
} |
} |
645 |
|
|
|
/* Returns a random number between a and b (inclusive). */ |
|
|
static int |
|
|
irand(int a, int b) |
|
|
{ |
|
|
int r = int((b-a+1) * (rand()/(RAND_MAX+1.0))); |
|
|
return r+a; |
|
|
} |
|
|
|
|
646 |
void |
void |
647 |
video::ShowScreen (TransitionModes tm, Surface *newscr) |
video::ShowScreen (TransitionModes tm, Surface *newscr) |
648 |
{ |
{ |
665 |
{ |
{ |
666 |
int xo=0, yo=0; |
int xo=0, yo=0; |
667 |
while (xo==0 && yo==0) { |
while (xo==0 && yo==0) { |
668 |
xo = irand(-1,1)*scrw; |
xo = enigma::IntegerRand(-1,1)*scrw; |
669 |
yo = irand(-1,1)*scrh; |
yo = enigma::IntegerRand(-1,1)*scrh; |
670 |
} |
} |
671 |
FX_Push (newscr, xo, yo); |
FX_Push (newscr, xo, yo); |
672 |
} |
} |