mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 08:27:39 +00:00
Add type information, don't return self most of the time
Start "modernizing" the code base; old code is based heavily in the Smalltalk style, where everything that doesn't return a different object returns self. This can be useful, but it isn't what is usually done these days. Also, add type information (which didn't exist in "the old days" -- an object was an "id", not a "Foo *") to help with debugging.
This commit is contained in:
parent
7db4cefb2c
commit
ec0c37ee82
13 changed files with 280 additions and 348 deletions
|
@ -63,8 +63,8 @@ angle:(float)angle;
|
||||||
|
|
||||||
-homeView:sender;
|
-homeView:sender;
|
||||||
|
|
||||||
-XYDrawSelf; // for drawing viewpoint in XY view
|
- (void) XYDrawSelf; // for drawing viewpoint in XY view
|
||||||
-ZDrawSelf; // for drawing viewpoint in XY view
|
- (void) ZDrawSelf; // for drawing viewpoint in XY view
|
||||||
-(BOOL) XYmouseDown:(NSPoint *)pt flags:(int)flags;// return YES if brush handled
|
-(BOOL) XYmouseDown:(NSPoint *)pt flags:(int)flags;// return YES if brush handled
|
||||||
|
|
||||||
-(BOOL) ZmouseDown:(NSPoint *)pt flags:(int)flags;// return YES if brush handled
|
-(BOOL) ZmouseDown:(NSPoint *)pt flags:(int)flags;// return YES if brush handled
|
||||||
|
|
|
@ -492,7 +492,7 @@ drawWire
|
||||||
drawSelf
|
drawSelf
|
||||||
===================
|
===================
|
||||||
*/
|
*/
|
||||||
-drawRect:(NSRect)rect
|
- (void) drawRect:(NSRect)rect
|
||||||
{
|
{
|
||||||
float drawtime = 0;
|
float drawtime = 0;
|
||||||
|
|
||||||
|
@ -511,8 +511,6 @@ drawSelf
|
||||||
drawtime = Sys_DoubleTime () - drawtime;
|
drawtime = Sys_DoubleTime () - drawtime;
|
||||||
printf ("CameraView drawtime: %5.3f\n", drawtime);
|
printf ("CameraView drawtime: %5.3f\n", drawtime);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -521,7 +519,7 @@ drawSelf
|
||||||
XYDrawSelf
|
XYDrawSelf
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
-XYDrawSelf
|
- (void) XYDrawSelf
|
||||||
{
|
{
|
||||||
NSBezierPath *path;
|
NSBezierPath *path;
|
||||||
NSAffineTransform *trans;
|
NSAffineTransform *trans;
|
||||||
|
@ -542,8 +540,6 @@ XYDrawSelf
|
||||||
[path transformUsingAffineTransform: trans];
|
[path transformUsingAffineTransform: trans];
|
||||||
[path stroke];
|
[path stroke];
|
||||||
[path release];
|
[path release];
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -551,7 +547,7 @@ XYDrawSelf
|
||||||
ZDrawSelf
|
ZDrawSelf
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
-ZDrawSelf
|
- (void) ZDrawSelf
|
||||||
{
|
{
|
||||||
NSBezierPath *path;
|
NSBezierPath *path;
|
||||||
NSAffineTransform *trans;
|
NSAffineTransform *trans;
|
||||||
|
@ -565,8 +561,6 @@ ZDrawSelf
|
||||||
[path transformUsingAffineTransform: trans];
|
[path transformUsingAffineTransform: trans];
|
||||||
[path stroke];
|
[path stroke];
|
||||||
[path release];
|
[path release];
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,12 @@ extern id clipper_i;
|
||||||
-(BOOL) XYDrag:(NSPoint *) pt;
|
-(BOOL) XYDrag:(NSPoint *) pt;
|
||||||
-ZClick:(NSPoint) pt;
|
-ZClick:(NSPoint) pt;
|
||||||
-carve;
|
-carve;
|
||||||
-flipNormal;
|
- (void) flipNormal;
|
||||||
-(BOOL) getFace:(face_t *) pl;
|
-(BOOL) getFace:(face_t *) pl;
|
||||||
|
|
||||||
-cameraDrawSelf;
|
- (void) cameraDrawSelf;
|
||||||
-XYDrawSelf;
|
- (void) XYDrawSelf;
|
||||||
-ZDrawSelf;
|
- (void) ZDrawSelf;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
#endif // Clipper_h
|
#endif // Clipper_h
|
||||||
|
|
|
@ -28,7 +28,7 @@ extern NSBezierPath *path;
|
||||||
return (oldnum > 0);
|
return (oldnum > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
-flipNormal
|
- (void) flipNormal
|
||||||
{
|
{
|
||||||
vec3_t temp;
|
vec3_t temp;
|
||||||
|
|
||||||
|
@ -44,8 +44,6 @@ extern NSBezierPath *path;
|
||||||
Sys_Printf ("no clipplane\n");
|
Sys_Printf ("no clipplane\n");
|
||||||
NSBeep ();
|
NSBeep ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(BOOL) getFace:(face_t *) f
|
-(BOOL) getFace:(face_t *) f
|
||||||
|
@ -143,7 +141,7 @@ XYDrag
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
-carve
|
- (id) carve
|
||||||
{
|
{
|
||||||
[map_i makeSelectedPerform:@selector (carveByClipper)];
|
[map_i makeSelectedPerform:@selector (carveByClipper)];
|
||||||
num = 0;
|
num = 0;
|
||||||
|
@ -151,7 +149,7 @@ XYDrag
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
-cameraDrawSelf
|
- (void) cameraDrawSelf
|
||||||
{
|
{
|
||||||
vec3_t mid;
|
vec3_t mid;
|
||||||
int i;
|
int i;
|
||||||
|
@ -175,11 +173,9 @@ XYDrag
|
||||||
mid[1] -= 16;
|
mid[1] -= 16;
|
||||||
CameraLineto (mid);
|
CameraLineto (mid);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-XYDrawSelf
|
- (void) XYDrawSelf
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
NSMutableDictionary *attribs = [NSMutableDictionary dictionary];
|
NSMutableDictionary *attribs = [NSMutableDictionary dictionary];
|
||||||
|
@ -202,10 +198,9 @@ XYDrag
|
||||||
endAngle: 360];
|
endAngle: 360];
|
||||||
}
|
}
|
||||||
[path stroke];
|
[path stroke];
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-ZDrawSelf
|
- (void) ZDrawSelf
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
NSMutableDictionary *attribs = [NSMutableDictionary dictionary];
|
NSMutableDictionary *attribs = [NSMutableDictionary dictionary];
|
||||||
|
@ -228,7 +223,6 @@ XYDrag
|
||||||
endAngle: 360];
|
endAngle: 360];
|
||||||
}
|
}
|
||||||
[path stroke];
|
[path stroke];
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -20,26 +20,27 @@ typedef struct epair_s {
|
||||||
BOOL modifiable;
|
BOOL modifiable;
|
||||||
}
|
}
|
||||||
|
|
||||||
-initClass:(const char *) classname;
|
- (Entity *) initClass:(const char *) classname;
|
||||||
-initFromScript:(struct script_s *) script;
|
- (Entity *) initFromScript: (struct script_s *) script;
|
||||||
|
|
||||||
-(void) dealloc;
|
- (oneway void) dealloc;
|
||||||
|
|
||||||
-(BOOL) modifiable;
|
-(BOOL) modifiable;
|
||||||
-setModifiable:(BOOL) m;
|
- (void) setModifiable:(BOOL) m;
|
||||||
|
|
||||||
-(const char *) targetname;
|
-(const char *) targetname;
|
||||||
|
|
||||||
-writeToFILE:(FILE *)f region:(BOOL) reg;
|
- (void) writeToFILE:(FILE *)f region:(BOOL) reg;
|
||||||
|
|
||||||
-(const char *) valueForQKey:(const char *) k;
|
-(const char *) valueForQKey:(const char *) k;
|
||||||
-getVector:(vec3_t)v forKey:(const char *) k;
|
- (void) getVector:(vec3_t)v forKey:(const char *) k;
|
||||||
|
|
||||||
-setKey:(const char *) k toValue:(const char *) v;
|
- (void) setKey:(const char *)k
|
||||||
|
toValue:(const char *)v;
|
||||||
|
|
||||||
-(int) numPairs;
|
-(int) numPairs;
|
||||||
-(epair_t *) epairs;
|
-(epair_t *) epairs;
|
||||||
-removeKeyPair:(const char *) key;
|
- (void) removeKeyPair:(const char *) key;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
#endif // Entity_h
|
#endif // Entity_h
|
||||||
|
|
|
@ -51,7 +51,7 @@ vec3_t bad_maxs = { 8, 8, 8 };
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
-initClass:(const char *) classname
|
- (Entity *) initClass: (const char *)classname
|
||||||
{
|
{
|
||||||
id new;
|
id new;
|
||||||
esize_t esize;
|
esize_t esize;
|
||||||
|
@ -64,33 +64,32 @@ vec3_t bad_maxs = { 8, 8, 8 };
|
||||||
|
|
||||||
modifiable = YES;
|
modifiable = YES;
|
||||||
|
|
||||||
[self setKey: "classname" toValue:classname];
|
[self setKey: "classname" toValue: classname];
|
||||||
|
|
||||||
// get class
|
// get class
|
||||||
new =[entity_classes_i classForName: [self valueForQKey:"classname"]];
|
new = [entity_classes_i classForName: [self valueForQKey:"classname"]];
|
||||||
if (!new)
|
if (!new)
|
||||||
esize = esize_model;
|
esize = esize_model;
|
||||||
else
|
else
|
||||||
esize =[new esize];
|
esize = [new esize];
|
||||||
|
|
||||||
// create a brush if needed
|
// create a brush if needed
|
||||||
if (esize == esize_fixed) {
|
if (esize == esize_fixed) {
|
||||||
v =[new mins];
|
v = [new mins];
|
||||||
[[map_i selectedBrush] getMins: min maxs:max];
|
[[map_i selectedBrush] getMins: min maxs:max];
|
||||||
VectorSubtract (min, v, min);
|
VectorSubtract (min, v, min);
|
||||||
VectorCopy (min, org); // convert to integer
|
VectorCopy (min, org); // convert to integer
|
||||||
|
|
||||||
[self setKey:"origin" toValue:va ("%i %i %i", org[0], org[1], org[2])];
|
[self setKey:"origin" toValue:va ("%i %i %i", org[0], org[1], org[2])];
|
||||||
|
|
||||||
[self createFixedBrush:min];
|
[self createFixedBrush: min];
|
||||||
} else
|
} else
|
||||||
modifiable = YES;
|
modifiable = YES;
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (oneway void) dealloc
|
||||||
-(void) dealloc
|
|
||||||
{
|
{
|
||||||
epair_t *e, *n;
|
epair_t *e, *n;
|
||||||
|
|
||||||
|
@ -109,13 +108,13 @@ vec3_t bad_maxs = { 8, 8, 8 };
|
||||||
return modifiable;
|
return modifiable;
|
||||||
}
|
}
|
||||||
|
|
||||||
-setModifiable:(BOOL) m
|
- (void) setModifiable: (BOOL)m
|
||||||
{
|
{
|
||||||
modifiable = m;
|
modifiable = m;
|
||||||
return self;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void) removeObject:o
|
-(void) removeObject: (id)o
|
||||||
{
|
{
|
||||||
[super removeObject:o];
|
[super removeObject:o];
|
||||||
if ([self count])
|
if ([self count])
|
||||||
|
@ -139,7 +138,8 @@ vec3_t bad_maxs = { 8, 8, 8 };
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
-getVector:(vec3_t) v forKey:(const char *) k
|
- (void) getVector: (vec3_t)v
|
||||||
|
forKey: (const char *)k
|
||||||
{
|
{
|
||||||
const char *c;
|
const char *c;
|
||||||
|
|
||||||
|
@ -148,8 +148,6 @@ vec3_t bad_maxs = { 8, 8, 8 };
|
||||||
v[0] = v[1] = v[2] = 0;
|
v[0] = v[1] = v[2] = 0;
|
||||||
|
|
||||||
sscanf (c, "%f %f %f", &v[0], &v[1], &v[2]);
|
sscanf (c, "%f %f %f", &v[0], &v[1], &v[2]);
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-print
|
-print
|
||||||
|
@ -162,21 +160,20 @@ vec3_t bad_maxs = { 8, 8, 8 };
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
-setKey:(const char *)
|
- (void) setKey:(const char *)k
|
||||||
k toValue:(const char *) v
|
toValue:(const char *) v
|
||||||
{
|
{
|
||||||
epair_t *e;
|
epair_t *e;
|
||||||
|
|
||||||
while (*k && *k <= ' ')
|
while (*k && *k <= ' ')
|
||||||
k++;
|
k++;
|
||||||
if (!*k)
|
if (!*k)
|
||||||
return self; // don't set NULL values
|
return; // don't set NULL values
|
||||||
|
|
||||||
for (e = epairs; e; e = e->next) {
|
for (e = epairs; e; e = e->next) {
|
||||||
if (!strcmp (k, e->key)) {
|
if (!strcmp (k, e->key)) {
|
||||||
free (e->value);
|
free (e->value);
|
||||||
e->value = strdup (v);
|
e->value = strdup (v);
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,8 +183,6 @@ k toValue:(const char *) v
|
||||||
e->value = strdup (v);
|
e->value = strdup (v);
|
||||||
e->next = epairs;
|
e->next = epairs;
|
||||||
epairs = e;
|
epairs = e;
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(int) numPairs
|
-(int) numPairs
|
||||||
|
@ -206,17 +201,18 @@ k toValue:(const char *) v
|
||||||
return epairs;
|
return epairs;
|
||||||
}
|
}
|
||||||
|
|
||||||
-removeKeyPair:(char *) key
|
- (void) removeKeyPair:(char *) key
|
||||||
{
|
{
|
||||||
epair_t *e, *e2;
|
epair_t *e, *e2;
|
||||||
|
|
||||||
if (!epairs)
|
if (!epairs)
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
e = epairs;
|
e = epairs;
|
||||||
if (!strcmp (e->key, key)) {
|
if (!strcmp (e->key, key)) {
|
||||||
epairs = e->next;
|
epairs = e->next;
|
||||||
free (e);
|
free (e);
|
||||||
return self;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; e; e = e->next) {
|
for (; e; e = e->next) {
|
||||||
|
@ -224,12 +220,12 @@ k toValue:(const char *) v
|
||||||
e2 = e->next;
|
e2 = e->next;
|
||||||
e->next = e2->next;
|
e->next = e2->next;
|
||||||
free (e2);
|
free (e2);
|
||||||
return self;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("WARNING: removeKeyPair: %s not found\n", key);
|
printf ("WARNING: removeKeyPair: %s not found\n", key);
|
||||||
return self;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -279,7 +275,7 @@ FILE METHODS
|
||||||
|
|
||||||
int nument;
|
int nument;
|
||||||
|
|
||||||
-initFromScript:(script_t *) script
|
- (Entity *) initFromScript:(script_t *) script
|
||||||
{
|
{
|
||||||
char *key;
|
char *key;
|
||||||
id eclass, brush;
|
id eclass, brush;
|
||||||
|
@ -364,8 +360,8 @@ int nument;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
-writeToFILE:(FILE *)
|
- (void) writeToFILE:(FILE *)f
|
||||||
f region:(BOOL) reg;
|
region:(BOOL) reg;
|
||||||
{
|
{
|
||||||
epair_t *e;
|
epair_t *e;
|
||||||
int ang;
|
int ang;
|
||||||
|
@ -384,7 +380,7 @@ f region:(BOOL) reg;
|
||||||
[self setKey: "angle" toValue: va ("%i", ang)];
|
[self setKey: "angle" toValue: va ("%i", ang)];
|
||||||
} else if (self != [map_i objectAtIndex:0]
|
} else if (self != [map_i objectAtIndex:0]
|
||||||
&& [[self objectAtIndex:0] regioned]) {
|
&& [[self objectAtIndex:0] regioned]) {
|
||||||
return self; // skip the entire entity definition
|
return; // skip the entire entity definition
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,7 +423,7 @@ f region:(BOOL) reg;
|
||||||
free (oldang);
|
free (oldang);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <AppKit/AppKit.h>
|
#include <AppKit/AppKit.h>
|
||||||
|
|
||||||
#define MINIWINICON "DoomEdIcon"
|
#define MINIWINICON "DoomEdIcon"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
i_project,
|
i_project,
|
||||||
|
@ -14,66 +14,69 @@ typedef enum {
|
||||||
i_output,
|
i_output,
|
||||||
i_help,
|
i_help,
|
||||||
i_end
|
i_end
|
||||||
} insp_e;
|
} insp_e;
|
||||||
|
|
||||||
extern id inspcontrol_i;
|
@class InspectorControl;
|
||||||
|
|
||||||
@interface InspectorControl:NSObject
|
extern InspectorControl *inspcontrol_i;
|
||||||
|
|
||||||
|
@interface InspectorControl: NSObject
|
||||||
{
|
{
|
||||||
id inspectorView_i; // inspector view
|
IBOutlet NSView *inspectorView_i; // inspector view
|
||||||
id inspectorSubview_i; // inspector view's current subview
|
IBOutlet NSView *inspectorSubview_i; // inspector view's current subview
|
||||||
// (gets replaced)
|
// (gets replaced)
|
||||||
|
|
||||||
id contentList; // List of contentviews (corresponds to
|
id contentList; // List of contentviews (corresponds to
|
||||||
// insp_e enum order)
|
// insp_e enum order)
|
||||||
|
|
||||||
id windowList; // List of Windows (corresponds to
|
id windowList; // List of Windows (corresponds to
|
||||||
// insp_e enum order)
|
// insp_e enum order)
|
||||||
|
|
||||||
id obj_textures_i; // TexturePalette object (for
|
id obj_textures_i; // TexturePalette object (for
|
||||||
// delegating)
|
// delegating)
|
||||||
id obj_genkeypair_i; // GenKeyPair object
|
id obj_genkeypair_i; // GenKeyPair object
|
||||||
|
|
||||||
id popUpButton_i; // PopUpList title button
|
NSPopUpButton *popUpButton_i; // PopUpList title button
|
||||||
id popUpMatrix_i; // PopUpList matrix
|
NSMatrix *popUpMatrix_i; // PopUpList matrix
|
||||||
id itemList; // List of popUp buttons
|
NSMutableArray *itemList; // List of popUp buttons
|
||||||
|
|
||||||
id helpView;
|
IBOutlet NSTextView *helpView;
|
||||||
|
|
||||||
insp_e currentInspectorType; // keep track of current inspector
|
insp_e currentInspectorType; // keep track of current inspector
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add id's here for new inspectors
|
// Add id's here for new inspectors
|
||||||
// **NOTE: Make sure PopUpList has correct TAG value that
|
// **NOTE: Make sure PopUpList has correct TAG value that
|
||||||
// corresponds to the enums above!
|
// corresponds to the enums above!
|
||||||
|
|
||||||
// Windows
|
// Windows
|
||||||
id win_project_i; // project
|
IBOutlet NSWindow *win_project_i; // project
|
||||||
id win_textures_i; // textures
|
IBOutlet NSWindow *win_textures_i; // textures
|
||||||
id win_things_i; // things
|
IBOutlet NSWindow *win_things_i; // things
|
||||||
id win_prefs_i; // preferences
|
IBOutlet NSWindow *win_prefs_i; // preferences
|
||||||
id win_settings_i; // project settings
|
IBOutlet NSWindow *win_settings_i; // project settings
|
||||||
id win_output_i; // bsp output
|
IBOutlet NSWindow *win_output_i; // bsp output
|
||||||
id win_help_i; // documentation
|
IBOutlet NSWindow *win_help_i; // documentation
|
||||||
|
|
||||||
// PopUpList objs
|
// PopUpList objs
|
||||||
id itemProject_i; // project
|
IBOutlet id <NSMenuItem> itemProject_i; // project
|
||||||
id itemTextures_i; // textures
|
IBOutlet id <NSMenuItem> itemTextures_i; // textures
|
||||||
id itemThings_i; // things
|
IBOutlet id <NSMenuItem> itemThings_i; // things
|
||||||
id itemPrefs_i; // preferences
|
IBOutlet id <NSMenuItem> itemPrefs_i; // preferences
|
||||||
id itemSettings_i; // project settings
|
IBOutlet id <NSMenuItem> itemSettings_i; // project settings
|
||||||
id itemOutput_i; // bsp output
|
IBOutlet id <NSMenuItem> itemOutput_i; // bsp output
|
||||||
id itemHelp_i; // docs
|
IBOutlet id <NSMenuItem> itemHelp_i; // docs
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) changeInspector:sender;
|
- (IBAction) changeInspector: (id)sender;
|
||||||
- (void) changeInspectorTo:(insp_e) which;
|
|
||||||
-(insp_e) getCurrentInspector;
|
- (void) setCurrentInspector: (insp_e)which;
|
||||||
|
- (insp_e) currentInspector;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@protocol InspectorControl
|
@protocol InspectorControl
|
||||||
-windowResized;
|
- (void) windowResized;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif // InspectorControl_h
|
#endif // InspectorControl_h
|
||||||
|
|
|
@ -3,25 +3,25 @@
|
||||||
#include "InspectorControl.h"
|
#include "InspectorControl.h"
|
||||||
|
|
||||||
// Add .h-files here for new inspectors
|
// Add .h-files here for new inspectors
|
||||||
#include "Things.h"
|
#include "Things.h"
|
||||||
#include "TexturePalette.h"
|
#include "TexturePalette.h"
|
||||||
#include "Preferences.h"
|
#include "Preferences.h"
|
||||||
|
|
||||||
id inspcontrol_i;
|
InspectorControl *inspcontrol_i;
|
||||||
|
|
||||||
@interface CustomView:NSView
|
@interface CustomView: NSView
|
||||||
@end
|
@end
|
||||||
@implementation CustomView
|
@implementation CustomView
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation InspectorControl
|
@implementation InspectorControl
|
||||||
|
|
||||||
-(void)awakeFromNib
|
- (void) awakeFromNib
|
||||||
{
|
{
|
||||||
NSBundle *mainBundle = [NSBundle mainBundle];
|
NSBundle *mainBundle = [NSBundle mainBundle];
|
||||||
NSString *path = [mainBundle pathForResource:@"help" ofType:@"txt"
|
NSString *path = [mainBundle pathForResource: @"help" ofType: @"txt"
|
||||||
inDirectory:nil];
|
inDirectory: nil];
|
||||||
NSString *help = [NSString stringWithContentsOfFile: path];
|
NSString *help = [NSString stringWithContentsOfFile: path];
|
||||||
|
|
||||||
[helpView setString: help];
|
[helpView setString: help];
|
||||||
|
|
||||||
|
@ -29,107 +29,106 @@ id inspcontrol_i;
|
||||||
|
|
||||||
currentInspectorType = -1;
|
currentInspectorType = -1;
|
||||||
|
|
||||||
contentList =[[NSMutableArray alloc] init];
|
contentList = [[NSMutableArray alloc] init];
|
||||||
windowList =[[NSMutableArray alloc] init];
|
windowList = [[NSMutableArray alloc] init];
|
||||||
itemList =[[NSMutableArray alloc] init];
|
itemList = [[NSMutableArray alloc] init];
|
||||||
|
|
||||||
// ADD NEW INSPECTORS HERE...
|
// ADD NEW INSPECTORS HERE...
|
||||||
|
|
||||||
[windowList addObject:win_project_i];
|
[windowList addObject: win_project_i];
|
||||||
[contentList addObject:[win_project_i contentView]];
|
[contentList addObject: [win_project_i contentView]];
|
||||||
[itemProject_i setKeyEquivalent:@"1"];
|
[itemProject_i setKeyEquivalent: @"1"];
|
||||||
[itemList addObject:itemProject_i];
|
[itemList addObject: itemProject_i];
|
||||||
|
|
||||||
[windowList addObject:win_textures_i];
|
[windowList addObject: win_textures_i];
|
||||||
[contentList addObject:[win_textures_i contentView]];
|
[contentList addObject: [win_textures_i contentView]];
|
||||||
[itemTextures_i setKeyEquivalent:@"2"];
|
[itemTextures_i setKeyEquivalent: @"2"];
|
||||||
[itemList addObject:itemTextures_i];
|
[itemList addObject: itemTextures_i];
|
||||||
|
|
||||||
[windowList addObject:win_things_i];
|
[windowList addObject: win_things_i];
|
||||||
[contentList addObject:[win_things_i contentView]];
|
[contentList addObject: [win_things_i contentView]];
|
||||||
[itemThings_i setKeyEquivalent:@"3"];
|
[itemThings_i setKeyEquivalent: @"3"];
|
||||||
[itemList addObject:itemThings_i];
|
[itemList addObject: itemThings_i];
|
||||||
|
|
||||||
[windowList addObject:win_prefs_i];
|
[windowList addObject: win_prefs_i];
|
||||||
[contentList addObject:[win_prefs_i contentView]];
|
[contentList addObject: [win_prefs_i contentView]];
|
||||||
[itemPrefs_i setKeyEquivalent:@"4"];
|
[itemPrefs_i setKeyEquivalent: @"4"];
|
||||||
[itemList addObject:itemPrefs_i];
|
[itemList addObject: itemPrefs_i];
|
||||||
|
|
||||||
[windowList addObject:win_settings_i];
|
[windowList addObject: win_settings_i];
|
||||||
[contentList addObject:[win_settings_i contentView]];
|
[contentList addObject: [win_settings_i contentView]];
|
||||||
[itemSettings_i setKeyEquivalent:@"5"];
|
[itemSettings_i setKeyEquivalent: @"5"];
|
||||||
[itemList addObject:itemSettings_i];
|
[itemList addObject: itemSettings_i];
|
||||||
|
|
||||||
[windowList addObject:win_output_i];
|
[windowList addObject: win_output_i];
|
||||||
[contentList addObject:[win_output_i contentView]];
|
[contentList addObject: [win_output_i contentView]];
|
||||||
[itemOutput_i setKeyEquivalent:@"6"];
|
[itemOutput_i setKeyEquivalent: @"6"];
|
||||||
[itemList addObject:itemOutput_i];
|
[itemList addObject: itemOutput_i];
|
||||||
|
|
||||||
[windowList addObject:win_help_i];
|
[windowList addObject: win_help_i];
|
||||||
[contentList addObject:[win_help_i contentView]];
|
[contentList addObject: [win_help_i contentView]];
|
||||||
[itemHelp_i setKeyEquivalent:@"7"];
|
[itemHelp_i setKeyEquivalent: @"7"];
|
||||||
[itemList addObject:itemHelp_i];
|
[itemList addObject: itemHelp_i];
|
||||||
|
|
||||||
// Setup inspector window with project subview first
|
// Setup inspector window with project subview first
|
||||||
|
|
||||||
[inspectorView_i setAutoresizesSubviews:YES];
|
[inspectorView_i setAutoresizesSubviews: YES];
|
||||||
|
|
||||||
inspectorSubview_i =[contentList objectAtIndex:i_project];
|
inspectorSubview_i = [contentList objectAtIndex: i_project];
|
||||||
|
|
||||||
[inspectorView_i addSubview:inspectorSubview_i];
|
[inspectorView_i addSubview: inspectorSubview_i];
|
||||||
|
|
||||||
currentInspectorType = -1;
|
currentInspectorType = -1;
|
||||||
[self changeInspectorTo:i_project];
|
[self setCurrentInspector: i_project];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Sent by the PopUpList in the Inspector
|
// Sent by the PopUpList in the Inspector
|
||||||
// Each cell in the PopUpList must have the correct tag
|
// Each cell in the PopUpList must have the correct tag
|
||||||
//
|
//
|
||||||
- (void) changeInspector:sender
|
- (IBAction) changeInspector: sender
|
||||||
{
|
{
|
||||||
[self changeInspectorTo:[sender selectedTag]];
|
[self setCurrentInspector: [sender selectedTag]];
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Change to specific Inspector
|
// Change to specific Inspector
|
||||||
//
|
//
|
||||||
- (void) changeInspectorTo:(insp_e) which
|
- (void) setCurrentInspector: (insp_e)which
|
||||||
{
|
{
|
||||||
id newView;
|
id newView;
|
||||||
NSRect r;
|
NSRect r;
|
||||||
NSRect f;
|
NSRect f;
|
||||||
|
|
||||||
if (which == currentInspectorType)
|
if (which == currentInspectorType) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
currentInspectorType = which;
|
currentInspectorType = which;
|
||||||
newView =[contentList objectAtIndex:which];
|
newView = [contentList objectAtIndex: which];
|
||||||
|
|
||||||
[popUpButton_i selectItemAtIndex:which];
|
[popUpButton_i selectItemAtIndex: which];
|
||||||
|
|
||||||
[inspectorView_i replaceSubview: inspectorSubview_i with:newView];
|
[inspectorView_i replaceSubview: inspectorSubview_i with: newView];
|
||||||
r =[inspectorView_i frame];
|
r = [inspectorView_i frame];
|
||||||
inspectorSubview_i = newView;
|
inspectorSubview_i = newView;
|
||||||
[inspectorSubview_i setAutoresizingMask:NSViewWidthSizable |
|
[inspectorSubview_i setAutoresizingMask: NSViewWidthSizable |
|
||||||
NSViewHeightSizable];
|
NSViewHeightSizable];
|
||||||
r.size.width -= 4;
|
r.size.width -= 4;
|
||||||
r.size.height -= 4;
|
r.size.height -= 4;
|
||||||
[inspectorSubview_i setFrameSize:r.size];
|
[inspectorSubview_i setFrameSize: r.size];
|
||||||
|
|
||||||
[inspectorSubview_i lockFocus];
|
[inspectorSubview_i lockFocus];
|
||||||
f =[inspectorSubview_i bounds];
|
f = [inspectorSubview_i bounds];
|
||||||
[[NSColor lightGrayColor] set];
|
[[NSColor windowBackgroundColor] set];
|
||||||
NSRectFill (f);
|
NSRectFill (f);
|
||||||
[inspectorSubview_i unlockFocus];
|
[inspectorSubview_i unlockFocus];
|
||||||
[inspectorView_i display];
|
[inspectorView_i setNeedsDisplay: YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(insp_e) getCurrentInspector
|
- (insp_e) currentInspector
|
||||||
{
|
{
|
||||||
return currentInspectorType;
|
return currentInspectorType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -119,7 +119,7 @@ FILE METHODS
|
||||||
currentEntity = ent;
|
currentEntity = ent;
|
||||||
if (old != ent) {
|
if (old != ent) {
|
||||||
[things_i newCurrentEntity]; // update inspector
|
[things_i newCurrentEntity]; // update inspector
|
||||||
[inspcontrol_i changeInspectorTo:i_things];
|
[inspcontrol_i setCurrentInspector: i_things];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
@ -325,7 +325,7 @@ DRAWING
|
||||||
==============================================================================
|
==============================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
-ZDrawSelf
|
-(void)ZDrawSelf
|
||||||
{
|
{
|
||||||
int i, count;
|
int i, count;
|
||||||
|
|
||||||
|
@ -333,11 +333,9 @@ DRAWING
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
[[self objectAtIndex:i] ZDrawSelf];
|
[[self objectAtIndex:i] ZDrawSelf];
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-RenderSelf:(void (*)(face_t *)) callback
|
-(void)RenderSelf:(void (*)(face_t *)) callback
|
||||||
{
|
{
|
||||||
int i, count;
|
int i, count;
|
||||||
|
|
||||||
|
@ -345,8 +343,6 @@ DRAWING
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
[[self objectAtIndex: i] RenderSelf:callback];
|
[[self objectAtIndex: i] RenderSelf:callback];
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ DisplayCmdOutput (void)
|
||||||
free (buffer);
|
free (buffer);
|
||||||
|
|
||||||
if ([preferences_i getShowBSP])
|
if ([preferences_i getShowBSP])
|
||||||
[inspcontrol_i changeInspectorTo:i_output];
|
[inspcontrol_i setCurrentInspector:i_output];
|
||||||
|
|
||||||
[preferences_i playBspSound];
|
[preferences_i playBspSound];
|
||||||
|
|
||||||
|
@ -720,7 +720,7 @@ saveBSP
|
||||||
[project_i addToOutput:expandedcmd];
|
[project_i addToOutput:expandedcmd];
|
||||||
|
|
||||||
if ([preferences_i getShowBSP])
|
if ([preferences_i getShowBSP])
|
||||||
[inspcontrol_i changeInspectorTo:i_output];
|
[inspcontrol_i setCurrentInspector:i_output];
|
||||||
|
|
||||||
if (wt) {
|
if (wt) {
|
||||||
id panel;
|
id panel;
|
||||||
|
|
|
@ -75,18 +75,18 @@ winding_t *NewWinding (int points);
|
||||||
|
|
||||||
-calcWindings;
|
-calcWindings;
|
||||||
|
|
||||||
-writeToFILE:(FILE *)f region:(BOOL)reg;
|
- (void) writeToFILE:(FILE *)f region:(BOOL)reg;
|
||||||
|
|
||||||
-(BOOL) selected;
|
-(BOOL) selected;
|
||||||
-(BOOL) regioned;
|
-(BOOL) regioned;
|
||||||
-setSelected:(BOOL) s;
|
- (void) setSelected: (BOOL)s;
|
||||||
-setRegioned:(BOOL) s;
|
- (void) setRegioned: (BOOL)s;
|
||||||
|
|
||||||
-getMins:(vec3_t)mins maxs:(vec3_t)maxs;
|
- (void) getMins: (vec3_t)mins maxs: (vec3_t)maxs;
|
||||||
|
|
||||||
-(BOOL) containsPoint:(vec3_t) pt;
|
-(BOOL) containsPoint:(vec3_t) pt;
|
||||||
|
|
||||||
-freeWindings;
|
- (void) freeWindings;
|
||||||
-removeIfInvalid;
|
-removeIfInvalid;
|
||||||
|
|
||||||
extern vec3_t region_min, region_max;
|
extern vec3_t region_min, region_max;
|
||||||
|
@ -95,16 +95,16 @@ extern vec3_t region_min, region_max;
|
||||||
|
|
||||||
-(texturedef_t *) texturedef;
|
-(texturedef_t *) texturedef;
|
||||||
-(texturedef_t *) texturedefForFace:(int) f;
|
-(texturedef_t *) texturedefForFace:(int) f;
|
||||||
-setTexturedef:(texturedef_t *) tex;
|
- (void) setTexturedef:(texturedef_t *) tex;
|
||||||
-setTexturedef:(texturedef_t *) tex forFace:(int) f;
|
- (void) setTexturedef:(texturedef_t *) tex forFace:(int) f;
|
||||||
|
|
||||||
-XYDrawSelf;
|
- (void) XYDrawSelf;
|
||||||
-ZDrawSelf;
|
- (void) ZDrawSelf;
|
||||||
-CameraDrawSelf;
|
- (void) CameraDrawSelf;
|
||||||
-XYRenderSelf;
|
- (void) XYRenderSelf;
|
||||||
-CameraRenderSelf;
|
- (void) CameraRenderSelf;
|
||||||
|
|
||||||
-hitByRay: (vec3_t) p1: (vec3_t) p2: (float *) time:(int *) face;
|
- (void) hitByRay: (vec3_t)p1: (vec3_t)p2: (float *)time: (int *)face;
|
||||||
|
|
||||||
//
|
//
|
||||||
// single brush actions
|
// single brush actions
|
||||||
|
@ -112,61 +112,61 @@ extern vec3_t region_min, region_max;
|
||||||
extern int numcontrolpoints;
|
extern int numcontrolpoints;
|
||||||
extern float *controlpoints[MAX_FACES * 3];
|
extern float *controlpoints[MAX_FACES * 3];
|
||||||
|
|
||||||
-getZdragface:(vec3_t) dragpoint;
|
- (void) getZdragface: (vec3_t)dragpoint;
|
||||||
-getXYdragface:(vec3_t) dragpoint;
|
- (void) getXYdragface: (vec3_t)dragpoint;
|
||||||
-getXYShearPoints:(vec3_t) dragpoint;
|
- (void) getXYShearPoints: (vec3_t)dragpoint;
|
||||||
|
|
||||||
-addFace:(face_t *) f;
|
-addFace:(face_t *) f;
|
||||||
|
|
||||||
//
|
//
|
||||||
// multiple brush actions
|
// multiple brush actions
|
||||||
//
|
//
|
||||||
-carveByClipper;
|
- (void) carveByClipper;
|
||||||
|
|
||||||
extern vec3_t sb_translate;
|
extern vec3_t sb_translate;
|
||||||
|
|
||||||
-translate;
|
- (void) translate;
|
||||||
|
|
||||||
extern id carve_in, carve_out;
|
extern id carve_in, carve_out;
|
||||||
|
|
||||||
-select;
|
- (void) select;
|
||||||
-deselect;
|
- (void) deselect;
|
||||||
-remove;
|
- (void) remove;
|
||||||
-flushTextures;
|
- (void) flushTextures;
|
||||||
|
|
||||||
extern vec3_t sb_mins, sb_maxs;
|
extern vec3_t sb_mins, sb_maxs;
|
||||||
|
|
||||||
-addToBBox;
|
- (void) addToBBox;
|
||||||
|
|
||||||
extern vec3_t sel_x, sel_y, sel_z;
|
extern vec3_t sel_x, sel_y, sel_z;
|
||||||
extern vec3_t sel_org;
|
extern vec3_t sel_org;
|
||||||
|
|
||||||
-transform;
|
- (void) transform;
|
||||||
|
|
||||||
-flipNormals;
|
- (void) flipNormals;
|
||||||
|
|
||||||
-carve;
|
-carve;
|
||||||
-setCarveVars;
|
- (void) setCarveVars;
|
||||||
|
|
||||||
extern id sb_newowner;
|
extern id sb_newowner;
|
||||||
|
|
||||||
-moveToEntity;
|
- (void) moveToEntity;
|
||||||
|
|
||||||
-takeCurrentTexture;
|
- (void) takeCurrentTexture;
|
||||||
|
|
||||||
extern vec3_t select_min, select_max;
|
extern vec3_t select_min, select_max;
|
||||||
|
|
||||||
-selectPartial;
|
- (void) selectPartial;
|
||||||
-selectComplete;
|
- (void) selectComplete;
|
||||||
-regionPartial;
|
- (void) regionPartial;
|
||||||
-regionComplete;
|
- (void) regionComplete;
|
||||||
|
|
||||||
extern float sb_floor_dir, sb_floor_dist;
|
extern float sb_floor_dir, sb_floor_dist;
|
||||||
|
|
||||||
-feetToFloor;
|
- (void) feetToFloor;
|
||||||
|
|
||||||
-(int) getNumBrushFaces;
|
- (int) getNumBrushFaces;
|
||||||
-(face_t *) getBrushFace:(int) which;
|
- (face_t *) getBrushFace: (int)which;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
#endif // SetBrush_h
|
#endif // SetBrush_h
|
||||||
|
|
|
@ -486,9 +486,9 @@ can be removed.
|
||||||
initOwner:::
|
initOwner:::
|
||||||
===========
|
===========
|
||||||
*/
|
*/
|
||||||
-initOwner: own mins:(float *)
|
- (SetBrush *)initOwner: own mins:(float *)mins
|
||||||
mins maxs:(float *)
|
maxs:(float *)maxs
|
||||||
maxs texture:(texturedef_t *) tex
|
texture:(texturedef_t *) tex
|
||||||
{
|
{
|
||||||
[super init];
|
[super init];
|
||||||
|
|
||||||
|
@ -597,7 +597,7 @@ mins maxs:(float *) maxs
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
-freeWindings
|
-(void)freeWindings
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -606,7 +606,6 @@ mins maxs:(float *) maxs
|
||||||
free (faces[i].w);
|
free (faces[i].w);
|
||||||
faces[i].w = NULL;
|
faces[i].w = NULL;
|
||||||
}
|
}
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void) dealloc
|
-(void) dealloc
|
||||||
|
@ -709,8 +708,8 @@ int numsb;
|
||||||
writeToFILE
|
writeToFILE
|
||||||
===========
|
===========
|
||||||
*/
|
*/
|
||||||
-writeToFILE:(FILE *)
|
- (void) writeToFILE:(FILE *)f
|
||||||
f region:(BOOL) reg
|
region:(BOOL) reg
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
face_t *fa;
|
face_t *fa;
|
||||||
|
@ -718,7 +717,7 @@ f region:(BOOL) reg
|
||||||
|
|
||||||
|
|
||||||
if (reg && regioned)
|
if (reg && regioned)
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
fprintf (f, "{\n");
|
fprintf (f, "{\n");
|
||||||
for (i = 0; i < numfaces; i++) {
|
for (i = 0; i < numfaces; i++) {
|
||||||
|
@ -733,7 +732,7 @@ f region:(BOOL) reg
|
||||||
}
|
}
|
||||||
fprintf (f, "}\n");
|
fprintf (f, "}\n");
|
||||||
|
|
||||||
return self;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -746,12 +745,11 @@ INTERACTION
|
||||||
==============================================================================
|
==============================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
-getMins:(vec3_t)
|
- (void)getMins:(vec3_t)
|
||||||
mins maxs:(vec3_t) maxs
|
mins maxs:(vec3_t) maxs
|
||||||
{
|
{
|
||||||
VectorCopy (bmins, mins);
|
VectorCopy (bmins, mins);
|
||||||
VectorCopy (bmaxs, maxs);
|
VectorCopy (bmaxs, maxs);
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -760,10 +758,9 @@ mins maxs:(vec3_t) maxs
|
||||||
return selected;
|
return selected;
|
||||||
}
|
}
|
||||||
|
|
||||||
-setSelected:(BOOL) s
|
- (void) setSelected:(BOOL) s
|
||||||
{
|
{
|
||||||
selected = s;
|
selected = s;
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(BOOL) regioned
|
-(BOOL) regioned
|
||||||
|
@ -771,10 +768,9 @@ mins maxs:(vec3_t) maxs
|
||||||
return regioned;
|
return regioned;
|
||||||
}
|
}
|
||||||
|
|
||||||
-setRegioned:(BOOL) s
|
- (void)setRegioned:(BOOL) s
|
||||||
{
|
{
|
||||||
regioned = s;
|
regioned = s;
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -783,7 +779,7 @@ mins maxs:(vec3_t) maxs
|
||||||
setTexturedef
|
setTexturedef
|
||||||
===========
|
===========
|
||||||
*/
|
*/
|
||||||
-setTexturedef:(texturedef_t *) tex
|
- (void) setTexturedef: (texturedef_t *)tex
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -793,11 +789,9 @@ setTexturedef
|
||||||
}
|
}
|
||||||
|
|
||||||
[self calcWindings]; // in case texture coords changed
|
[self calcWindings]; // in case texture coords changed
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-setTexturedef:(texturedef_t *)
|
- (void) setTexturedef: (texturedef_t *)tex forFace: (int)f
|
||||||
tex forFace:(int) f
|
|
||||||
{
|
{
|
||||||
if (f > numfaces)
|
if (f > numfaces)
|
||||||
Sys_Error ("setTexturedef:forFace: bad face number %i", f);
|
Sys_Error ("setTexturedef:forFace: bad face number %i", f);
|
||||||
|
@ -806,7 +800,6 @@ tex forFace:(int) f
|
||||||
faces[f].qtexture = NULL; // recache next render
|
faces[f].qtexture = NULL; // recache next render
|
||||||
|
|
||||||
[self calcWindings]; // in case texture coords changed
|
[self calcWindings]; // in case texture coords changed
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -931,7 +924,7 @@ hitByRay
|
||||||
|
|
||||||
===========
|
===========
|
||||||
*/
|
*/
|
||||||
-hitByRay: (vec3_t) p1: (vec3_t) p2: (float *) time:(int *) face
|
- (void) hitByRay: (vec3_t) p1: (vec3_t) p2: (float *) time:(int *) face
|
||||||
{
|
{
|
||||||
vec3_t frontpoint, backpoint, dir;
|
vec3_t frontpoint, backpoint, dir;
|
||||||
int frontface, backface;
|
int frontface, backface;
|
||||||
|
@ -939,7 +932,6 @@ hitByRay
|
||||||
if (regioned) {
|
if (regioned) {
|
||||||
*time = -1;
|
*time = -1;
|
||||||
*face = -1;
|
*face = -1;
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[self clipRay: p1: p2: frontpoint: &frontface: backpoint:&backface];
|
[self clipRay: p1: p2: frontpoint: &frontface: backpoint:&backface];
|
||||||
|
@ -948,7 +940,6 @@ hitByRay
|
||||||
// brush, select first face
|
// brush, select first face
|
||||||
*time = 0;
|
*time = 0;
|
||||||
*face = 0;
|
*face = 0;
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -956,7 +947,6 @@ hitByRay
|
||||||
// don't select it
|
// don't select it
|
||||||
*time = -1;
|
*time = -1;
|
||||||
*face = -1;
|
*face = -1;
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorSubtract (p2, p1, dir);
|
VectorSubtract (p2, p1, dir);
|
||||||
|
@ -968,8 +958,6 @@ hitByRay
|
||||||
Sys_Error ("hitByRay: negative t");
|
Sys_Error ("hitByRay: negative t");
|
||||||
|
|
||||||
*face = frontface;
|
*face = frontface;
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1072,7 +1060,7 @@ BOOL fakebrush;
|
||||||
XYDrawSelf
|
XYDrawSelf
|
||||||
===========
|
===========
|
||||||
*/
|
*/
|
||||||
-XYDrawSelf
|
- (void) XYDrawSelf
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
winding_t *w;
|
winding_t *w;
|
||||||
|
@ -1083,7 +1071,7 @@ XYDrawSelf
|
||||||
BOOL keybrush;
|
BOOL keybrush;
|
||||||
|
|
||||||
if ([self fakeBrush:@selector (XYDrawSelf)])
|
if ([self fakeBrush:@selector (XYDrawSelf)])
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
[xyview_i addToScrollRange: bmins[0]:bmins[1]];
|
[xyview_i addToScrollRange: bmins[0]:bmins[1]];
|
||||||
[xyview_i addToScrollRange: bmaxs[0]:bmaxs[1]];
|
[xyview_i addToScrollRange: bmaxs[0]:bmaxs[1]];
|
||||||
|
@ -1113,7 +1101,7 @@ XYDrawSelf
|
||||||
|| bmaxs[1] < xy_draw_rect.origin.y
|
|| bmaxs[1] < xy_draw_rect.origin.y
|
||||||
|| bmins[0] > xy_draw_rect.origin.x + xy_draw_rect.size.width
|
|| bmins[0] > xy_draw_rect.origin.x + xy_draw_rect.size.width
|
||||||
|| bmins[1] > xy_draw_rect.origin.y + xy_draw_rect.size.height))
|
|| bmins[1] > xy_draw_rect.origin.y + xy_draw_rect.size.height))
|
||||||
return self; // off view, don't bother
|
return; // off view, don't bother
|
||||||
|
|
||||||
for (i = 0; i < numfaces; i++) {
|
for (i = 0; i < numfaces; i++) {
|
||||||
w = faces[i].w;
|
w = faces[i].w;
|
||||||
|
@ -1155,7 +1143,7 @@ XYDrawSelf
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1163,7 +1151,7 @@ XYDrawSelf
|
||||||
ZDrawSelf
|
ZDrawSelf
|
||||||
===========
|
===========
|
||||||
*/
|
*/
|
||||||
-ZDrawSelf
|
- (void) ZDrawSelf
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
NSPoint p;
|
NSPoint p;
|
||||||
|
@ -1173,7 +1161,7 @@ ZDrawSelf
|
||||||
qtexture_t *q;
|
qtexture_t *q;
|
||||||
|
|
||||||
if ([self fakeBrush:@selector (ZDrawSelf)])
|
if ([self fakeBrush:@selector (ZDrawSelf)])
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
[zview_i addToHeightRange:bmins[2]];
|
[zview_i addToHeightRange:bmins[2]];
|
||||||
[zview_i addToHeightRange:bmaxs[2]];
|
[zview_i addToHeightRange:bmaxs[2]];
|
||||||
|
@ -1188,7 +1176,7 @@ ZDrawSelf
|
||||||
p1[1] = p.y;
|
p1[1] = p.y;
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
if (bmins[i] >= p1[i] || bmaxs[i] <= p1[i])
|
if (bmins[i] >= p1[i] || bmaxs[i] <= p1[i])
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
p1[2] = 4096;
|
p1[2] = 4096;
|
||||||
p2[0] = p1[0];
|
p2[0] = p1[0];
|
||||||
|
@ -1198,7 +1186,7 @@ ZDrawSelf
|
||||||
[self clipRay: p1: p2: frontpoint: &frontface: backpoint:&backface];
|
[self clipRay: p1: p2: frontpoint: &frontface: backpoint:&backface];
|
||||||
|
|
||||||
if (frontface == -1 || backface == -1)
|
if (frontface == -1 || backface == -1)
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
q = TEX_ForName (faces[frontface].texture.texture);
|
q = TEX_ForName (faces[frontface].texture.texture);
|
||||||
|
|
||||||
|
@ -1212,7 +1200,7 @@ ZDrawSelf
|
||||||
NSFrameRect (NSMakeRect (-12, backpoint[2],
|
NSFrameRect (NSMakeRect (-12, backpoint[2],
|
||||||
25, frontpoint[2] - backpoint[2] + 1));
|
25, frontpoint[2] - backpoint[2] + 1));
|
||||||
|
|
||||||
return self;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1220,14 +1208,14 @@ ZDrawSelf
|
||||||
CameraDrawSelf
|
CameraDrawSelf
|
||||||
===========
|
===========
|
||||||
*/
|
*/
|
||||||
-CameraDrawSelf
|
- (void) CameraDrawSelf
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
winding_t *w;
|
winding_t *w;
|
||||||
id worldent, currentent;
|
id worldent, currentent;
|
||||||
|
|
||||||
if ([self fakeBrush:@selector (CameraDrawSelf)])
|
if ([self fakeBrush:@selector (CameraDrawSelf)])
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
worldent =[map_i objectAtIndex:0];
|
worldent =[map_i objectAtIndex:0];
|
||||||
currentent =[map_i currentEntity];
|
currentent =[map_i currentEntity];
|
||||||
|
@ -1249,7 +1237,7 @@ CameraDrawSelf
|
||||||
for (j = 0; j < w->numpoints; j++)
|
for (j = 0; j < w->numpoints; j++)
|
||||||
CameraLineto (w->points[j]);
|
CameraLineto (w->points[j]);
|
||||||
}
|
}
|
||||||
return self;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1258,17 +1246,17 @@ CameraDrawSelf
|
||||||
XYRenderSelf
|
XYRenderSelf
|
||||||
===========
|
===========
|
||||||
*/
|
*/
|
||||||
-XYRenderSelf
|
- (void) XYRenderSelf
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ([self fakeBrush:@selector (XYRenderSelf)])
|
if ([self fakeBrush:@selector (XYRenderSelf)])
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < numfaces; i++)
|
for (i = 0; i < numfaces; i++)
|
||||||
REN_DrawXYFace (&faces[i]);
|
REN_DrawXYFace (&faces[i]);
|
||||||
|
|
||||||
return self;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1276,7 +1264,7 @@ XYRenderSelf
|
||||||
CameraRenderSelf
|
CameraRenderSelf
|
||||||
===========
|
===========
|
||||||
*/
|
*/
|
||||||
-CameraRenderSelf
|
-(void)CameraRenderSelf
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
BOOL olddraw;
|
BOOL olddraw;
|
||||||
|
@ -1284,7 +1272,7 @@ CameraRenderSelf
|
||||||
pixel32_t p;
|
pixel32_t p;
|
||||||
|
|
||||||
if ([self fakeBrush:@selector (CameraRenderSelf)])
|
if ([self fakeBrush:@selector (CameraRenderSelf)])
|
||||||
return self;
|
return;
|
||||||
// hack to draw entity boxes as single flat color
|
// hack to draw entity boxes as single flat color
|
||||||
if (![parent modifiable]) {
|
if (![parent modifiable]) {
|
||||||
olddraw = r_drawflat;
|
olddraw = r_drawflat;
|
||||||
|
@ -1306,7 +1294,7 @@ CameraRenderSelf
|
||||||
REN_DrawCameraFace (&faces[i]);
|
REN_DrawCameraFace (&faces[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1339,14 +1327,14 @@ float *controlpoints[MAX_FACES * 3];
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
-getZdragface:(vec3_t) dragpoint
|
- (void) getZdragface:(vec3_t) dragpoint
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
float d;
|
float d;
|
||||||
|
|
||||||
|
|
||||||
if (![self checkModifiable])
|
if (![self checkModifiable])
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
numcontrolpoints = 0;
|
numcontrolpoints = 0;
|
||||||
|
|
||||||
|
@ -1368,11 +1356,9 @@ float *controlpoints[MAX_FACES * 3];
|
||||||
numcontrolpoints++;
|
numcontrolpoints++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-getXYdragface:(vec3_t) dragpoint
|
- (void) getXYdragface:(vec3_t) dragpoint
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
float d;
|
float d;
|
||||||
|
@ -1380,7 +1366,7 @@ float *controlpoints[MAX_FACES * 3];
|
||||||
numcontrolpoints = 0;
|
numcontrolpoints = 0;
|
||||||
|
|
||||||
if (![self checkModifiable])
|
if (![self checkModifiable])
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < numfaces; i++) {
|
for (i = 0; i < numfaces; i++) {
|
||||||
if (!faces[i].w)
|
if (!faces[i].w)
|
||||||
|
@ -1397,11 +1383,9 @@ float *controlpoints[MAX_FACES * 3];
|
||||||
numcontrolpoints++;
|
numcontrolpoints++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-getXYShearPoints:(vec3_t) dragpoint
|
- (void) getXYShearPoints:(vec3_t) dragpoint
|
||||||
{
|
{
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
int facectl;
|
int facectl;
|
||||||
|
@ -1414,7 +1398,7 @@ float *controlpoints[MAX_FACES * 3];
|
||||||
|
|
||||||
|
|
||||||
if (![self checkModifiable])
|
if (![self checkModifiable])
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
numcontrolpoints = 0;
|
numcontrolpoints = 0;
|
||||||
numdragplanes = 0;
|
numdragplanes = 0;
|
||||||
|
@ -1515,15 +1499,13 @@ float *controlpoints[MAX_FACES * 3];
|
||||||
if (k != 3) {
|
if (k != 3) {
|
||||||
// Sys_Error ("getXYShearPoints: didn't get three points on plane");
|
// Sys_Error ("getXYShearPoints: didn't get three points on plane");
|
||||||
numcontrolpoints = 0;
|
numcontrolpoints = 0;
|
||||||
return self;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
for (k = 0; k < 3; k++)
|
for (k = 0; k < 3; k++)
|
||||||
f->planepts[j][k] = rint (f->planepts[j][k]);
|
f->planepts[j][k] = rint (f->planepts[j][k]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1592,7 +1574,28 @@ Set the regioned flag based on if the object is containted in region_min/max
|
||||||
|
|
||||||
vec3_t select_min, select_max;
|
vec3_t select_min, select_max;
|
||||||
|
|
||||||
-selectPartial
|
- (void) selectPartial
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 3; i++)
|
||||||
|
if (select_min[i] >= bmaxs[i] || select_max[i] <= bmins[i])
|
||||||
|
return;
|
||||||
|
selected = YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)selectComplete
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 3; i++)
|
||||||
|
if (select_min[i] > bmins[i] || select_max[i] < bmaxs[i])
|
||||||
|
return;
|
||||||
|
selected = YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
-(void)regionPartial
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -1600,47 +1603,22 @@ vec3_t select_min, select_max;
|
||||||
if (select_min[i] >= bmaxs[i] || select_max[i] <= bmins[i])
|
if (select_min[i] >= bmaxs[i] || select_max[i] <= bmins[i])
|
||||||
return self;
|
return self;
|
||||||
selected = YES;
|
selected = YES;
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-selectComplete
|
-(void)regionComplete
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
if (select_min[i] > bmins[i] || select_max[i] < bmaxs[i])
|
if (select_min[i] > bmins[i] || select_max[i] < bmaxs[i])
|
||||||
return self;
|
return;
|
||||||
selected = YES;
|
selected = YES;
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
-regionPartial
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
|
||||||
if (select_min[i] >= bmaxs[i] || select_max[i] <= bmins[i])
|
|
||||||
return self;
|
|
||||||
selected = YES;
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
-regionComplete
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
|
||||||
if (select_min[i] > bmins[i] || select_max[i] < bmaxs[i])
|
|
||||||
return self;
|
|
||||||
selected = YES;
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
id sb_newowner;
|
id sb_newowner;
|
||||||
|
|
||||||
-moveToEntity
|
- (void) moveToEntity
|
||||||
{
|
{
|
||||||
id eclass;
|
id eclass;
|
||||||
float *c;
|
float *c;
|
||||||
|
@ -1656,12 +1634,11 @@ id sb_newowner;
|
||||||
}
|
}
|
||||||
|
|
||||||
[parent addObject:self];
|
[parent addObject:self];
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3_t sb_translate;
|
vec3_t sb_translate;
|
||||||
|
|
||||||
-translate
|
- (void) translate
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
@ -1673,18 +1650,16 @@ vec3_t sb_translate;
|
||||||
}
|
}
|
||||||
|
|
||||||
[self calcWindings];
|
[self calcWindings];
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3_t sb_mins, sb_maxs;
|
vec3_t sb_mins, sb_maxs;
|
||||||
|
|
||||||
-addToBBox
|
- (void) addToBBox
|
||||||
{
|
{
|
||||||
int k;
|
int k;
|
||||||
|
|
||||||
if (numfaces < 4)
|
if (numfaces < 4)
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
for (k = 0; k < 3; k++) {
|
for (k = 0; k < 3; k++) {
|
||||||
if (bmins[k] < sb_mins[k])
|
if (bmins[k] < sb_mins[k])
|
||||||
|
@ -1692,11 +1667,9 @@ vec3_t sb_mins, sb_maxs;
|
||||||
if (bmaxs[k] > sb_maxs[k])
|
if (bmaxs[k] > sb_maxs[k])
|
||||||
sb_maxs[k] = bmaxs[k];
|
sb_maxs[k] = bmaxs[k];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-flushTextures
|
-(void)flushTextures
|
||||||
{ // call when texture palette changes
|
{ // call when texture palette changes
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -1704,18 +1677,15 @@ vec3_t sb_mins, sb_maxs;
|
||||||
faces[i].qtexture = NULL;
|
faces[i].qtexture = NULL;
|
||||||
|
|
||||||
[self calcWindings];
|
[self calcWindings];
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-select
|
-(void)select
|
||||||
{
|
{
|
||||||
[map_i setCurrentEntity:parent];
|
[map_i setCurrentEntity:parent];
|
||||||
selected = YES;
|
selected = YES;
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-deselect
|
-(void)deselect
|
||||||
{
|
{
|
||||||
selected = NO;
|
selected = NO;
|
||||||
|
|
||||||
|
@ -1724,11 +1694,9 @@ vec3_t sb_mins, sb_maxs;
|
||||||
printf ("WARNING: deselected invalid brush\n");
|
printf ("WARNING: deselected invalid brush\n");
|
||||||
[map_i setCurrentMinZ:bmins[2]];
|
[map_i setCurrentMinZ:bmins[2]];
|
||||||
[map_i setCurrentMaxZ:bmaxs[2]];
|
[map_i setCurrentMaxZ:bmaxs[2]];
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-remove
|
-(void)remove
|
||||||
{
|
{
|
||||||
// the last selected brush determines
|
// the last selected brush determines
|
||||||
if (!invalid) {
|
if (!invalid) {
|
||||||
|
@ -1737,16 +1705,14 @@ vec3_t sb_mins, sb_maxs;
|
||||||
}
|
}
|
||||||
|
|
||||||
[parent removeObject:self];
|
[parent removeObject:self];
|
||||||
[self dealloc];
|
[self release];
|
||||||
|
|
||||||
return nil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vec3_t sel_x, sel_y, sel_z;
|
vec3_t sel_x, sel_y, sel_z;
|
||||||
vec3_t sel_org;
|
vec3_t sel_org;
|
||||||
|
|
||||||
-transform
|
- (void) transform
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
vec3_t old;
|
vec3_t old;
|
||||||
|
@ -1764,11 +1730,9 @@ vec3_t sel_org;
|
||||||
}
|
}
|
||||||
|
|
||||||
[self calcWindings];
|
[self calcWindings];
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-flipNormals // used after an inside-out transform
|
-(void)flipNormals // used after an inside-out transform
|
||||||
// (flip x/y/z)
|
// (flip x/y/z)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -1780,36 +1744,30 @@ vec3_t sel_org;
|
||||||
VectorCopy (temp, faces[i].planepts[2]);
|
VectorCopy (temp, faces[i].planepts[2]);
|
||||||
}
|
}
|
||||||
[self calcWindings];
|
[self calcWindings];
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-carveByClipper
|
- (void) carveByClipper
|
||||||
{
|
{
|
||||||
face_t face;
|
face_t face;
|
||||||
|
|
||||||
if (![clipper_i getFace:&face])
|
if (![clipper_i getFace:&face])
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
[self addFace:&face];
|
[self addFace:&face];
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) takeCurrentTexture
|
||||||
-takeCurrentTexture
|
|
||||||
{
|
{
|
||||||
texturedef_t td;
|
texturedef_t td;
|
||||||
|
|
||||||
[texturepalette_i getTextureDef:&td];
|
[texturepalette_i getTextureDef:&td];
|
||||||
[self setTexturedef:&td];
|
[self setTexturedef:&td];
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
float sb_floor_dir, sb_floor_dist;
|
float sb_floor_dir, sb_floor_dist;
|
||||||
|
|
||||||
-feetToFloor
|
- (void) feetToFloor
|
||||||
{
|
{
|
||||||
float oldz;
|
float oldz;
|
||||||
vec3_t p1, p2;
|
vec3_t p1, p2;
|
||||||
|
@ -1826,7 +1784,7 @@ float sb_floor_dir, sb_floor_dist;
|
||||||
|
|
||||||
[self clipRay: p1: p2: frontpoint: &frontface: backpoint:&backface];
|
[self clipRay: p1: p2: frontpoint: &frontface: backpoint:&backface];
|
||||||
if (frontface == -1)
|
if (frontface == -1)
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
dist = frontpoint[2] - oldz;
|
dist = frontpoint[2] - oldz;
|
||||||
|
|
||||||
|
@ -1837,7 +1795,6 @@ float sb_floor_dir, sb_floor_dist;
|
||||||
if (dist < 0 && dist > sb_floor_dist)
|
if (dist < 0 && dist > sb_floor_dist)
|
||||||
sb_floor_dist = dist;
|
sb_floor_dist = dist;
|
||||||
}
|
}
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1872,9 +1829,9 @@ id carve_in, carve_out;
|
||||||
return[self removeIfInvalid];
|
return[self removeIfInvalid];
|
||||||
}
|
}
|
||||||
|
|
||||||
-clipByFace:(face_t *)
|
- (void) clipByFace:(face_t *) fa
|
||||||
fa front:(id *)
|
front:(id *)f
|
||||||
f back:(id *) b
|
back:(id *) b
|
||||||
{
|
{
|
||||||
id front, back;
|
id front, back;
|
||||||
face_t fb;
|
face_t fb;
|
||||||
|
@ -1890,8 +1847,6 @@ f back:(id *) b
|
||||||
|
|
||||||
*b =[back addFace:fa];
|
*b =[back addFace:fa];
|
||||||
*f =[front addFace:&fb];
|
*f =[front addFace:&fb];
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-carve
|
-carve
|
||||||
|
@ -1929,14 +1884,12 @@ f back:(id *) b
|
||||||
setCarveVars
|
setCarveVars
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
-setCarveVars
|
- (void) setCarveVars
|
||||||
{
|
{
|
||||||
VectorCopy (bmins, carvemin);
|
VectorCopy (bmins, carvemin);
|
||||||
VectorCopy (bmaxs, carvemax);
|
VectorCopy (bmaxs, carvemax);
|
||||||
numcarvefaces = numfaces;
|
numcarvefaces = numfaces;
|
||||||
carvefaces = faces;
|
carvefaces = faces;
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(int) getNumBrushFaces
|
-(int) getNumBrushFaces
|
||||||
|
|
|
@ -429,7 +429,7 @@ drawSelf
|
||||||
===============================================================================
|
===============================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
-drawRect: (NSRect) rect
|
- (void) drawRect: (NSRect) rect
|
||||||
{
|
{
|
||||||
//NSRect visRect;
|
//NSRect visRect;
|
||||||
//Sys_Printf("ZView:drawRect\n");
|
//Sys_Printf("ZView:drawRect\n");
|
||||||
|
@ -456,8 +456,6 @@ drawSelf
|
||||||
|
|
||||||
// possibly resize the view
|
// possibly resize the view
|
||||||
[self newRealBounds];
|
[self newRealBounds];
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -465,7 +463,7 @@ drawSelf
|
||||||
XYDrawSelf
|
XYDrawSelf
|
||||||
==============
|
==============
|
||||||
*/
|
*/
|
||||||
-XYDrawSelf
|
- (void) XYDrawSelf
|
||||||
{
|
{
|
||||||
NSBezierPath *path;
|
NSBezierPath *path;
|
||||||
NSAffineTransform *trans;
|
NSAffineTransform *trans;
|
||||||
|
@ -479,8 +477,6 @@ XYDrawSelf
|
||||||
[path transformUsingAffineTransform: trans];
|
[path transformUsingAffineTransform: trans];
|
||||||
[path stroke];
|
[path stroke];
|
||||||
[path release];
|
[path release];
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue