From cb970bddce039f2a85a6a5b1293c32dca6f3789b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 11 Oct 2010 09:19:09 +0900 Subject: [PATCH] Can now copy brushes. Implement SetBrush's copyWithZone: --- tools/Forge/Bundles/MapEdit/SetBrush.m | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/Forge/Bundles/MapEdit/SetBrush.m b/tools/Forge/Bundles/MapEdit/SetBrush.m index e2f44f49a..1194cc92e 100644 --- a/tools/Forge/Bundles/MapEdit/SetBrush.m +++ b/tools/Forge/Bundles/MapEdit/SetBrush.m @@ -603,6 +603,28 @@ initOwner::: } } +- (id) copyWithZone: (NSZone *) zone +{ + SetBrush *new; + + [self freeWindings]; + + new = [[SetBrush allocWithZone: zone] init]; + new->regioned = regioned; + new->selected = selected; + new->invalid = invalid; + new->parent = parent; + VectorCopy (bmins, new->bmins); + VectorCopy (bmaxs, new->bmaxs); + VectorCopy (entitycolor, new->entitycolor); + new->numfaces = numfaces; + memcpy (new->faces, faces, sizeof (new->faces)); + + [self calcWindings]; + [new calcWindings]; + return new; +} + - (void) dealloc { [self freeWindings];