private void paintWaterOnMap(NWN2AreaViewer nwN2AreaViewer, NWN2TerrainEditorForm terrainEditor, SynchronousNetDisplayManager netDisplayManager, float z, Vector3 vector3, string texture)
 {
     netDisplayManager.TerrainBrush(nwN2AreaViewer.AreaNetDisplayWindow.Scene, 1, 1, vector3, 1f, 6f, z, 0.5f, terrainEditor.TerrainBrushColor, terrainEditor.CursorColor, texture, TerrainModificationType.Water);
     terrainEditor.UpdateWaterSliders();
     netDisplayManager.TerrainModify(nwN2AreaViewer.AreaNetDisplayWindow.Scene, TerrainModificationType.Water, -1);
 }
 private void paintGrass(TerrainImporterSettings importerSettings, NWN2AreaViewer nwN2AreaViewer, NWN2TerrainEditorForm terrainEditor, SynchronousNetDisplayManager netDisplayManager, float outerRight, float outerTop, float areaX, float areaY, Vector3 vector3, string texture, string textureName)
 {
     if (importerSettings.paintGrass != null)
     {
         Hashtable hashtable = (Hashtable)importerSettings.paintGrass[textureName];
         Decimal fullRadius = (Decimal)hashtable["innerRadius"] + (Decimal)hashtable["outerRadius"];
         float floatFullRadius = Convert.ToSingle(++fullRadius);
         if ((bool)hashtable["doPaint"] && areaX > floatFullRadius && (areaX < outerRight - floatFullRadius && areaY > floatFullRadius) && areaY < outerTop - floatFullRadius)
         {
             string[] textures = (string[])((ArrayList)hashtable["textures"]).ToArray(typeof(string));
             netDisplayManager.GrassParameters(nwN2AreaViewer.AreaNetDisplayWindow.Scene, (float)hashtable["bladeSize"], (float)hashtable["bladeSizeVariation"], textures.Length, textures);
             netDisplayManager.TerrainBrush(nwN2AreaViewer.AreaNetDisplayWindow.Scene, 1, 1, vector3, Convert.ToSingle(hashtable["innerRadius"]), Convert.ToSingle(hashtable["outerRadius"]), (float)hashtable["pressure"], 0.5f, terrainEditor.TerrainBrushColor, terrainEditor.CursorColor, texture, TerrainModificationType.Grass);
             netDisplayManager.TerrainModify(nwN2AreaViewer.AreaNetDisplayWindow.Scene, TerrainModificationType.Grass, -1);
         }
     }
 }
 private void handleWaterMap(TerrainImporterSettings importerSettings, NWN2AreaViewer nwN2AreaViewer, NWN2TerrainEditorForm terrainEditor, SynchronousNetDisplayManager netDisplayManager, int x, int y, float z, ref Vector3 vector3, string texture)
 {
     WaterMap waterMap = importerSettings.waterMap;
     if (importerSettings.paintWaterCheckbox.Checked)
     {
         float seaLevel = Convert.ToSingle(importerSettings.seaLevel.Value);
         if (waterMap == null && z < Convert.ToSingle(importerSettings.seaLevel.Value))
         {
             paintWaterOnMap(nwN2AreaViewer, terrainEditor, netDisplayManager, seaLevel, vector3, texture);
         }
         else if (waterMap != null)
         {
             bool paintWater = waterMap.PaintWater(x, y);
             if (paintWater)
             {
                 if (z > 0.0f)
                 {
                     paintWaterOnMap(nwN2AreaViewer, terrainEditor, netDisplayManager, z, vector3, texture);
                 }
                 else
                 {
                     paintWaterOnMap(nwN2AreaViewer, terrainEditor, netDisplayManager, seaLevel, vector3, texture);
                 }
             }
         }
     }
 }
 private void manipulateTerrain(TerrainImporterSettings importerSettings, bool paintTerrain, float texturePressure, float textureInnerRadius, float textureOuterRadius, NWN2AreaViewer nwN2AreaViewer, NWN2TerrainEditorForm terrainEditor, SynchronousNetDisplayManager netDisplayManager, float zValue, ref Vector3 vector3, ref string texture, string textureName)
 {
     netDisplayManager.TerrainBrush(nwN2AreaViewer.AreaNetDisplayWindow.Scene, 1, 0, vector3, 1f, 1f, zValue, 0.5f, terrainEditor.TerrainBrushColor, terrainEditor.CursorColor, texture, TerrainModificationType.Flatten);
     netDisplayManager.TerrainModify(nwN2AreaViewer.AreaNetDisplayWindow.Scene, TerrainModificationType.Flatten, 0);
     if (paintTerrain)
     {
         texture = (string)importerSettings.paintTextures[textureName];
         netDisplayManager.TerrainBrush(nwN2AreaViewer.AreaNetDisplayWindow.Scene, 1, 0, vector3, textureInnerRadius, textureOuterRadius, texturePressure, 0.5f, terrainEditor.TerrainBrushColor, terrainEditor.CursorColor, texture, TerrainModificationType.Flatten);
         netDisplayManager.TerrainModify(nwN2AreaViewer.AreaNetDisplayWindow.Scene, TerrainModificationType.Texture, 0);
     }
 }
        private void handleAttributeMap(TerrainImporterSettings importerSettings, NWN2AreaViewer nwN2AreaViewer, NWN2TerrainEditorForm terrainEditor, SynchronousNetDisplayManager netDisplayManager, float outerRight, float outerTop, int x, int y, float areaX, float areaY, float z, ref Vector3 vector3, string texture, ref string textureName)
        {
            if (importerSettings.attributeMap != null)
            {
                AmfAttributeMap amfAttributeMap = (AmfAttributeMap)importerSettings.attributeMap;
                if (textureName == "")
                {
                    textureName = (string)importerSettings.fullAttributeTable[amfAttributeMap.GetPixel(x, y)];
                }

                paintGrass(importerSettings, nwN2AreaViewer, terrainEditor, netDisplayManager, outerRight, outerTop, areaX, areaY, vector3, texture, textureName);
                paintTrees(importerSettings, areaX, areaY, z, textureName);
            }
        }