MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / naturalTexture

Function naturalTexture

radiantcore/selection/algorithm/Shader.cpp:483–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481}
482
483void naturalTexture(const cmd::ArgumentList& args)
484{
485 UndoableCommand undo("naturalTexture");
486
487 // Construct the "naturally" scaled Texdef structure
488 ShiftScaleRotation shiftScaleRotation;
489
490 float naturalScale = registry::getValue<float>("user/ui/textures/defaultTextureScale");
491
492 shiftScaleRotation.scale[0] = naturalScale;
493 shiftScaleRotation.scale[1] = naturalScale;
494
495 // Patches
496 GlobalSelectionSystem().foreachPatch(
497 [] (IPatch& patch) { patch.scaleTextureNaturally(); }
498 );
499 GlobalSelectionSystem().foreachFace(
500 [&] (IFace& face) { face.setShiftScaleRotation(shiftScaleRotation); }
501 );
502
503 SceneChangeNotify();
504
505 // Update the Texture Tools
506 radiant::TextureChangedMessage::Send();
507}
508
509void shiftTexture(const Vector2& shift)
510{

Callers

nothing calls this directly

Calls 5

SceneChangeNotifyFunction · 0.85
foreachPatchMethod · 0.80
scaleTextureNaturallyMethod · 0.80
foreachFaceMethod · 0.80
setShiftScaleRotationMethod · 0.80

Tested by

no test coverage detected