[Gtkradiant] PatchCreation bugfix: remaining brush will be removed
namespace
spam at codecreator.net
Mon Mar 19 15:09:39 CDT 2007
Hi!
Thanks for your contribution, but that change has some flaws:
The brush will only be deleted if the patch was created with
the "Simple Patch Mesh" command in the Curve menu, all other
ways to create a patch (Cylinder, Cone) will still keep the brush.
To fix that for all methods a Select_Delete(); must be inserted at line 51.
I changed the aabb parameter to a call-by-value parameter to avoid
possible dead memory access.
Otherwise it would be easy to introduce a bug here by directly passing the
aabb of the selected object as parameter.
This is _not_ the case at the moment since every call to
Scene_PatchConstructPrefab() uses PatchCreator_getBounds()
which returns a aabb that is located on the stack.
The change is in svn now.
Btw, please send new changes as diffs. This makes merging
them much easier, esp. when they add up.
Diffs can easly be generated by svn with "svn diff > myfile.diff"
or TortoiseSVN (Create patch).
Thx.
namespace
Am Montag, 19. März 2007 00:39 schrieb Eduard Aumüller:
> Hi,
> you might have notices that when you create a patch from scratch, the
> previously selected brush will remain, unselected
>
>
> With the fix the unneeded brush will be gone.
>
> Here is a little fix.
>
> 1. get the selection bounds
> 2. clear the selection
> 3. create the patch with the previously gained AABB
>
> code in patchmanip.cpp line 915
>
> new code:
> 915 //get the bounds of the current selection
> 916 AABB patch_creator_aabb = PatchCreator_getBounds();
> 917
> 918 //delete the current selection
> 919 Select_Delete();
> 920
> 921 //create the new patch
> 922 Scene_PatchConstructPrefab(GlobalSceneGraph(),
> patch_creator_aabb, 923
> TextureBrowser_GetSelectedShader(GlobalTextureBrowser()), ePlane,
> GlobalXYWnd_getCurrentViewType(), w, h);
>
>
> please adjust this in the SVN repository
>
> cya
--
www.codecreator.net | GPG: 0xD4DB516D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://zerowing.idsoftware.com/pipermail/gtkradiant/attachments/20070319/dc518b04/attachment.pgp
More information about the Gtkradiant
mailing list