tactical whitespace bomb

Add return-type information to all methods, split up lines properly where
I could find them, and ran the whole thing through uncrustify. Looks purty
now. :)
This commit is contained in:
Jeff Teunissen 2010-09-29 16:09:11 -04:00 committed by Bill Currie
parent a4eec40843
commit 0e5cd14829
47 changed files with 3544 additions and 3602 deletions

View file

@ -41,36 +41,36 @@ extern BOOL timedrawing;
// UI links
id mode_radio_i;
}
-setXYOrigin:(NSPoint *) pt;
-setZOrigin:(float) pt;
- (id) setXYOrigin: (NSPoint *)pt;
- (id) setZOrigin: (float)pt;
-setOrigin:(vec3_t)
org
- (id) setOrigin: (vec3_t)org
angle: (float)angle;
-getOrigin:(vec3_t)org;
- (id) getOrigin: (vec3_t)org;
- (float) yawAngle;
-matrixFromAngles;
-_keyDown:(NSEvent *)theEvent;
- (id) matrixFromAngles;
- (id) _keyDown: (NSEvent *)theEvent;
-drawMode:sender;
-setDrawMode:(drawmode_t) mode;
- (id) drawMode: sender;
- (id) setDrawMode: (drawmode_t)mode;
-homeView:sender;
- (id) homeView: sender;
- (void) XYDrawSelf; // 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 // return YES if brush handled
flags: (int)flags;
-(BOOL) ZmouseDown:(NSPoint *)pt flags:(int)flags;// return YES if brush handled
- (BOOL) ZmouseDown: (NSPoint *)pt // return YES if brush handled
flags: (int)flags;
-upFloor:sender;
-downFloor:sender;
- (id) upFloor: sender;
- (id) downFloor: sender;
@end
#endif // CameraView_h

View file

@ -1,5 +1,6 @@
#include "QF/sys.h"
#import <AppKit/NSEvent.h>
#include "CameraView.h"
#include "Map.h"
#include "QuakeEd.h"
@ -17,7 +18,7 @@ BOOL timedrawing = 0;
initWithFrame:
==================
*/
- initWithFrame:(NSRect)frameRect
- (id) initWithFrame: (NSRect)frameRect
{
int size;
@ -77,20 +78,21 @@ initWithFrame:
[path relativeLineToPoint: NSMakePoint (45, -45)];
}
-setXYOrigin:(NSPoint *)pt
- (id) setXYOrigin: (NSPoint *)pt
{
origin[0] = pt->x;
origin[1] = pt->y;
return self;
}
-setZOrigin:(float)pt
- (id) setZOrigin: (float)pt
{
origin[2] = pt;
return self;
}
-setOrigin:(vec3_t)org angle:(float)angle
- (id) setOrigin: (vec3_t)org
angle: (float)angle
{
VectorCopy (org, origin);
ya = angle;
@ -98,7 +100,7 @@ initWithFrame:
return self;
}
-getOrigin:(vec3_t)org
- (id) getOrigin: (vec3_t)org
{
VectorCopy (origin, org);
return self;
@ -109,7 +111,7 @@ initWithFrame:
return ya;
}
-upFloor:sender
- (id) upFloor: sender
{
sb_floor_dir = 1;
sb_floor_dist = 99999;
@ -124,7 +126,7 @@ initWithFrame:
return self;
}
-downFloor:sender
- (id) downFloor: sender
{
sb_floor_dir = -1;
sb_floor_dist = -99999;
@ -152,7 +154,7 @@ UI TARGETS
homeView
============
*/
-homeView:sender
- (id) homeView: sender
{
xa = za = 0;
@ -165,14 +167,14 @@ homeView
return self;
}
-drawMode:sender
- (id) drawMode: sender
{
drawmode = [sender selectedColumn];
[quakeed_i updateCamera];
return self;
}
-setDrawMode:(drawmode_t)mode
- (id) setDrawMode: (drawmode_t)mode
{
drawmode = mode;
[mode_radio_i selectCellAtRow: 0 column: mode];
@ -188,7 +190,7 @@ TRANSFORMATION METHODS
===============================================================================
*/
-matrixFromAngles
- (id) matrixFromAngles
{
if (xa > M_PI * 0.4)
xa = M_PI * 0.4;
@ -211,16 +213,17 @@ TRANSFORMATION METHODS
return self;
}
-inverseTransform:(vec_t *)invec to:(vec_t *)outvec
- (id) inverseTransform: (vec_t *)invec
to: (vec_t *)outvec
{
vec3_t inverse[3];
vec3_t temp;
int i, j;
for (i = 0; i < 3; i++)
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++)
inverse[i][j] = matrix[j][i];
}
temp[0] = DotProduct (invec, inverse[0]);
temp[1] = DotProduct (invec, inverse[1]);
@ -231,8 +234,6 @@ TRANSFORMATION METHODS
return self;
}
/*
===============================================================================
@ -302,7 +303,6 @@ MakeCampt (vec3_t in, campt_t * pt)
pt->screen[1] = mid_y + pt->trans[1] * scale;
}
void
CameraMoveto (vec3_t p)
{
@ -314,8 +314,7 @@ CameraMoveto (vec3_t p)
pt = &campts[cam_cur];
cam_cur ^= 1;
MakeCampt (p, pt);
if (!pt->clipflags) {
// onscreen, so move there immediately
if (!pt->clipflags) { // onscreen, so move there immediately
NSPoint point = {pt->screen[0], pt->screen[1]};
[path moveToPoint: point];
}
@ -330,8 +329,7 @@ ClipLine (vec3_t p1, vec3_t p2, int planenum)
float scale;
NSPoint point;
if (planenum == 5) {
// draw it!
if (planenum == 5) { // draw it!
scale = mid_x / p1[2];
point.x = mid_x + p1[0] * scale;
point.y = mid_y + p1[1] * scale;
@ -348,9 +346,8 @@ ClipLine (vec3_t p1, vec3_t p2, int planenum)
d = DotProduct (p1, pl->normal) - pl->dist;
d2 = DotProduct (p2, pl->normal) - pl->dist;
if (d <= ON_EPSILON && d2 <= ON_EPSILON) { // off screen
if (d <= ON_EPSILON && d2 <= ON_EPSILON) // off screen
return;
}
if (d >= 0 && d2 >= 0) { // on front
ClipLine (p1, p2, planenum + 1);
@ -381,34 +378,34 @@ CameraLineto (vec3_t p)
p1 = &campts[cam_cur];
MakeCampt (p, p2);
if (p1->clipflags & p2->clipflags) {
if (p1->clipflags & p2->clipflags) { // entirely off screen
c_off++;
return; // entirely off screen
return;
}
bits = p1->clipflags | p2->clipflags;
if (!bits) {
if (!bits) { // entirely on screen
NSPoint point1 = {p1->screen[0], p1->screen[1]};
NSPoint point2 = {p2->screen[0], p2->screen[1]};
c_on++;
[path moveToPoint: point1];
[path lineToPoint: point2];
return; // entirely on screen
return;
}
// needs to be clipped
c_clip++;
ClipLine (p1->trans, p2->trans, 0);
}
/*
=============
drawSolid
=============
*/
-drawSolid
- (id) drawSolid
{
unsigned char *planes[5];
@ -442,23 +439,19 @@ drawSolid
planes[0] = (unsigned char *) imagebuffer;
NSDrawBitmap (_bounds, r_width, r_height, 8, 3, 32, r_width * 4, NO, NO,
NSCalibratedRGBColorSpace,
(const unsigned char **) planes);
NSCalibratedRGBColorSpace, (const unsigned char **) planes);
[[self window] setBackingType: NSBackingStoreBuffered];
return self;
}
/*
===================
drawWire
===================
*/
-drawWire:(NSRect)rect
- (id) drawWire: (NSRect)rect
{
// copy current info to globals for the C callbacks
mid_x = _bounds.size.width / 2;
@ -513,7 +506,6 @@ drawSelf
}
}
/*
=============
XYDrawSelf
@ -563,7 +555,6 @@ ZDrawSelf
[path release];
}
/*
===============================================================================
@ -577,10 +568,15 @@ ZDrawSelf
modalMoveLoop
================
*/
-modalMoveLoop:(NSPoint *)basept :(vec3_t)movemod :converter
- (id) modalMoveLoop: (NSPoint *)basept
: (vec3_t)movemod
: converter
{
vec3_t originbase;
NSEvent *event = 0;
unsigned eventMask = (NSLeftMouseUpMask | NSLeftMouseDraggedMask
| NSRightMouseUpMask | NSRightMouseDraggedMask
| NSApplicationDefinedMask);
NSPoint newpt;
vec3_t delta;
int i;
@ -616,9 +612,9 @@ modalMoveLoop
[ent origin: temp];
brushpt.x = temp[0];
brushpt.y = temp[1];
} else
} else {
brushpt = [brush_i centerPoint];
ya = atan2 (brushpt.y - newpt.y, brushpt.x - newpt.x);
} ya = atan2 (brushpt.y - newpt.y, brushpt.x - newpt.x);
[self matrixFromAngles];
}
#endif
@ -627,17 +623,15 @@ modalMoveLoop
// instance draw new frame
[quakeed_i newinstance];
[self display];
event = [NSApp nextEventMatchingMask: NSLeftMouseUpMask
| NSLeftMouseDraggedMask | NSRightMouseUpMask
| NSRightMouseDraggedMask | NSApplicationDefinedMask
event = [NSApp nextEventMatchingMask: eventMask
untilDate: [NSDate distantFuture]
inMode: NSEventTrackingRunLoopMode dequeue: YES];
inMode: NSEventTrackingRunLoopMode dequeue:
YES];
if ([event type] == NSKeyDown) {
[self _keyDown: event];
[self display];
goto drawentry;
}
}
return self;
@ -650,7 +644,8 @@ modalMoveLoop
XYmouseDown
===============
*/
-(BOOL) XYmouseDown:(NSPoint *)pt flags:(int)flags
- (BOOL) XYmouseDown: (NSPoint *)pt
flags: (int)flags
// return YES if brush handled
{
vec3_t movemod;
@ -676,13 +671,13 @@ XYmouseDown
return YES;
}
/*
===============
ZmouseDown
===============
*/
-(BOOL) ZmouseDown:(NSPoint *)pt flags:(int)flags
- (BOOL) ZmouseDown: (NSPoint *)pt
flags: (int)flags
// return YES if brush handled
{
vec3_t movemod;
@ -699,7 +694,6 @@ ZmouseDown
return YES;
}
// =============================================================================
/*
@ -707,7 +701,7 @@ ZmouseDown
viewDrag:
===================
*/
-viewDrag:(NSPoint *)pt
- (id) viewDrag: (NSPoint *)pt
{
float dx, dy;
NSEvent *event = 0;
@ -740,19 +734,18 @@ viewDrag:
event = [NSApp nextEventMatchingMask: NSRightMouseUpMask
| NSRightMouseDraggedMask
untilDate: [NSDate distantFuture]
inMode: NSEventTrackingRunLoopMode dequeue: YES];
inMode: NSEventTrackingRunLoopMode dequeue:
YES];
if ([event type] == NSKeyDown) {
[self _keyDown: event];
[self display];
goto drawentry;
}
}
return self;
}
// =============================================================================
/*
@ -776,9 +769,10 @@ mouseDown
forward = 160;
right = pt.x - 160;
up = pt.y - 240 * 2 / 3;
for (i = 0; i < 3; i++)
for (i = 0; i < 3; i++) {
p2[i] =
forward * matrix[2][i] + up * matrix[1][i] + right * matrix[0][i];
}
for (i = 0; i < 3; i++)
p2[i] = p1[i] + 100 * p2[i];
@ -835,7 +829,6 @@ mouseDown
return;
}
Sys_Printf ("bad flags for click %x\n", flags);
NopSound ();
@ -856,9 +849,9 @@ rightMouseDown
[self convertPoint: pt fromView: NULL];
flags =
[theEvent modifierFlags] & (NSShiftKeyMask | NSControlKeyMask |
NSAlternateKeyMask | NSCommandKeyMask);
flags = [theEvent modifierFlags]
& (NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask
| NSCommandKeyMask);
//
// click = drag camera
@ -881,11 +874,10 @@ keyDown
===============
*/
-_keyDown:(NSEvent *)theEvent
- (id) _keyDown: (NSEvent *)theEvent
{
NSString *chars = [theEvent characters];
unichar c = [chars length] == 1 ? [chars characterAtIndex: 0] : '\0';
unichar c = ([chars length] == 1) ? [chars characterAtIndex: 0] : '\0';
switch (c) {
case 13:
@ -952,12 +944,9 @@ keyDown
origin[2] -= move;
[quakeed_i updateCamera];
break;
}
} /* switch */
return self;
}
@end

View file

@ -17,10 +17,10 @@ extern id clipper_i;
}
- (BOOL) hide;
-XYClick:(NSPoint) pt;
- (id) XYClick: (NSPoint)pt;
- (BOOL) XYDrag: (NSPoint *)pt;
-ZClick:(NSPoint) pt;
-carve;
- (id) ZClick: (NSPoint)pt;
- (id) carve;
- (void) flipNormal;
- (BOOL) getFace: (face_t *)pl;

View file

