Commit 86498e73 authored by bitplane's avatar bitplane

Added serialization for terrain smooth factor, patch by RdR



git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4034 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 99e84fda
...@@ -39,7 +39,7 @@ namespace scene ...@@ -39,7 +39,7 @@ namespace scene
VerticesToRender(0), IndicesToRender(0), DynamicSelectorUpdate(false), VerticesToRender(0), IndicesToRender(0), DynamicSelectorUpdate(false),
OverrideDistanceThreshold(false), UseDefaultRotationPivot(true), ForceRecalculation(true), OverrideDistanceThreshold(false), UseDefaultRotationPivot(true), ForceRecalculation(true),
CameraMovementDelta(10.0f), CameraRotationDelta(1.0f),CameraFOVDelta(0.1f), CameraMovementDelta(10.0f), CameraRotationDelta(1.0f),CameraFOVDelta(0.1f),
TCoordScale1(1.0f), TCoordScale2(1.0f), FileSystem(fs) TCoordScale1(1.0f), TCoordScale2(1.0f), SmoothFactor(0), FileSystem(fs)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("CTerrainSceneNode"); setDebugName("CTerrainSceneNode");
...@@ -91,6 +91,7 @@ namespace scene ...@@ -91,6 +91,7 @@ namespace scene
} }
HeightmapFile = file->getFileName(); HeightmapFile = file->getFileName();
SmoothFactor = smoothFactor;
// Get the dimension of the heightmap data // Get the dimension of the heightmap data
TerrainData.Size = heightMap->getDimension().Width; TerrainData.Size = heightMap->getDimension().Width;
...@@ -1398,6 +1399,7 @@ namespace scene ...@@ -1398,6 +1399,7 @@ namespace scene
out->addString("Heightmap", HeightmapFile.c_str()); out->addString("Heightmap", HeightmapFile.c_str());
out->addFloat("TextureScale1", TCoordScale1); out->addFloat("TextureScale1", TCoordScale1);
out->addFloat("TextureScale2", TCoordScale2); out->addFloat("TextureScale2", TCoordScale2);
out->addInt("SmoothFactor", SmoothFactor);
} }
...@@ -1408,6 +1410,7 @@ namespace scene ...@@ -1408,6 +1410,7 @@ namespace scene
io::path newHeightmap = in->getAttributeAsString("Heightmap"); io::path newHeightmap = in->getAttributeAsString("Heightmap");
f32 tcoordScale1 = in->getAttributeAsFloat("TextureScale1"); f32 tcoordScale1 = in->getAttributeAsFloat("TextureScale1");
f32 tcoordScale2 = in->getAttributeAsFloat("TextureScale2"); f32 tcoordScale2 = in->getAttributeAsFloat("TextureScale2");
s32 smoothFactor = in->getAttributeAsInt("SmoothFactor");
// set possible new heightmap // set possible new heightmap
...@@ -1416,7 +1419,7 @@ namespace scene ...@@ -1416,7 +1419,7 @@ namespace scene
io::IReadFile* file = FileSystem->createAndOpenFile(newHeightmap.c_str()); io::IReadFile* file = FileSystem->createAndOpenFile(newHeightmap.c_str());
if (file) if (file)
{ {
loadHeightMap(file, video::SColor(255,255,255,255), 0); loadHeightMap(file, video::SColor(255,255,255,255), smoothFactor);
file->drop(); file->drop();
} }
else else
......
...@@ -308,7 +308,7 @@ namespace scene ...@@ -308,7 +308,7 @@ namespace scene
core::vector3df OldCameraPosition; core::vector3df OldCameraPosition;
core::vector3df OldCameraRotation; core::vector3df OldCameraRotation;
core::vector3df OldCameraUp; core::vector3df OldCameraUp;
f32 OldCameraFOV; f32 OldCameraFOV;
f32 CameraMovementDelta; f32 CameraMovementDelta;
f32 CameraRotationDelta; f32 CameraRotationDelta;
f32 CameraFOVDelta; f32 CameraFOVDelta;
...@@ -316,6 +316,7 @@ namespace scene ...@@ -316,6 +316,7 @@ namespace scene
// needed for (de)serialization // needed for (de)serialization
f32 TCoordScale1; f32 TCoordScale1;
f32 TCoordScale2; f32 TCoordScale2;
s32 SmoothFactor;
io::path HeightmapFile; io::path HeightmapFile;
io::IFileSystem* FileSystem; io::IFileSystem* FileSystem;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment