Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve seed range

  • Loading branch information...
commit a29d5c0a7ed4ea16ff10ea0f92fcc36f5d09d4c9 1 parent 9f1b7aa
@antoinehersen authored
View
11 cinder/brownian_motion/src/borwnian_motionApp.cpp
@@ -21,7 +21,7 @@ using namespace std;
// From GetPrimaryMACAdress
-int getUUID();
+uint32_t getUUID();
@@ -79,8 +79,13 @@ void bm::prepareSettings( Settings *settings ){
}
void borwnian_motionApp::setup(){
- Rand::randomize();
- Rand::randSeed(getUUID());
+ uint32_t seed = getUUID();
+ Rand::randSeed(seed);
+ if (seed == 3471019890U) {
+ Rand::randomize();
+ std::cout << "Special seed" << std::endl;
+ }
+ std::cout << getUUID() << std::endl;
gl::enableAdditiveBlending();
useFullScreen = true;
setFullScreen(useFullScreen);
View
6 cinder/brownian_motion/xcode/GetPrimaryMACAddress.cpp
@@ -194,7 +194,7 @@ static kern_return_t GetMACAddress(io_iterator_t intfIterator, UInt8 *MACAddress
return kernResult;
}
-int getUUID()
+uint32_t getUUID()
{
kern_return_t kernResult = KERN_SUCCESS;
io_iterator_t intfIterator;
@@ -219,10 +219,10 @@ int getUUID()
(void) IOObjectRelease(intfIterator); // Release the iterator.
- int results = 0;
+ uint32_t results = 0;
for(int i = 0; i < kIOEthernetAddressSize; i++) {
- results += MACAddress[i];
+ results = MACAddress[i] + results*16*16;
}
return results;
Please sign in to comment.
Something went wrong with that request. Please try again.