freebsd-ports/games/xlogical/files/patch-tile__spinner.cpp
John Marino fac4ecc6a6 games/xlogical: stage support and unbreak on F10+
This port needed a lot more help than the PR indicated:
 * Full stage support
 * DESTDIR had to be patched in, there was only a placeholder
 * It didn't build on clang because there was no header for rand function
 * Almost very patch had DOS carriage returns (stripped)
 * Needed USES+=dos2unix so patches apply (caused revbump)
 * NOPORTDOCS needed to be replaced by PORT_OPTIONS - DOCS
 * post-extract target was muted, as is the norm
 * Previous install patches reworked to fit STAGE support better

The PR updated:
 * Use of autotools
 * conversion of USE_GMAKE and USE_BZIP2 was done previously
 * GPLv2 license was added

PR:		188798
Submitted by:	maintainer (Aaron Baugher)
Rest by:	marino
2014-06-10 20:49:51 +00:00

28 lines
762 B
C++

--- tile_spinner.cpp.orig 2014-06-10 17:24:39.000000000 +0000
+++ tile_spinner.cpp
@@ -21,6 +21,7 @@
////////////////////////////////////////////////////////////////////////
+#include <cstdlib>
// Application Includes
@@ -46,7 +47,7 @@ Ctile_spinner::Ctile_spinner( void )
finished = 0;
finishing_hopper = -1;
flashOn = 0;
- flashWait = rand( ) % 5;
+ flashWait = std::rand( ) % 5;
// Reset the hopper
hopper[0] = NULL;
@@ -477,7 +478,7 @@ Ctile_spinner::check_complete( void )
if( CURMAP->randOrder == 1 )
{
// Randomize a new color
- CURMAP->order[2] = (color_t)(rand( )%4 + 1);
+ CURMAP->order[2] = (color_t)(std::rand( )%4 + 1);
} else {
// Set the next one to null
CURMAP->order[2] = NO_COLOR;