Can now copy brushes.

Implement SetBrush's copyWithZone:
This commit is contained in:
Bill Currie 2010-10-11 09:19:09 +09:00
parent 708c8743af
commit 1945da99d9

View file

@ -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 - (void) dealloc
{ {
[self freeWindings]; [self freeWindings];