From a2eceb0f18d89d3bcbc41d5a3f84ec6310e20f33 Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 24 Jul 2009 23:18:20 +0000 Subject: [PATCH] enable the previously disabled "Sphere" patch primitive git-svn-id: svn://svn.icculus.org/netradiant/trunk@390 61c419a2-8eb2-4b30-bcec-8cead039b335 --- radiant/patch.cpp | 3 ++- radiant/patchmanip.cpp | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/radiant/patch.cpp b/radiant/patch.cpp index 59be212e..1c314c17 100644 --- a/radiant/patch.cpp +++ b/radiant/patch.cpp @@ -1336,7 +1336,7 @@ void Patch::ConstructPrefab(const AABB& aabb, EPatchPrefab eType, int axis, std: { pCtrl->m_vertex[0] = vPos[1][0]; pCtrl->m_vertex[1] = vPos[1][1]; - pCtrl->m_vertex[2] = vPos[2][2]; + pCtrl->m_vertex[2] = vPos[0][2]; } } { @@ -1348,6 +1348,7 @@ void Patch::ConstructPrefab(const AABB& aabb, EPatchPrefab eType, int axis, std: pCtrl->m_vertex[2] = vPos[2][2]; } } + break; default: ERROR_MESSAGE("this should be unreachable"); return; diff --git a/radiant/patchmanip.cpp b/radiant/patchmanip.cpp index ac360b6f..b8bccee6 100644 --- a/radiant/patchmanip.cpp +++ b/radiant/patchmanip.cpp @@ -474,6 +474,13 @@ void Patch_Bevel() Scene_PatchConstructPrefab(GlobalSceneGraph(), PatchCreator_getBounds(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser()), eBevel, GlobalXYWnd_getCurrentViewType()); } +void Patch_Sphere() +{ + UndoableCommand undo("patchCreateSphere"); + + Scene_PatchConstructPrefab(GlobalSceneGraph(), PatchCreator_getBounds(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser()), eSphere, GlobalXYWnd_getCurrentViewType()); +} + void Patch_SquareBevel() { } @@ -744,6 +751,7 @@ void Patch_registerCommands() GlobalCommands_insert("PatchSquareBevel", FreeCaller()); GlobalCommands_insert("PatchSquareEndcap", FreeCaller()); GlobalCommands_insert("PatchCone", FreeCaller()); + GlobalCommands_insert("PatchSphere", FreeCaller()); GlobalCommands_insert("SimplePatchMesh", FreeCaller(), Accelerator('P', (GdkModifierType)GDK_SHIFT_MASK)); GlobalCommands_insert("PatchInsertInsertColumn", FreeCaller()); GlobalCommands_insert("PatchInsertAddColumn", FreeCaller()); @@ -793,6 +801,7 @@ void Patch_constructMenu(GtkMenu* menu) } menu_separator (menu); create_menu_item_with_mnemonic(menu, "Cone", "PatchCone"); + create_menu_item_with_mnemonic(menu, "Sphere", "PatchSphere"); menu_separator (menu); create_menu_item_with_mnemonic(menu, "Simple Patch Mesh...", "SimplePatchMesh"); menu_separator (menu); -- 2.39.2