mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Compile fixes, we're getting a bit closer.
This commit is contained in:
parent
c7d74c6743
commit
1bd5d98c4d
9 changed files with 334 additions and 336 deletions
|
@ -368,7 +368,7 @@ drawSolid
|
|||
*/
|
||||
- drawSolid
|
||||
{
|
||||
unsigned char *planes[5];
|
||||
const unsigned char *planes[5];
|
||||
|
||||
//
|
||||
// draw it
|
||||
|
@ -408,7 +408,7 @@ drawSolid
|
|||
planes
|
||||
);
|
||||
|
||||
NSPing ();
|
||||
// NSPing ();
|
||||
[[self window] setBackingType:NSBackingStoreBuffered];
|
||||
|
||||
|
||||
|
@ -468,9 +468,8 @@ drawSelf
|
|||
else
|
||||
[self drawWire: rects];
|
||||
|
||||
if (timedrawing)
|
||||
{
|
||||
NSPing ();
|
||||
if (timedrawing) {
|
||||
// NSPing ();
|
||||
drawtime = I_FloatTime() - drawtime;
|
||||
printf ("CameraView drawtime: %5.3f\n", drawtime);
|
||||
}
|
||||
|
|
|
@ -8,12 +8,14 @@
|
|||
the classname, color triple, and bounding box are parsed out of comments
|
||||
A ? size means take the exact brush size.
|
||||
|
||||
/*QUAKED <classname> (0 0 0) ?
|
||||
/*QUAKED <classname> (0 0 0) (-8 -8 -8) (8 8 8)
|
||||
(these are really comments, but a space has been added to shut the compiler up.)
|
||||
|
||||
/ *QUAKED <classname> (0 0 0) ?
|
||||
/ *QUAKED <classname> (0 0 0) (-8 -8 -8) (8 8 8)
|
||||
|
||||
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
|
||||
|
||||
*/
|
||||
char *debugname;
|
||||
|
|
|
@ -5,10 +5,13 @@
|
|||
|
||||
#import "Forge.h"
|
||||
|
||||
id quakeed_i;
|
||||
id entclasses_i;
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
|
||||
id g_cmd_out_i;
|
||||
id quakeed_i;
|
||||
id entclasses_i;
|
||||
|
||||
id g_cmd_out_i;
|
||||
|
||||
BOOL autodirty;
|
||||
BOOL filter_light, filter_path, filter_entities;
|
||||
|
@ -63,19 +66,19 @@ void AutoSave(DPSTimedEntry tag, double now, void *userData)
|
|||
|
||||
void DisplayCmdOutput (void)
|
||||
{
|
||||
char *buffer;
|
||||
NSString *output;
|
||||
|
||||
LoadFile (FN_CMDOUT, (void **)&buffer);
|
||||
unlink (FN_CMDOUT);
|
||||
[project_i addToOutput:buffer];
|
||||
free (buffer);
|
||||
output = [NSString stringWithContentsOfFile: commandOutput];
|
||||
unlink ([commandOutput cString]);
|
||||
[project_i addToOutput: output];
|
||||
[output release];
|
||||
|
||||
if ([preferences_i getShowBSP])
|
||||
[inspcontrol_i changeInspectorTo:i_output];
|
||||
[inspcontrol_i changeInspectorTo: i_output];
|
||||
|
||||
[preferences_i playBspSound];
|
||||
|
||||
NSPing ();
|
||||
// NSPing ();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -120,7 +123,7 @@ init
|
|||
|
||||
// [self addToEventMask: NSRightMouseDraggedMask | NSLeftMouseDraggedMask];
|
||||
|
||||
malloc_error(My_Malloc_Error);
|
||||
malloc_error (My_Malloc_Error);
|
||||
|
||||
quakeed_i = self;
|
||||
dirty = autodirty = NO;
|
||||
|
@ -134,7 +137,12 @@ init
|
|||
|
||||
- setDefaultFilename
|
||||
{
|
||||
filename = [NSString stringWithCString: FN_TEMPSAVE];
|
||||
if (!filename) {
|
||||
filename = [NSMutableString stringWithString: tempSaveFile];
|
||||
} else {
|
||||
[filename setString: tempSaveFile];
|
||||
}
|
||||
|
||||
[self setTitleWithRepresentedFilename: filename];
|
||||
|
||||
return self;
|
||||
|
@ -187,7 +195,7 @@ int c_updateall;
|
|||
{
|
||||
updatecamera = updatexy = updatez = YES;
|
||||
c_updateall++;
|
||||
postappdefined ();
|
||||
[self postAppDefined];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -202,21 +210,21 @@ int c_updateall;
|
|||
updatecamera = YES;
|
||||
clearinstance = YES;
|
||||
|
||||
postappdefined ();
|
||||
[self postAppDefined];
|
||||
return self;
|
||||
}
|
||||
|
||||
- updateXY
|
||||
{
|
||||
updatexy = YES;
|
||||
postappdefined ();
|
||||
[self postAppDefined];
|
||||
return self;
|
||||
}
|
||||
|
||||
- updateZ
|
||||
{
|
||||
updatez = YES;
|
||||
postappdefined ();
|
||||
[self postAppDefined];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -299,20 +307,18 @@ App delegate methods
|
|||
|
||||
- applicationDefined: (NSEvent *) theEvent
|
||||
{
|
||||
NSEvent *ev, *evp;
|
||||
NSEvent *ev;
|
||||
|
||||
updateinflight = NO;
|
||||
|
||||
//printf ("serviced\n");
|
||||
|
||||
// update screen
|
||||
evp = [NSApp peekNextEvent:-1 into:&ev];
|
||||
if (evp)
|
||||
{
|
||||
postappdefined();
|
||||
ev = [NSApp peekNextEvent: -1];
|
||||
if (ev) {
|
||||
[self postAppDefined];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
[self disableFlushWindow];
|
||||
|
||||
|
@ -340,8 +346,10 @@ App delegate methods
|
|||
|
||||
- appDidInitialize: sender
|
||||
{
|
||||
#if 0
|
||||
NSScreen const *screens;
|
||||
int screencount;
|
||||
#endif
|
||||
|
||||
running = YES;
|
||||
g_cmd_out_i = cmd_out_i; // for qprintf
|
||||
|
@ -569,28 +577,14 @@ BSP PROCESSING
|
|||
==============================================================================
|
||||
*/
|
||||
|
||||
void ExpandCommand (char *in, char *out, char *src, char *dest)
|
||||
NSString *
|
||||
ExpandCommand (NSString *input, NSString *src, NSString *dest)
|
||||
{
|
||||
while (*in)
|
||||
{
|
||||
if (in[0] == '$')
|
||||
{
|
||||
if (in[1] == '1')
|
||||
{
|
||||
strcpy (out, src);
|
||||
out += strlen(src);
|
||||
}
|
||||
else if (in[1] == '2')
|
||||
{
|
||||
strcpy (out, dest);
|
||||
out += strlen(dest);
|
||||
}
|
||||
in += 2;
|
||||
continue;
|
||||
}
|
||||
*out++ = *in++;
|
||||
}
|
||||
*out = 0;
|
||||
return [[[[input
|
||||
componentsSeparatedByString: @"$1"]
|
||||
componentsJoinedByString: src]
|
||||
componentsSeparatedByString: @"$2"]
|
||||
componentsJoinedByString: dest];
|
||||
}
|
||||
|
||||
|
||||
|
@ -599,18 +593,17 @@ void ExpandCommand (char *in, char *out, char *src, char *dest)
|
|||
saveBSP
|
||||
=============
|
||||
*/
|
||||
- saveBSP: (char *) cmdline dialog: (BOOL) wt
|
||||
- saveBSP: (NSString *) cmdline dialog: (BOOL) wt
|
||||
{
|
||||
char expandedcmd[1024];
|
||||
int oldLightFilter;
|
||||
int oldPathFilter;
|
||||
NSString *expandedcmd;
|
||||
NSString *mappath;
|
||||
char bsppath[1024];
|
||||
int oldLightFilter;
|
||||
int oldPathFilter;
|
||||
char *destdir;
|
||||
NSString *bsppath;
|
||||
NSString *destdir;
|
||||
|
||||
if (bsppid)
|
||||
{
|
||||
NXBeep();
|
||||
if (bsppid) {
|
||||
NSBeep();
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -624,14 +617,14 @@ saveBSP
|
|||
[self applyRegion: self];
|
||||
|
||||
if ([regionbutton_i intValue]) {
|
||||
mappath = [[[NSString stringWithString: filename]
|
||||
mappath = [[filename
|
||||
stringByDeletingPathExtension]
|
||||
stringByAppendingPathExtension: @"reg"];
|
||||
[map_i writeMapFile: mappath useRegion: YES];
|
||||
wt = YES; // always pop the dialog on region ops
|
||||
} else {
|
||||
mappath = filename;
|
||||
}
|
||||
else
|
||||
strcpy (mappath, filename);
|
||||
|
||||
// save the entire thing, just in case there is a problem
|
||||
[self save: self];
|
||||
|
@ -643,43 +636,39 @@ saveBSP
|
|||
//
|
||||
// write the command to the bsp host
|
||||
//
|
||||
destdir = [project_i getFinalMapDirectory];
|
||||
destdir = [project_i finalMapDirectory];
|
||||
|
||||
strcpy (bsppath, destdir);
|
||||
strcat (bsppath, "/");
|
||||
ExtractFileBase (mappath, bsppath + strlen(bsppath));
|
||||
strcat (bsppath, ".bsp");
|
||||
bsppath = [[destdir
|
||||
stringByAppendingString: @"/"]
|
||||
stringByAppendingString: [[[mappath lastPathComponent]
|
||||
stringByDeletingPathExtension]
|
||||
stringByAppendingPathExtension: @"bsp"]];
|
||||
|
||||
ExpandCommand (cmdline, expandedcmd, mappath, bsppath);
|
||||
expandedcmd = ExpandCommand (cmdline, mappath, bsppath);
|
||||
|
||||
strcat (expandedcmd, " > ");
|
||||
strcat (expandedcmd, FN_CMDOUT);
|
||||
strcat (expandedcmd, "\n");
|
||||
printf ("system: %s", expandedcmd);
|
||||
|
||||
[project_i addToOutput: "\n\n========= BUSY =========\n\n"];
|
||||
NSLog (@"system: %s", expandedcmd);
|
||||
|
||||
[project_i addToOutput: @"\n\n========= BUSY =========\n\n"];
|
||||
[project_i addToOutput: expandedcmd];
|
||||
|
||||
if ([preferences_i getShowBSP])
|
||||
[inspcontrol_i changeInspectorTo:i_output];
|
||||
|
||||
if (wt)
|
||||
{
|
||||
id panel;
|
||||
if (wt) {
|
||||
id panel;
|
||||
|
||||
panel = NXGetAlertPanel("BSP In Progress",expandedcmd,NULL,NULL,NULL);
|
||||
[panel makeKeyAndOrderFront:NULL];
|
||||
system(expandedcmd);
|
||||
NXFreeAlertPanel(panel);
|
||||
[self makeKeyAndOrderFront:NULL];
|
||||
panel = NSGetAlertPanel (@"BSP In Progress", expandedcmd, NULL, NULL, NULL);
|
||||
|
||||
[panel makeKeyAndOrderFront: NULL];
|
||||
system ([expandedcmd cString]);
|
||||
NSReleaseAlertPanel (panel);
|
||||
[self makeKeyAndOrderFront: NULL];
|
||||
|
||||
DisplayCmdOutput ();
|
||||
}
|
||||
else
|
||||
{
|
||||
cmdte = DPSAddTimedEntry(1, CheckCmdDone, self, NX_BASETHRESHOLD);
|
||||
if (! (bsppid = fork ()) )
|
||||
{
|
||||
system (expandedcmd);
|
||||
} else {
|
||||
// cmdte = DPSAddTimedEntry(1, CheckCmdDone, self, NX_BASETHRESHOLD);
|
||||
if (!(bsppid = fork ())) {
|
||||
system ([expandedcmd cString]);
|
||||
exit (0);
|
||||
}
|
||||
}
|
||||
|
@ -690,45 +679,44 @@ saveBSP
|
|||
|
||||
- BSP_Full: sender
|
||||
{
|
||||
[self saveBSP:[project_i getFullVisCmd] dialog: NO];
|
||||
[self saveBSP: [project_i fullVisCommand] dialog: NO];
|
||||
return self;
|
||||
}
|
||||
|
||||
- BSP_FastVis: sender
|
||||
{
|
||||
[self saveBSP:[project_i getFastVisCmd] dialog: NO];
|
||||
[self saveBSP: [project_i fastVisCommand] dialog: NO];
|
||||
return self;
|
||||
}
|
||||
|
||||
- BSP_NoVis: sender
|
||||
{
|
||||
[self saveBSP:[project_i getNoVisCmd] dialog: NO];
|
||||
[self saveBSP: [project_i noVisCommand] dialog: NO];
|
||||
return self;
|
||||
}
|
||||
|
||||
- BSP_relight: sender
|
||||
{
|
||||
[self saveBSP:[project_i getRelightCmd] dialog: NO];
|
||||
[self saveBSP: [project_i relightCommand] dialog: NO];
|
||||
return self;
|
||||
}
|
||||
|
||||
- BSP_entities: sender
|
||||
{
|
||||
[self saveBSP:[project_i getEntitiesCmd] dialog: NO];
|
||||
[self saveBSP: [project_i entitiesCommand] dialog: NO];
|
||||
return self;
|
||||
}
|
||||
|
||||
- BSP_stop: sender
|
||||
{
|
||||
if (!bsppid)
|
||||
{
|
||||
NXBeep();
|
||||
if (!bsppid) {
|
||||
NSBeep ();
|
||||
return self;
|
||||
}
|
||||
|
||||
kill (bsppid, 9);
|
||||
CheckCmdDone (cmdte, 0, NULL);
|
||||
[project_i addToOutput: "\n\n========= STOPPED =========\n\n"];
|
||||
// CheckCmdDone (cmdte, 0, NULL);
|
||||
[project_i addToOutput: @"\n\n========= STOPPED =========\n\n"];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
@ -742,14 +730,14 @@ doOpen:
|
|||
Called by open or the project panel
|
||||
==============
|
||||
*/
|
||||
- doOpen: (char *)fname;
|
||||
- doOpen: (NSString *)fname;
|
||||
{
|
||||
strcpy (filename, fname);
|
||||
[filename setString: fname];
|
||||
|
||||
[map_i readMapFile:filename];
|
||||
[map_i readMapFile: filename];
|
||||
|
||||
[regionbutton_i setIntValue: 0];
|
||||
[self setTitleAsFilename:fname];
|
||||
[self setTitleWithRepresentedFilename: filename];
|
||||
[self updateAll];
|
||||
|
||||
qprintf ("%s loaded\n", fname);
|
||||
|
@ -765,18 +753,16 @@ open
|
|||
*/
|
||||
- open: sender;
|
||||
{
|
||||
id openpanel;
|
||||
static char *suffixlist[] = {"map", 0};
|
||||
id openPanel = [NSOpenPanel openPanel];
|
||||
id fileTypes = [NSArray arrayWithObject: @"map"];
|
||||
|
||||
openpanel = [OpenPanel new];
|
||||
|
||||
if ( [openpanel
|
||||
runModalForDirectory: [project_i getMapDirectory]
|
||||
file: ""
|
||||
types: suffixlist] != NX_OKTAG)
|
||||
if ([openPanel
|
||||
runModalForDirectory: [project_i mapDirectory]
|
||||
file: @""
|
||||
types: fileTypes] != NSOKButton)
|
||||
return self;
|
||||
|
||||
[self doOpen: (char *)[openpanel filename]];
|
||||
[self doOpen: [openPanel filename]];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
@ -789,18 +775,18 @@ save:
|
|||
*/
|
||||
- save: sender;
|
||||
{
|
||||
char backup[1024];
|
||||
NSString *backup;
|
||||
|
||||
// force a name change if using tempname
|
||||
if (!strcmp (filename, FN_TEMPSAVE) )
|
||||
// force a name change if using tempname
|
||||
if ([filename isEqualToString: tempSaveFile])
|
||||
return [self saveAs: self];
|
||||
|
||||
dirty = autodirty = NO;
|
||||
|
||||
strcpy (backup, filename);
|
||||
StripExtension (backup);
|
||||
strcat (backup, ".bak");
|
||||
rename (filename, backup); // copy old to .bak
|
||||
backup = [[filename stringByDeletingPathExtension]
|
||||
stringByAppendingPathExtension: @"bak"];
|
||||
|
||||
rename ([filename cString], [backup cString]); // copy old to .bak
|
||||
|
||||
[map_i writeMapFile: filename useRegion: NO];
|
||||
|
||||
|
@ -809,24 +795,22 @@ save:
|
|||
|
||||
|
||||
/*
|
||||
==============
|
||||
saveAs
|
||||
==============
|
||||
saveAs
|
||||
*/
|
||||
- saveAs: sender;
|
||||
{
|
||||
id panel_i;
|
||||
char dir[1024];
|
||||
id panel_i = [NSSavePanel savePanel];
|
||||
NSString *dir;
|
||||
|
||||
panel_i = [SavePanel new];
|
||||
ExtractFileBase (filename, dir);
|
||||
[panel_i setRequiredFileType: "map"];
|
||||
if ( [panel_i runModalForDirectory:[project_i getMapDirectory] file: dir] != NX_OKTAG)
|
||||
dir = [[filename lastPathComponent] stringByDeletingPathExtension];
|
||||
|
||||
[panel_i setRequiredFileType: @"map"];
|
||||
if ([panel_i runModalForDirectory: [project_i mapDirectory] file: dir] != NSOKButton)
|
||||
return self;
|
||||
|
||||
strcpy (filename, [panel_i filename]);
|
||||
[filename setString: [panel_i filename]];
|
||||
|
||||
[self setTitleAsFilename:filename];
|
||||
[self setTitleWithRepresentedFilename: filename];
|
||||
|
||||
[self save: self];
|
||||
|
||||
|
@ -846,7 +830,7 @@ saveAs
|
|||
//
|
||||
// AJR - added this for Project info
|
||||
//
|
||||
- (char *)currentFilename
|
||||
- (NSString *) currentFilename
|
||||
{
|
||||
return filename;
|
||||
}
|
||||
|
@ -856,7 +840,7 @@ saveAs
|
|||
if ([clipper_i hide]) // first click hides clipper only
|
||||
return [self updateAll];
|
||||
|
||||
[map_i setCurrentEntity: [map_i objectAt: 0]]; // make world selected
|
||||
[map_i setCurrentEntity: [map_i objectAtIndex: 0]]; // make world selected
|
||||
[map_i makeSelectedPerform: @selector(deselect)];
|
||||
[self updateAll];
|
||||
|
||||
|
@ -875,150 +859,143 @@ keyDown
|
|||
#define KEY_UPARROW 0xad
|
||||
#define KEY_DOWNARROW 0xaf
|
||||
|
||||
- keyDown:(NSEvent *)theEvent
|
||||
- (void) keyDown:(NSEvent *)theEvent
|
||||
{
|
||||
int ch;
|
||||
|
||||
// function keys
|
||||
switch (theEvent->data.key.keyCode)
|
||||
{
|
||||
case 60: // F2
|
||||
[cameraview_i setDrawMode: dr_wire];
|
||||
qprintf ("wire draw mode");
|
||||
return self;
|
||||
case 61: // F3
|
||||
[cameraview_i setDrawMode: dr_flat];
|
||||
qprintf ("flat draw mode");
|
||||
return self;
|
||||
case 62: // F4
|
||||
[cameraview_i setDrawMode: dr_texture];
|
||||
qprintf ("texture draw mode");
|
||||
return self;
|
||||
// function keys
|
||||
switch ([[theEvent characters] characterAtIndex: 0]) {
|
||||
case NSF2FunctionKey: // F2
|
||||
[cameraview_i setDrawMode: dr_wire];
|
||||
qprintf ("wire draw mode");
|
||||
return;
|
||||
case NSF3FunctionKey: // F3
|
||||
[cameraview_i setDrawMode: dr_flat];
|
||||
qprintf ("flat draw mode");
|
||||
return;
|
||||
case NSF4FunctionKey: // F4
|
||||
[cameraview_i setDrawMode: dr_texture];
|
||||
qprintf ("texture draw mode");
|
||||
return;
|
||||
case NSF5FunctionKey: // F5
|
||||
[xyview_i setDrawMode: dr_wire];
|
||||
qprintf ("wire draw mode");
|
||||
return;
|
||||
case NSF6FunctionKey: // F6
|
||||
qprintf ("texture draw mode");
|
||||
return;
|
||||
|
||||
case 63: // F5
|
||||
[xyview_i setDrawMode: dr_wire];
|
||||
qprintf ("wire draw mode");
|
||||
return self;
|
||||
case 64: // F6
|
||||
qprintf ("texture draw mode");
|
||||
return self;
|
||||
case NSF8FunctionKey: // F8
|
||||
[cameraview_i homeView: self];
|
||||
return;
|
||||
|
||||
case 66: // F8
|
||||
[cameraview_i homeView: self];
|
||||
return self;
|
||||
|
||||
case 88: // F12
|
||||
[map_i subtractSelection: self];
|
||||
return self;
|
||||
case NSF12FunctionKey: // F12
|
||||
[map_i subtractSelection: self];
|
||||
return;
|
||||
|
||||
case 106: // page up
|
||||
[cameraview_i upFloor: self];
|
||||
return self;
|
||||
|
||||
case 107: // page down
|
||||
[cameraview_i downFloor: self];
|
||||
return self;
|
||||
|
||||
case 109: // end
|
||||
[self deselect: self];
|
||||
return self;
|
||||
case NSPageUpFunctionKey: // page up
|
||||
[cameraview_i upFloor: self];
|
||||
return;
|
||||
case NSPageDownFunctionKey: // page down
|
||||
[cameraview_i downFloor: self];
|
||||
return;
|
||||
|
||||
case NSEndFunctionKey: // end
|
||||
[self deselect: self];
|
||||
return;
|
||||
}
|
||||
|
||||
// portable things
|
||||
ch = tolower(theEvent->data.key.charCode);
|
||||
|
||||
switch (ch)
|
||||
{
|
||||
case KEY_RIGHTARROW:
|
||||
case KEY_LEFTARROW:
|
||||
case KEY_UPARROW:
|
||||
case KEY_DOWNARROW:
|
||||
case 'a':
|
||||
case 'z':
|
||||
case 'd':
|
||||
case 'c':
|
||||
case '.':
|
||||
case ',':
|
||||
[cameraview_i _keyDown: theEvent];
|
||||
break;
|
||||
// portable things
|
||||
switch ([[[theEvent characters] lowercaseString] characterAtIndex: 0]) {
|
||||
case NSRightArrowFunctionKey:
|
||||
case NSLeftArrowFunctionKey:
|
||||
case NSUpArrowFunctionKey:
|
||||
case NSDownArrowFunctionKey:
|
||||
case 'a':
|
||||
case 'z':
|
||||
case 'd':
|
||||
case 'c':
|
||||
case '.':
|
||||
case ',':
|
||||
[cameraview_i _keyDown: theEvent];
|
||||
break;
|
||||
|
||||
case 27: // escape
|
||||
autodirty = dirty = YES;
|
||||
[self deselect: self];
|
||||
return self;
|
||||
case 27: // escape
|
||||
autodirty = dirty = YES;
|
||||
[self deselect: self];
|
||||
return;
|
||||
|
||||
case 127: // delete
|
||||
autodirty = dirty = YES;
|
||||
[map_i makeSelectedPerform: @selector(remove)];
|
||||
[clipper_i hide];
|
||||
[self updateAll];
|
||||
break;
|
||||
case NSDeleteFunctionKey: // delete
|
||||
autodirty = dirty = YES;
|
||||
[map_i makeSelectedPerform: @selector(remove)];
|
||||
[clipper_i hide];
|
||||
[self updateAll];
|
||||
break;
|
||||
|
||||
case '/':
|
||||
[clipper_i flipNormal];
|
||||
[self updateAll];
|
||||
break;
|
||||
|
||||
case 13: // enter
|
||||
[clipper_i carve];
|
||||
[self updateAll];
|
||||
qprintf ("carved brush");
|
||||
break;
|
||||
|
||||
case ' ':
|
||||
[map_i cloneSelection: self];
|
||||
break;
|
||||
|
||||
case '/':
|
||||
[clipper_i flipNormal];
|
||||
[self updateAll];
|
||||
break;
|
||||
|
||||
case 13: // enter
|
||||
[clipper_i carve];
|
||||
[self updateAll];
|
||||
qprintf ("carved brush");
|
||||
break;
|
||||
|
||||
case ' ':
|
||||
[map_i cloneSelection: self];
|
||||
break;
|
||||
|
||||
//
|
||||
// move selection keys
|
||||
//
|
||||
case '2':
|
||||
VectorCopy (vec3_origin, sb_translate);
|
||||
sb_translate[1] = -[xyview_i gridsize];
|
||||
[map_i makeSelectedPerform: @selector(translate)];
|
||||
[self updateAll];
|
||||
break;
|
||||
case '8':
|
||||
VectorCopy (vec3_origin, sb_translate);
|
||||
sb_translate[1] = [xyview_i gridsize];
|
||||
[map_i makeSelectedPerform: @selector(translate)];
|
||||
[self updateAll];
|
||||
break;
|
||||
case '2':
|
||||
VectorCopy (vec3_origin, sb_translate);
|
||||
sb_translate[1] = -[xyview_i gridsize];
|
||||
[map_i makeSelectedPerform: @selector(translate)];
|
||||
[self updateAll];
|
||||
break;
|
||||
|
||||
case '4':
|
||||
VectorCopy (vec3_origin, sb_translate);
|
||||
sb_translate[0] = -[xyview_i gridsize];
|
||||
[map_i makeSelectedPerform: @selector(translate)];
|
||||
[self updateAll];
|
||||
break;
|
||||
case '6':
|
||||
VectorCopy (vec3_origin, sb_translate);
|
||||
sb_translate[0] = [xyview_i gridsize];
|
||||
[map_i makeSelectedPerform: @selector(translate)];
|
||||
[self updateAll];
|
||||
break;
|
||||
case '8':
|
||||
VectorCopy (vec3_origin, sb_translate);
|
||||
sb_translate[1] = [xyview_i gridsize];
|
||||
[map_i makeSelectedPerform: @selector(translate)];
|
||||
[self updateAll];
|
||||
break;
|
||||
|
||||
case '-':
|
||||
VectorCopy (vec3_origin, sb_translate);
|
||||
sb_translate[2] = -[xyview_i gridsize];
|
||||
[map_i makeSelectedPerform: @selector(translate)];
|
||||
[self updateAll];
|
||||
break;
|
||||
case '+':
|
||||
VectorCopy (vec3_origin, sb_translate);
|
||||
sb_translate[2] = [xyview_i gridsize];
|
||||
[map_i makeSelectedPerform: @selector(translate)];
|
||||
[self updateAll];
|
||||
break;
|
||||
case '4':
|
||||
VectorCopy (vec3_origin, sb_translate);
|
||||
sb_translate[0] = -[xyview_i gridsize];
|
||||
[map_i makeSelectedPerform: @selector(translate)];
|
||||
[self updateAll];
|
||||
break;
|
||||
|
||||
default:
|
||||
qprintf ("undefined keypress");
|
||||
NopSound ();
|
||||
break;
|
||||
case '6':
|
||||
VectorCopy (vec3_origin, sb_translate);
|
||||
sb_translate[0] = [xyview_i gridsize];
|
||||
[map_i makeSelectedPerform: @selector(translate)];
|
||||
[self updateAll];
|
||||
break;
|
||||
|
||||
case '-':
|
||||
VectorCopy (vec3_origin, sb_translate);
|
||||
sb_translate[2] = -[xyview_i gridsize];
|
||||
[map_i makeSelectedPerform: @selector(translate)];
|
||||
[self updateAll];
|
||||
break;
|
||||
case '+':
|
||||
VectorCopy (vec3_origin, sb_translate);
|
||||
sb_translate[2] = [xyview_i gridsize];
|
||||
[map_i makeSelectedPerform: @selector(translate)];
|
||||
[self updateAll];
|
||||
break;
|
||||
|
||||
default:
|
||||
qprintf ("undefined keypress");
|
||||
NopSound ();
|
||||
break;
|
||||
}
|
||||
|
||||
return self;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
/* Generated by the NeXT Project Builder
|
||||
NOTE: Do NOT change this file -- Project Builder maintains it.
|
||||
*/
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
void main(int argc, char *argv[]) {
|
||||
NSString *commandOutput = @"/tmp/Forge/command.txt";
|
||||
NSString *developerLogFile = @"/tmp/Forge/developer.log";
|
||||
NSString *tempSaveFile = @"/tmp/Forge/temp.map";
|
||||
NSString *autoSaveFile = @"/tmp/Forge/autoSave.map";
|
||||
NSString *errorSaveFile = @"/tmp/Forge/errorSave.map";
|
||||
|
||||
[Application new];
|
||||
if ([NXApp loadNibSection:"QuakeEd.nib" owner:NXApp withNames:NO])
|
||||
[NXApp run];
|
||||
int
|
||||
main (int argc, char *argv[]) {
|
||||
|
||||
[NSApplication new];
|
||||
if ([NSBundle loadNibNamed: @"Forge" owner: NSApp])
|
||||
[NSApp run];
|
||||
|
||||
[NXApp free];
|
||||
exit(0);
|
||||
[NSApp release];
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
ADDITIONAL_CPPFLAGS +=
|
||||
|
||||
# Additional flags to pass to the Objective-C compiler
|
||||
ADDITIONAL_OBJCFLAGS += -g -Wall
|
||||
ADDITIONAL_OBJCFLAGS += -g -Wall -Werror
|
||||
|
||||
# Additional flags to pass to the C compiler
|
||||
ADDITIONAL_CFLAGS += -g -Wall
|
||||
ADDITIONAL_CFLAGS += -g -Wall -Werror
|
||||
|
||||
# Additional include directories the compiler should search
|
||||
ADDITIONAL_INCLUDE_DIRS += -I ./Headers
|
||||
|
@ -16,7 +16,20 @@ ADDITIONAL_LDFLAGS +=
|
|||
# Additional library directories the linker should search
|
||||
ADDITIONAL_LIB_DIRS +=
|
||||
|
||||
# Additional libraries
|
||||
|
||||
# GNUstepWeb
|
||||
ADDITIONAL_GSW_LIBS +=
|
||||
# GUI apps
|
||||
ADDITIONAL_GUI_LIBS +=
|
||||
# Libraries
|
||||
ADDITIONAL_LIBRARY_LIBS +=
|
||||
# ObjC stuff
|
||||
ADDITIONAL_OBJC_LIBS +=
|
||||
# Tools
|
||||
ADDITIONAL_TOOL_LIBS +=
|
||||
# WebObjects
|
||||
ADDITIONAL_WO_LIBS +=
|
||||
|
||||
#
|
||||
# Flags dealing with installing and uninstalling
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
|
||||
extern id quakeed_i;
|
||||
|
||||
extern BOOL filter_light, filter_path, filter_entities;
|
||||
|
@ -16,8 +19,8 @@ void qprintf (char *fmt, ...); // prints text to cmd_out_i
|
|||
|
||||
@interface Forge: NSWindow
|
||||
{
|
||||
BOOL dirty;
|
||||
NSString *filename; // full path with .map extension
|
||||
BOOL dirty;
|
||||
NSMutableString *filename; // full path with .map extension
|
||||
|
||||
// UI objects
|
||||
id brushcount_i;
|
||||
|
@ -41,27 +44,27 @@ void qprintf (char *fmt, ...); // prints text to cmd_out_i
|
|||
}
|
||||
|
||||
- setDefaultFilename;
|
||||
- (char *)currentFilename;
|
||||
- (NSString *)currentFilename;
|
||||
|
||||
- updateAll; // when a model has been changed
|
||||
- updateCamera; // when the camera has moved
|
||||
- updateXY;
|
||||
- updateZ;
|
||||
|
||||
- updateAll:sender;
|
||||
- updateAll: sender;
|
||||
|
||||
- newinstance; // force next flushwindow to clear all instance drawing
|
||||
- redrawInstance; // erase and redraw all instance now
|
||||
|
||||
- appWillTerminate:sender;
|
||||
- appWillTerminate: sender;
|
||||
|
||||
- openProject:sender;
|
||||
- openProject: sender;
|
||||
|
||||
- textCommand: sender;
|
||||
|
||||
- applyRegion: sender;
|
||||
|
||||
- (BOOL)dirty;
|
||||
- (BOOL) dirty;
|
||||
|
||||
- clear: sender;
|
||||
- centerCamera: sender;
|
||||
|
@ -76,9 +79,9 @@ void qprintf (char *fmt, ...); // prints text to cmd_out_i
|
|||
- save: sender;
|
||||
- saveAs: sender;
|
||||
|
||||
- doOpen: (char *)fname;
|
||||
- doOpen: (NSString *) fname;
|
||||
|
||||
- saveBSP:(char *)cmdline dialog:(BOOL)wt;
|
||||
- saveBSP: (NSString *) cmdline dialog: (BOOL) wt;
|
||||
|
||||
- BSP_Full: sender;
|
||||
- BSP_FastVis: sender;
|
||||
|
|
|
@ -14,34 +14,34 @@ extern id map_i;
|
|||
|
||||
- writeStats;
|
||||
|
||||
- readMapFile: (char *)fname;
|
||||
- writeMapFile: (char *)fname useRegion: (BOOL)reg;
|
||||
- readMapFile: (NSString *) fname;
|
||||
- writeMapFile: (NSString *) fname useRegion: (BOOL) reg;
|
||||
|
||||
- entityConnect: (vec3_t)p1 : (vec3_t)p2;
|
||||
- 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;
|
||||
- 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;
|
||||
|
||||
- currentEntity;
|
||||
- setCurrentEntity: ent;
|
||||
|
||||
- (float)currentMinZ;
|
||||
- setCurrentMinZ: (float)m;
|
||||
- (float)currentMaxZ;
|
||||
- setCurrentMaxZ: (float)m;
|
||||
- (float) currentMinZ;
|
||||
- setCurrentMinZ: (float) m;
|
||||
- (float) currentMaxZ;
|
||||
- setCurrentMaxZ: (float) m;
|
||||
|
||||
- (int)numSelected;
|
||||
- (int) numSelected;
|
||||
- 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
|
||||
- makeSelectedPerform: (SEL) sel;
|
||||
- makeUnselectedPerform: (SEL) sel;
|
||||
- makeAllPerform: (SEL) sel;
|
||||
- makeGlobalPerform: (SEL) sel; // in and out of region
|
||||
|
||||
- cloneSelection: sender;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
extern id project_i;
|
||||
|
||||
@interface Project:Object
|
||||
@interface Project: NSObject
|
||||
{
|
||||
id projectInfo; // dictionary storage of project info
|
||||
|
||||
|
@ -42,24 +42,24 @@ extern id project_i;
|
|||
|
||||
id BSPoutput_i; // outlet to Text
|
||||
|
||||
char path_projectinfo[128]; // path of QE_Project file
|
||||
NSString *path_projectinfo; // path of QE_Project file
|
||||
|
||||
char path_basepath[128]; // base path of heirarchy
|
||||
NSString *path_basepath; // base path of heirarchy
|
||||
|
||||
char path_progdir[128]; // derived from basepath
|
||||
char path_mapdirectory[128]; // derived from basepath
|
||||
char path_finalmapdir[128]; // derived from basepath
|
||||
|
||||
char path_wad8[128]; // path of texture WAD for cmd-8 key
|
||||
char path_wad9[128]; // path of texture WAD for cmd-9 key
|
||||
char path_wad0[128]; // path of texture WAD for cmd-0 key
|
||||
NSString *path_progdir; // derived from basepath
|
||||
NSString *path_mapdirectory; // derived from basepath
|
||||
NSString *path_finalmapdir; // derived from basepath
|
||||
|
||||
char string_fullvis[1024]; // cmd-line parm
|
||||
char string_fastvis[1024]; // cmd-line parm
|
||||
char string_novis[1024]; // cmd-line parm
|
||||
char string_relight[1024]; // cmd-line parm
|
||||
char string_leaktest[1024]; // cmd-line parm
|
||||
char string_entities[1024]; // cmd-line parm
|
||||
NSString *path_wad8; // path of texture WAD for cmd-8 key
|
||||
NSString *path_wad9; // path of texture WAD for cmd-9 key
|
||||
NSString *path_wad0; // path of texture WAD for cmd-0 key
|
||||
|
||||
NSString *string_fullvis; // cmd-line parm
|
||||
NSString *string_fastvis; // cmd-line parm
|
||||
NSString *string_novis; // cmd-line parm
|
||||
NSString *string_relight; // cmd-line parm
|
||||
NSString *string_leaktest; // cmd-line parm
|
||||
NSString *string_entities; // cmd-line parm
|
||||
|
||||
int showDescriptions; // 1 = show map descs in browser
|
||||
|
||||
|
@ -73,36 +73,36 @@ extern id project_i;
|
|||
|
||||
- setTextureWad: (char *)wf;
|
||||
|
||||
- addToOutput:(char *)string;
|
||||
- clearBspOutput:sender;
|
||||
- addToOutput: (NSString *) string;
|
||||
- clearBspOutput: sender;
|
||||
- initProjSettings;
|
||||
- changeChar:(char)f to:(char)t in:(id)obj;
|
||||
- (int)searchForString:(char *)str in:(id)obj;
|
||||
- changeChar: (char) f to: (char) t in: (id) obj;
|
||||
- (int) searchForString: (NSString *) str in: (id) obj;
|
||||
|
||||
- parseProjectFile; // read defaultsdatabase for project path
|
||||
- openProjectFile:(char *)path; // called by openProject and newProject
|
||||
- openProjectFile: (NSString *) 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
|
||||
// methods to query the project file
|
||||
|
||||
- (char *)getMapDirectory;
|
||||
- (char *)getFinalMapDirectory;
|
||||
- (char *)getProgDirectory;
|
||||
- (NSString *) mapDirectory;
|
||||
- (NSString *) finalMapDirectory;
|
||||
- (NSString *) progDirectory;
|
||||
|
||||
- (char *)getWAD8;
|
||||
- (char *)getWAD9;
|
||||
- (char *)getWAD0;
|
||||
- (NSString *) WAD8;
|
||||
- (NSString *) WAD9;
|
||||
- (NSString *) WAD0;
|
||||
|
||||
- (char *)getFullVisCmd;
|
||||
- (char *)getFastVisCmd;
|
||||
- (char *)getNoVisCmd;
|
||||
- (char *)getRelightCmd;
|
||||
- (char *)getLeaktestCmd;
|
||||
- (char *)getEntitiesCmd;
|
||||
- (NSString *) fullVisCommand;
|
||||
- (NSString *) fastVisCommand;
|
||||
- (NSString *) noVisCommand;
|
||||
- (NSString *) relightCommand;
|
||||
- (NSString *) leakTestCommand;
|
||||
- (NSString *) entitiesCommand;
|
||||
|
||||
@end
|
||||
|
||||
void changeString(char cf,char ct,char *string);
|
||||
void changeString(char cf, char ct, char *string);
|
||||
|
||||
|
|
|
@ -49,10 +49,11 @@ qboolean GetToken (qboolean 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"
|
||||
#define FN_CRASHSAVE "/qcache/ErrorSaveMap.map"
|
||||
#define FN_DEVLOG "/qcache/devlog"
|
||||
extern NSString *commandOutput;
|
||||
extern NSString *developerLogFile;
|
||||
|
||||
extern NSString *tempSaveFile;
|
||||
extern NSString *autoSaveFile;
|
||||
extern NSString *errorSaveFile;
|
||||
|
||||
extern char *debugname;
|
||||
|
|
Loading…
Reference in a new issue