]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
enable the previously disabled "Sphere" patch primitive
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Fri, 24 Jul 2009 23:18:20 +0000 (23:18 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Fri, 24 Jul 2009 23:18:20 +0000 (23:18 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@390 61c419a2-8eb2-4b30-bcec-8cead039b335

radiant/patch.cpp
radiant/patchmanip.cpp

index 59be212ee50f6226371ccfb466be714b597758a3..1c314c17bcb868076d5bbd386ccd2716f5fc4c82 100644 (file)
@@ -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;
index ac360b6f8ee44d4ff91028f75e06122ac5342513..b8bccee63d735ad3c8bb40279880f08ca13d4624 100644 (file)
@@ -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<Patch_SquareBevel>());
   GlobalCommands_insert("PatchSquareEndcap", FreeCaller<Patch_SquareEndcap>());
   GlobalCommands_insert("PatchCone", FreeCaller<Patch_Cone>());
+  GlobalCommands_insert("PatchSphere", FreeCaller<Patch_Sphere>());
   GlobalCommands_insert("SimplePatchMesh", FreeCaller<Patch_Plane>(), Accelerator('P', (GdkModifierType)GDK_SHIFT_MASK));
   GlobalCommands_insert("PatchInsertInsertColumn", FreeCaller<Patch_InsertInsertColumn>());
   GlobalCommands_insert("PatchInsertAddColumn", FreeCaller<Patch_InsertAddColumn>());
@@ -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);