mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
Added a checkbox to the terrain import GUI and fixed a space.
This commit is contained in:
parent
6ff1db6c0c
commit
b868906ba5
5 changed files with 97 additions and 5 deletions
|
|
@ -684,7 +684,7 @@ void TerrainFile::import( const GBitmap &heightMap,
|
||||||
F32 heightScale,
|
F32 heightScale,
|
||||||
const Vector<U8> &layerMap,
|
const Vector<U8> &layerMap,
|
||||||
const Vector<String> &materials,
|
const Vector<String> &materials,
|
||||||
bool flipYAxis)
|
bool flipYAxis )
|
||||||
{
|
{
|
||||||
AssertFatal( heightMap.getWidth() == heightMap.getHeight(), "TerrainFile::import - Height map is not square!" );
|
AssertFatal( heightMap.getWidth() == heightMap.getHeight(), "TerrainFile::import - Height map is not square!" );
|
||||||
AssertFatal( isPow2( heightMap.getWidth() ), "TerrainFile::import - Height map is not power of two!" );
|
AssertFatal( isPow2( heightMap.getWidth() ), "TerrainFile::import - Height map is not power of two!" );
|
||||||
|
|
|
||||||
|
|
@ -510,6 +510,26 @@
|
||||||
buttonType = "PushButton";
|
buttonType = "PushButton";
|
||||||
useMouseEvents = "0";
|
useMouseEvents = "0";
|
||||||
};
|
};
|
||||||
|
new GuiCheckBoxCtrl() {
|
||||||
|
text = " Flip Y axis?";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "ToggleButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "12 222";
|
||||||
|
extent = "140 30";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiCheckBoxProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
internalName = "FlipYAxis";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
//--- OBJECT WRITE END ---
|
//--- OBJECT WRITE END ---
|
||||||
|
|
@ -533,6 +553,8 @@ function TerrainImportGui::import( %this )
|
||||||
%metersPerPixel = %this-->MetersPerPixel.getText();
|
%metersPerPixel = %this-->MetersPerPixel.getText();
|
||||||
%heightScale = %this-->HeightScale.getText();
|
%heightScale = %this-->HeightScale.getText();
|
||||||
|
|
||||||
|
%flipYAxis = %this-->FlipYAxis.isStateOn();
|
||||||
|
|
||||||
// Grab and validate terrain object name.
|
// Grab and validate terrain object name.
|
||||||
|
|
||||||
%terrainName = %this-->TerrainName.getText();
|
%terrainName = %this-->TerrainName.getText();
|
||||||
|
|
@ -568,7 +590,8 @@ function TerrainImportGui::import( %this )
|
||||||
%metersPerPixel,
|
%metersPerPixel,
|
||||||
%heightScale,
|
%heightScale,
|
||||||
%opacityNames,
|
%opacityNames,
|
||||||
%materialNames );
|
%materialNames,
|
||||||
|
%flipYAxis );
|
||||||
|
|
||||||
Canvas.popDialog( %this );
|
Canvas.popDialog( %this );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -510,6 +510,26 @@
|
||||||
buttonType = "PushButton";
|
buttonType = "PushButton";
|
||||||
useMouseEvents = "0";
|
useMouseEvents = "0";
|
||||||
};
|
};
|
||||||
|
new GuiCheckBoxCtrl() {
|
||||||
|
text = " Flip Y axis?";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "ToggleButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "12 222";
|
||||||
|
extent = "140 30";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiCheckBoxProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
internalName = "FlipYAxis";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
//--- OBJECT WRITE END ---
|
//--- OBJECT WRITE END ---
|
||||||
|
|
@ -533,6 +553,8 @@ function TerrainImportGui::import( %this )
|
||||||
%metersPerPixel = %this-->MetersPerPixel.getText();
|
%metersPerPixel = %this-->MetersPerPixel.getText();
|
||||||
%heightScale = %this-->HeightScale.getText();
|
%heightScale = %this-->HeightScale.getText();
|
||||||
|
|
||||||
|
%flipYAxis = %this-->FlipYAxis.isStateOn();
|
||||||
|
|
||||||
// Grab and validate terrain object name.
|
// Grab and validate terrain object name.
|
||||||
|
|
||||||
%terrainName = %this-->TerrainName.getText();
|
%terrainName = %this-->TerrainName.getText();
|
||||||
|
|
@ -568,7 +590,8 @@ function TerrainImportGui::import( %this )
|
||||||
%metersPerPixel,
|
%metersPerPixel,
|
||||||
%heightScale,
|
%heightScale,
|
||||||
%opacityNames,
|
%opacityNames,
|
||||||
%materialNames );
|
%materialNames,
|
||||||
|
%flipYAxis );
|
||||||
|
|
||||||
Canvas.popDialog( %this );
|
Canvas.popDialog( %this );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -510,6 +510,26 @@
|
||||||
buttonType = "PushButton";
|
buttonType = "PushButton";
|
||||||
useMouseEvents = "0";
|
useMouseEvents = "0";
|
||||||
};
|
};
|
||||||
|
new GuiCheckBoxCtrl() {
|
||||||
|
text = " Flip Y axis?";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "ToggleButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "12 222";
|
||||||
|
extent = "140 30";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiCheckBoxProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
internalName = "FlipYAxis";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
//--- OBJECT WRITE END ---
|
//--- OBJECT WRITE END ---
|
||||||
|
|
@ -533,6 +553,8 @@ function TerrainImportGui::import( %this )
|
||||||
%metersPerPixel = %this-->MetersPerPixel.getText();
|
%metersPerPixel = %this-->MetersPerPixel.getText();
|
||||||
%heightScale = %this-->HeightScale.getText();
|
%heightScale = %this-->HeightScale.getText();
|
||||||
|
|
||||||
|
%flipYAxis = %this-->FlipYAxis.isStateOn();
|
||||||
|
|
||||||
// Grab and validate terrain object name.
|
// Grab and validate terrain object name.
|
||||||
|
|
||||||
%terrainName = %this-->TerrainName.getText();
|
%terrainName = %this-->TerrainName.getText();
|
||||||
|
|
@ -568,7 +590,8 @@ function TerrainImportGui::import( %this )
|
||||||
%metersPerPixel,
|
%metersPerPixel,
|
||||||
%heightScale,
|
%heightScale,
|
||||||
%opacityNames,
|
%opacityNames,
|
||||||
%materialNames );
|
%materialNames,
|
||||||
|
%flipYAxis );
|
||||||
|
|
||||||
Canvas.popDialog( %this );
|
Canvas.popDialog( %this );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -510,6 +510,26 @@
|
||||||
buttonType = "PushButton";
|
buttonType = "PushButton";
|
||||||
useMouseEvents = "0";
|
useMouseEvents = "0";
|
||||||
};
|
};
|
||||||
|
new GuiCheckBoxCtrl() {
|
||||||
|
text = " Flip Y axis?";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "ToggleButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "12 222";
|
||||||
|
extent = "140 30";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiCheckBoxProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
internalName = "FlipYAxis";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
//--- OBJECT WRITE END ---
|
//--- OBJECT WRITE END ---
|
||||||
|
|
@ -533,6 +553,8 @@ function TerrainImportGui::import( %this )
|
||||||
%metersPerPixel = %this-->MetersPerPixel.getText();
|
%metersPerPixel = %this-->MetersPerPixel.getText();
|
||||||
%heightScale = %this-->HeightScale.getText();
|
%heightScale = %this-->HeightScale.getText();
|
||||||
|
|
||||||
|
%flipYAxis = %this-->FlipYAxis.isStateOn();
|
||||||
|
|
||||||
// Grab and validate terrain object name.
|
// Grab and validate terrain object name.
|
||||||
|
|
||||||
%terrainName = %this-->TerrainName.getText();
|
%terrainName = %this-->TerrainName.getText();
|
||||||
|
|
@ -568,7 +590,8 @@ function TerrainImportGui::import( %this )
|
||||||
%metersPerPixel,
|
%metersPerPixel,
|
||||||
%heightScale,
|
%heightScale,
|
||||||
%opacityNames,
|
%opacityNames,
|
||||||
%materialNames );
|
%materialNames,
|
||||||
|
%flipYAxis );
|
||||||
|
|
||||||
Canvas.popDialog( %this );
|
Canvas.popDialog( %this );
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue