From b0e48907d717780407d2093a4fba9dfa9fdff5f3 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 18 May 2012 20:53:59 +0200 Subject: [PATCH] Fixed: #1328 Map time and weather Issue (synced with SVN, thanks!) --- code/nel/include/nel/misc/fast_floor.h | 2 +- code/nel/src/3d/patch_lightmap.cpp | 2 +- code/nel/src/3d/patch_noise.cpp | 4 ++-- code/nel/src/misc/fast_floor.cpp | 2 +- code/nel/src/misc/noise_value.cpp | 13 ++++++------- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/code/nel/include/nel/misc/fast_floor.h b/code/nel/include/nel/misc/fast_floor.h index 421364ad1..203e8c9b0 100644 --- a/code/nel/include/nel/misc/fast_floor.h +++ b/code/nel/include/nel/misc/fast_floor.h @@ -29,7 +29,7 @@ extern int *OptFastFloorCWStackPtr; extern int *OptFastFloorCWStackEnd; // fastFloor function. -#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) +#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) && defined(NL_USE_FASTFLOOR) #include diff --git a/code/nel/src/3d/patch_lightmap.cpp b/code/nel/src/3d/patch_lightmap.cpp index bd3886a71..8b91632d4 100644 --- a/code/nel/src/3d/patch_lightmap.cpp +++ b/code/nel/src/3d/patch_lightmap.cpp @@ -618,7 +618,7 @@ void CPatch::computeTileLightmapPixelAutomatic(uint ts, uint tt, uint s, uint t c= max(c, 0.f); sint ic; -#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) +#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) && defined(NL_USE_FASTFLOOR) // FastFloor using fistp. Don't care convention. float fc= c*256; _asm diff --git a/code/nel/src/3d/patch_noise.cpp b/code/nel/src/3d/patch_noise.cpp index 386fe98bd..6772c27b5 100644 --- a/code/nel/src/3d/patch_noise.cpp +++ b/code/nel/src/3d/patch_noise.cpp @@ -37,14 +37,14 @@ namespace NL3D // *************************************************************************** -#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) +#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) && defined(NL_USE_FASTFLOOR) /* This floor works only for floor with noise, because floor/ceil are only made on decimal coordinates: sTile =1.25 .... NB: because of difference of mapping (rare case), we may have sometimes values with precision < 1/4 (eg 1.125). Just use f*256 to compute the floor. NB: using a fastFloor() (fistp changing the controlfp() is not very a good idea here, because - computeNoise() are not "packed", so change on controlFp() would bee to frequent... + computeNoise() are not "packed", so change on controlFp() would bee too frequent... And also because we need either floor() or ceil() here. */ inline sint noiseFloor(float f) diff --git a/code/nel/src/misc/fast_floor.cpp b/code/nel/src/misc/fast_floor.cpp index 0c0aa9e02..fbbb1adac 100644 --- a/code/nel/src/misc/fast_floor.cpp +++ b/code/nel/src/misc/fast_floor.cpp @@ -24,7 +24,7 @@ int OptFastFloorCWStack[OptFastFloorCWStackSize]; int *OptFastFloorCWStackEnd = OptFastFloorCWStack + OptFastFloorCWStackSize; int *OptFastFloorCWStackPtr = OptFastFloorCWStack; -#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) +#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) && defined(NL_USE_FASTFLOOR) double OptFastFloorMagicConst = pow(2.0,52) + pow(2.0,51); float OptFastFloorMagicConst24 = (float)pow(2.0,23); diff --git a/code/nel/src/misc/noise_value.cpp b/code/nel/src/misc/noise_value.cpp index 4b7cade1f..89b9a8ad4 100644 --- a/code/nel/src/misc/noise_value.cpp +++ b/code/nel/src/misc/noise_value.cpp @@ -18,7 +18,7 @@ #include "nel/misc/noise_value.h" #include "nel/misc/fast_floor.h" -#include "nel/misc/random.h" + namespace NLMISC @@ -45,8 +45,7 @@ public: CRandomGrid3D() { //seed - CRandom Random; - Random.srand(0); + srand(0); // init the grid for(uint z=0; z> 5; + uint v= rand() >> 5; _Texture3d[id]= v&255; } } @@ -81,9 +80,9 @@ public: // init LevelPhases. for(i=0; i