diff --git a/mk/windoze/Glest.suo b/mk/windoze/Glest.suo index 6b144f5e4..46682f3b0 100755 Binary files a/mk/windoze/Glest.suo and b/mk/windoze/Glest.suo differ diff --git a/mk/windoze/glest_game.vcproj b/mk/windoze/glest_game.vcproj index 04521431f..a91fe5bbb 100755 --- a/mk/windoze/glest_game.vcproj +++ b/mk/windoze/glest_game.vcproj @@ -46,7 +46,7 @@ WholeProgramOptimization="false" AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/shared_lib/include/tinyxml;../../source/glest_game/ai;../../source/glest_game/facilities;../../source/glest_game/game;../../source/glest_game/global;../../source/glest_game/graphics;../../source/glest_game/gui;../../source/glest_game/main;../../source/glest_game/menu;../../source/glest_game/network;../../source/glest_game/sound;../../source/glest_game/type_instances;../../source/glest_game/types;../../source/glest_game/world;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/SDL-1.2.14/include";../../source/shared_lib/include/platform/sdl;../../source/shared_lib/include/sound/openal;"../../source/win32_deps/openal-soft-1.12.854/include";../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/platform/common;$(NOINHERIT)" AdditionalUsingDirectories="" - PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;XML_LIBRARY;NO_GL_ASSERTIONS;USE_PCH=1;USE_STREFLOP;STREFLOP_X87;LIBM_COMPILING_FLT32" + PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;XML_LIBRARY;NO_GL_ASSERTIONS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32" StringPooling="true" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -137,7 +137,7 @@ WholeProgramOptimization="false" AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/shared_lib/include/tinyxml;../../source/glest_game/ai;../../source/glest_game/facilities;../../source/glest_game/game;../../source/glest_game/global;../../source/glest_game/graphics;../../source/glest_game/gui;../../source/glest_game/main;../../source/glest_game/menu;../../source/glest_game/network;../../source/glest_game/sound;../../source/glest_game/type_instances;../../source/glest_game/types;../../source/glest_game/world;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/SDL-1.2.14/include";../../source/shared_lib/include/platform/sdl;../../source/shared_lib/include/sound/openal;"../../source/win32_deps/openal-soft-1.12.854/include";../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/platform/common;"../../source/win32_deps/curl-7.20.1/include";$(NOINHERIT)" AdditionalUsingDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS;USE_STREFLOP;STREFLOP_X87;LIBM_COMPILING_FLT32;CURL_STATICLIB" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32;CURL_STATICLIB" StringPooling="true" ExceptionHandling="2" RuntimeLibrary="0" diff --git a/mk/windoze/libstreflop.vcproj b/mk/windoze/libstreflop.vcproj index c8b7075c7..217687116 100644 --- a/mk/windoze/libstreflop.vcproj +++ b/mk/windoze/libstreflop.vcproj @@ -114,7 +114,7 @@ FavorSizeOrSpeed="1" WholeProgramOptimization="false" AdditionalIncludeDirectories=""..\..\source\shared_lib\include\streflop\libm\flt-32";..\..\source\shared_lib\include\streflop\libm\headers" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_X87;LIBM_COMPILING_FLT32" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32" StringPooling="true" ExceptionHandling="2" RuntimeLibrary="0" @@ -186,7 +186,7 @@ FavorSizeOrSpeed="1" WholeProgramOptimization="false" AdditionalIncludeDirectories=""..\..\source\shared_lib\include\streflop\libm\flt-32";..\..\source\shared_lib\include\streflop\libm\headers" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_X87;LIBM_COMPILING_FLT32" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32" StringPooling="true" ExceptionHandling="2" RuntimeLibrary="0" diff --git a/mk/windoze/shared_lib.vcproj b/mk/windoze/shared_lib.vcproj index 771a9916b..babc23281 100755 --- a/mk/windoze/shared_lib.vcproj +++ b/mk/windoze/shared_lib.vcproj @@ -41,7 +41,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude";../../source/win32_deps/libpng141;"../../source/win32_deps/jpeg-8a";"../../source/win32_deps/SDL-1.2.14/include";../../source/shared_lib/include/platform/sdl;"../../source/win32_deps/openal-soft-1.12.854/include";../../source/shared_lib/include/sound/openal;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/streflop/libm_flt32_source;../../source/shared_lib/include/platform/common" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;NO_GL_ASSERTIONS;USE_PCH=1;USE_STREFLOP;STREFLOP_X87;LIBM_COMPILING_FLT32" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;NO_GL_ASSERTIONS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32" StringPooling="true" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -116,7 +116,7 @@ FavorSizeOrSpeed="1" WholeProgramOptimization="false" AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude";../../source/win32_deps/libpng141;"../../source/win32_deps/jpeg-8a";"../../source/win32_deps/SDL-1.2.14/include";../../source/shared_lib/include/platform/sdl;"../../source/win32_deps/openal-soft-1.12.854/include";../../source/shared_lib/include/sound/openal;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/streflop/libm_flt32_source;../../source/shared_lib/include/platform/common;"../../source/win32_deps/curl-7.20.1/include"" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_X87;LIBM_COMPILING_FLT32;CURL_STATICLIB" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;STREFLOP_RANDOM_GEN_SIZE=32;LIBM_COMPILING_FLT32;CURL_STATICLIB" StringPooling="true" ExceptionHandling="2" RuntimeLibrary="0" diff --git a/source/shared_lib/include/util/randomgen.h b/source/shared_lib/include/util/randomgen.h index e05de3fd9..833e43621 100644 --- a/source/shared_lib/include/util/randomgen.h +++ b/source/shared_lib/include/util/randomgen.h @@ -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); diff --git a/source/shared_lib/sources/util/randomgen.cpp b/source/shared_lib/sources/util/randomgen.cpp index 43489982c..43e8d4e9b 100644 --- a/source/shared_lib/sources/util/randomgen.cpp +++ b/source/shared_lib/sources/util/randomgen.cpp @@ -1,7 +1,6 @@ #include "randomgen.h" #include #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(min, max); // streflop + float res = streflop::Random(min, max, randomState); // streflop #else float rand01= static_cast(RandomGen::rand())/(m-1); float res= min+((max-min)*rand01);