mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-10 06:04:37 +00:00
- Updates the material and terrain material assets to utilize AssetRef and drop the old macros like how Image and ShapeAssets have been updated.
- Updates the various classes using materials to comply to the change. - Also standardizes some getter names to follow the general convention image and shape used to keep things more consistent across the board to minimize usage friction. - Shifts handling of fallback asset lookups for the thus-far converted classes to have them be loaded during core initialization rather than being loaded as part of other asset loading as that sometimes lead to nesting execution/stability errors. Explicit call now ensures the fallbacks are loaded before any other asset tries to load, so there's no room for confounding or having no fallback to work with.
This commit is contained in:
parent
6d8f83bd3a
commit
c96d58ae34
42 changed files with 583 additions and 698 deletions
|
|
@ -85,7 +85,7 @@ GuiRoadEditorCtrl::GuiRoadEditorCtrl()
|
|||
mSavedDrag = false;
|
||||
mIsDirty = false;
|
||||
|
||||
mMaterialAssetId = Con::getVariable("$DecalRoadEditor::defaultMaterialAsset");
|
||||
mMaterialAssetRef = Con::getVariable( "$DecalRoadEditor::defaultMaterialAsset" );
|
||||
}
|
||||
|
||||
GuiRoadEditorCtrl::~GuiRoadEditorCtrl()
|
||||
|
|
@ -100,7 +100,7 @@ void GuiRoadEditorUndoAction::undo()
|
|||
return;
|
||||
|
||||
// Temporarily save the roads current data.
|
||||
String materialAssetId = road->mMaterialAssetId;
|
||||
StringTableEntry materialAssetId = road->getMaterialAssetId();
|
||||
F32 textureLength = road->mTextureLength;
|
||||
F32 breakAngle = road->mBreakAngle;
|
||||
F32 segmentsPerBatch = road->mSegmentsPerBatch;
|
||||
|
|
@ -108,7 +108,7 @@ void GuiRoadEditorUndoAction::undo()
|
|||
nodes.merge( road->mNodes );
|
||||
|
||||
// Restore the Road properties saved in the UndoAction
|
||||
road->_setMaterial(materialAssetId);
|
||||
road->mMaterialAssetRef = mMaterialAssetId;
|
||||
road->mBreakAngle = breakAngle;
|
||||
road->mSegmentsPerBatch = segmentsPerBatch;
|
||||
road->mTextureLength = textureLength;
|
||||
|
|
@ -165,7 +165,7 @@ void GuiRoadEditorCtrl::initPersistFields()
|
|||
addField( "HoverNodeColor", TypeColorI, Offset( mHoverNodeColor, GuiRoadEditorCtrl ) );
|
||||
addField( "isDirty", TypeBool, Offset( mIsDirty, GuiRoadEditorCtrl ) );
|
||||
|
||||
INITPERSISTFIELD_MATERIALASSET(Material, GuiRoadEditorCtrl, "Default Material used by the Road Editor on road creation.");
|
||||
ADD_FIELD( "materialAsset", TypeMaterialAssetRef, Offset( mMaterialAssetRef, GuiRoadEditorCtrl ) ).doc( "Default material asset used by the Road Editor on road creation." );
|
||||
|
||||
//addField( "MoveNodeCursor", TYPEID< SimObject >(), Offset( mMoveNodeCursor, GuiRoadEditorCtrl) );
|
||||
//addField( "AddNodeCursor", TYPEID< SimObject >(), Offset( mAddNodeCursor, GuiRoadEditorCtrl) );
|
||||
|
|
@ -407,8 +407,8 @@ void GuiRoadEditorCtrl::on3DMouseDown(const Gui3DMouseEvent & event)
|
|||
|
||||
DecalRoad *newRoad = new DecalRoad;
|
||||
|
||||
if (mMaterialAsset.notNull())
|
||||
newRoad->_setMaterial(mMaterialAssetId);
|
||||
if ( mMaterialAssetRef.notNull() )
|
||||
newRoad->mMaterialAssetRef = mMaterialAssetRef.getAssetId();
|
||||
|
||||
newRoad->registerObject();
|
||||
|
||||
|
|
@ -1029,7 +1029,7 @@ void GuiRoadEditorCtrl::submitUndo( const UTF8 *name )
|
|||
|
||||
action->mObjId = mSelRoad->getId();
|
||||
action->mBreakAngle = mSelRoad->mBreakAngle;
|
||||
action->mMaterialAssetId = mSelRoad->mMaterialAssetId;
|
||||
action->mMaterialAssetId = mSelRoad->getMaterialAssetId();
|
||||
action->mSegmentsPerBatch = mSelRoad->mSegmentsPerBatch;
|
||||
action->mTextureLength = mSelRoad->mTextureLength;
|
||||
action->mRoadEditor = this;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue