- a few changes to properly compile in win32

This commit is contained in:
Mark Vejvoda
2010-06-01 01:17:37 +00:00
parent b8dac6de50
commit f70f0cc896
6 changed files with 13 additions and 9 deletions

View File

@@ -12,6 +12,8 @@
#ifndef _SHARED_UTIL_RANDOM_H_
#define _SHARED_UTIL_RANDOM_H_
#include "math_wrapper.h"
namespace Shared { namespace Util {
// =====================================================
@@ -26,7 +28,10 @@ private:
private:
int lastNumber;
#ifdef USE_STREFLOP
streflop::RandomState randomState;
#endif
public:
RandomGen();
void init(int seed);

View File

@@ -1,7 +1,6 @@
#include "randomgen.h"
#include <cassert>
#include "util.h"
#include "math_wrapper.h"
#include "leak_dumper.h"
namespace Shared { namespace Util {
@@ -65,7 +64,7 @@ float RandomGen::randRange(float min, float max){
assert(min<=max);
#ifdef USE_STREFLOP
float res = streflop::Random<true, false, float>(min, max); // streflop
float res = streflop::Random<true, false, float>(min, max, randomState); // streflop
#else
float rand01= static_cast<float>(RandomGen::rand())/(m-1);
float res= min+((max-min)*rand01);