Fixed: #1328 Map time and weather Issue (synced with SVN, thanks!)

This commit is contained in:
kervala 2012-05-18 20:53:59 +02:00
parent e269b6355c
commit 78f23a713e
5 changed files with 11 additions and 12 deletions

View file

@ -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 <cfloat>

View file

@ -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

View file

@ -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)

View file

@ -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);

View file

@ -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<NL3D_NOISE_GRID_SIZE; z++)
@ -57,7 +56,7 @@ public:
{
uint id= x + (y<<NL3D_NOISE_GRID_SIZE_SHIFT) + (z<<(NL3D_NOISE_GRID_SIZE_SHIFT*2));
// take higher bits of rand gives better result.
uint v= Random.rand() >> 5;
uint v= rand() >> 5;
_Texture3d[id]= v&255;
}
}
@ -81,9 +80,9 @@ public:
// init LevelPhases.
for(i=0; i<NL3D_NOISE_LEVEL; i++)
{
_LevelPhase[i].x= Random.frand(NL3D_NOISE_GRID_SIZE);
_LevelPhase[i].y= Random.frand(NL3D_NOISE_GRID_SIZE);
_LevelPhase[i].z= Random.frand(NL3D_NOISE_GRID_SIZE);
_LevelPhase[i].x= frand(NL3D_NOISE_GRID_SIZE);
_LevelPhase[i].y= frand(NL3D_NOISE_GRID_SIZE);
_LevelPhase[i].z= frand(NL3D_NOISE_GRID_SIZE);
}
// not for level 0.
_LevelPhase[0]= CVector::Null;