@ -12,7 +12,7 @@ extern NSBezierPath *path;
@implementation Clipper
-init
- (id) init
{
[super init];
clipper_i = self;
@ -82,7 +82,7 @@ extern NSBezierPath *path;
XYClick
================
*/
-XYClick:(NSPoint) pt
- (id) XYClick: (NSPoint)pt
{
int i;
vec3_t new;
@ -103,7 +103,6 @@ XYClick
}
}
if (num == 3)
num = 0;
@ -126,15 +125,13 @@ XYDrag
for (i = 0; i < 3; i++) {
if (fabs (pt->x - pos[i][0] > 10) || fabs (pt->y - pos[i][1] > 10))
continue;
// drag this point
continue; // drag this point
}
return NO;
}
-ZClick:(NSPoint) pt
- (id) ZClick: (NSPoint)pt
{
return self;
}
@ -148,7 +145,6 @@ XYDrag
return self;
}
- (void) cameraDrawSelf
{
vec3_t mid;
@ -191,8 +187,8 @@ XYDrag
[s drawAtPoint: NSMakePoint (pos[i][0] - 4, pos[i][1] - 4)
withAttributes: attribs];
// [path moveToPoint: NSMakePoint (pos[i][0] - 4, pos[i][1] - 4)];
[path appendBezierPathWithArcWithCenter: NSMakePoint (pos[i][0],
pos[i][1])
[path
appendBezierPathWithArcWithCenter: NSMakePoint (pos[i][0], pos[i][1])
radius: 10
startAngle: 0
endAngle: 360];
@ -205,9 +201,7 @@ XYDrag
int i;
NSMutableDictionary *attribs = [NSMutableDictionary dictionary];
[[NSColor colorWithCalibratedRed: 1.0 green: 0.5 blue: 0.0 alpha: 1.0]
set];
[[NSColor colorWithCalibratedRed: 1. green: 0.5 blue: 0. alpha: 1.] set];
[[NSFont systemFontOfSize: 10 / [xyview_i currentScale]] set];
[path removeAllPoints];
@ -216,8 +210,8 @@ XYDrag
[s drawAtPoint: NSMakePoint (-28 + i * 8 - 4, pos[i][2] - 4)
withAttributes: attribs];
// [path moveToPoint: NSMakePoint (pos[i][0] - 4, pos[i][1] - 4)];
[path appendBezierPathWithArcWithCenter: NSMakePoint (-28 + i * 8,
pos[i][2])
[path
appendBezierPathWithArcWithCenter: NSMakePoint (-28 + i * 8, pos[i][2])
radius: 10
startAngle: 0
endAngle: 360];

View file

@ -14,29 +14,29 @@ typedef struct {
{
}
-initFromFile:(FILE *) fp;
- (id) initFromFile: (FILE *)fp;
- (id) parseMultipleFrom: (const char *)value;
- (int) getValueUnits: (const char *)key;
-delString:(const char *)string fromValue:(const char *) key;
- (id) delString: (const char *)string fromValue: (const char *)key;
-addString:(const char *)string toValue:(const char *) key;
- (id) addString: (const char *)string toValue: (const char *)key;
- (char *) convertListToString: (id)list;
- (const char *) getStringFor: (const char *)name;
-removeKeyword:(const char *) key;
- (id) removeKeyword: (const char *)key;
- (unsigned int) getValueFor: (const char *)name;
-changeStringFor:(const char *)key to:(const char *) value;
- (id) changeStringFor: (const char *)key to: (const char *)value;
- (dict_t *) findKeyword: (const char *)key;
-writeBlockTo:(FILE *) fp;
-writeFile:(const char *) path;
- (id) writeBlockTo: (FILE *)fp;
- (id) writeFile: (const char *)path;
// INTERNAL
-init;
- (id) init;
- (id) parseBraceBlock: (FILE *)fp;
-setupMultiple:(const char *) value;
- (id) setupMultiple: (const char *)value;
- (char *) getNextParameter;
@end

View file

@ -5,14 +5,14 @@
@implementation Dict
-init
- (id) init
{
[super initCount: 0 elementSize: sizeof (dict_t)
description: NULL];
return self;
}
-print
- (id) print
{
NSUInteger i;
dict_t *d;
@ -31,7 +31,7 @@ copyFromZone
JDC
===========
*/
-copy
- (id) copy
{
id new;
NSUInteger i;
@ -53,7 +53,7 @@ JDC
return new;
}
-initFromFile:(FILE *) fp
- (id) initFromFile: (FILE *)fp
{
[self init];
return [self parseBraceBlock: fp];
@ -68,7 +68,7 @@ JDC
//
// Write a { } block out to a FILE*
//
-writeBlockTo:(FILE *) fp
- (id) writeBlockTo: (FILE *)fp
{
int max;
int i;
@ -88,7 +88,7 @@ JDC
//
// Write a single { } block out
//
-writeFile:(const char *) path
- (id) writeFile: (const char *)path
{
FILE *fp;
@ -135,7 +135,7 @@ JDC
//
// Change a keyword's string
//
-changeStringFor:(const char *) key to:(const char *) value
- (id) changeStringFor: (const char *)key to: (const char *)value
{
dict_t *d;
dict_t newd;
@ -165,7 +165,6 @@ JDC
d = [self findKeyword: name];
if (d != NULL)
return d->value;
return (char *) "";
}
@ -179,7 +178,6 @@ JDC
d = [self findKeyword: name];
if (d != NULL)
return atol (d->value);
return 0;
}
@ -222,7 +220,7 @@ JDC
//
// JDC: I wrote this to simplify removing vectors
//
-removeKeyword:(const char *) key
- (id) removeKeyword: (const char *)key
{
dict_t *d;
@ -236,7 +234,7 @@ JDC
//
// Delete string from keyword's value
//
-delString:(const char *) string fromValue:(const char *) key
- (id) delString: (const char *)string fromValue: (const char *)key
{
id temp;
int count;
@ -266,7 +264,7 @@ JDC
//
// Add string to keyword's value
//
-addString:(const char *) string toValue:(const char *) key
- (id) addString: (const char *)string toValue: (const char *)key
{
char *newstr;
dict_t *d;
@ -289,7 +287,7 @@ JDC
const char *searchStr;
char item[4096];
-setupMultiple:(const char *) value
- (id) setupMultiple: (const char *)value
{
searchStr = value;
return self;
@ -303,9 +301,9 @@ char item[4096];
return NULL;
strcpy (item, searchStr);
s = FindWhitespcInBuffer (item);
if (!*s)
if (!*s) {
searchStr = NULL;
else {
} else {
*s = 0;
searchStr = FindNonwhitespcInBuffer (s + 1);
}
@ -325,7 +323,6 @@ char item[4096];
s = [self getStringFor: key];
if (s == NULL)
return NULL;
stuff = [[Storage alloc]
initCount: 0 elementSize: ITEMSIZE description: NULL];
@ -357,23 +354,25 @@ char item[4096];
c = FindBrace (fp);
if (c == -1)
return NULL;
while ((c = FindBrace (fp)) != '}') {
if (c == -1)
return NULL;
// c = FindNonwhitespc(fp);
// if (c == -1)
// return NULL;
// CopyUntilWhitespc(fp,string);
#if 0
c = FindNonwhitespc (fp);
if (c == -1)
return NULL;
CopyUntilWhitespc (fp, string);
#endif
// JDC: fixed to allow quoted keys
c = FindNonwhitespc (fp);
if (c == -1)
return NULL;
c = fgetc (fp);
if (c == '\"')
if (c == '\"') {
CopyUntilQuote (fp, string);
else {
} else {
ungetc (c, fp);
CopyUntilWhitespc (fp, string);
}
@ -394,6 +393,7 @@ char item[4096];
}
@end
// ===============================================
//
// C routines for string parsing
@ -408,15 +408,18 @@ GetNextChar (FILE * fp)
c = getc (fp);
if (c == EOF)
return -1;
if (c == '/') // parse comments
{
if (c == '/') { // parse comments
c2 = getc (fp);
if (c2 == '/') {
while ((c2 = getc (fp)) != '\n');
while ((c2 = getc (fp)) != '\n')
;
c = getc (fp);
} else
} else {
ungetc (c2, fp);
}
}
return c;
}
@ -430,6 +433,7 @@ CopyUntilWhitespc (FILE * fp, char *buffer)
c = GetNextChar (fp);
if (c == EOF)
return;
if (c <= ' ') {
*buffer = 0;
return;
@ -448,10 +452,12 @@ CopyUntilQuote (FILE * fp, char *buffer)
c = GetNextChar (fp);
if (c == EOF)
return;
if (c == '\"') {
*buffer = 0;
return;
}
*buffer++ = c;
}
}
@ -466,6 +472,7 @@ FindBrace (FILE * fp)
c = GetNextChar (fp);
if (c == EOF)
return -1;
if (c == '{' || c == '}')
return c;
}
@ -480,8 +487,10 @@ FindQuote (FILE * fp)
while (count--) {
c = GetNextChar (fp);
if (c == EOF)
return -1;
if (c == '\"')
return c;
}
@ -530,11 +539,12 @@ FindWhitespcInBuffer (char *buffer)
int count = 1000;
char *b = buffer;
while (count--)
while (count--) {
if (*b <= ' ')
return b;
else
b++;
}
return NULL;
}
@ -544,10 +554,11 @@ FindNonwhitespcInBuffer (char *buffer)
int count = 1000;
char *b = buffer;
while (count--)
while (count--) {
if (*b > ' ')
return b;
else
b++;
}
return NULL;
}

View file

@ -8,8 +8,8 @@
NSMutableArray *array;
}
-initListFromFile:(FILE *) fp;
-writeListFile:(const char *) filename;
- (id) initListFromFile: (FILE *)fp;
- (id) writeListFile: (const char *)filename;
- (id) findDictKeyword: (const char *)key;
@end

View file

@ -1,4 +1,3 @@
#include "DictList.h"
#include "Dict.h"
@ -9,7 +8,7 @@
//
// Read in variable # of objects from FILE *
//
- initListFromFile:(FILE *) fp
- (id) initListFromFile: (FILE *)fp
{
id d;
@ -28,7 +27,7 @@
//
// Write out list file
//
-writeListFile:(const char *) filename
- (id) writeListFile: (const char *)filename
{
FILE *fp;
NSUInteger i;
@ -37,7 +36,6 @@
fp = fopen (filename, "w+t");
if (fp == NULL)
return NULL;
fprintf (fp, "// Object List written by QuakeEd\n");
for (i = 0; i < [self count]; i++) {

View file

@ -18,7 +18,7 @@
vec3_t bad_mins = {-8, -8, -8};
vec3_t bad_maxs = {8, 8, 8};
-createFixedBrush:(vec3_t) org
- (id) createFixedBrush: (vec3_t)org
{
vec3_t emins, emaxs;
float *v, *v2, *color;
@ -78,14 +78,15 @@ vec3_t bad_maxs = { 8, 8, 8 };
v = [new mins];
[[map_i selectedBrush] getMins: min maxs: max];
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 createFixedBrush: min];
} else
} else {
modifiable = YES;
}
return self;
}
@ -119,22 +120,23 @@ vec3_t bad_maxs = { 8, 8, 8 };
[super removeObject: o];
if ([self count])
return;
// the entity is empty, so remove the entire thing
if (self ==[map_i objectAtIndex:0])
return; // never remove the world
if (self == [map_i objectAtIndex: 0]) // unless it's the world...
return;
[map_i removeObject: self];
[self release];
}
- (const char *) valueForQKey: (const char *)k
{
epair_t *e;
for (e = epairs; e; e = e->next)
for (e = epairs; e; e = e->next) {
if (!strcmp (k, e->key))
return e->value;
}
return "";
}
@ -144,13 +146,12 @@ vec3_t bad_maxs = { 8, 8, 8 };
const char *c;
c = [self valueForQKey: k];
v[0] = v[1] = v[2] = 0;
sscanf (c, "%f %f %f", &v[0], &v[1], &v[2]);
}
-print
- (id) print
{
epair_t *e;
@ -167,8 +168,10 @@ vec3_t bad_maxs = { 8, 8, 8 };
while (*k && *k <= ' ')
k++;
// don't set NULL values
if (!*k)
return; // don't set NULL values
return;
for (e = epairs; e; e = e->next) {
if (!strcmp (k, e->key)) {
@ -193,6 +196,7 @@ vec3_t bad_maxs = { 8, 8, 8 };
i = 0;
for (e = epairs; e; e = e->next)
i++;
return i;
}
@ -228,7 +232,6 @@ vec3_t bad_maxs = { 8, 8, 8 };
return;
}
/*
=============
targetname
@ -332,15 +335,18 @@ int nument;
}
if (![self count] && esize == esize_model) {
printf ("WARNING:Entity with no brushes and esize_model: %s\n", [self valueForQKey:"classname"]);
printf ("WARNING:Entity with no brushes and esize_model: %s\n",
[self valueForQKey: "classname"]);
[texturepalette_i getTextureDef: &td];
for (i = 0; i < 3; i++) {
emins[i] = org[i] - 8;
emaxs[i] = org[i] + 8;
}
brush =[[SetBrush alloc] initOwner: self mins: emins maxs: emaxs texture:&td];
brush =
[[SetBrush alloc] initOwner: self mins: emins maxs: emaxs texture: &td];
[self addObject: brush];
}
// create a brush if needed
if (esize == esize_fixed)
[self createFixedBrush: org];
@ -359,7 +365,6 @@ int nument;
return self;
}
- (void) writeToFILE: (FILE *)f
region: (BOOL)reg;
{

View file

@ -19,7 +19,7 @@ typedef enum { esize_model, esize_fixed } esize_t;
char *flagnames[MAX_FLAGS];
}
-initFromText:(const char *)text source:(const char *) filename;
- (id) initFromText: (const char *)text source: (const char *)filename;
- (const char *) classname;
- (esize_t) esize;
@ -38,7 +38,7 @@ typedef enum { esize_model, esize_fixed } esize_t;
char *source_path;
}
-initForSourceDirectory:(const char *) path;
- (id) initForSourceDirectory: (const char *)path;
- (id) classForName: (const char *)name;
- (void) scanDirectory;

View file

@ -18,11 +18,9 @@ parse_vector (script_t * script, vec3_t vec)
return 0;
if (strcmp (Script_Token (script), "("))
return 0;
r = sscanf (script->p, "%f %f %f)", &vec[0], &vec[1], &vec[2]);
if (r != 3)
return 0;
while (strcmp (Script_Token (script), ")")) {
if (!Script_GetToken (script, 0))
return 0;
@ -38,9 +36,10 @@ parse_vector (script_t * script, vec3_t vec)
//
// Flag names can follow the size description:
//
// /*QUAKED func_door (0 .5 .8) ? START_OPEN STONE_SOUND DOOR_DONT_LINK GOLD_KEY SILVER_KEY
// /*QUAKED func_door (0 .5 .8) ? START_OPEN STONE_SOUND DOOR_DONT_LINK GOLD_KEY
// SILVER_KEY
-initFromText:(const char *) text source:(const char *) filename
- (id) initFromText: (const char *)text source: (const char *)filename
{
const char *t;
size_t len;
@ -80,7 +79,6 @@ parse_vector (script_t * script, vec3_t vec)
} else {
return 0;
}
// get the flags
// any remaining words on the line are parm flags
for (i = 0; i < MAX_FLAGS; i++) {
@ -135,7 +133,6 @@ parse_vector (script_t * script, vec3_t vec)
return comments;
}
- (const char *) flagName: (unsigned)flagnum
{
if (flagnum >= MAX_FLAGS)
@ -170,7 +167,6 @@ insertEC:
[self addObject: ec];
}
/*
=================
scanFile
@ -199,7 +195,8 @@ scanFile
line = 1;
for (i = 0; i < size; i++) {
if (!strncmp (data + i, "/*QUAKED", 8)) {
cl =[[EntityClass alloc] initFromText:(data + i)
cl = [[EntityClass alloc]
initFromText: (data + i)
source: va ("%s:%d", filename, line)];
if (cl)
[self insertEC: cl];
@ -211,7 +208,6 @@ scanFile
free (data);
}
/*
=================
scanDirectory
@ -238,11 +234,9 @@ scanDirectory
}
}
id entity_classes_i;
-initForSourceDirectory:(const char *) path
- (id) initForSourceDirectory: (const char *)path
{
self = [super init];
array = [[NSMutableArray alloc] init];
@ -253,9 +247,8 @@ id entity_classes_i;
entity_classes_i = self;
nullclass = [[EntityClass alloc]
initFromText: "/*QUAKED UNKNOWN_CLASS (0 0.5 0) ?*/" source:va ("%s:%d", __FILE__,
__LINE__ -
1)];
initFromText: "/*QUAKED UNKNOWN_CLASS (0 0.5 0) ?*/"
source: va ("%s:%d", __FILE__, __LINE__ - 1)];
return self;
}
@ -274,5 +267,4 @@ id entity_classes_i;
return nullclass;
}
@end

View file

@ -100,10 +100,8 @@ InspectorControl *inspcontrol_i;
NSRect r;
NSRect f;
if (which == currentInspectorType) {
if (which == currentInspectorType)
return;
}
currentInspectorType = which;
newView = [contentList objectAtIndex: which];

View file

@ -9,7 +9,7 @@ extern id keypairview_i;
{
}
-calcViewSize;
- (id) calcViewSize;
#define SPACING 4
#define FONTSIZE 12

View file

@ -1,4 +1,3 @@
#include "KeypairView.h"
#include "Map.h"
#include "Entity.h"
@ -12,7 +11,7 @@ id keypairview_i;
initWithFrame:
==================
*/
- initWithFrame:(NSRect) frameRect
- (id) initWithFrame: (NSRect)frameRect
{
[super initWithFrame: frameRect];
keypairview_i = self;
@ -24,8 +23,7 @@ initWithFrame:
return YES;
}
-calcViewSize
- (id) calcViewSize
{
NSRect b;
NSPoint pt;
@ -43,7 +41,7 @@ initWithFrame:
return self;
}
-drawRect: (NSRect) rects
- (id) drawRect: (NSRect)rects
{
epair_t *pair;
int y;
@ -60,6 +58,7 @@ initWithFrame:
for ( ; pair; pair = pair->next) {
NSString *key = [NSString stringWithCString: pair->key];
NSString *value = [NSString stringWithCString: pair->value];
[key drawAtPoint: NSMakePoint (SPACING, y) withAttributes: attribs];
[value drawAtPoint: NSMakePoint (100, y) withAttributes: attribs];
y -= LINEHEIGHT;

View file

@ -17,60 +17,60 @@ extern id map_i;
float minz, maxz;
}
-newMap;
- (id) newMap;
-writeStats;
- (id) writeStats;
-readMapFile:(const char *) fname;
-writeMapFile:(const char *)fname useRegion:(BOOL) reg;
- (id) readMapFile: (const char *)fname;
- (id) writeMapFile: (const char *)fname useRegion: (BOOL)reg;
-entityConnect: (vec3_t) p1:(vec3_t) p2;
- (id) entityConnect: (vec3_t)p1: (vec3_t)p2;
-selectRay: (vec3_t) p1: (vec3_t) p2:(BOOL) ef;
-grabRay: (vec3_t) p1:(vec3_t) p2;
-setTextureRay: (vec3_t) p1: (vec3_t) p2:(BOOL) allsides;
-getTextureRay: (vec3_t) p1:(vec3_t) p2;
- (id) selectRay: (vec3_t)p1: (vec3_t)p2: (BOOL)ef;
- (id) grabRay: (vec3_t)p1: (vec3_t)p2;
- (id) setTextureRay: (vec3_t)p1: (vec3_t)p2: (BOOL)allsides;
- (id) getTextureRay: (vec3_t)p1: (vec3_t)p2;
-currentEntity;
-setCurrentEntity:ent;
- (id) currentEntity;
- (id) setCurrentEntity: ent;
- (float) currentMinZ;
-setCurrentMinZ:(float) m;
- (id) setCurrentMinZ: (float)m;
- (float) currentMaxZ;
-setCurrentMaxZ:(float) m;
- (id) setCurrentMaxZ: (float)m;
- (int) numSelected;
-selectedBrush; // returns the first selected brush
- (id) selectedBrush; // returns the first selected brush
//
// operations on current selection
//
-makeSelectedPerform:(SEL) sel;
-makeUnselectedPerform:(SEL) sel;
-makeAllPerform:(SEL) sel;
-makeGlobalPerform:(SEL) sel; // in and out of region
- (id) makeSelectedPerform: (SEL)sel;
- (id) makeUnselectedPerform: (SEL)sel;
- (id) makeAllPerform: (SEL)sel;
- (id) makeGlobalPerform: (SEL)sel; // in and out of region
-cloneSelection:sender;
- (id) cloneSelection: sender;
-makeEntity:sender;
- (id) makeEntity: sender;
-subtractSelection:sender;
- (id) subtractSelection: sender;
-selectCompletelyInside:sender;
-selectPartiallyInside:sender;
- (id) selectCompletelyInside: sender;
- (id) selectPartiallyInside: sender;
-tallBrush:sender;
-shortBrush:sender;
- (id) tallBrush: sender;
- (id) shortBrush: sender;
-rotate_x:sender;
-rotate_y:sender;
-rotate_z:sender;
- (id) rotate_x: sender;
- (id) rotate_y: sender;
- (id) rotate_z: sender;
-flip_x:sender;
-flip_y:sender;
-flip_z:sender;
- (id) flip_x: sender;
- (id) flip_y: sender;
- (id) flip_z: sender;
-selectCompleteEntity:sender;
- (id) selectCompleteEntity: sender;
@end

View file

@ -1,4 +1,3 @@
#include <sys/time.h>
#include <time.h>
@ -30,7 +29,7 @@ FILE METHODS
===============================================================================
*/
- init
- (id) init
{
self = [super init];
array = [[NSMutableArray alloc] init];
@ -43,7 +42,7 @@ FILE METHODS
return self;
}
-saveSelected
- (id) saveSelected
{
int i, c;
id o, w;
@ -56,10 +55,9 @@ FILE METHODS
o = [w objectAtIndex: 0];
if ([o selected])
[o moveToEntity];
else {
else
[w removeObjectAtIndex: 0];
}
}
c = [self count];
for (i = 0; i < c; i++) {
@ -71,7 +69,7 @@ FILE METHODS
return self;
}
-addSelected
- (id) addSelected
{
int i, c;
id n, w;
@ -91,8 +89,7 @@ FILE METHODS
return self;
}
-newMap
- (id) newMap
{
id ent;
@ -106,12 +103,12 @@ FILE METHODS
return self;
}
-currentEntity
- (id) currentEntity
{
return currentEntity;
}
-setCurrentEntity:ent
- (id) setCurrentEntity: ent
{
id old;
@ -131,13 +128,15 @@ FILE METHODS
grid = [xyview_i gridsize];
minz = grid * rint (minz / grid);
return minz;
}
-setCurrentMinZ:(float) m
- (id) setCurrentMinZ: (float)m
{
if (m > -2048)
minz = m;
return self;
}
@ -145,20 +144,23 @@ FILE METHODS
{
float grid;
[self currentMinZ]; // grid align
[self currentMinZ];
// grid align
grid = [xyview_i gridsize];
maxz = grid * rint (maxz / grid);
if (maxz <= minz)
maxz = minz + grid;
return maxz;
}
-setCurrentMaxZ:(float) m
- (id) setCurrentMaxZ: (float)m
{
if (m < 2048)
maxz = m;
return self;
}
@ -166,15 +168,14 @@ FILE METHODS
{
[super removeObject: o];
if (o == currentEntity) { // select the world
if (o == currentEntity) // select the world
[self setCurrentEntity: [self objectAtIndex: 0]];
}
return;
}
#define FN_DEVLOG "/qcache/devlog"
-writeStats
- (id) writeStats
{
FILE *f;
extern int c_updateall;
@ -197,32 +198,33 @@ FILE METHODS
num = 0;
c = [currentEntity count];
for (i = 0; i < c; i++)
for (i = 0; i < c; i++) {
if ([[currentEntity objectAtIndex: i] selected])
num++;
}
return num;
}
-selectedBrush
- (id) selectedBrush
{
int i, c;
int num;
num = 0;
c = [currentEntity count];
for (i = 0; i < c; i++)
for (i = 0; i < c; i++) {
if ([[currentEntity objectAtIndex: i] selected])
return [currentEntity objectAtIndex: i];
}
return nil;
}
/*
=================
readMapFile
=================
*/
-readMapFile:(const char *) fname
- (id) readMapFile: (const char *)fname
{
char *dat;
const char *wad, *cl;
@ -265,15 +267,15 @@ readMapFile
// load the apropriate texture wad
wad = [currentEntity valueForQKey: "wad"];
if (wad && wad[0]) {
if (wad[0] == '/') // remove old style fullpaths
// remove old style fullpaths
if (wad[0] == '/')
[currentEntity removeKeyPair: "wad"];
else {
if (strcmp ([texturepalette_i currentWad], wad))
else if (strcmp ([texturepalette_i currentWad], wad))
[project_i setTextureWad: wad];
}
}
[self setCurrentEntity: [self objectAtIndex: 0]];
// center the camera and XY view on the playerstart
c = [self count];
for (i = 1; i < c; i++) {
@ -297,8 +299,8 @@ readMapFile
writeMapFile
=================
*/
-writeMapFile:(const char *)
fname useRegion:(BOOL) reg
- (id) writeMapFile: (const char *)fname
useRegion: (BOOL)reg
{
FILE *f;
unsigned int i;
@ -308,7 +310,6 @@ fname useRegion:(BOOL) reg
f = fopen (fname, "w");
if (!f)
Sys_Error ("couldn't write %s", fname);
for (i = 0; i < [self count]; i++)
[[self objectAtIndex: i] writeToFILE: f region: reg];
@ -345,10 +346,8 @@ DRAWING
[[self objectAtIndex: i] RenderSelf: callback];
}
// ============================================================================
/*
===================
entityConnect
@ -357,7 +356,8 @@ A command-shift-click on an entity while an entity is selected will
make a target connection from the original entity.
===================
*/
-entityConnect: (vec3_t) p1:(vec3_t) p2
- (id) entityConnect: (vec3_t)p1
: (vec3_t)p2
{
id oldent, ent;
@ -385,7 +385,6 @@ make a target connection from the original entity.
return self;
}
/*
=================
selectRay
@ -394,7 +393,9 @@ If ef is true, any entity brush along the ray will be selected in preference
to intervening world brushes
=================
*/
-selectRay: (vec3_t) p1: (vec3_t) p2:(BOOL) ef
- (id) selectRay: (vec3_t)p1
: (vec3_t)p2
: (BOOL)ef
{
int i, j, c, c2;
id ent, bestent;
@ -422,9 +423,9 @@ to intervening world brushes
bestbrush = brush;
bestface = face;
}
if (i == 1 && ef && bestbrush)
break; // found an entity, so don't check the
if (i == 1 && ef && bestbrush) // found an entity, don't check the
// world
break;
}
if (besttime == 99999) {
@ -433,7 +434,7 @@ to intervening world brushes
}
if ([bestbrush regioned]) {
Sys_Printf ("WANRING: clicked on regioned brush\n");
Sys_Printf ("WARNING: clicked on regioned brush\n");
return self;
}
@ -444,8 +445,8 @@ to intervening world brushes
[quakeed_i disableFlushWindow];
if (![bestbrush selected]) {
if ([map_i numSelected] == 0) { // don't grab texture if others are
// selected
// don't grab texture if others are selected
if ([map_i numSelected] == 0) {
td = [bestbrush texturedefForFace: bestface];
[texturepalette_i setTextureDef: td];
}
@ -475,7 +476,8 @@ checks only the selected brushes
Returns the brush hit, or nil if missed.
=================
*/
-grabRay: (vec3_t) p1:(vec3_t) p2
- (id) grabRay: (vec3_t)p1
: (vec3_t)p2
{
int i, j, c, c2;
id ent;
@ -504,7 +506,6 @@ Returns the brush hit, or nil if missed.
if (besttime == 99999)
return nil;
return bestbrush;
}
@ -513,7 +514,8 @@ Returns the brush hit, or nil if missed.
getTextureRay
=================
*/
-getTextureRay: (vec3_t) p1:(vec3_t) p2
- (id) getTextureRay: (vec3_t)p1
: (vec3_t)p2
{
int i, j, c, c2;
id ent, bestent;
@ -523,7 +525,6 @@ getTextureRay
texturedef_t *td;
vec3_t mins, maxs;
bestbrush = nil;
bestent = nil;
besttime = 99999;
@ -546,7 +547,6 @@ getTextureRay
if (besttime == 99999)
return nil;
if (![bestent modifiable]) {
Sys_Printf ("can't modify spawned entities\n");
return self;
@ -570,7 +570,9 @@ getTextureRay
setTextureRay
=================
*/
-setTextureRay: (vec3_t) p1: (vec3_t) p2:(BOOL) allsides;
- (id) setTextureRay: (vec3_t)p1
: (vec3_t)p2
: (BOOL)allsides;
{
int i, j, c, c2;
id ent, bestent;
@ -620,10 +622,15 @@ setTextureRay
[quakeed_i disableFlushWindow];
if (allsides) {
[bestbrush setTexturedef: &td];
Sys_Printf ("textured entity %i brush %i\n", (int)[self indexOfObject: bestent], (int)[bestent indexOfObject:bestbrush]);
Sys_Printf ("textured entity %i brush %i\n",
(int) [self indexOfObject: bestent],
(int) [bestent indexOfObject: bestbrush]);
} else {
[bestbrush setTexturedef: &td forFace: bestface];
Sys_Printf ("deselected entity %i brush %i face %i\n", (int)[self indexOfObject: bestent], (int)[bestent indexOfObject:bestbrush], bestface);
Sys_Printf ("deselected entity %i brush %i face %i\n",
(int) [self indexOfObject: bestent],
(int) [bestent indexOfObject: bestbrush],
bestface);
}
[quakeed_i enableFlushWindow];
@ -632,7 +639,6 @@ setTextureRay
return self;
}
/*
==============================================================================
@ -641,7 +647,7 @@ OPERATIONS ON SELECTIONS
==============================================================================
*/
-makeSelectedPerform:(SEL) sel
- (id) makeSelectedPerform: (SEL)sel
{
int i, j, c, c2;
id ent, brush;
@ -669,7 +675,7 @@ OPERATIONS ON SELECTIONS
return self;
}
-makeUnselectedPerform:(SEL) sel
- (id) makeUnselectedPerform: (SEL)sel
{
int i, j, c, c2;
id ent, brush;
@ -691,7 +697,7 @@ OPERATIONS ON SELECTIONS
return self;
}
-makeAllPerform:(SEL) sel
- (id) makeAllPerform: (SEL)sel
{
int i, j, c, c2;
id ent, brush;
@ -711,7 +717,7 @@ OPERATIONS ON SELECTIONS
return self;
}
-makeGlobalPerform:(SEL) sel // in and out of region
- (id) makeGlobalPerform: (SEL)sel // in and out of region
{
int i, j, c, c2;
id ent, brush;
@ -729,7 +735,6 @@ OPERATIONS ON SELECTIONS
return self;
}
void
sel_identity (void)
{
@ -744,7 +749,7 @@ sel_identity (void)
sel_z[2] = 1;
}
-transformSelection
- (id) transformSelection
{
if (![currentEntity modifiable]) {
Sys_Printf ("can't modify spawned entities\n");
@ -765,7 +770,6 @@ sel_identity (void)
return self;
}
void
swapvectors (vec3_t a, vec3_t b)
{
@ -784,7 +788,7 @@ UI operations
===============================================================================
*/
-rotate_x:sender
- (id) rotate_x: sender
{
sel_identity ();
swapvectors (sel_y, sel_z);
@ -792,7 +796,7 @@ UI operations
return self;
}
-rotate_y:sender
- (id) rotate_y: sender
{
sel_identity ();
swapvectors (sel_x, sel_z);
@ -800,7 +804,7 @@ UI operations
return self;
}
-rotate_z:sender
- (id) rotate_z: sender
{
sel_identity ();
swapvectors (sel_x, sel_y);
@ -808,8 +812,7 @@ UI operations
return self;
}
-flip_x:sender
- (id) flip_x: sender
{
sel_identity ();
sel_x[0] = -1;
@ -818,7 +821,7 @@ UI operations
return self;
}
-flip_y:sender
- (id) flip_y: sender
{
sel_identity ();
sel_y[1] = -1;
@ -827,8 +830,7 @@ UI operations
return self;
}
-flip_z:sender
- (id) flip_z: sender
{
sel_identity ();
sel_z[2] = -1;
@ -837,8 +839,7 @@ UI operations
return self;
}
-cloneSelection:sender
- (id) cloneSelection: sender
{
int i, j, c, originalElements;
id o, b;
@ -854,7 +855,6 @@ UI operations
b = [o objectAtIndex: i];
if (![b selected])
continue;
// copy the brush, then translate the original
new = [b copy];
[new setSelected: YES];
@ -890,8 +890,7 @@ UI operations
return self;
}
-selectCompleteEntity:sender
- (id) selectCompleteEntity: sender
{
id o;
int i, c;
@ -905,6 +904,7 @@ UI operations
c = [o count];
for (i = 0; i < c; i++)
[[o objectAtIndex: i] setSelected: YES];
Sys_Printf ("%i brushes selected\n", c);
[quakeed_i updateAll];
@ -912,7 +912,7 @@ UI operations
return self;
}
-makeEntity:sender
- (id) makeEntity: sender
{
if (currentEntity != [self objectAtIndex: 0]) {
Sys_Printf ("ERROR: can't makeEntity inside an entity\n");
@ -928,10 +928,9 @@ UI operations
sb_newowner = [[Entity alloc] initClass: [things_i spawnName]];
if ([sb_newowner modifiable])
if ([sb_newowner modifiable]) {
[self makeSelectedPerform: @selector (moveToEntity)];
else { // throw out seed brush and select
// entity fixed brush
} else { // throw out seed brush and select entity fixed brush
[self makeSelectedPerform: @selector (remove)];
[[sb_newowner objectAtIndex: 0] setSelected: YES];
}
@ -944,8 +943,7 @@ UI operations
return self;
}
-selbox:(SEL) selector
- (id) selbox: (SEL)selector
{
id b;
@ -966,18 +964,17 @@ UI operations
return self;
}
-selectCompletelyInside:sender
- (id) selectCompletelyInside: sender
{
return [self selbox: @selector (selectComplete)];
}
-selectPartiallyInside:sender
- (id) selectPartiallyInside: sender
{
return [self selbox: @selector (selectPartial)];
}
-tallBrush:sender
- (id) tallBrush: sender
{
id b;
vec3_t mins, maxs;
@ -996,7 +993,10 @@ UI operations
mins[2] = -2048;
maxs[2] = 2048;
b =[[SetBrush alloc] initOwner: [map_i objectAtIndex: 0] mins: mins maxs: maxs texture:&td];
b = [[SetBrush alloc] initOwner: [map_i objectAtIndex: 0]
mins: mins
maxs: maxs
texture: &td];
[[map_i objectAtIndex: 0] addObject: b];
[b setSelected: YES];
[quakeed_i updateAll];
@ -1004,7 +1004,7 @@ UI operations
return self;
}
-shortBrush:sender
- (id) shortBrush: sender
{
id b;
vec3_t mins, maxs;
@ -1023,7 +1023,10 @@ UI operations
mins[2] = 0;
maxs[2] = 16;
b =[[SetBrush alloc] initOwner: [map_i objectAtIndex: 0] mins: mins maxs: maxs texture:&td];
b = [[SetBrush alloc] initOwner: [map_i objectAtIndex: 0]
mins: mins
maxs: maxs
texture: &td];
[[map_i objectAtIndex: 0] addObject: b];
[b setSelected: YES];
[quakeed_i updateAll];
@ -1036,7 +1039,7 @@ UI operations
subtractSelection
==================
*/
-subtractSelection:semder
- (id) subtractSelection: semder
{
int i, j, c, c2;
id o, o2;
@ -1058,7 +1061,6 @@ subtractSelection
[sourcelist addObject: o];
}
c = [sellist count];
for (i = 0; i < c; i++) {
o = [sellist objectAtIndex: i];
@ -1097,5 +1099,4 @@ subtractSelection
return self;
}
@end

View file

@ -8,10 +8,11 @@
id button1, button2;
}
-initWithFrame:(NSRect)
frameRect button1:b1 button2:b2;
- (id) initWithFrame: (NSRect)frameRect
button1: b1
button2: b2;
-tile;
- (id) tile;
@end
#endif // PopScrollView_h

View file

@ -1,4 +1,3 @@
#include "PopScrollView.h"
@implementation PopScrollView
@ -9,8 +8,10 @@ initWithFrame: button:
Initizes a scroll view with a button at it's lower right corner
====================
*/
- initWithFrame:(NSRect)
frameRect button1:b1 button2:b2 {
- (id) initWithFrame: (NSRect)frameRect
button1: b1
button2: b2
{
[super initWithFrame: frameRect];
[self addSubview: b1];
@ -26,6 +27,7 @@ frameRect button1:b1 button2:b2 {
return self;
}
/*
================
tile
@ -33,7 +35,7 @@ tile
Adjust the size for the pop up scale menu
=================
*/
-tile
- (id) tile
{
NSRect scrollerframe;
NSRect buttonframe, buttonframe2;
@ -45,7 +47,8 @@ Adjust the size for the pop up scale menu
scrollerframe = [_horizScroller frame];
newframe.origin.y = scrollerframe.origin.y;
newframe.origin.x = scrollerframe.origin.x + scrollerframe.size.width - buttonframe.size.width;
newframe.origin.x = scrollerframe.origin.x + scrollerframe.size.width -
buttonframe.size.width;
newframe.size.width = buttonframe.size.width;
newframe.size.height = scrollerframe.size.height;
scrollerframe.size.width -= newframe.size.width;
@ -61,7 +64,7 @@ Adjust the size for the pop up scale menu
}
/*
- superviewSizeChanged:(const NSSize *)oldSize
- (id) superviewSizeChanged: (const NSSize *)oldSize
{
[super superviewSizeChanged: oldSize];
@ -76,6 +79,4 @@ Adjust the size for the pop up scale menu
return YES;
}
@end

View file

@ -44,32 +44,31 @@ extern float lightaxis[3];
NSUserDefaults *prefs;
}
-readDefaults;
- (id) readDefaults;
//
// validate and set methods called by UI or defaults
//
-setProjectPath:(const char *) path;
-setBspSoundPath:(const char *) path; // set the path of the soundfile
// externally
-setShowBSP:(int) state; // set the state of ShowBSP
-setBrushOffset:(int) state; // set the state of BrushOffset
-setStartWad:(int) value; // set start wad (0-2)
-setXlight:(float) value; // set Xlight value for CameraView
-setYlight:(float) value; // set Ylight value for CameraView
-setZlight:(float) value; // set Zlight value for CameraView
- (id) setProjectPath: (const char *)path;
- (id) setBspSoundPath: (const char *)path; // set the path of the soundfile
- (id) setShowBSP: (int)state; // set the state of ShowBSP
- (id) setBrushOffset: (int)state; // set the state of BrushOffset
- (id) setStartWad: (int)value; // set start wad (0-2)
- (id) setXlight: (float)value; // set Xlight value for CameraView
- (id) setYlight: (float)value; // set Ylight value for CameraView
- (id) setZlight: (float)value; // set Zlight value for CameraView
//
// UI targets
//
-setBspSound:sender; // use OpenPanel to select sound
-setCurrentProject:sender; // make current roject the default
-UIChanged:sender; // target for all checks and fields
- (id) setBspSound: sender; // use OpenPanel to select sound
- (id) setCurrentProject: sender; // make current project the default
- (id) UIChanged: sender; // target for all checks and fields
//
// methods used by other objects to retreive defaults
//
-playBspSound;
- (id) playBspSound;
- (const char *) getProjectPath;
- (int) getBrushOffset; // get the state
@ -81,6 +80,5 @@ extern float lightaxis[3];
- (int) getStartWad;
@end
#endif // Preferences_h

View file

@ -21,6 +21,7 @@ WriteStringDefault (id prefs, const char *name, const char *value)
{
NSString *key = [NSString stringWithCString: name];
NSString *val = [NSString stringWithCString: value];
[prefs setObject: val forKey: key];
}
@ -30,7 +31,7 @@ WriteNumericDefault (id prefs, const char *name, float value)
WriteStringDefault (prefs, name, va ("%f", value));
}
-init
- (id) init
{
[super init];
preferences_i = self;
@ -56,6 +57,7 @@ _atoi (const char *c)
{
if (!c)
return 0;
return atoi (c);
}
@ -64,13 +66,14 @@ _atof (const char *c)
{
if (!c)
return 0;
return atof (c);
}
//
// Read in at start of program
//
-readDefaults
- (id) readDefaults
{
const char *string;
float value = 0;
@ -108,21 +111,22 @@ _atof (const char *c)
return self;
}
-setProjectPath:(const char *) path
- (id) setProjectPath: (const char *)path
{
if (!path)
path = "";
strcpy (projectpath, path);
[startproject_i setStringValue: [NSString stringWithCString: path]];
WriteStringDefault (prefs, "ProjectPath", path);
return self;
}
-setCurrentProject:sender
- (id) setCurrentProject: sender
{
[startproject_i setStringValue: [NSString stringWithCString: [project_i
currentProjectFile]]];
currentProjectFile
]]];
[self UIChanged: self];
return self;
}
@ -132,7 +136,6 @@ _atof (const char *c)
return projectpath;
}
//
// ===============================================
// BSP sound stuff
@ -140,7 +143,7 @@ _atof (const char *c)
//
// Set the BSP sound using an OpenPanel
//
-setBspSound:sender
- (id) setBspSound: sender
{
id panel;
NSString *types[] = {@"snd"};
@ -155,7 +158,8 @@ _atof (const char *c)
rtn = [panel runModalForDirectory: [NSString stringWithCString: path]
file: [NSString stringWithCString: file]
types: [NSArray arrayWithObjects: types count:1]];
types: [NSArray arrayWithObjects: types count: 1]
];
if (rtn) {
filenames = [panel filenames];
@ -169,21 +173,19 @@ _atof (const char *c)
return self;
}
//
// Play the BSP sound
//
-playBspSound
- (id) playBspSound
{
[bspSound_i play];
return self;
}
//
// Set the bspSound path
//
-setBspSoundPath:(const char *) path
- (id) setBspSoundPath: (const char *)path
{
if (!path)
path = "";
@ -193,11 +195,13 @@ _atof (const char *c)
[bspSound_i release];
bspSound_i = nil;
}
if (path[0] && access (path, R_OK))
bspSound_i =[[NSSound alloc] initWithContentsOfFile: [NSString stringWithCString:bspSound] byReference: YES];
if (!bspSound_i) {
return self;
if (path[0] && access (path, R_OK)) {
bspSound_i =
[[NSSound alloc] initWithContentsOfFile: [NSString stringWithCString:
bspSound] byReference: YES];
}
if (!bspSound_i)
return self;
[bspSoundField_i setStringValue: [NSString stringWithCString: bspSound]];
@ -213,7 +217,7 @@ _atof (const char *c)
//
// Set the state
//
-setShowBSP:(int) state
- (id) setShowBSP: (int)state
{
showBSP = state;
[showBSP_i setIntValue: state];
@ -230,7 +234,6 @@ _atof (const char *c)
return showBSP;
}
// ===============================================
// "Offset Brush ..." management
// ===============================================
@ -238,7 +241,7 @@ _atof (const char *c)
//
// Set the state
//
-setBrushOffset:(int) state
- (id) setBrushOffset: (int)state
{
brushOffset = state;
[brushOffset_i setIntValue: state];
@ -258,7 +261,7 @@ _atof (const char *c)
// StartWad
// ===============================================
-setStartWad:(int) value // set start wad (0-2)
- (id) setStartWad: (int)value // set start wad (0-2)
{
startwad = value;
if (startwad < 0 || startwad > 2)
@ -275,14 +278,13 @@ _atof (const char *c)
return startwad;
}
// ===============================================
// X,Y,Z light values
// ===============================================
//
// Set the state
//
-setXlight:(float) value
- (id) setXlight: (float)value
{
xlight = value;
if (xlight < 0.25 || xlight > 1)
@ -293,7 +295,7 @@ _atof (const char *c)
return self;
}
-setYlight:(float) value
- (id) setYlight: (float)value
{
ylight = value;
if (ylight < 0.25 || ylight > 1)
@ -304,7 +306,7 @@ _atof (const char *c)
return self;
}
-setZlight:(float) value
- (id) setZlight: (float)value
{
zlight = value;
if (zlight < 0.25 || zlight > 1)
@ -333,8 +335,6 @@ _atof (const char *c)
return [zlight_i floatValue];
}
/*
============
UIChanged
@ -342,7 +342,7 @@ UIChanged
Grab all the current UI state
============
*/
-UIChanged:sender
- (id) UIChanged: sender
{
Sys_Printf ("defaults updated\n");
@ -361,5 +361,4 @@ Grab all the current UI state
return self;
}
@end

View file

@ -32,8 +32,8 @@ extern id project_i;
id descList; // list of map descriptions (Storage)
id wadList; // list of wad names (Storage)
id pis_panel_i; // outlet to Project Info Settings
// (PIS) panel
id pis_panel_i; // outlet to Project Info Settings (PIS)
// panel
id pis_basepath_i; // outlet to PIS->base path
id pis_wads_i; // outlet to PIS->wad browser
@ -69,29 +69,32 @@ extern id project_i;
time_t lastModified; // last time project file was modified
}
-initProject;
-initVars;
- (id) initProject;
- (id) initVars;
- (const char *) currentProjectFile;
-setTextureWad:(const char *) wf;
- (id) setTextureWad: (const char *)wf;
-addToOutput:(const char *) string;
-clearBspOutput:sender;
-initProjSettings;
-changeChar:(char) f to:(char) t in:(id) obj;
- (id) addToOutput: (const char *)string;
- (id) clearBspOutput: (id)sender;
- (id) initProjSettings;
- (id) changeChar: (char)f
to: (char)t
in: (id)obj;
-(int) searchForString:(const char *) str in:(id) obj;
- (int) searchForString: (const char *)str
in: (id)obj;
-parseProjectFile; // read defaultsdatabase for project
// path
-openProjectFile:(const char *) path; // called by openProject and newProject
-openProject;
-clickedOnMap:sender; // called if clicked on map in browser
-clickedOnWad:sender; // called if clicked on wad in browser
// methods to querie the project file
- (id) parseProjectFile; // read defaultsdatabase for project path
- (id) openProjectFile: (const char *)path; // called by openProject, newProject
- (id) openProject;
- (id) clickedOnMap: sender; // called if clicked on map in browser
- (id) clickedOnWad: sender; // called if clicked on wad in browser
//
// methods to query the project file
//
- (const char *) getMapDirectory;
- (const char *) getFinalMapDirectory;
- (const char *) getProgDirectory;
@ -107,8 +110,8 @@ extern id project_i;
- (const char *) getLeaktestCmd;
- (const char *) getEntitiesCmd;
@end void
changeString (char cf, char ct, char *string);
@end
void changeString (char cf, char ct, char *string);
#endif // Project_h

View file

@ -18,12 +18,11 @@
#include "Things.h"
#include "TexturePalette.h"
id project_i;
@implementation Project
-init
- (id) init
{
project_i = self;
@ -35,7 +34,7 @@ id project_i;
// Project code
//
// ===========================================================
-initVars
- (id) initVars
{
const char *s;
const char *pe;
@ -55,10 +54,10 @@ id project_i;
strcpy (path_finalmapdir, ts);
strcat (path_finalmapdir, SUBDIR_MAPS); // dest dir
[basepathinfo_i setStringValue: [NSString stringWithCString:ts]];
// in Project Inspector
[basepathinfo_i setStringValue: [NSString stringWithCString: ts]];
#if 0 // FIXME: for "out-of-tree" projects
#if 0 // FIXME: for "out-of-tree" projects ?
if ((s = [projectInfo getStringFor: BASEPATHKEY])) {
strcpy (path_basepath, s);
@ -71,8 +70,7 @@ id project_i;
strcpy (path_finalmapdir, s);
strcat (path_finalmapdir, "/" SUBDIR_MAPS); // dest dir
[basepathinfo_i setStringValue:s];
// in Project Inspector
[basepathinfo_i setStringValue: s]; // in Project Inspector
}
#endif
@ -121,7 +119,7 @@ id project_i;
//
// Init Project Settings fields
//
-initProjSettings
- (id) initProjSettings
{
[pis_basepath_i setStringValue: [NSString stringWithCString: path_basepath]];
[pis_fullvis_i setStringValue: [NSString stringWithCString: string_fullvis]];
@ -136,12 +134,13 @@ id project_i;
//
// Add text to the BSP Output window
//
-addToOutput:(const char *) string
- (id) addToOutput: (const char *)string
{
int end;
end = [BSPoutput_i textLength];
[BSPoutput_i replaceCharactersInRange: NSMakeRange (end, 0) withString: [NSString stringWithCString:string]];
[BSPoutput_i replaceCharactersInRange: NSMakeRange (end, 0)
withString: [NSString stringWithCString: string]];
end = [BSPoutput_i textLength];
[BSPoutput_i setSelectedRange: NSMakeRange (end, 0)];
@ -150,7 +149,7 @@ id project_i;
return self;
}
-clearBspOutput:sender
- (id) clearBspOutput: sender
{
int end;
@ -160,14 +159,13 @@ id project_i;
return self;
}
-print
- (id) print
{
// XXX [BSPoutput_i printPSCode:self];
return self;
}
-initProject
- (id) initProject
{
[self parseProjectFile];
if (projectInfo == NULL)
@ -186,7 +184,7 @@ id project_i;
//
// Change a character to another in a Storage list of strings
//
-changeChar:(char) f to:(char) t in:(id) obj
- (id) changeChar: (char)f to: (char)t in: (id)obj
{
int i;
int max;
@ -211,11 +209,11 @@ id project_i;
char *name;
int i;
if (sender == mapbrowse_i)
if (sender == mapbrowse_i) {
list = mapList;
else if (sender == pis_wads_i)
} else if (sender == pis_wads_i) {
list = wadList;
else {
} else {
list = nil;
Sys_Error ("Project: unknown browser to fill");
}
@ -234,7 +232,7 @@ id project_i;
//
// Clicked on a map name or description!
//
-clickedOnMap:sender
- (id) clickedOnMap: sender
{
id matrix;
int row;
@ -261,8 +259,7 @@ id project_i;
return self;
}
-setTextureWad:(const char *) wf
- (id) setTextureWad: (const char *)wf
{
int i, c;
const char *name;
@ -292,7 +289,7 @@ id project_i;
//
// Clicked on a wad name
//
-clickedOnWad:sender
- (id) clickedOnWad: sender
{
id matrix;
int row;
@ -307,11 +304,10 @@ id project_i;
return self;
}
//
// Read in the <name>.QE_Project file
//
-parseProjectFile
- (id) parseProjectFile
{
const char *path;
int rtn;
@ -321,9 +317,10 @@ id project_i;
rtn = NSRunAlertPanel (@"Project Error!",
@"A default project has not been found.\n",
@"Open Project", NULL, NULL);
if ([self openProject] == nil)
while (1) // can't run without a project
[NSApp terminate:self];
if ([self openProject] == nil) {
while (1)
[NSApp terminate: self]; // can't run without a project
}
return self;
}
@ -334,10 +331,11 @@ id project_i;
//
// Loads and parses a project file
//
-openProjectFile:(const char *) path
- (id) openProjectFile: (const char *)path
{
FILE *fp;
struct stat s;
Sys_Printf ("openProjectFile: %s\n", path);
strcpy (path_projectinfo, path);
@ -363,7 +361,7 @@ Sys_Printf ("openProjectFile: %s\n", path);
//
// Open a project file
//
-openProject
- (id) openProject
{
const char *path;
id openpanel;
@ -375,7 +373,8 @@ Sys_Printf ("openProjectFile: %s\n", path);
openpanel = [NSOpenPanel new];
// [openpanel allowMultipleFiles:NO];
// [openpanel chooseDirectories:NO];
rtn =[openpanel runModalForTypes: [NSArray arrayWithObjects: projtypes count:1]];
rtn = [openpanel runModalForTypes: [NSArray arrayWithObjects: projtypes
count: 1]];
if (rtn == NSOKButton) {
filenames = [openpanel filenames];
dir = [[openpanel directory] cString];
@ -389,7 +388,6 @@ Sys_Printf ("openProjectFile: %s\n", path);
return nil;
}
//
// Search for a string in a List of strings
//
@ -423,7 +421,6 @@ Sys_Printf ("openProjectFile: %s\n", path);
return path_progdir;
}
//
// Return the WAD name for cmd-8
//
@ -431,6 +428,7 @@ Sys_Printf ("openProjectFile: %s\n", path);
{
if (!path_wad8[0])
return NULL;
return path_wad8;
}
@ -441,6 +439,7 @@ Sys_Printf ("openProjectFile: %s\n", path);
{
if (!path_wad9[0])
return NULL;
return path_wad9;
}
@ -451,6 +450,7 @@ Sys_Printf ("openProjectFile: %s\n", path);
{
if (!path_wad0[0])
return NULL;
return path_wad0;
}
@ -461,6 +461,7 @@ Sys_Printf ("openProjectFile: %s\n", path);
{
if (!string_fullvis[0])
return NULL;
return string_fullvis;
}
@ -471,6 +472,7 @@ Sys_Printf ("openProjectFile: %s\n", path);
{
if (!string_fastvis[0])
return NULL;
return string_fastvis;
}
@ -481,6 +483,7 @@ Sys_Printf ("openProjectFile: %s\n", path);
{
if (!string_novis[0])
return NULL;
return string_novis;
}
@ -491,6 +494,7 @@ Sys_Printf ("openProjectFile: %s\n", path);
{
if (!string_relight[0])
return NULL;
return string_relight;
}
@ -501,6 +505,7 @@ Sys_Printf ("openProjectFile: %s\n", path);
{
if (!string_leaktest[0])
return NULL;
return string_leaktest;
}
@ -508,10 +513,12 @@ Sys_Printf ("openProjectFile: %s\n", path);
{
if (!string_entities[0])
return NULL;
return string_entities;
}
@end
// ====================================================
// C Functions
// ====================================================
@ -523,7 +530,8 @@ changeString (char cf, char ct, char *string)
{
unsigned int j;
for (j = 0; j < strlen (string); j++)
for (j = 0; j < strlen (string); j++) {
if (string[j] == cf)
string[j] = ct;
}
}

View file

@ -23,7 +23,9 @@ void NopSound (void);
NSRect cache_rect[3];
BOOL no_restore[3];
//
// UI objects
//
id brushcount_i;
id entitycount_i;
id regionbutton_i;
@ -44,62 +46,62 @@ void NopSound (void);
id xy_drawmode_i; // passed over to xyview after init
}
-setDefaultFilename;
- (id) setDefaultFilename;
- (const char *) currentFilename;
-updateAll; // when a model has been changed
-updateCamera; // when the camera has moved
-updateXY;
-updateZ;
- (id) updateAll; // when a model has been changed
- (id) updateCamera; // when the camera has moved
- (id) updateXY;
- (id) updateZ;
-updateAll:sender;
- (id) updateAll: sender;
- (void) cameraNoRestore: (NSRect)rect;
- (void) xyNoRestore: (NSRect)rect;
- (void) zNoRestore: (NSRect)rect;
-newinstance; // force next flushwindow to clear all
- (id) newinstance; // force next flushwindow to clear all
// instance drawing
-redrawInstance; // erase and redraw all instance now
- (id) redrawInstance; // erase and redraw all instance now
-appWillTerminate:sender;
- (id) appWillTerminate: sender;
-openProject:sender;
- (id) openProject: sender;
-textCommand:sender;
- (id) textCommand: sender;
-applyRegion:sender;
- (id) applyRegion: sender;
- (BOOL) dirty;
-clear:sender;
-centerCamera:sender;
-centerZChecker:sender;
- (id) clear: sender;
- (id) centerCamera: sender;
- (id) centerZChecker: sender;
-changeXYLookUp:sender;
- (id) changeXYLookUp: sender;
-setBrushRegion:sender;
-setXYRegion:sender;
- (id) setBrushRegion: sender;
- (id) setXYRegion: sender;
-open:sender;
-save:sender;
-saveAs:sender;
- (id) open: sender;
- (id) save: sender;
- (id) saveAs: sender;
-doOpen:(const char *) fname;
- (id) doOpen: (const char *)fname;
-saveBSP:(const char *)cmdline dialog:(BOOL)wt;
- (id) saveBSP: (const char *)cmdline dialog: (BOOL)wt;
-BSP_Full:sender;
-BSP_FastVis:sender;
-BSP_NoVis:sender;
-BSP_relight:sender;
-BSP_stop:sender;
-BSP_entities:sender;
- (id) BSP_Full: sender;
- (id) BSP_FastVis: sender;
- (id) BSP_NoVis: sender;
- (id) BSP_relight: sender;
- (id) BSP_stop: sender;
- (id) BSP_entities: sender;
-applicationDefined:(NSEvent *) theEvent;
- (id) applicationDefined: (NSEvent *)theEvent;
//
// UI querie for other objects
// UI query for other objects
//
- (BOOL) showCoordinates;
- (BOOL) showNames;

View file

@ -51,7 +51,6 @@ NopSound (void)
NSBeep ();
}
void
My_Malloc_Error (int code)
{
@ -82,7 +81,6 @@ DisplayCmdOutput (void)
[inspcontrol_i setCurrentInspector: i_output];
[preferences_i playBspSound];
}
/*
@ -114,7 +112,6 @@ QuakeEd_print (const char *fmt, va_list args)
if (!output)
output = dstring_new ();
dvsprintf (output, fmt, args);
string = [NSString stringWithCString: output->str];
[g_cmd_out_i setStringValue: string];
@ -131,7 +128,8 @@ AutoSave
Every five minutes, save a modified map
===============
*/
- (void) AutoSave {
- (void) AutoSave
{
// automatic backup
if (autodirty) {
autodirty = NO;
@ -141,9 +139,8 @@ Every five minutes, save a modified map
[map_i writeStats];
}
#define FN_TEMPSAVE "/qcache/temp.map"
-setDefaultFilename
- (id) setDefaultFilename
{
strcpy (filename, FN_TEMPSAVE);
[self setTitleWithRepresentedFilename: [NSString stringWithCString: filename]];
@ -151,7 +148,6 @@ Every five minutes, save a modified map
return self;
}
- (BOOL) dirty
{
return dirty;
@ -180,53 +176,61 @@ postappdefined (void)
if (updateinflight)
return;
// post an event at the end of the que
ev =[NSEvent otherEventWithType: NSApplicationDefined location: NSZeroPoint modifierFlags: 0 timestamp:[[NSDate date]
timeIntervalSinceReferenceDate]
windowNumber: 0 context:[NSApp context]
subtype: 0 data1: 0 data2:0];
ev = [NSEvent otherEventWithType: NSApplicationDefined
location: NSZeroPoint
modifierFlags: 0
timestamp: [[NSDate date] timeIntervalSinceReferenceDate]
windowNumber: 0
context: [NSApp context]
subtype: 0
data1: 0
data2: 0];
[NSApp postEvent: ev atStart: NO];
updateinflight = YES;
}
int c_updateall;
-updateAll // when a model has been changed
- (id) updateAll // when a model has been changed
{
updatecamera = updatexy = updatez = YES;
c_updateall++;
postappdefined ();
return self;
}
-updateAll:sender
- (id) updateAll: sender
{
[self updateAll];
return self;
}
-updateCamera // when the camera has moved
- (id) updateCamera // when the camera has moved
{
updatecamera = YES;
clearinstance = YES;
postappdefined ();
return self;
}
-updateXY
- (id) updateXY
{
updatexy = YES;
postappdefined ();
return self;
}
-updateZ
- (id) updateZ
{
updatez = YES;
postappdefined ();
return self;
}
@ -245,13 +249,13 @@ int c_updateall;
no_restore[2] = YES;
}
-newinstance
- (id) newinstance
{
clearinstance = YES;
return self;
}
-redrawInstance
- (id) redrawInstance
{
clearinstance = YES;
[self flushWindow];
@ -273,9 +277,9 @@ instance draw the brush after each flush
[super flushWindow];
// don't lock focus before nib is finished loading
if (!running)
return; // don't lock focus before nib is
// finished loading
return;
if (_disableFlushWindow)
return;
@ -336,7 +340,6 @@ instance draw the brush after each flush
[super flushWindow];
}
/*
==============================================================================
@ -345,7 +348,7 @@ App delegate methods
==============================================================================
*/
-applicationDefined:(NSEvent *) theEvent
- (id) applicationDefined: (NSEvent *)theEvent
{
NSEvent *evp;
@ -365,13 +368,16 @@ App delegate methods
if ([map_i count] != (unsigned) [entitycount_i intValue])
[entitycount_i setIntValue: [map_i count]];
if ([[map_i currentEntity] count] != (unsigned) [brushcount_i intValue])
[brushcount_i setIntValue: [[map_i currentEntity] count]];
if (updatecamera)
[cameraview_i display];
if (updatexy)
[xyview_i display];
if (updatez)
[zview_i display];
@ -395,9 +401,11 @@ App delegate methods
quakeed_i = self;
dirty = autodirty = NO;
[NSTimer timerWithTimeInterval: 5 * 60 target: self selector:@selector
(AutoSave)
userInfo: nil repeats:YES];
[NSTimer timerWithTimeInterval: 5 * 60
target: self
selector: @selector (AutoSave)
userInfo: nil
repeats: YES];
path = [NSBezierPath new];
}
@ -428,8 +436,7 @@ App delegate methods
NSRect frm;
scrn = [screens objectAtIndex: 1];
frm = [scrn frame];
[self setFrameTopLeftPoint: NSMakePoint (frm.origin.x,
frm.size.height)];
[self setFrameTopLeftPoint: NSMakePoint (frm.origin.x, frm.size.height)];
}
[self makeKeyAndOrderFront: self];
@ -438,20 +445,18 @@ App delegate methods
[map_i newMap];
Sys_Printf ("ready.\n");
// malloc_debug(-1); // DEBUG
}
-appWillTerminate:sender
- (id) appWillTerminate: sender
{
// FIXME: save dialog if dirty
return self;
}
// ===========================================================================
-textCommand:sender
- (id) textCommand: sender
{
char const *t;
@ -469,20 +474,18 @@ App delegate methods
td = [b texturedef];
Sys_Printf ("%s\n", td->texture);
return self;
} else
} else {
Sys_Printf ("Unknown command\n");
return self;
} return self;
}
-openProject:sender
- (id) openProject: sender
{
[project_i openProject];
return self;
}
-clear:sender
- (id) clear: sender
{
[map_i newMap];
@ -493,8 +496,7 @@ App delegate methods
return self;
}
-centerCamera:sender
- (id) centerCamera: sender
{
NSRect sbounds;
@ -509,7 +511,7 @@ App delegate methods
return self;
}
-centerZChecker:sender
- (id) centerZChecker: sender
{
NSRect sbounds;
@ -524,13 +526,12 @@ App delegate methods
return self;
}
-changeXYLookUp:sender
- (id) changeXYLookUp: sender
{
if ([sender intValue]) {
if ([sender intValue])
xy_viewnormal[2] = 1;
} else {
else
xy_viewnormal[2] = -1;
}
[self updateAll];
return self;
}
@ -543,13 +544,12 @@ REGION MODIFICATION
==============================================================================
*/
/*
==================
applyRegion:
==================
*/
-applyRegion:sender
- (id) applyRegion: sender
{
filter_clip_brushes = [filter_clip_i intValue];
filter_water_brushes = [filter_water_i intValue];
@ -570,7 +570,7 @@ applyRegion:
return self;
}
-setBrushRegion:sender
- (id) setBrushRegion: sender
{
id b;
@ -592,7 +592,7 @@ applyRegion:
return self;
}
-setXYRegion:sender
- (id) setXYRegion: sender
{
NSRect bounds;
@ -626,7 +626,6 @@ applyRegion:
return [show_names_i intValue];
}
/*
==============================================================================
@ -634,7 +633,6 @@ BSP PROCESSING
==============================================================================
*/
void
ExpandCommand (const char *in, char *out, char *src, char *dest)
{
@ -655,13 +653,12 @@ ExpandCommand (const char *in, char *out, char *src, char *dest)
*out = 0;
}
/*
=============
saveBSP
=============
*/
-saveBSP:(const char *) cmdline dialog:(BOOL) wt
- (id) saveBSP: (const char *)cmdline dialog: (BOOL)wt
{
char expandedcmd[1024];
char mappath[1024];
@ -689,9 +686,9 @@ saveBSP
strcat (mappath, ".reg");
[map_i writeMapFile: mappath useRegion: YES];
wt = YES; // allways pop the dialog on region ops
} else
} else {
strcpy (mappath, filename);
}
// save the entire thing, just in case there is a problem
[self save: self];
@ -721,12 +718,13 @@ saveBSP
if ([preferences_i getShowBSP])
[inspcontrol_i setCurrentInspector: i_output];
if (wt) {
id panel;
NSModalSession session;
panel = NSGetAlertPanel (@"BSP In Progress",[NSString stringWithCString:expandedcmd], NULL, NULL, NULL);
panel = NSGetAlertPanel (@"BSP In Progress",
[NSString stringWithCString: expandedcmd],
NULL, NULL, NULL);
session = [NSApp beginModalSessionForWindow: panel];
system (expandedcmd);
[NSApp endModalSession: session];
@ -744,38 +742,37 @@ saveBSP
return self;
}
-BSP_Full:sender
- (id) BSP_Full: sender
{
[self saveBSP: [project_i getFullVisCmd] dialog: NO];
return self;
}
-BSP_FastVis:sender
- (id) BSP_FastVis: sender
{
[self saveBSP: [project_i getFastVisCmd] dialog: NO];
return self;
}
-BSP_NoVis:sender
- (id) BSP_NoVis: sender
{
[self saveBSP: [project_i getNoVisCmd] dialog: NO];
return self;
}
-BSP_relight:sender
- (id) BSP_relight: sender
{
[self saveBSP: [project_i getRelightCmd] dialog: NO];
return self;
}
-BSP_entities:sender
- (id) BSP_entities: sender
{
[self saveBSP: [project_i getEntitiesCmd] dialog: NO];
return self;
}
-BSP_stop:sender
- (id) BSP_stop: sender
{
if (!bsppid) {
NSBeep ();
@ -789,8 +786,6 @@ saveBSP
return self;
}
/*
==============
doOpen:
@ -798,7 +793,7 @@ doOpen:
Called by open or the project panel
==============
*/
-doOpen:(const char *) fname;
- (id) doOpen: (const char *)fname;
{
strcpy (filename, fname);
@ -813,44 +808,42 @@ Called by open or the project panel
return self;
}
/*
==============
open
==============
*/
-open:sender;
- (id) open: sender;
{
id openpanel;
NSString *suffixlist[] = {@"map"};
openpanel = [NSOpenPanel new];
if ([openpanel runModalForDirectory: [NSString stringWithCString:[project_i
if ([openpanel
runModalForDirectory: [NSString stringWithCString: [project_i
getMapDirectory]]
file: @"" types: [NSArray arrayWithObjects: suffixlist count:1]] !=
NSOKButton)
file: @""
types: [NSArray arrayWithObjects: suffixlist count: 1]]
!= NSOKButton)
return self;
[self doOpen: [[openpanel filename] cString]];
return self;
}
/*
==============
save:
==============
*/
-save:sender;
- (id) save: sender;
{
char backup[1024];
// force a name change if using tempname
if (!strcmp (filename, FN_TEMPSAVE))
return [self saveAs: self];
dirty = autodirty = NO;
strcpy (backup, filename);
@ -863,13 +856,12 @@ save:
return self;
}
/*
==============
saveAs
==============
*/
-saveAs:sender;
- (id) saveAs: sender;
{
id panel_i;
char dir[1024];
@ -877,10 +869,12 @@ saveAs
panel_i = [NSSavePanel new];
// XXX ExtractFileBase (filename, dir);
[panel_i setRequiredFileType: @"map"];
if ([panel_i runModalForDirectory: [NSString stringWithCString: [project_i getMapDirectory]] file: [NSString stringWithCString:dir]] !=
NSOKButton)
if ([panel_i
runModalForDirectory: [NSString stringWithCString: [project_i
getMapDirectory]]
file: [NSString stringWithCString: dir]]
!= NSOKButton)
return self;
strcpy (filename, [[panel_i filename] cString]);
[self setTitleWithRepresentedFilename: [NSString stringWithCString: filename]];
@ -890,7 +884,6 @@ saveAs
return self;
}
/*
===============================================================================
@ -899,7 +892,6 @@ saveAs
===============================================================================
*/
//
// AJR - added this for Project info
//
@ -908,12 +900,13 @@ saveAs
return filename;
}
-deselect:sender
- (id) deselect: sender
{
if ([clipper_i hide]) // first click hides only the clipper
return [self updateAll];
[map_i setCurrentEntity: [map_i objectAtIndex: 0]];
// make world selected
[map_i makeSelectedPerform: @selector (deselect)];
[self updateAll];
@ -921,28 +914,31 @@ saveAs
return self;
}
/*
===============
keyDown
===============
*/
-keyDown:(NSEvent *) theEvent
- (id) keyDown: (NSEvent *)theEvent
{
NSString *chars = [theEvent characters];
unichar c = [chars length] == 1 ? [chars characterAtIndex: 0] : '\0';
unichar c = ([chars length] == 1) ? [chars characterAtIndex: 0] : '\0';
//
// function keys
//
switch (c) {
case NSF2FunctionKey:
[cameraview_i setDrawMode: dr_wire];
Sys_Printf ("wire draw mode\n");
return self;
case NSF3FunctionKey:
[cameraview_i setDrawMode: dr_flat];
Sys_Printf ("flat draw mode\n");
return self;
case NSF4FunctionKey:
[cameraview_i setDrawMode: dr_texture];
Sys_Printf ("texture draw mode\n");
@ -952,6 +948,7 @@ keyDown
[xyview_i setDrawMode: dr_wire];
Sys_Printf ("wire draw mode\n");
return self;
case NSF6FunctionKey:
Sys_Printf ("texture draw mode\n");
return self;
@ -1020,7 +1017,6 @@ keyDown
[map_i cloneSelection: self];
break;
//
// move selection keys
//
@ -1030,6 +1026,7 @@ keyDown
[map_i makeSelectedPerform: @selector (translate)];
[self updateAll];
break;
case '8':
VectorCopy (vec3_origin, sb_translate);
sb_translate[1] = [xyview_i gridsize];
@ -1043,6 +1040,7 @@ keyDown
[map_i makeSelectedPerform: @selector (translate)];
[self updateAll];
break;
case '6':
VectorCopy (vec3_origin, sb_translate);
sb_translate[0] = [xyview_i gridsize];
@ -1056,6 +1054,7 @@ keyDown
[map_i makeSelectedPerform: @selector (translate)];
[self updateAll];
break;
case '+':
VectorCopy (vec3_origin, sb_translate);
sb_translate[2] = [xyview_i gridsize];
@ -1067,10 +1066,9 @@ keyDown
Sys_Printf ("undefined keypress\n");
NopSound ();
break;
}
} /* switch */
return self;
}
@end

View file

@ -12,12 +12,11 @@
- (void) sendEvent: (NSEvent *)evt;
{
if ([evt type] == NSApplicationDefined) {
if ([evt type] == NSApplicationDefined)
[quakeed_i applicationDefined: evt];
} else {
else
[super sendEvent: evt];
}
}
@end

View file

@ -41,17 +41,14 @@ typedef struct {
#define SIDE_BACK 1
#define SIDE_ON 2
winding_t *ClipWinding (winding_t * in, plane_t *split);
winding_t *CopyWinding (winding_t * w);
winding_t *NewWinding (int points);
@interface SetBrush: NSObject
{
BOOL regioned; // not active
BOOL selected;
BOOL invalid; // not a proper polyhedron
id parent; // the entity this brush is in
@ -61,19 +58,22 @@ winding_t *NewWinding (int points);
face_t faces[MAX_FACES];
}
-initOwner:own mins:(float *)mins maxs:(float *)maxs
- (SetBrush *) initOwner: (id)own
mins: (float *)mins
maxs: (float *)maxs
texture: (texturedef_t *)tex;
-initFromScript:(struct script_s *)script owner:own;
- (id) initFromScript: (struct script_s *)script
owner: (id)own;
-setMins:(float *)mins maxs:(float *)maxs;
- (id) setMins: (float *)mins maxs: (float *)maxs;
-parent;
-setParent:(id) p;
- (id) parent;
- (id) setParent: (id)p;
-setEntityColor:(vec3_t) color;
- (id) setEntityColor: (vec3_t)color;
-calcWindings;
- (id) calcWindings;
- (void) writeToFILE: (FILE *)f region: (BOOL)reg;
@ -87,11 +87,11 @@ winding_t *NewWinding (int points);
- (BOOL) containsPoint: (vec3_t)pt;
- (void) freeWindings;
-removeIfInvalid;
- (id) removeIfInvalid;
extern vec3_t region_min, region_max;
-newRegion;
- (id) newRegion;
- (texturedef_t *) texturedef;
- (texturedef_t *) texturedefForFace: (int)f;
@ -116,7 +116,7 @@ extern float *controlpoints[MAX_FACES * 3];
- (void) getXYdragface: (vec3_t)dragpoint;
- (void) getXYShearPoints: (vec3_t)dragpoint;
-addFace:(face_t *) f;
- (id) addFace: (face_t *)f;
//
// multiple brush actions
@ -145,7 +145,7 @@ extern vec3_t sel_org;
- (void) flipNormals;
-carve;
- (id) carve;
- (void) setCarveVars;
extern id sb_newowner;

View file

@ -38,7 +38,6 @@ vec3_t baseaxis[18] = {
};
#endif
float
TextureAxisFromPlane (plane_t *pln, float *xv, float *yv)
{
@ -91,9 +90,10 @@ CheckFace (face_t * f)
for (i = 0; i < w->numpoints; i++) {
p1 = w->points[i];
for (j = 0; j < 3; j++)
for (j = 0; j < 3; j++) {
if (p1[j] > BOGUS_RANGE || p1[j] < -BOGUS_RANGE)
Sys_Error ("CheckFace: BUGUS_RANGE: %f", p1[j]);
}
j = i + 1 == w->numpoints ? 0 : i + 1;
@ -125,7 +125,6 @@ CheckFace (face_t * f)
}
}
/*
=============================================================================
@ -134,7 +133,6 @@ CheckFace (face_t * f)
=============================================================================
*/
/*
==================
NewWinding
@ -156,7 +154,6 @@ NewWinding (int points)
return w;
}
/*
==================
CopyWinding
@ -174,7 +171,6 @@ CopyWinding (winding_t * w)
return c;
}
/*
==================
ClipWinding
@ -206,9 +202,8 @@ ClipWinding (winding_t * in, plane_t *split)
sides[i] = SIDE_FRONT;
else if (dot < -ON_EPSILON)
sides[i] = SIDE_BACK;
else {
else
sides[i] = SIDE_ON;
}
counts[sides[i]]++;
}
sides[i] = sides[0];
@ -216,7 +211,6 @@ ClipWinding (winding_t * in, plane_t *split)
if (!counts[0] && !counts[1])
return in;
if (!counts[0]) {
free (in);
return NULL;
@ -224,8 +218,8 @@ ClipWinding (winding_t * in, plane_t *split)
if (!counts[1])
return in;
maxpts = in->numpoints + 4; // can't use counts[0]+2 because
// of fp grouping errors
// can't use counts[0]+2 because of fp grouping errors
maxpts = in->numpoints + 4;
neww = NewWinding (maxpts);
for (i = 0; i < in->numpoints; i++) {
@ -298,7 +292,6 @@ BasePolyForPlane (face_t * f)
p = &f->plane;
// find the major axis
max = -BOGUS_RANGE;
x = -1;
for (i = 0; i < 3; i++) {
@ -308,6 +301,7 @@ BasePolyForPlane (face_t * f)
max = v;
}
}
if (x == -1)
Sys_Error ("BasePolyForPlane: no axis found");
@ -317,6 +311,7 @@ BasePolyForPlane (face_t * f)
case 1:
vup[2] = 1;
break;
case 2:
vup[0] = 1;
break;
@ -333,7 +328,7 @@ BasePolyForPlane (face_t * f)
VectorScale (vup, 8192, vup);
VectorScale (vright, 8192, vright);
// project a really big axis aligned box onto the plane
// project a really big axis-aligned box onto the plane
w = NewWinding (4);
w->numpoints = 4;
@ -358,9 +353,10 @@ BasePolyForPlane (face_t * f)
sinv = sin (ang);
cosv = cos (ang);
if (!td->scale[0])
if (!(td->scale[0]))
td->scale[0] = 1;
if (!td->scale[1])
if (!(td->scale[1]))
td->scale[1] = 1;
for (i = 0; i < 4; i++) {
@ -386,7 +382,7 @@ If a face has a NULL winding, it is an overconstraining plane and
can be removed.
===========
*/
-calcWindings
- (id) calcWindings
{
int i, j, k;
float v;
@ -432,12 +428,11 @@ can be removed.
break;
}
}
}
for (i = 0; i < numfaces; i++) {
if (!useplane[i])
continue; // duplicate plane
if (!useplane[i]) // duplicate plane
continue;
f = &faces[i];
@ -486,7 +481,8 @@ can be removed.
initOwner:::
===========
*/
- (SetBrush *)initOwner: own mins:(float *)mins
- (SetBrush *) initOwner: own
mins: (float *)mins
maxs: (float *)maxs
texture: (texturedef_t *)tex
{
@ -499,7 +495,7 @@ initOwner:::
return self;
}
-setMins:(float *)
- (id) setMins: (float *)
mins maxs: (float *)maxs
{
int i, j;
@ -562,7 +558,6 @@ mins maxs:(float *) maxs
faces[4].planepts[2][1] = pts[2][1][1];
faces[4].planepts[2][2] = pts[2][1][2];
faces[5].planepts[0][0] = pts[2][0][0];
faces[5].planepts[0][1] = pts[2][0][1];
faces[5].planepts[0][2] = pts[2][0][2];
@ -575,23 +570,22 @@ mins maxs:(float *) maxs
faces[5].planepts[2][1] = pts[0][0][1];
faces[5].planepts[2][2] = pts[0][0][2];
[self calcWindings];
return self;
}
-parent
- (id) parent
{
return parent;
}
-setParent:(id) p
- (id) setParent: (id)p
{
parent = p;
return self;
}
-setEntityColor:(vec3_t) color
- (id) setEntityColor: (vec3_t)color
{
VectorCopy (color, entitycolor);
return self;
@ -601,12 +595,13 @@ mins maxs:(float *) maxs
{
int i;
for (i = 0; i < MAX_FACES; i++)
for (i = 0; i < MAX_FACES; i++) {
if (faces[i].w) {
free (faces[i].w);
faces[i].w = NULL;
}
}
}
- (void) dealloc
{
@ -621,7 +616,7 @@ initOwner: fromTokens
*/
int numsb;
-initFromScript:(script_t *)script owner:own
- (id) initFromScript: (script_t *)script owner: own
{
face_t *f;
int i, j;
@ -647,7 +642,8 @@ int numsb;
for (j = 0; j < 3; j++) {
Script_GetToken (script, false);
f->planepts[i][j] = atoi (Script_Token (script));
} Script_GetToken (script, false);
}
Script_GetToken (script, false);
if (strcmp (Script_Token (script), ")"))
Sys_Error ("parsing map file");
@ -691,7 +687,7 @@ int numsb;
if (flags & TEX_FLIPT)
f->texture.scale[1] = -1;
}
#endif
#endif /* if 0 */
f++;
numfaces++;
} while (1);
@ -715,16 +711,15 @@ writeToFILE
face_t *fa;
texturedef_t *td;
if (reg && regioned)
return;
fprintf (f, "{\n");
for (i = 0; i < numfaces; i++) {
fa = &faces[i];
for (j = 0; j < 3; j++)
for (j = 0; j < 3; j++) {
fprintf (f, "( %d %d %d ) ", (int) fa->planepts[j][0],
(int) fa->planepts[j][1], (int) fa->planepts[j][2]);
}
td = &fa->texture;
fprintf (f, "%s %d %d %d %f %f\n", td->texture, (int) td->shift[0],
(int) td->shift[1], (int) td->rotate, td->scale[0],
@ -735,8 +730,6 @@ writeToFILE
return;
}
/*
==============================================================================
@ -745,14 +738,13 @@ INTERACTION
==============================================================================
*/
- (void)getMins:(vec3_t)
mins maxs:(vec3_t) maxs
- (void) getMins: (vec3_t)mins
maxs: (vec3_t)maxs
{
VectorCopy (bmins, mins);
VectorCopy (bmaxs, maxs);
}
- (BOOL) selected
{
return selected;
@ -773,7 +765,6 @@ mins maxs:(vec3_t) maxs
regioned = s;
}
/*
===========
setTexturedef
@ -791,11 +782,11 @@ setTexturedef
[self calcWindings]; // in case texture coords changed
}
- (void) setTexturedef: (texturedef_t *)tex forFace: (int)f
- (void) setTexturedef: (texturedef_t *)tex
forFace: (int)f
{
if (f > numfaces)
Sys_Error ("setTexturedef:forFace: bad face number %i", f);
faces[f].texture = *tex;
faces[f].qtexture = NULL; // recache next render
@ -817,7 +808,6 @@ texturedef
return &faces[f].texture;
}
/*
===========
removeIfInvalid
@ -825,7 +815,7 @@ removeIfInvalid
So created veneers don't stay around
===========
*/
-removeIfInvalid
- (id) removeIfInvalid
{
int i, j;
@ -834,6 +824,7 @@ So created veneers don't stay around
continue;
for (j = i + 1; j < numfaces; j++)
faces[j - 1] = faces[j];
i--;
numfaces--;
}
@ -858,19 +849,25 @@ containsPoint
{
int i;
for (i = 0; i < numfaces; i++)
for (i = 0; i < numfaces; i++) {
if (DotProduct (faces[i].plane.normal, pt) >= faces[i].plane.dist)
return NO;
}
return YES;
}
/*
===========
clipRay
clipRay::::::
===========
*/
-clipRay: (vec3_t) p1: (vec3_t) p2: (vec3_t) frontpoint: (int *) f_face: (vec3_t) backpoint:(int *) b_face
- (id) clipRay: (vec3_t)p1
: (vec3_t)p2
: (vec3_t)frontpoint
: (int *)f_face
: (vec3_t)backpoint
: (int *)b_face
{
int frontface, backface;
int i, j;
@ -889,8 +886,7 @@ clipRay
continue; // clipped off plane
d1 = DotProduct (p1, f->plane.normal) - f->plane.dist;
d2 = DotProduct (p2, f->plane.normal) - f->plane.dist;
if (d1 >= 0 && d2 >= 0) { // the entire ray is in front of the
// polytope
if (d1 >= 0 && d2 >= 0) { // the whole ray is in front of the polytope
*f_face = -1;
*b_face = -1;
return self;
@ -900,6 +896,7 @@ clipRay
m = d1 / (d1 - d2);
for (j = 0; j < 3; j++)
frontpoint[j] = p1[j] + m * (p2[j] - p1[j]);
p1 = frontpoint;
}
if (d1 < 0 && d2 > 0) { // new back plane
@ -907,6 +904,7 @@ clipRay
m = d1 / (d1 - d2);
for (j = 0; j < 3; j++)
backpoint[j] = p1[j] + m * (p2[j] - p1[j]);
p2 = backpoint;
}
}
@ -917,14 +915,16 @@ clipRay
return self;
}
/*
===========
hitByRay
hitByRay::::
===========
*/
- (void) 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;
int frontface, backface;
@ -936,15 +936,13 @@ hitByRay
[self clipRay: p1 : p2 : frontpoint : &frontface : backpoint : &backface];
if (frontface == -2 && backface == -2) { // entire ray is inside the
// brush, select first face
if (frontface == -2 && backface == -2) {
// entire ray is inside the brush, select first face
*time = 0;
*face = 0;
}
if (frontface < 0) { // ray started inside the polytope,
// don't select it
if (frontface < 0) { // ray started inside the polytope, don't select it
*time = -1;
*face = -1;
}
@ -960,7 +958,6 @@ hitByRay
*face = frontface;
}
/*
==============================================================================
@ -971,7 +968,7 @@ DRAWING ROUTINES
BOOL fakebrush;
-drawConnections
- (id) drawConnections
{
id obj;
int c, i;
@ -1010,7 +1007,6 @@ BOOL fakebrush;
if (!forward[0] && !forward[1])
continue;
VectorNormalize (forward);
forward[0] = 8 * forward[0];
forward[1] = 8 * forward[1];
@ -1027,7 +1023,6 @@ BOOL fakebrush;
temp[0] = mid[0] - right[0] - forward[0];
temp[1] = mid[1] - right[1] - forward[1];
XYlineto (temp);
}
return self;
@ -1086,12 +1081,12 @@ XYDrawSelf
if (parent != worldent && worldent == currentent)
linecolor (entitycolor[0], entitycolor[1], entitycolor[2]);
else if (selected)
linecolor (1, 0, 0); // selected
else if (parent == currentent)
linecolor (0, 0, 0); // unselected, but in same entity
else
linecolor (0, 0.5, 0); // other entity green
else if (selected) // selected
linecolor (1, 0, 0);
else if (parent == currentent) // unselected, but in same entity
linecolor (0, 0, 0);
else // other entity green
linecolor (0, 0.5, 0);
if (keybrush)
[self drawConnections]; // target line
@ -1116,12 +1111,10 @@ XYDrawSelf
}
if (keybrush) {
// angle arrow
val =[parent valueForQKey:"angle"];
val = [parent valueForQKey: "angle"]; // angle arrow
if (val && val[0]) {
ang = atof (val) * M_PI / 180;
if (ang > 0) // negative values are up/down flags
{
if (ang > 0) { // negative values are up/down flags
mid[0] = (bmins[0] + bmaxs[0]) / 2;
mid[1] = (bmins[1] + bmaxs[1]) / 2;
@ -1174,9 +1167,10 @@ ZDrawSelf
[zview_i getPoint: &p];
p1[0] = p.x;
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])
return;
}
p1[2] = 4096;
p2[0] = p1[0];
@ -1240,7 +1234,6 @@ CameraDrawSelf
return;
}
/*
===========
XYRenderSelf
@ -1273,6 +1266,7 @@ CameraRenderSelf
if ([self fakeBrush: @selector (CameraRenderSelf)])
return;
// hack to draw entity boxes as single flat color
if (![parent modifiable]) {
olddraw = r_drawflat;
@ -1324,6 +1318,7 @@ float *controlpoints[MAX_FACES * 3];
for (i = 0; i < numcontrolpoints; i++)
controlpoints[i] = faces[i / 3].planepts[i % 3];
#endif
return NO;
}
@ -1332,7 +1327,6 @@ float *controlpoints[MAX_FACES * 3];
int i, j;
float d;
if (![self checkModifiable])
return;
@ -1341,6 +1335,7 @@ float *controlpoints[MAX_FACES * 3];
for (i = 0; i < numfaces; i++) {
if (!faces[i].w)
continue;
if (faces[i].plane.normal[2] == 1)
d = dragpoint[2] - faces[i].plane.dist;
else if (faces[i].plane.normal[2] == -1)
@ -1371,6 +1366,7 @@ float *controlpoints[MAX_FACES * 3];
for (i = 0; i < numfaces; i++) {
if (!faces[i].w)
continue;
if (faces[i].plane.normal[2])
continue;
@ -1396,10 +1392,8 @@ float *controlpoints[MAX_FACES * 3];
face_t *f;
BOOL onplane[MAX_POINTS_ON_WINDING];
if (![self checkModifiable])
return;
numcontrolpoints = 0;
numdragplanes = 0;
for (i = 0; i < numfaces; i++) {
@ -1412,7 +1406,6 @@ float *controlpoints[MAX_FACES * 3];
d = DotProduct (faces[i].plane.normal, dragpoint) - faces[i].plane.dist;
if (d <= -ON_EPSILON)
continue;
dragplane[i] = YES;
numdragplanes++;
}
@ -1423,6 +1416,7 @@ float *controlpoints[MAX_FACES * 3];
w = f->w;
if (!w)
continue;
if (dragplane[i] && numdragplanes == 1) {
for (j = 0; j < 3; j++) {
controlpoints[numcontrolpoints] = faces[i].planepts[j];
@ -1430,6 +1424,7 @@ float *controlpoints[MAX_FACES * 3];
}
continue;
}
if (!dragplane[i] && numdragplanes > 1)
continue;
@ -1450,6 +1445,7 @@ float *controlpoints[MAX_FACES * 3];
break;
}
}
if (facectl == 0)
continue;
@ -1463,7 +1459,6 @@ float *controlpoints[MAX_FACES * 3];
continue;
if (facectl == 3 && !onplane[(j + 2) % w->numpoints])
continue;
VectorCopy (w->points[j], f->planepts[k]);
controlpoints[numcontrolpoints] = f->planepts[k];
numcontrolpoints++;
@ -1484,17 +1479,19 @@ float *controlpoints[MAX_FACES * 3];
break;
}
for (; j < w->numpoints && k != 3; j++)
for ( ; j < w->numpoints && k != 3; j++) {
if (!onplane[j]) {
VectorCopy (w->points[j], f->planepts[k]);
k++;
}
}
for (j = 0; j < w->numpoints && k != 3; j++)
for (j = 0; j < w->numpoints && k != 3; j++) {
if (!onplane[j]) {
VectorCopy (w->points[j], f->planepts[k]);
k++;
}
}
if (k != 3) {
// Sys_Error ("getXYShearPoints: didn't get three points on plane");
@ -1502,11 +1499,12 @@ float *controlpoints[MAX_FACES * 3];
return;
}
for (j = 0; j < 3; j++)
for (j = 0; j < 3; j++) {
for (k = 0; k < 3; k++)
f->planepts[j][k] = rint (f->planepts[j][k]);
}
}
}
/*
==============================================================================
@ -1525,7 +1523,7 @@ newRegion
Set the regioned flag based on if the object is containted in region_min/max
===========
*/
-newRegion
- (id) newRegion
{
int i;
const char *name;
@ -1578,9 +1576,10 @@ vec3_t select_min, select_max;
{
int i;
for (i = 0; i < 3; i++)
for (i = 0; i < 3; i++) {
if (select_min[i] >= bmaxs[i] || select_max[i] <= bmins[i])
return;
}
selected = YES;
}
@ -1588,20 +1587,21 @@ vec3_t select_min, select_max;
{
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])
return;
}
selected = YES;
}
- (void) regionPartial
{
int i;
for (i = 0; i < 3; i++)
for (i = 0; i < 3; i++) {
if (select_min[i] >= bmaxs[i] || select_max[i] <= bmins[i])
return self;
return;
}
selected = YES;
}
@ -1609,13 +1609,13 @@ vec3_t select_min, select_max;
{
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])
return;
}
selected = YES;
}
id sb_newowner;
- (void) moveToEntity
@ -1643,10 +1643,9 @@ vec3_t sb_translate;
int i, j;
// move the planes
for (i = 0; i < numfaces; i++)
for (j = 0; j < 3; j++) {
VectorAdd (faces[i].planepts[j], sb_translate,
faces[i].planepts[j]);
for (i = 0; i < numfaces; i++) {
for (j = 0; j < 3; j++)
VectorAdd (faces[i].planepts[j], sb_translate, faces[i].planepts[j]);
}
[self calcWindings];
@ -1708,7 +1707,6 @@ vec3_t sb_mins, sb_maxs;
[self release];
}
vec3_t sel_x, sel_y, sel_z;
vec3_t sel_org;
@ -1718,7 +1716,7 @@ vec3_t sel_org;
vec3_t old;
float *p;
for (i = 0; i < numfaces; i++)
for (i = 0; i < numfaces; i++) {
for (j = 0; j < 3; j++) {
p = faces[i].planepts[j];
VectorCopy (p, old);
@ -1728,6 +1726,7 @@ vec3_t sel_org;
p[2] = DotProduct (old, sel_z);
VectorAdd (p, sel_org, p);
}
}
[self calcWindings];
}
@ -1764,7 +1763,6 @@ vec3_t sel_org;
[self setTexturedef: &td];
}
float sb_floor_dir, sb_floor_dist;
- (void) feetToFloor
@ -1791,13 +1789,11 @@ float sb_floor_dir, sb_floor_dist;
if (sb_floor_dir == 1) {
if (dist > 0 && dist < sb_floor_dist)
sb_floor_dist = dist;
} else {
if (dist < 0 && dist > sb_floor_dist)
else if (dist < 0 && dist > sb_floor_dist)
sb_floor_dist = dist;
}
}
/*
===============================================================================
@ -1813,11 +1809,10 @@ id carve_in, carve_out;
// returns the new brush formed after the addition of the given plane
// nil is returned if it faced all of the original setbrush
-addFace:(face_t *) f
- (id) addFace: (face_t *)f
{
if (numfaces == MAX_FACES)
Sys_Error ("addFace: numfaces == MAX_FACES");
faces[numfaces] = *f;
faces[numfaces].texture = faces[0].texture;
faces[numfaces].qtexture = NULL;
@ -1849,7 +1844,7 @@ id carve_in, carve_out;
*f = [front addFace: &fb];
}
-carve
- (id) carve
{
int i;
id front, back;
@ -1860,11 +1855,13 @@ id carve_in, carve_out;
#endif
// check bboxes
for (i = 0; i < 3; i++)
for (i = 0; i < 3; i++) {
if (bmins[i] >= carvemax[i] || bmaxs[i] <= carvemin[i]) {
[carve_out addObject: self];
return self;
}
}
// carve by the planes
back = self;
for (i = 0; i < numcarvefaces; i++) {

View file

@ -33,7 +33,8 @@
@interface Storage: NSObject
{
@public void *dataPtr; /* data of the Storage object */
@public
void *dataPtr; /* data of the Storage object */
const char *description; /* Element description */
NSUInteger numElements; /* Actual number of elements */
NSUInteger maxElements; /* Total allocated elements */
@ -42,12 +43,13 @@
/* Creating, freeing, initializing, and emptying */
-init;
-initCount:(NSUInteger) numSlots elementSize:(NSUInteger) sizeInBytes
- (id) init;
- (id) initCount: (NSUInteger)numSlots
elementSize: (NSUInteger)sizeInBytes
description: (const char *)elemDesc;
- (void) dealloc;
-empty;
-copy;
- (id) empty;
- (id) copy;
/* Manipulating the elements */
@ -55,22 +57,23 @@
- (const char *) description;
- (NSUInteger) count;
- (void *) elementAt: (NSUInteger)index;
-replaceElementAt:(NSUInteger) index with:(void *) anElement;
-setNumSlots:(NSUInteger) numSlots;
-setAvailableCapacity:(NSUInteger) numSlots;
-addElement:(void *) anElement;
-removeLastElement;
-insertElement:(void *) anElement at:(NSUInteger) index;
-removeElementAt:(NSUInteger) index;
- (id) replaceElementAt: (NSUInteger)index
with: (void *)anElement;
- (id) setNumSlots: (NSUInteger)numSlots;
- (id) setAvailableCapacity: (NSUInteger)numSlots;
- (id) addElement: (void *)anElement;
- (id) removeLastElement;
- (id) insertElement: (void *)anElement
at: (NSUInteger)index;
- (id) removeElementAt: (NSUInteger)index;
/* old-style creation */
+new;
+newCount:(NSUInteger) count elementSize:(NSUInteger) sizeInBytes
+ (id) new;
+ (id) newCount: (NSUInteger)count
elementSize: (NSUInteger)sizeInBytes
description: (const char *)descriptor;
@end
@ -79,5 +82,4 @@ typedef struct {
@defs (Storage)
} NXStorageId;
#endif /* __Storage_h_INCLUDE_GNU */

View file

@ -26,7 +26,6 @@
#include <string.h>
#include <strings.h>
#define GNU_STORAGE_NTH(x, N) \
({GNUStorageId* __s = (GNUStorageId*) (x); \
(void*) (((char*) __s->dataPtr) + (__s->elementSize * (N))); })
@ -38,7 +37,7 @@ typedef struct {
@implementation Storage
+initialize
+ (id) initialize
{
if (self == [Storage class])
[self setVersion: 0]; /* beta release */
@ -47,7 +46,8 @@ typedef struct {
// INITIALIZING, FREEING;
-initCount: (NSUInteger) numSlots elementSize: (NSUInteger) sizeInBytes description:(const char *)
- (id) initCount: (NSUInteger)numSlots elementSize: (NSUInteger)sizeInBytes
description: (const char *)
elemDesc;
{
[super init];
@ -60,13 +60,12 @@ typedef struct {
return self;
}
-init
- (id) init
{
return [self initCount: 1 elementSize: sizeof (id)
description: @encode (id)];
}
- (void) dealloc
{
if (dataPtr)
@ -79,10 +78,9 @@ typedef struct {
return description;
}
// COPYING;
-copy
- (id) copy
{
Storage *c = [super copy];
@ -112,7 +110,8 @@ _makeRoomForAnotherIfNecessary (Storage * self)
if (self->numElements == self->maxElements) {
self->maxElements *= 2;
self->dataPtr = (void *)
objc_realloc (self->dataPtr, self->maxElements * self->elementSize);
objc_realloc (self->dataPtr,
self->maxElements * self->elementSize);
}
}
@ -122,11 +121,12 @@ _shrinkIfDesired (Storage * self)
if (self->numElements < (self->maxElements / 2)) {
self->maxElements /= 2;
self->dataPtr = (void *)
objc_realloc (self->dataPtr, self->maxElements * self->elementSize);
objc_realloc (self->dataPtr,
self->maxElements * self->elementSize);
}
}
-setAvailableCapacity:(NSUInteger) numSlots
- (id) setAvailableCapacity: (NSUInteger)numSlots
{
if (numSlots > numElements) {
maxElements = numSlots;
@ -135,7 +135,7 @@ _shrinkIfDesired (Storage * self)
return self;
}
-setNumSlots:(NSUInteger) numSlots
- (id) setNumSlots: (NSUInteger)numSlots
{
if (numSlots > numElements) {
maxElements = numSlots;
@ -164,7 +164,7 @@ _shrinkIfDesired (Storage * self)
return STORAGE_NTH (index);
}
-addElement:(void *) anElement
- (id) addElement: (void *)anElement
{
_makeRoomForAnotherIfNecessary (self);
memcpy (STORAGE_NTH (numElements), anElement, elementSize);
@ -172,7 +172,7 @@ _shrinkIfDesired (Storage * self)
return self;
}
-insertElement:(void *)
- (id) insertElement: (void *)
anElement at: (NSUInteger)index
{
NSUInteger i;
@ -182,6 +182,7 @@ anElement at:(NSUInteger) index
#ifndef STABLE_MEMCPY
for (i = numElements; i >= index; i--)
memcpy (STORAGE_NTH (i + 1), STORAGE_NTH (i), elementSize);
#else
memcpy (STORAGE_NTH (index + 1),
STORAGE_NTH (index), elementSize * (numElements - index));
@ -191,7 +192,7 @@ anElement at:(NSUInteger) index
return self;
}
-removeElementAt:(NSUInteger) index
- (id) removeElementAt: (NSUInteger)index
{
NSUInteger i;
@ -200,6 +201,7 @@ anElement at:(NSUInteger) index
#ifndef STABLE_MEMCPY
for (i = index; i < numElements; i++)
memcpy (STORAGE_NTH (i), STORAGE_NTH (i + 1), elementSize);
#else
memcpy (STORAGE_NTH (index),
STORAGE_NTH (index + 1), elementSize * (numElements - index - 1));
@ -208,7 +210,7 @@ anElement at:(NSUInteger) index
return self;
}
-removeLastElement
- (id) removeLastElement
{
if (numElements) {
numElements--;
@ -217,7 +219,7 @@ anElement at:(NSUInteger) index
return self;
}
-replaceElementAt:(NSUInteger)
- (id) replaceElementAt: (NSUInteger)
index with: (void *)newElement
{
CHECK_INDEX (index);
@ -227,7 +229,7 @@ index with:(void *) newElement
/* Emptying the Storage */
-empty
- (id) empty
{
numElements = 0;
maxElements = 1;
@ -235,16 +237,17 @@ index with:(void *) newElement
return self;
}
+new
+ (id) new
{
return [[self alloc] init];
}
+newCount:(NSUInteger)
+ (id) newCount: (NSUInteger)
count elementSize: (NSUInteger)sizeInBytes
description: (const char *)descriptor
{
return[[self alloc] initCount: count elementSize: sizeInBytes description:descriptor];
return [[self alloc] initCount: count elementSize: sizeInBytes description:
descriptor];
}
@end

View file

@ -10,7 +10,6 @@ typedef union {
unsigned p;
} pixel32_t;
typedef struct {
char texture[16];
float rotate;
@ -18,7 +17,6 @@ typedef struct {
float scale[2];
} texturedef_t;
typedef struct {
char name[16];
@ -69,46 +67,47 @@ extern id texturepalette_i;
}
- (const char *) currentWad;
-initPaletteFromWadfile:(const char *) wf;
-computeTextureViewSize;
-alphabetize;
-getList;
- (id) initPaletteFromWadfile: (const char *)wf;
- (id) computeTextureViewSize;
- (id) alphabetize;
- (id) getList;
- (int) getSelectedTexture;
-setSelectedTexture:(int) which;
- (id) setSelectedTexture: (int)which;
- (int) getSelectedTexIndex;
// Called externally
- (const char *) getSelTextureName;
-setTextureByName:(const char *) name;
- (id) setTextureByName: (const char *)name;
// New methods to replace the 2 above ones
-setTextureDef:(texturedef_t *) td;
-getTextureDef:(texturedef_t *) td;
- (id) setTextureDef: (texturedef_t *)td;
- (id) getTextureDef: (texturedef_t *)td;
// Action methods
-searchForTexture:sender;
- (id) searchForTexture: sender;
-clearTexinfo:sender;
- (id) clearTexinfo: sender;
-incXShift:sender;
-decXShift:sender;
- (id) incXShift: sender;
- (id) decXShift: sender;
-incYShift:sender;
-decYShift:sender;
- (id) incYShift: sender;
- (id) decYShift: sender;
-incRotate:sender;
-decRotate:sender;
- (id) incRotate: sender;
- (id) decRotate: sender;
-incXScale:sender;
-decXScale:sender;
- (id) incXScale: sender;
- (id) decXScale: sender;
-incYScale:sender;
-decYScale:sender;
- (id) incYScale: sender;
- (id) decYScale: sender;
-texturedefChanged:sender;
-onlyShowMapTextures:sender;
- (id) texturedefChanged: sender;
- (id) onlyShowMapTextures: sender;
- (int) searchForTextureInPalette: (const char *)texture;
-setDisplayFlag:(int) index to:(int) value;
- (id) setDisplayFlag: (int)index
to: (int)value;
@end
#endif // TexturePalette_h

View file

@ -17,7 +17,6 @@
id texturepalette_i;
int tex_count;
qtexture_t qtextures[MAX_TEXTURES];
@ -65,8 +64,7 @@ unsigned badtex_d[] = {
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
};
qtexture_t badtex =
{ "notexture", 16, 16, NULL, badtex_d, {{0, 0, 255, 255}} };
qtexture_t badtex = {"notexture", 16, 16, NULL, badtex_d, {{0, 0, 255, 255}}};
void
CleanupName (const char *in, char *out)
@ -112,7 +110,6 @@ TEX_InitPalette (wad_t *wad, lumpinfo_t *pallump)
free (opal);
}
/*
=================
TEX_ImageFromMiptex
@ -137,7 +134,16 @@ TEX_ImageFromMiptex (wad_t *wad, lumpinfo_t *qtexlump)
height = LittleLong (qtex->height);
bm = [[NSBitmapImageRep alloc]
initWithBitmapDataPlanes: NULL pixelsWide: width pixelsHigh: height bitsPerSample: 8 samplesPerPixel: 3 hasAlpha: NO isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace bytesPerRow: width * 4 bitsPerPixel:32];
initWithBitmapDataPlanes: NULL
pixelsWide: width
pixelsHigh: height
bitsPerSample: 8
samplesPerPixel: 3
hasAlpha: NO
isPlanar: NO
colorSpaceName: NSCalibratedRGBColorSpace
bytesPerRow: width * 4
bitsPerPixel: 32];
dest = (unsigned *) [bm bitmapData];
count = width * height;
@ -191,6 +197,7 @@ TEX_InitFromWad (const char *path)
// free any textures
for (i = 0; i < tex_count; i++)
[qtextures[i].rep release];
tex_count = 0;
// try to use the cached wadfile
@ -201,15 +208,15 @@ TEX_InitFromWad (const char *path)
NSRunAlertPanel (@"Wad Error!",
[NSString stringWithFormat: @"Failed to open '%s'",
newpath],
@"OK", nil, nil);
@"OK", nil,
nil);
return 0;
}
lumpinfo = wad->lumps;
if (strcmp (lumpinfo->name, "PALETTE")) {
if (strcmp (lumpinfo->name, "PALETTE"))
Sys_Error ("TEX_InitFromWad: %s doesn't have palette as 0", path);
}
TEX_InitPalette (wad, lumpinfo);
@ -251,12 +258,10 @@ TEX_ForName (const char *name)
return &badtex;
}
// ===========================================================================
@implementation TexturePalette
-init
- (id) init
{
[super init];
texturepalette_i = self;
@ -269,13 +274,12 @@ TEX_ForName (const char *name)
[[textureView_i superview] display];
}
- (const char *) currentWad
{
return currentwad;
}
-initPaletteFromWadfile:(const char *) wf
- (id) initPaletteFromWadfile: (const char *)wf
{
int i;
texpal_t t;
@ -290,13 +294,13 @@ TEX_ForName (const char *name)
return self;
// Create STORAGE
if (textureList_i)
if (textureList_i) {
[textureList_i empty];
else
} else {
textureList_i = [[Storage alloc] initCount: 0
elementSize: sizeof (texpal_t)
description: NULL];
}
// Init STORAGE
for (i = 0, q = qtextures; i < tex_count; i++, q++) {
@ -320,16 +324,14 @@ TEX_ForName (const char *name)
return self;
}
// Return texture STORAGE list
-getList
- (id) getList
{
return textureList_i;
}
// Alphabetize texture list - reverse order!
-alphabetize
- (id) alphabetize
{
int i;
int max;
@ -358,7 +360,7 @@ TEX_ForName (const char *name)
return self;
}
-computeTextureViewSize
- (id) computeTextureViewSize
{
int i;
int max;
@ -405,27 +407,28 @@ TEX_ForName (const char *name)
return self;
}
-windowResized
- (id) windowResized
{
[self computeTextureViewSize];
return self;
}
-texturedefChanged:sender
- (id) texturedefChanged: sender
{
if ([map_i numSelected]) {
if ([[map_i currentEntity] modifiable]) {
[map_i makeSelectedPerform: @selector
(takeCurrentTexture)];
[quakeed_i updateAll];
} else
} else {
Sys_Printf ("can't modify spawned entities\n");
}
}
[quakeed_i makeFirstResponder: quakeed_i];
return self;
}
-clearTexinfo:sender
- (id) clearTexinfo: sender
{
[field_Xshift_i setFloatValue: 0];
[field_Yshift_i setFloatValue: 0];
@ -441,7 +444,7 @@ TEX_ForName (const char *name)
//
// Set the selected texture
//
-setSelectedTexture:(int) which
- (id) setSelectedTexture: (int)which
{
texpal_t *t;
NSRect r;
@ -509,7 +512,7 @@ TEX_ForName (const char *name)
//
// Set selected texture by texture name
//
-setTextureByName:(const char *) name
- (id) setTextureByName: (const char *)name
{
texpal_t *t;
int i;
@ -536,11 +539,10 @@ TEX_ForName (const char *name)
//
// ===================================================
//
// Search for texture named in searchField
//
-searchForTexture:sender
- (id) searchForTexture: sender
{
int i;
int max;
@ -586,7 +588,7 @@ TEX_ForName (const char *name)
//
// Set texture def from outside TexturePalette
//
-setTextureDef:(texturedef_t *) td
- (id) setTextureDef: (texturedef_t *)td
{
[self setTextureByName: td->texture];
@ -604,7 +606,7 @@ TEX_ForName (const char *name)
//
// Return the current texture def to passed *
//
-getTextureDef:(texturedef_t *) td
- (id) getTextureDef: (texturedef_t *)td
{
if (selectedTexture == -1) {
memset (td, 0, sizeof (*td));
@ -628,7 +630,7 @@ TEX_ForName (const char *name)
//
// Change value in a field
//
-changeField:(id)
- (id) changeField: (id)
field by: (int)amount
{
int val;
@ -645,13 +647,13 @@ field by:(int) amount
//
// Inc/Dec the XShift field
//
-incXShift:sender
- (id) incXShift: sender
{
[self changeField: field_Xshift_i by: 8];
return self;
}
-decXShift:sender
- (id) decXShift: sender
{
[self changeField: field_Xshift_i by: -8];
return self;
@ -660,13 +662,13 @@ field by:(int) amount
//
// Inc/Dec the YShift field
//
-incYShift:sender
- (id) incYShift: sender
{
[self changeField: field_Yshift_i by: 8];
return self;
}
-decYShift:sender
- (id) decYShift: sender
{
[self changeField: field_Yshift_i by: -8];
return self;
@ -675,13 +677,13 @@ field by:(int) amount
//
// Inc/Dec the Rotate field
//
-incRotate:sender
- (id) incRotate: sender
{
[self changeField: field_Rotate_i by: 90];
return self;
}
-decRotate:sender
- (id) decRotate: sender
{
[self changeField: field_Rotate_i by: -90];
return self;
@ -690,14 +692,14 @@ field by:(int) amount
//
// Inc/Dec the Xscale field
//
-incXScale:sender
- (id) incXScale: sender
{
[field_Xscale_i setIntValue: 1];
[self texturedefChanged: self];
return self;
}
-decXScale:sender
- (id) decXScale: sender
{
[field_Xscale_i setIntValue: -1];
[self texturedefChanged: self];
@ -707,24 +709,22 @@ field by:(int) amount
//
// Inc/Dec the Yscale field
//
-incYScale:sender
- (id) incYScale: sender
{
[field_Yscale_i setIntValue: 1];
[self texturedefChanged: self];
return self;
}
-decYScale:sender
- (id) decYScale: sender
{
[field_Yscale_i setIntValue: -1];
[self texturedefChanged: self];
return self;
}
// ============================================================================
//
// Search for texture in entire palette
// Return index of texturedef, or -1 if unsuccessful
@ -751,7 +751,7 @@ field by:(int) amount
//
// Scan thru map & display only textures that are in map
//
-onlyShowMapTextures:sender
- (id) onlyShowMapTextures: sender
{
int max;
int i;
@ -794,7 +794,7 @@ field by:(int) amount
return self;
}
-setDisplayFlag:(int)
- (id) setDisplayFlag: (int)
index to: (int)value
{
texpal_t *tp;

View file

@ -9,8 +9,8 @@
int deselectIndex;
}
-setParent:(id) from;
-deselect;
- (id) setParent: (id)from;
- (id) deselect;
@end
#endif // TextureView_h

View file

@ -14,13 +14,13 @@ NOTE: I am specifically not using cached image reps, because the data is also ne
@implementation TextureView
-init
- (id) init
{
deselectIndex = -1;
return self;
}
-setParent:(id) from
- (id) setParent: (id)from
{
parent_i = from;
return self;
@ -31,7 +31,7 @@ NOTE: I am specifically not using cached image reps, because the data is also ne
return YES;
}
-drawRect: (NSRect) rects
- (id) drawRect: (NSRect)rects
{
int i;
int max;
@ -53,7 +53,6 @@ NOTE: I am specifically not using cached image reps, because the data is also ne
if (!list_i) // WADfile didn't init
return self;
if (deselectIndex != -1) {
t = [list_i elementAt: deselectIndex];
r = t->r;
@ -105,13 +104,13 @@ NOTE: I am specifically not using cached image reps, because the data is also ne
return self;
}
-deselect
- (id) deselect
{
deselectIndex = [parent_i getSelectedTexture];
return self;
}
-mouseDown:(NSEvent *) theEvent
- (id) mouseDown: (NSEvent *)theEvent
{
NSPoint loc;
int i;

View file

@ -23,25 +23,24 @@ extern id things_i;
id flags_i;
}
-initEntities;
- (id) initEntities;
-newCurrentEntity;
-setSelectedKey:(epair_t *) ep;
- (id) newCurrentEntity;
- (id) setSelectedKey: (epair_t *)ep;
-clearInputs;
- (id) clearInputs;
- (const char *) spawnName;
// UI targets
-reloadEntityClasses:sender;
-selectEntity:sender;
-doubleClickEntity:sender;
- (id) reloadEntityClasses: sender;
- (id) selectEntity: sender;
- (id) doubleClickEntity: sender;
// Action methods
-addPair:sender;
-delPair:sender;
-setAngle:sender;
-setFlags:sender;
- (id) addPair: sender;
- (id) delPair: sender;
- (id) setAngle: sender;
- (id) setFlags: sender;
@end
#endif // Things_h

View file

@ -12,7 +12,7 @@ id things_i;
@implementation Things
-init
- (id) init
{
[super init];
@ -32,17 +32,17 @@ id things_i;
//
// Load the TEXT object with the entity comment
//
-loadEntityComment:(id) obj
- (id) loadEntityComment: (id)obj
{
[entity_comment_i selectAll: self];
[entity_comment_i replaceCharactersInRange: [entity_comment_i selectedRange] withString: [NSString stringWithCString:[obj
comments]]];
[entity_comment_i
replaceCharactersInRange: [entity_comment_i selectedRange]
withString: [NSString stringWithCString: [obj comments]]];
return self;
}
-initEntities
- (id) initEntities
{
const char *path;
@ -61,7 +61,7 @@ id things_i;
return self;
}
-selectEntity:sender
- (id) selectEntity: sender
{
id matr;
@ -73,7 +73,7 @@ id things_i;
return self;
}
-doubleClickEntity:sender
- (id) doubleClickEntity: sender
{
[map_i makeEntity: sender];
[quakeed_i makeFirstResponder: quakeed_i];
@ -85,11 +85,10 @@ id things_i;
return [[entity_classes_i objectAtIndex: lastSelected] classname];
}
//
// Flush entity classes & reload them!
//
-reloadEntityClasses:sender
- (id) reloadEntityClasses: sender
{
EntityClass *ent;
const char *path;
@ -118,8 +117,7 @@ id things_i;
return self;
}
-selectClass:(const char *) class
- (id) selectClass: (const char *)class
{
id classent;
@ -130,16 +128,15 @@ id things_i;
if (lastSelected < 0)
lastSelected = 0;
[self loadEntityComment: classent];
[[entity_browser_i matrixInColumn: 0] selectCellAtRow: lastSelected column: 0];
[[entity_browser_i matrixInColumn: 0] scrollCellToVisibleAtRow: lastSelected column:0];
[[entity_browser_i matrixInColumn: 0] scrollCellToVisibleAtRow: lastSelected
column: 0];
return self;
}
-newCurrentEntity
- (id) newCurrentEntity
{
id ent, classent, cell;
const char *classname;
@ -159,7 +156,7 @@ id things_i;
flags = atoi (flagname);
// [flags_i setAutodisplay:NO];
for (r = 0; r < 4; r++)
for (r = 0; r < 4; r++) {
for (c = 0; c < 3; c++) {
cell = [flags_i cellAtRow: r column: c];
if (c < 2) {
@ -168,6 +165,7 @@ id things_i;
}
[cell setIntValue: (flags & (1 << ((c * 4) + r))) > 0];
}
}
// [flags_i setAutodisplay:YES];
[flags_i display];
@ -184,7 +182,7 @@ id things_i;
//
// Clicked in the Keypair view - set as selected
//
-setSelectedKey:(epair_t *) ep;
- (id) setSelectedKey: (epair_t *)ep;
{
[keyInput_i setStringValue: [NSString stringWithCString: ep->key]];
[valueInput_i setStringValue: [NSString stringWithCString: ep->value]];
@ -192,7 +190,7 @@ id things_i;
return self;
}
-clearInputs
- (id) clearInputs
{
// [keyInput_i setStringValue: ""];
// [valueInput_i setStringValue: ""];
@ -205,7 +203,7 @@ id things_i;
// Action methods
//
-addPair:sender
- (id) addPair: sender
{
const char *key, *value;
@ -223,7 +221,7 @@ id things_i;
return self;
}
-delPair:sender
- (id) delPair: sender
{
[quakeed_i makeFirstResponder: quakeed_i];
@ -239,11 +237,10 @@ id things_i;
return self;
}
//
// Set the key/value fields to "angle <button value>"
//
-setAngle:sender
- (id) setAngle: sender
{
NSString *value;
@ -264,7 +261,7 @@ id things_i;
return self;
}
-setFlags:sender
- (id) setFlags: sender
{
int flags;
int r, c, i;
@ -273,12 +270,13 @@ id things_i;
[self clearInputs];
flags = 0;
for (r = 0; r < 4; r++)
for (r = 0; r < 4; r++) {
for (c = 0; c < 3; c++) {
cell = [flags_i cellAtRow: r column: c];
i = ([cell intValue] > 0);
flags |= (i << ((c * 4) + r));
}
}
if (!flags)
[[map_i currentEntity] removeKeyPair: "spawnflags"];
@ -291,12 +289,13 @@ id things_i;
return self;
}
//
// Fill the Entity browser
// (Delegate method - delegated in Interface Builder)
//
-(void) browser: sender createRowsForColumn:(int) column inMatrix: matrix
- (void) browser: sender
createRowsForColumn: (int)column
inMatrix: matrix
{
id cell;
int max;
@ -309,8 +308,8 @@ id things_i;
object = [entity_classes_i objectAtIndex: i];
[matrix addRow];
cell = [matrix cellAtRow: i++ column: 0];
[cell setStringValue: [NSString stringWithCString:[object
classname]]];
[cell setStringValue: [NSString
stringWithCString: [object classname]]];
[cell setLeaf: YES];
[cell setLoaded: YES];
}

View file

@ -14,7 +14,6 @@ extern id xyview_i;
#define MINSCALE 0.125
#define MAXSCALE 2.0
extern vec3_t xy_viewnormal; // v_forward for xy view
extern float xy_viewdist; // clip behind this plane
@ -27,8 +26,6 @@ void linecolor (float r, float g, float b);
void XYmoveto (vec3_t pt);
void XYlineto (vec3_t pt);
@interface XYView: NSView
{
NSRect realbounds, newrect, combinedrect;
@ -36,35 +33,41 @@ void XYlineto (vec3_t pt);
int gridsize;
float scale;
//
// for textured view
//
int xywidth, xyheight;
float *xyzbuffer;
unsigned *xypicbuffer;
drawmode_t drawmode;
//
// UI links
//
id mode_radio_i;
}
- (float) currentScale;
-setModeRadio:m;
- (id) setModeRadio: m;
-drawMode:sender;
-setDrawMode:(drawmode_t) mode;
- (id) drawMode: sender;
- (id) setDrawMode: (drawmode_t)mode;
-newSuperBounds;
-newRealBounds:(NSRect) nb;
- (id) newSuperBounds;
- (id) newRealBounds: (NSRect)nb;
-addToScrollRange: (float) x:(float) y;
-setOrigin:(NSPoint) pt scale:(float) sc;
- (id) addToScrollRange: (float)x
: (float)y;
-centerOn:(vec3_t) org;
- (id) setOrigin: (NSPoint)pt scale: (float)sc;
-drawMode:sender;
- (id) centerOn: (vec3_t)org;
-superviewChanged;
- (id) drawMode: sender;
- (id) superviewChanged;
- (int) gridsize;
- (float) snapToGrid: (float)f;
@ -72,6 +75,8 @@ void XYlineto (vec3_t pt);
@end
@interface NSView (XYView)
-(void) setFrame:(NSRect) frame bounds:(NSRect) bounds scale:(NSSize) scale;
- (void) setFrame: (NSRect)frame
bounds: (NSRect)bounds
scale: (NSSize)scale;
@end
#endif // XYView_h

View file

@ -17,7 +17,9 @@ vec3_t xy_viewnormal; // v_forward for xy view
float xy_viewdist; // clip behind this plane
@implementation NSView (XYView)
-(void) setFrame:(NSRect) frame bounds:(NSRect) bounds scale:(NSSize) scale
- (void) setFrame: (NSRect)frame
bounds: (NSRect)bounds
scale: (NSSize)scale
{
// XXX[quakeed_i disableDisplay];
// [self setPostsFrameChangedNotifications:NO];
@ -42,6 +44,7 @@ float xy_viewdist; // clip behind this plane
// [self setPostsBoundsChangedNotifications:YES];
// XXX[quakeed_i reenableDisplay];
}
@end
@implementation XYView
@ -50,7 +53,7 @@ float xy_viewdist; // clip behind this plane
initWithFrame:
==================
*/
- initWithFrame:(NSRect) frameRect
- (id) initWithFrame: (NSRect)frameRect
{
[super initWithFrame: frameRect];
[self allocateGState];
@ -80,7 +83,6 @@ initWithFrame:
[scalebutton_i sizeToFit];
[scalebutton_i selectItemAtIndex: 4];
gridbutton_i = [[NSPopUpButton alloc] init];
[gridbutton_i setTarget: self];
[gridbutton_i setAction: @selector (gridMenuTarget:)];
@ -95,7 +97,9 @@ initWithFrame:
[gridbutton_i sizeToFit];
[gridbutton_i selectItemAtIndex: 4];
//
// initialize the scroll view
//
scrollview_i = [[PopScrollView alloc] initWithFrame: frameRect
button1: scalebutton_i
button2: gridbutton_i];
@ -103,10 +107,11 @@ initWithFrame:
[scrollview_i setAutoresizingMask: (NSViewWidthSizable |
NSViewHeightSizable)];
//
// link objects together
//
[scrollview_i setDocumentView: self];
return scrollview_i;
}
- (BOOL) acceptsFirstResponder
@ -114,7 +119,7 @@ initWithFrame:
return YES;
}
-setModeRadio:m
- (id) setModeRadio: m
{
// this should be set from IB, but because I toss myself in a
// popscrollview the connection gets lost
@ -124,14 +129,14 @@ initWithFrame:
return self;
}
-drawMode:sender
- (id) drawMode: sender
{
drawmode = [sender selectedColumn];
[quakeed_i updateXY];
return self;
}
-setDrawMode:(drawmode_t) mode
- (id) setDrawMode: (drawmode_t)mode
{
drawmode = mode;
[mode_radio_i selectCellAtRow: 0 column: mode];
@ -139,14 +144,13 @@ initWithFrame:
return self;
}
- (float) currentScale
{
return scale;
}
-setOrigin:(NSPoint)pt scale:(float) sc
- (id) setOrigin: (NSPoint)pt
scale: (float)sc
{
NSRect sframe;
NSRect bounds;
@ -185,7 +189,7 @@ initWithFrame:
return self;
}
-centerOn:(vec3_t) org
- (id) centerOn: (vec3_t)org
{
NSRect sbounds;
NSPoint mid, origin;
@ -209,7 +213,7 @@ newSuperBounds
When superview is resized
==================
*/
-newSuperBounds
- (id) newSuperBounds
{
NSRect r;
@ -228,7 +232,7 @@ Should only change the scroll bars, not cause any redraws.
If realbounds has shrunk, nothing will change.
===================
*/
-newRealBounds:(NSRect) nb
- (id) newRealBounds: (NSRect)nb
{
NSRect bounds;
NSRect sframe;
@ -258,7 +262,6 @@ If realbounds has shrunk, nothing will change.
return self;
}
/*
====================
scaleMenuTarget:
@ -267,7 +270,7 @@ Called when the scaler popup on the window is used
====================
*/
-scaleMenuTarget:sender
- (id) scaleMenuTarget: sender
{
char const *item;
NSRect rect;
@ -302,7 +305,7 @@ Called when the scaler popup on the window is used
zoomIn
==============
*/
-zoomIn:(NSPoint *) constant
- (id) zoomIn: (NSPoint *)constant
{
id itemlist, selectedItem;
int selected, numrows;
@ -320,7 +323,6 @@ zoomIn
selected = [itemlist indexOfObject: selectedItem] + 1;
if (selected >= numrows)
return NULL;
[scalebutton_i selectItemAtIndex: selected];
//
@ -338,13 +340,12 @@ zoomIn
return self;
}
/*
==============
zoomOut
==============
*/
-zoomOut:(NSPoint *) constant
- (id) zoomOut: (NSPoint *)constant
{
id itemlist, selectedItem;
int selected;
@ -379,7 +380,6 @@ zoomOut
return self;
}
/*
====================
gridMenuTarget:
@ -388,7 +388,7 @@ Called when the scaler popup on the window is used
====================
*/
-gridMenuTarget:sender
- (id) gridMenuTarget: sender
{
char const *item;
int grid;
@ -398,14 +398,12 @@ Called when the scaler popup on the window is used
if (grid == gridsize)
return NULL;
gridsize = grid;
[quakeed_i updateAll];
return self;
}
/*
====================
snapToGrid
@ -425,14 +423,13 @@ snapToGrid
return gridsize;
}
/*
===================
addToScrollRange::
===================
*/
-addToScrollRange: (float) x:(float) y;
- (id) addToScrollRange: (float)x
: (float)y;
{
if (x < newrect.origin.x) {
newrect.size.width += newrect.origin.x - x;
@ -446,10 +443,8 @@ addToScrollRange::
if (x > newrect.origin.x + newrect.size.width)
newrect.size.width += x - (newrect.origin.x + newrect.size.width);
if (y > newrect.origin.y + newrect.size.height)
newrect.size.height += y - (newrect.origin.y + newrect.size.height);
return self;
}
@ -458,14 +453,13 @@ addToScrollRange::
superviewChanged
===================
*/
-superviewChanged
- (id) superviewChanged
{
[self newRealBounds: realbounds];
return self;
}
/*
===============================================================================
@ -489,6 +483,7 @@ lineflush (void)
{
if ([path isEmpty])
return;
// endUserPath (upath, dps_ustroke);
[[NSColor colorWithCalibratedRed: cur_linecolor[0]
green: cur_linecolor[1]
@ -511,6 +506,7 @@ void
XYmoveto (vec3_t pt)
{
NSPoint point = {pt[0], pt[1]};
if ([path elementCount] > 2048)
lineflush ();
[path moveToPoint: point];
@ -520,6 +516,7 @@ void
XYlineto (vec3_t pt)
{
NSPoint point = {pt[0], pt[1]};
[path lineToPoint: point];
}
@ -534,7 +531,7 @@ Rect is in global world (unscaled) coordinates
============
*/
-drawGrid:(NSRect) rect
- (id) drawGrid: (NSRect)rect
{
int x, y, stopx, stopy;
float top, bottom, right, left;
@ -570,16 +567,19 @@ Rect is in global world (unscaled) coordinates
stopx *= gridsize;
if (y < bottom)
y += gridsize;
if (x < left)
x += gridsize;
if (stopx >= right)
stopx -= gridsize;
if (stopy >= top)
stopy -= gridsize;
[path removeAllPoints];
for (; y <= stopy; y += gridsize)
for ( ; y <= stopy; y += gridsize) {
if (y & 63) {
point.x = left;
point.y = y;
@ -587,8 +587,9 @@ Rect is in global world (unscaled) coordinates
point.x = right;
[path lineToPoint: point];
}
}
for (; x <= stopx; x += gridsize)
for ( ; x <= stopx; x += gridsize) {
if (x & 63) {
point.x = x;
point.y = top;
@ -596,19 +597,21 @@ Rect is in global world (unscaled) coordinates
point.y = bottom;
[path lineToPoint: point];
}
}
// endUserPath (upath, dps_ustroke);
[[NSColor colorWithCalibratedRed: 0.8
green: 0.8
blue: 1.0
alpha: 1.0] set]; // thin grid color
[path stroke];
}
//
// tiles
//
[[NSColor colorWithCalibratedWhite: 0.0 / 16.0 alpha: 1.0]
set]; // for text
// for text
[[NSColor colorWithCalibratedWhite: 0.0 / 16.0 alpha: 1.0] set];
if (scale > 4.0 / 64) {
y = floor (bottom / 64);
@ -622,10 +625,13 @@ Rect is in global world (unscaled) coordinates
stopx *= 64;
if (y < bottom)
y += 64;
if (x < left)
x += 64;
if (stopx >= right)
stopx -= 64;
if (stopy >= top)
stopy -= 64;
@ -655,8 +661,7 @@ Rect is in global world (unscaled) coordinates
}
// endUserPath (upath, dps_ustroke);
[[NSColor colorWithCalibratedWhite: 12.0 / 16.0 alpha: 1.0]
set];
[[NSColor colorWithCalibratedWhite: 12.0 / 16.0 alpha: 1.0] set];
[path stroke];
}
[path setLineWidth: 1];
@ -669,7 +674,7 @@ Rect is in global world (unscaled) coordinates
drawWire
==================
*/
-drawWire:(NSRect) rect
- (id) drawWire: (NSRect)rect
{
NSRect visRect;
int i, j, c, c2;
@ -680,15 +685,12 @@ drawWire
drawnames = [quakeed_i showNames];
if ([quakeed_i showCoordinates]) // if coords are showing, update
// everything
{
if ([quakeed_i showCoordinates]) { // coords are showing, update everything
visRect = [self visibleRect];
rect = visRect;
xy_draw_rect = rect;
}
NSRectClip (rect);
// erase window
@ -733,19 +735,19 @@ drawWire
newrect.origin.y -= gridsize;
newrect.size.width += 2 * gridsize;
newrect.size.height += 2 * gridsize;
if (!NSEqualRects (newrect, realbounds))
[self newRealBounds: newrect];
return self;
}
/*
=============
drawSolid
=============
*/
-drawSolid
- (id) drawSolid
{
const unsigned char *planes[5];
NSRect visRect;
@ -758,8 +760,7 @@ drawSolid
r_origin[0] = visRect.origin.x;
r_origin[1] = visRect.origin.y;
r_origin[2] = scale / 2; // using Z as a scale for the 2D
// projection
r_origin[2] = scale / 2; // using Z as a scale for the 2D projection
r_width = visRect.size.width * r_origin[2];
r_height = visRect.size.height * r_origin[2];
@ -794,12 +795,8 @@ drawSolid
[[self window] setBackingType: NSBackingStoreRetained];
planes[0] = (unsigned char *) r_picbuffer;
NSDrawBitmap (visRect,
r_width,
r_height,
8,
3,
32, r_width * 4, NO, NO, NSCalibratedRGBColorSpace, planes);
NSDrawBitmap (visRect, r_width, r_height, 8, 3, 32, r_width * 4, NO, NO,
NSCalibratedRGBColorSpace, planes);
// NSPing ();
[[self window] setBackingType: NSBackingStoreBuffered];
@ -815,13 +812,12 @@ drawSelf
*/
NSRect xy_draw_rect;
-drawRect: (NSRect) rect
- (id) drawRect: (NSRect)rect
{
float drawtime = 0;
if (timedrawing)
drawtime = Sys_DoubleTime ();
xy_draw_rect = rect;
newrect.origin.x = newrect.origin.y = 99999;
newrect.size.width = newrect.size.height = -2 * 99999;
@ -846,8 +842,6 @@ NSRect xy_draw_rect;
return self;
}
/*
===============================================================================
@ -863,7 +857,9 @@ dragLoop:
*/
static NSPoint oldreletive;
-dragFrom: (NSEvent *) startevent useGrid: (BOOL) ug callback:(void (*)(float dx, float dy)) callback
- (id) dragFrom: (NSEvent *)startevent
useGrid: (BOOL)ug
callback: (void (*)(float dx, float dy))callback
{
NSEvent *event;
NSPoint startpt, newpt;
@ -883,18 +879,19 @@ static NSPoint oldreletive;
unsigned eventMask = NSLeftMouseUpMask | NSLeftMouseDraggedMask
| NSRightMouseUpMask | NSRightMouseDraggedMask
| NSApplicationDefinedMask;
event =[NSApp nextEventMatchingMask: eventMask untilDate:[NSDate
distantFuture]
inMode: NSEventTrackingRunLoopMode dequeue:YES];
event =
[NSApp nextEventMatchingMask: eventMask untilDate: [NSDate distantFuture
]
inMode: NSEventTrackingRunLoopMode
dequeue: YES];
if ([event type] == NSLeftMouseUp || [event type] == NSRightMouseUp)
break;
if ([event type] == NSApplicationDefined) { // doesn't work. grrr.
if ([event type] == NSApplicationDefined) { // doesn't work.
// grrr.
// [quakeed_i applicationDefined:event];
continue;
}
newpt = [event locationInWindow];
newpt = [self convertPoint: newpt fromView: NULL];
@ -913,7 +910,6 @@ static NSPoint oldreletive;
oldreletive = reletive;
callback (delta.x, delta.y);
}
return self;
@ -921,7 +917,6 @@ static NSPoint oldreletive;
// ============================================================================
void
DragCallback (float dx, float dy)
{
@ -934,13 +929,12 @@ DragCallback (float dx, float dy)
[quakeed_i redrawInstance];
}
-selectionDragFrom:(NSEvent *) theEvent
- (id) selectionDragFrom: (NSEvent *)theEvent
{
Sys_Printf ("dragging selection\n");
[self dragFrom: theEvent useGrid: YES callback: DragCallback];
[quakeed_i updateAll];
return self;
}
// ============================================================================
@ -965,12 +959,11 @@ ScrollCallback (float dx, float dy)
[xyview_i setOrigin: neworg scale: scale];
}
-scrollDragFrom:(NSEvent *) theEvent
- (id) scrollDragFrom: (NSEvent *)theEvent
{
Sys_Printf ("scrolling view\n");
[self dragFrom: theEvent useGrid: YES callback: ScrollCallback];
return self;
}
// ============================================================================
@ -998,7 +991,7 @@ DirectionCallback (float dx, float dy)
[cameraview_i display];
}
-directionDragFrom:(NSEvent *) theEvent
- (id) directionDragFrom: (NSEvent *)theEvent
{
NSPoint pt;
@ -1045,7 +1038,7 @@ NewCallback (float dx, float dy)
[quakeed_i redrawInstance];
}
-newBrushDragFrom:(NSEvent *) theEvent
- (id) newBrushDragFrom: (NSEvent *)theEvent
{
id owner;
texturedef_t td;
@ -1068,7 +1061,10 @@ NewCallback (float dx, float dy)
[texturepalette_i getTextureDef: &td];
newbrush =[[SetBrush alloc] initOwner: owner mins: neworg maxs: newdrag texture:&td];
newbrush = [[SetBrush alloc] initOwner: owner
mins: neworg
maxs: newdrag
texture: &td];
[owner addObject: newbrush];
[newbrush setSelected: YES];
@ -1079,7 +1075,6 @@ NewCallback (float dx, float dy)
[quakeed_i updateCamera];
return self;
}
// ============================================================================
@ -1105,7 +1100,6 @@ ControlCallback (float dx, float dy)
if ([map_i numSelected] != 1)
return NO;
pt = [theEvent locationInWindow];
pt = [self convertPoint: pt fromView: NULL];
@ -1116,7 +1110,6 @@ ControlCallback (float dx, float dy)
[[map_i selectedBrush] getXYdragface: dragpoint];
if (!numcontrolpoints)
return NO;
Sys_Printf ("dragging brush plane\n");
pt = [theEvent locationInWindow];
@ -1165,11 +1158,9 @@ ControlCallback (float dx, float dy)
dragpoint[2] = (p1[2] + p2[2]) / 2;
}
[br getXYShearPoints: dragpoint];
if (!numcontrolpoints)
return NO;
Sys_Printf ("dragging brush plane\n");
pt = [theEvent locationInWindow];
@ -1183,7 +1174,6 @@ ControlCallback (float dx, float dy)
return YES;
}
/*
===============================================================================
@ -1192,13 +1182,12 @@ ControlCallback (float dx, float dy)
===============================================================================
*/
/*
===================
mouseDown
===================
*/
-mouseDown:(NSEvent *) theEvent
- (id) mouseDown: (NSEvent *)theEvent
{
NSPoint pt;
id ent;
@ -1217,7 +1206,6 @@ mouseDown
[theEvent modifierFlags] & (NSShiftKeyMask | NSControlKeyMask |
NSAlternateKeyMask | NSCommandKeyMask);
// shift click to select / deselect a brush from the world
if (flags == NSShiftKeyMask) {
[map_i selectRay: p1: p2: YES];
@ -1240,6 +1228,7 @@ mouseDown
[quakeed_i updateZ];
return self;
}
// check eye
if ([cameraview_i XYmouseDown: &pt flags: [theEvent modifierFlags]])
return self; // camera move
@ -1325,7 +1314,7 @@ mouseDown
rightMouseDown
===================
*/
-rightMouseDown:(NSEvent *) theEvent
- (id) rightMouseDown: (NSEvent *)theEvent
{
NSPoint pt;
int flags;
@ -1337,23 +1326,16 @@ rightMouseDown
[theEvent modifierFlags] & (NSShiftKeyMask | NSControlKeyMask |
NSAlternateKeyMask | NSCommandKeyMask);
if (flags == NSCommandKeyMask) {
if (flags == NSCommandKeyMask)
return [self scrollDragFrom: theEvent];
}
if (flags == NSAlternateKeyMask) {
if (flags == NSAlternateKeyMask)
return [clipper_i XYClick: pt];
}
if (flags == 0 || flags == NSControlKeyMask) {
if (flags == 0 || flags == NSControlKeyMask)
return [self directionDragFrom: theEvent];
}
Sys_Printf ("bad flags for click\n");
NopSound ();
return self;
}
@end

View file

@ -8,9 +8,10 @@
id button1;
}
-initWithFrame:(NSRect) frameRect button1:b1;
- (id) initWithFrame: (NSRect)frameRect
button1: b1;
-tile;
- (id) tile;
@end
#endif // ZScrollView_h

View file

@ -8,7 +8,8 @@ initWithFrame: button:
Initizes a scroll view with a button at it's lower right corner
====================
*/
- initWithFrame:(NSRect) frameRect button1:b1
- (id) initWithFrame: (NSRect)frameRect
button1: b1
{
[super initWithFrame: frameRect];
@ -23,6 +24,7 @@ Initizes a scroll view with a button at it's lower right corner
return self;
}
/*
================
tile
@ -30,7 +32,7 @@ tile
Adjust the size for the pop up scale menu
=================
*/
-tile
- (id) tile
{
NSRect scrollerframe;
@ -45,15 +47,13 @@ Adjust the size for the pop up scale menu
return self;
}
- (BOOL) acceptsFirstResponder
{
return YES;
}
/*
- superviewSizeChanged:(const NSSize *)oldSize
#if 0
- (id) superviewSizeChanged: (const NSSize *)oldSize
{
[super superviewSizeChanged: oldSize];
@ -61,7 +61,7 @@ Adjust the size for the pop up scale menu
return self;
}
*/
#endif
@end

View file

@ -26,24 +26,25 @@ extern float zplanedir;
NSBezierPath *checker;
}
-clearBounds;
-getBounds: (float *) top:(float *) bottom;
- (id) clearBounds;
- (id) getBounds: (float *)top
: (float *)bottom;
-getPoint:(NSPoint *) pt;
-setPoint:(NSPoint *) pt;
- (id) getPoint: (NSPoint *)pt;
- (id) setPoint: (NSPoint *)pt;
-addToHeightRange:(float) height;
- (id) addToHeightRange: (float)height;
-newRealBounds;
-newSuperBounds;
- (id) newRealBounds;
- (id) newSuperBounds;
-XYDrawSelf;
- (void) XYDrawSelf;
- (BOOL) XYmouseDown: (NSPoint *)pt;
-setXYOrigin:(NSPoint *) pt;
- (id) setXYOrigin: (NSPoint *)pt;
-setOrigin:(NSPoint) pt scale:(float) sc;
- (id) setOrigin: (NSPoint)pt scale: (float)sc;
@end
#endif // ZView_h

View file

@ -61,7 +61,8 @@ initWithFrame:
[zscalebutton_i selectItemAtIndex: 4];
// initialize the scroll view
zscrollview_i =[[ZScrollView alloc] initWithFrame: frameRect
zscrollview_i = [[ZScrollView alloc]
initWithFrame: frameRect
button1: zscalebutton_i];
[zscrollview_i setAutoresizingMask: NSViewWidthSizable |
NSViewHeightSizable];
@ -83,7 +84,7 @@ initWithFrame:
return zscrollview_i;
}
-setXYOrigin:(NSPoint *) pt
- (id) setXYOrigin: (NSPoint *)pt
{
origin[0] = pt->x + 0.333;
origin[1] = pt->y + 0.333;
@ -100,7 +101,7 @@ initWithFrame:
setOrigin:scale:
===================
*/
-setOrigin:(NSPoint) pt scale:(float) sc
- (id) setOrigin: (NSPoint)pt scale: (float)sc
{
NSRect sframe;
NSRect bounds;
@ -140,7 +141,6 @@ setOrigin:scale:
return self;
}
/*
====================
scaleMenuTarget:
@ -148,7 +148,7 @@ scaleMenuTarget:
Called when the scaler popup on the window is used
====================
*/
-scaleMenuTarget:sender
- (id) scaleMenuTarget: sender
{
char const *item;
NSRect rect;
@ -161,7 +161,6 @@ Called when the scaler popup on the window is used
if (nscale == scale)
return NULL;
// keep the center of the view constant
rect = [_super_view bounds];
mid.x = rect.size.width / 2;
@ -178,8 +177,7 @@ Called when the scaler popup on the window is used
return self;
}
-clearBounds
- (id) clearBounds
{
topbound = 999999;
bottombound = -999999;
@ -187,20 +185,19 @@ Called when the scaler popup on the window is used
return self;
}
-getBounds: (float *) top:(float *) bottom;
- (id) getBounds: (float *)top: (float *)bottom;
{
*top = topbound;
*bottom = bottombound;
return self;
}
/*
==================
addToHeightRange:
==================
*/
-addToHeightRange:(float) height
- (id) addToHeightRange: (float)height
{
if (height < minheight)
minheight = height;
@ -209,7 +206,6 @@ addToHeightRange:
return self;
}
/*
==================
newSuperBounds
@ -217,7 +213,7 @@ newSuperBounds
When _super_view is resized
==================
*/
-newSuperBounds
- (id) newSuperBounds
{
oldminheight++;
[self newRealBounds];
@ -225,7 +221,6 @@ When _super_view is resized
return self;
}
/*
===================
newRealBounds
@ -234,7 +229,7 @@ Should only change the scroll bars, not cause any redraws.
If realbounds has shrunk, nothing will change.
===================
*/
-newRealBounds
- (id) newRealBounds
{
NSRect bounds;
NSRect sframe;
@ -244,7 +239,6 @@ If realbounds has shrunk, nothing will change.
if (minheight == oldminheight && maxheight == oldmaxheight)
return self;
oldminheight = minheight;
oldmaxheight = maxheight;
@ -276,8 +270,6 @@ If realbounds has shrunk, nothing will change.
return self;
}
/*
============
drawGrid
@ -289,7 +281,7 @@ Rect is in global world (unscaled) coordinates
============
*/
-drawGrid:(NSRect) rect
- (id) drawGrid: (NSRect)rect
{
int y, stopy;
float top, bottom;
@ -306,12 +298,13 @@ Rect is in global world (unscaled) coordinates
right = 24;
bottom = rect.origin.y - 1;
top = rect.origin.y + rect.size.height + 2;
//
// grid
//
// can't just divide by grid size because of negetive coordinate
// truncating direction
//
if (gridsize >= 4 / scale) {
y = floor (bottom / gridsize);
stopy = floor (top / gridsize);
@ -320,19 +313,23 @@ Rect is in global world (unscaled) coordinates
stopy *= gridsize;
if (y < bottom)
y += gridsize;
[path removeAllPoints];
for (; y <= stopy; y += gridsize)
for ( ; y <= stopy; y += gridsize) {
if (y & 31) {
[path moveToPoint: NSMakePoint (left, y)];
[path lineToPoint: NSMakePoint (right, y)];
}
}
// endUserPath (upath, dps_ustroke);
[[NSColor colorWithCalibratedRed: 0.8 green: 0.8 blue: 1.0 alpha: 1.0]
set]; // thin grid color
[[NSColor colorWithCalibratedRed: 0.8
green: 0.8
blue: 1.0
alpha: 1.0] set]; // thin grid color
[path stroke];
}
//
// half tiles
//
@ -345,7 +342,6 @@ Rect is in global world (unscaled) coordinates
stopy *= 32;
if (stopy >= top)
stopy -= 32;
[path removeAllPoints];
for ( ; y <= stopy; y += 64) {
@ -370,10 +366,9 @@ Rect is in global world (unscaled) coordinates
y += 64;
if (stopy >= top)
stopy -= 64;
[path removeAllPoints];
[[NSColor colorWithCalibratedWhite: 0.0 / 16.0 alpha: 1.0]
set]; // for text
[[NSColor colorWithCalibratedWhite: 0.0 / 16.0 alpha: 1.0] set]; // for text
[[NSFont systemFontOfSize: 10] set];
for ( ; y <= stopy; y += 64) {
@ -387,19 +382,16 @@ Rect is in global world (unscaled) coordinates
// divider
[path moveToPoint: NSMakePoint (0, _bounds.origin.y)];
[path lineToPoint:NSMakePoint (0,
_bounds.origin.y + _bounds.size.height)];
[path lineToPoint: NSMakePoint (0, _bounds.origin.y + _bounds.size.height)];
// endUserPath (upath, dps_ustroke);
[[NSColor colorWithCalibratedWhite: 10.0 / 16.0 alpha: 1.0]
set];
[[NSColor colorWithCalibratedWhite: 10.0 / 16.0 alpha: 1.0] set];
[path stroke];
//
// origin
//
[[NSColor colorWithCalibratedWhite: 4.0 / 16.0 alpha: 1.0]
set];
[[NSColor colorWithCalibratedWhite: 4.0 / 16.0 alpha: 1.0] set];
[path removeAllPoints];
[path setLineWidth: 5];
[path moveToPoint: NSMakePoint (right, 0)];
@ -410,11 +402,9 @@ Rect is in global world (unscaled) coordinates
return self;
}
-drawZplane
- (id) drawZplane
{
[[NSColor colorWithCalibratedRed: 0.2 green: 0.2 blue: 0.0 alpha: 1.0]
set];
[[NSColor colorWithCalibratedRed: 0.2 green: 0.2 blue: 0.0 alpha: 1.0] set];
[path appendBezierPathWithArcWithCenter: NSMakePoint (0, zplane)
radius: 4
startAngle: 0
@ -479,27 +469,25 @@ XYDrawSelf
[path release];
}
/*
==============
getPoint: (NSPoint *)pt
==============
*/
-getPoint:(NSPoint *) pt
- (id) getPoint: (NSPoint *)pt
{
pt->x = origin[0] + 0.333; // offset a bit to avoid edge cases
pt->y = origin[1] + 0.333;
return self;
}
-setPoint:(NSPoint *) pt
- (id) setPoint: (NSPoint *)pt
{
origin[0] = pt->x;
origin[1] = pt->y;
return self;
}
/*
==============================================================================
@ -508,7 +496,6 @@ MOUSE CLICKING
==============================================================================
*/
/*
================
dragLoop:
@ -516,7 +503,9 @@ dragLoop:
*/
static NSPoint oldreletive;
-dragFrom: (NSEvent *) startevent useGrid: (BOOL) ug callback:(void (*)(float dy)) callback
- (id) dragFrom: (NSEvent *)startevent
useGrid: (BOOL)ug
callback: (void (*)(float dy))callback
{
NSEvent *event;
NSPoint startpt, newpt;
@ -537,24 +526,21 @@ static NSPoint oldreletive;
| NSApplicationDefinedMask;
event = [NSApp nextEventMatchingMask: eventMask untilDate: [NSDate
distantFuture]
inMode: NSEventTrackingRunLoopMode dequeue:YES];
inMode: NSEventTrackingRunLoopMode dequeue:
YES];
if ([event type] == NSLeftMouseUp || [event type] == NSRightMouseUp)
break;
newpt = [event locationInWindow];
newpt = [self convertPoint: newpt fromView: NULL];
reletive.y = newpt.y - startpt.y;
if (ug) { // we want truncate towards 0 behavior
// here
if (ug) // we want truncate-towards-0 behavior here
reletive.y = gridsize * (int) (reletive.y / gridsize);
}
if (reletive.y == oldreletive.y)
continue;
delta.y = reletive.y - oldreletive.y;
oldreletive = reletive;
callback (delta.y);
@ -565,7 +551,6 @@ static NSPoint oldreletive;
// ============================================================================
void
ZDragCallback (float dy)
{
@ -578,13 +563,12 @@ ZDragCallback (float dy)
[quakeed_i redrawInstance];
}
-selectionDragFrom:(NSEvent *) theEvent
- (id) selectionDragFrom: (NSEvent *)theEvent
{
Sys_Printf ("dragging selection\n");
[self dragFrom: theEvent useGrid: YES callback: ZDragCallback];
[quakeed_i updateCamera];
return self;
}
// ============================================================================
@ -608,7 +592,7 @@ ZScrollCallback (float dy)
[zview_i setOrigin: neworg scale: scale];
}
-scrollDragFrom:(NSEvent *) theEvent
- (id) scrollDragFrom: (NSEvent *)theEvent
{
Sys_Printf ("scrolling view\n");
[self dragFrom: theEvent useGrid: YES callback: ZScrollCallback];
@ -636,7 +620,6 @@ ZControlCallback (float dy)
if ([map_i numSelected] != 1)
return NO;
pt = [theEvent locationInWindow];
pt = [self convertPoint: pt fromView: NULL];
@ -647,7 +630,6 @@ ZControlCallback (float dy)
[[map_i selectedBrush] getZdragface: dragpoint];
if (!numcontrolpoints)
return NO;
Sys_Printf ("dragging brush plane\n");
pt = [theEvent locationInWindow];
@ -661,7 +643,6 @@ ZControlCallback (float dy)
return YES;
}
// ============================================================================
/*
@ -716,7 +697,6 @@ mouseDown
// check eye
if ([cameraview_i ZmouseDown: &pt flags: [theEvent modifierFlags]])
return;
if ([map_i numSelected]) {
if (pt.x > 0) {
if ([self planeDragFrom: theEvent])
@ -725,7 +705,6 @@ mouseDown
[self selectionDragFrom: theEvent];
return;
}
}
Sys_Printf ("bad flags for click %x %g %g\n", flags, pt.x, pt.y);
@ -750,19 +729,15 @@ rightMouseDown
[theEvent modifierFlags] & (NSShiftKeyMask | NSControlKeyMask |
NSAlternateKeyMask | NSCommandKeyMask);
//
// click = scroll view
//
if (flags == 0) {
if (flags == 0)
[self scrollDragFrom: theEvent];
}
Sys_Printf ("bad flags for click\n");
NopSound ();
}
/*
===============================================================================
@ -776,7 +751,9 @@ rightMouseDown
modalMoveLoop
================
*/
-modalMoveLoop: (NSPoint *) basept: (vec3_t) movemod:converter
- (id) modalMoveLoop: (NSPoint *)basept
: (vec3_t)movemod
: converter
{
vec3_t originbase;
NSEvent *event;
@ -802,7 +779,6 @@ modalMoveLoop
for (i = 0; i < 3; i++)
origin[i] = originbase[i] + movemod[i] * delta[i];
drawentry:
// instance draw new frame
[quakeed_i newinstance];
@ -812,7 +788,8 @@ modalMoveLoop
event = [NSApp nextEventMatchingMask: eventMask untilDate: [NSDate
distantFuture]
inMode: NSEventTrackingRunLoopMode dequeue:YES];
inMode: NSEventTrackingRunLoopMode dequeue:
YES];
}
// draw the brush back into the window buffer
@ -832,7 +809,6 @@ XYmouseDown
if (fabs (pt->x - origin[0]) > 16 || fabs (pt->y - origin[1]) > 16)
return NO;
movemod[0] = 1;
movemod[1] = 1;
movemod[2] = 0;

View file

@ -1,6 +1,3 @@
char token[MAXTOKEN];
boolean unget;
char *script_p;
@ -30,25 +27,29 @@ GetToken (boolean crossline)
if (!*script_p) {
if (!crossline)
Error ("Line %i is incomplete", scriptline);
return false;
}
if (*script_p++ == '\n') {
if (!crossline)
Error ("Line %i is incomplete", scriptline);
scriptline++;
}
}
if (script_p[0] == '/' && script_p[1] == '/') // comment field
{
if (script_p[0] == '/' && script_p[1] == '/') { // comment field
if (!crossline)
Error ("Line %i is incomplete\n", scriptline);
while (*script_p++ != '\n')
while (*script_p++ != '\n') {
if (!*script_p) {
if (!crossline)
Error ("Line %i is incomplete", scriptline);
return false;
}
}
goto skipspace;
}
//
@ -61,17 +62,19 @@ GetToken (boolean crossline)
while (*script_p != '"') {
if (!*script_p)
Error ("EOF inside quoted token");
*token_p++ = *script_p++;
if (token_p == &token[MAXTOKEN])
Error ("Token too large on line %i", scriptline);
}
script_p++;
} else
} else {
while (*script_p > 32) {
*token_p++ = *script_p++;
if (token_p == &token[MAXTOKEN])
Error ("Token too large on line %i", scriptline);
}
}
*token_p = 0;
@ -84,10 +87,6 @@ UngetToken ()
unget = true;
}
void
qprintf (char *fmt, ...) // prints text to cmd_out_i
{
@ -104,7 +103,6 @@ qprintf (char *fmt, ...) // prints text to cmd_out_i
return;
}
/*
=================
Error
@ -121,6 +119,7 @@ Error (char *error, ...)
if (in_error)
[NSApp terminate: NULL];
in_error = YES;
va_start (argptr, error);
@ -130,14 +129,11 @@ Error (char *error, ...)
strcat (string, "\nmap saved to " FN_CRASHSAVE);
[map_i writeMapFile: FN_CRASHSAVE useRegion: NO];
NSRunAlertPanel (@"Error",[NSString stringWithCString:string], NULL, NULL,
NULL);
NSRunAlertPanel (@"Error", [NSString stringWithCString: string],
NULL, NULL, NULL);
[NSApp terminate: NULL];
}
void
CleanupName (char *in, char *out)
{
@ -154,7 +150,6 @@ CleanupName (char *in, char *out)
out[i] = 0;
}
void
PrintRect (NSRect * r)
{
@ -163,7 +158,6 @@ PrintRect (NSRect * r)
r->origin.x + r->size.width, r->origin.y + r->size.height);
}
/*
============
FileTime
@ -207,7 +201,6 @@ I_FileOpenRead (char *path, int *handle)
int h;
struct stat fileinfo;
h = open (path, O_RDONLY, 0666);
*handle = h;
if (h == -1)
@ -261,11 +254,11 @@ Sys_UpdateFile (char *path, char *netpath)
buf = malloc (size);
if (read (in, buf, size) != size)
Error ("UpdateFile: couldn't read all of %s", netpath);
close (in);
CreatePath (path);
out = I_FileOpenWrite (path);
write (out, buf, size);
close (out);
}

View file

@ -34,7 +34,6 @@
#include "TextureView.h"
#include "Clipper.h"
void PrintRect (NSRect * r);
int FileTime (char *path);
void Sys_UpdateFile (char *path, char *netpath);
@ -46,11 +45,11 @@ void Error (char *error, ...);
#define MAXTOKEN 128
extern char token[MAXTOKEN];
extern int scriptline;
void StartTokenParsing (char *data);
boolean GetToken (boolean crossline); // returns false at eof
void UngetToken ();
#define FN_CMDOUT "/tmp/QuakeEdCmd.txt"
#define FN_TEMPSAVE "/qcache/temp.map"
#define FN_AUTOSAVE "/qcache/AutoSaveMap.map"

View file

@ -1,4 +1,3 @@
#include "render.h"
extern vec3_t xy_viewnormal;
@ -42,13 +41,11 @@ REN_ClearBuffers (void)
memset (r_picbuffer, 0, size);
}
/*
====================
REN_SetTexture
====================
*/
void
REN_SetTexture (face_t * face)
{
@ -142,7 +139,6 @@ REN_DrawSpan (int y)
if (x2 > r_width)
x2 = r_width;
ofs = y * r_width + x1;
// this should be specialized for 1.0 / 0.5 / 0.75 light levels
@ -177,7 +173,6 @@ REN_DrawSpan (int y)
zfrac += zstep;
ofs++;
}
}
/*
@ -228,7 +223,6 @@ REN_DrawFlatSpan (int y)
zfrac += zstep;
ofs++;
}
}
/*
@ -283,6 +277,7 @@ REN_RasterizeFace (winding_t * w)
do {
for (i = 0; i < 5; i++)
leftside[i] = w->points[leftv][i];
leftv--;
if (leftv == -1)
leftv = numvertex - 1;
@ -295,6 +290,7 @@ REN_RasterizeFace (winding_t * w)
do {
for (i = 0; i < 5; i++)
rightside[i] = w->points[rightv][i];
rightv++;
if (rightv == numvertex)
rightv = 0;
@ -359,7 +355,6 @@ REN_DrawSpanLinear (int y)
ustep = (rightside[3] - ufrac) * scale;
vstep = (rightside[4] - vfrac) * scale;
if (x1 < 0) {
ufrac -= x1 * ustep;
vfrac -= x1 * vstep;
@ -394,7 +389,6 @@ REN_DrawSpanLinear (int y)
zfrac += zstep;
ofs++;
}
}
/*
@ -446,6 +440,7 @@ REN_RasterizeFaceLinear (winding_t * w)
do {
for (i = 0; i < 5; i++)
leftside[i] = w->points[leftv][i];
leftv--;
if (leftv == -1)
leftv = numvertex - 1;
@ -458,6 +453,7 @@ REN_RasterizeFaceLinear (winding_t * w)
do {
for (i = 0; i < 5; i++)
rightside[i] = w->points[rightv][i];
rightv++;
if (rightv == numvertex)
rightv = 0;
@ -494,7 +490,6 @@ REN_BeginCamera (void)
r_width_2 = (float) r_width / 2;
r_height_3 = (float) r_height / 3;
// clip to right side
rfrustum[0].normal[0] = -1;
rfrustum[0].normal[1] = 0;
@ -526,7 +521,6 @@ REN_BeginCamera (void)
rfrustum[4].dist = 1;
}
void
REN_BeginXY (void)
{
@ -614,7 +608,6 @@ REN_DrawCameraFace (face_t * idpol)
w->points[i][2] = scale;
}
//
// draw it
//
@ -624,7 +617,6 @@ REN_DrawCameraFace (face_t * idpol)
free (w);
}
/*
=====================
REN_DrawXYFace
@ -640,8 +632,8 @@ REN_DrawXYFace (face_t * idpol)
if (!idpol->w)
return; // overconstrained plane
w = idpol->w;
w = idpol->w;
r_face = idpol;
//
@ -709,7 +701,6 @@ REN_DrawXYFace (face_t * idpol)
REN_SetTexture (idpol);
//
// draw it
//