Get progs source scanning working.

Of course, this is if the environment is set up just right, but it's
another step towards something to fix.
This commit is contained in:
Bill Currie 2010-09-12 18:12:02 +09:00
parent 7b03cd49dc
commit 37c2e0937c
7 changed files with 155 additions and 69 deletions

View file

@ -41,8 +41,7 @@ parse_vector (script_t * script, vec3_t vec)
// //
// /*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 *) -initFromText:(const char *) text source:(const char *) filename
text source:(const char *) filename
{ {
const char *t; const char *t;
size_t len; size_t len;

View file

@ -20,6 +20,8 @@
"BSP_entities:", "BSP_entities:",
"BSP_relight:", "BSP_relight:",
"BSP_stop:", "BSP_stop:",
"UIChanged:",
"addPair:",
"appDidInit:", "appDidInit:",
"appWillTerminate:", "appWillTerminate:",
"applyRegion:", "applyRegion:",
@ -28,13 +30,18 @@
"changeInspector:", "changeInspector:",
"changeXYLookUp:", "changeXYLookUp:",
"clear:", "clear:",
"clearBspOutput:",
"clearTexinfo:", "clearTexinfo:",
"clickedOnMap:",
"clickedOnWad:",
"cloneSelection:", "cloneSelection:",
"decRotate:", "decRotate:",
"decXScale:", "decXScale:",
"decXShift:", "decXShift:",
"decYScale:", "decYScale:",
"decYShift:", "decYShift:",
"delPair:",
"doubleClickEntity:",
"downFloor:", "downFloor:",
"drawMode:", "drawMode:",
"flip_x:", "flip_x:",
@ -49,6 +56,7 @@
"makeEntity:", "makeEntity:",
"onlyShowMapTextures:", "onlyShowMapTextures:",
"openProject:", "openProject:",
"reloadEntityClasses:",
"rotate_x:", "rotate_x:",
"rotate_y:", "rotate_y:",
"rotate_z:", "rotate_z:",
@ -57,9 +65,14 @@
"searchForTexture:", "searchForTexture:",
"selectCompleteEntity:", "selectCompleteEntity:",
"selectCompletelyInside:", "selectCompletelyInside:",
"selectEntity:",
"selectPartiallyInside:", "selectPartiallyInside:",
"setAngle:",
"setBrushRegion:", "setBrushRegion:",
"setBspSound:",
"setCurrentEntity:", "setCurrentEntity:",
"setCurrentProject:",
"setFlags:",
"setModeRadio:", "setModeRadio:",
"setXYRegion:", "setXYRegion:",
"shortBrush:", "shortBrush:",
@ -96,6 +109,51 @@
); );
Super = NSMutableArray; Super = NSMutableArray;
}; };
Preferences = {
Actions = (
"setBspSound:",
"setCurrentProject:",
"UIChanged:"
);
Outlets = (
bspSound_i,
startproject_i,
bspSoundField_i,
brushOffset_i,
showBSP_i,
startwad_i,
xlight_i,
ylight_i,
zlight_i
);
Super = NSObject;
};
Project = {
Actions = (
"clearBspOutput:",
"clickedOnMap:",
"clickedOnWad:"
);
Outlets = (
projectInfo,
basepathinfo_i,
mapbrowse_i,
currentmap_i,
mapList,
descList,
wadList,
pis_panel_i,
pis_basepath_i,
pis_wads_i,
pis_fullvis_i,
pis_fastvis_i,
pis_novis_i,
pis_relight_i,
pis_leaktest_i,
BSPoutput_i
);
Super = NSObject;
};
QuakeEd = { QuakeEd = {
Actions = ( Actions = (
"updateAll:", "updateAll:",
@ -168,6 +226,26 @@
); );
Super = NSObject; Super = NSObject;
}; };
Things = {
Actions = (
"reloadEntityClasses:",
"selectEntity:",
"doubleClickEntity:",
"addPair:",
"delPair:",
"setAngle:",
"setFlags:"
);
Outlets = (
entity_browser_i,
entity_comment_i,
prog_path_i,
keyInput_i,
valueInput_i,
flags_i
);
Super = NSObject;
};
XYView = { XYView = {
Actions = ( Actions = (
"setModeRadio:", "setModeRadio:",

View file

@ -1,3 +1,5 @@
#include <unistd.h>
#include "QF/sys.h" #include "QF/sys.h"
#include "Preferences.h" #include "Preferences.h"
@ -189,12 +191,14 @@ _atof (const char *c)
path = ""; path = "";
strcpy (bspSound, path); strcpy (bspSound, path);
if (bspSound_i) if (bspSound_i) {
[bspSound_i release]; [bspSound_i release];
bspSound_i =[[NSSound alloc] initWithContentsOfFile: [NSString stringWithCString:bspSound]]; bspSound_i = nil;
}
if (path[0] && access (path, R_OK))
bspSound_i =[[NSSound alloc] initWithContentsOfFile: [NSString stringWithCString:bspSound] byReference: YES];
if (!bspSound_i) { if (!bspSound_i) {
strcpy (bspSound, "/NextLibrary/Sounds/Funk.snd"); return self;
bspSound_i =[[NSSound alloc] initWithContentsOfFile: [NSString stringWithCString:bspSound]];
} }
[bspSoundField_i setStringValue: [NSString stringWithCString:bspSound]]; [bspSoundField_i setStringValue: [NSString stringWithCString:bspSound]];

View file

@ -6,6 +6,7 @@
#include <unistd.h> #include <unistd.h>
#include "QF/quakefs.h"
#include "QF/sys.h" #include "QF/sys.h"
#include "Project.h" #include "Project.h"
@ -36,19 +37,21 @@ id project_i;
-initVars -initVars
{ {
char *s; char *s;
const char *pe;
s =[preferences_i getProjectPath]; s =[preferences_i getProjectPath];
// XXX StripFilename(s); pe = QFS_SkipPath (s);
s[pe - s] = 0;
strcpy (path_basepath, s); strcpy (path_basepath, s);
strcpy (path_progdir, s); strcpy (path_progdir, s);
strcat (path_progdir, "/" SUBDIR_ENT); strcat (path_progdir, SUBDIR_ENT);
strcpy (path_mapdirectory, s); strcpy (path_mapdirectory, s);
strcat (path_mapdirectory, "/" SUBDIR_MAPS); // source dir strcat (path_mapdirectory, SUBDIR_MAPS); // source dir
strcpy (path_finalmapdir, s); strcpy (path_finalmapdir, s);
strcat (path_finalmapdir, "/" SUBDIR_MAPS); // dest dir strcat (path_finalmapdir, SUBDIR_MAPS); // dest dir
[basepathinfo_i setStringValue: [NSString stringWithCString:s]]; [basepathinfo_i setStringValue: [NSString stringWithCString:s]];
// in Project Inspector // in Project Inspector
@ -165,6 +168,7 @@ id project_i;
-initProject -initProject
{ {
[self parseProjectFile]; [self parseProjectFile];
Sys_Printf ("%p\n", projectInfo);
if (projectInfo == NULL) if (projectInfo == NULL)
return self; return self;
[self initVars]; [self initVars];
@ -331,7 +335,7 @@ t in:(id) obj
{ {
FILE *fp; FILE *fp;
struct stat s; struct stat s;
Sys_Printf ("openProjectFile: %s\n", path);
strcpy (path_projectinfo, path); strcpy (path_projectinfo, path);
projectInfo = NULL; projectInfo = NULL;
@ -372,6 +376,7 @@ t in:(id) obj
if (rtn == NSOKButton) { if (rtn == NSOKButton) {
filenames =[openpanel filenames]; filenames =[openpanel filenames];
dir =[[openpanel directory] cString]; dir =[[openpanel directory] cString];
dir = "";
sprintf (path, "%s/%s", dir,[[filenames objectAtIndex:0] cString]); sprintf (path, "%s/%s", dir,[[filenames objectAtIndex:0] cString]);
strcpy (path_projectinfo, path); strcpy (path_projectinfo, path);
[self openProjectFile:path]; [self openProjectFile:path];

View file

@ -622,80 +622,79 @@ initOwner: fromTokens
*/ */
int numsb; int numsb;
-initFromScript:(script_t *) -initFromScript:(script_t *)script owner:own
script owner:own { {
face_t *f; face_t *f;
int i, j; int i, j;
[self init]; [self init];
parent = own; parent = own;
f = faces; f = faces;
numfaces = 0; numfaces = 0;
do do {
{ if (!Script_GetToken (script, true))
if (!Script_GetToken (script, true)) break;
break; if (!strcmp (Script_Token (script), "}"))
if (!strcmp (Script_Token (script), "}")) break;
break;
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
if (i != 0) if (i != 0)
Script_GetToken (script, true); Script_GetToken (script, true);
if (strcmp (Script_Token (script), "(")) if (strcmp (Script_Token (script), "("))
Sys_Error ("parsing map file"); Sys_Error ("parsing map file");
for (j = 0; j < 3; j++) {
Script_GetToken (script, false);
f->planepts[i][j] = atoi (Script_Token (script));
} Script_GetToken (script, false);
if (strcmp (Script_Token (script), ")"))
Sys_Error ("parsing map file");
}
for (j = 0; j < 3; j++) {
Script_GetToken (script, false); Script_GetToken (script, false);
f->planepts[i][j] = atoi (Script_Token (script)); strcpy (f->texture.texture, Script_Token (script));
} Script_GetToken (script, false); Script_GetToken (script, false);
f->texture.shift[0] = atof (Script_Token (script));
if (strcmp (Script_Token (script), ")")) Script_GetToken (script, false);
Sys_Error ("parsing map file"); f->texture.shift[1] = atof (Script_Token (script));
} Script_GetToken (script, false);
f->texture.rotate = atof (Script_Token (script));
Script_GetToken (script, false); Script_GetToken (script, false);
strcpy (f->texture.texture, Script_Token (script)); f->texture.scale[0] = atof (Script_Token (script));
Script_GetToken (script, false); Script_GetToken (script, false);
f->texture.shift[0] = atof (Script_Token (script)); f->texture.scale[1] = atof (Script_Token (script));
Script_GetToken (script, false);
f->texture.shift[1] = atof (Script_Token (script));
Script_GetToken (script, false);
f->texture.rotate = atof (Script_Token (script));
Script_GetToken (script, false);
f->texture.scale[0] = atof (Script_Token (script));
Script_GetToken (script, false);
f->texture.scale[1] = atof (Script_Token (script));
#if 0 #if 0
flags = atoi (Script_Token (script)); flags = atoi (Script_Token (script));
flags &= 7; flags &= 7;
f->texture.rotate = 0; f->texture.rotate = 0;
f->texture.scale[0] = 1; f->texture.scale[0] = 1;
f->texture.scale[1] = 1; f->texture.scale[1] = 1;
#define TEX_FLIPAXIS 1 #define TEX_FLIPAXIS 1
#define TEX_FLIPS 2 #define TEX_FLIPS 2
#define TEX_FLIPT 4 #define TEX_FLIPT 4
if (flags & TEX_FLIPAXIS) { if (flags & TEX_FLIPAXIS) {
f->texture.rotate = 90; f->texture.rotate = 90;
if (!(flags & TEX_FLIPT)) if (!(flags & TEX_FLIPT))
f->texture.scale[0] = -1; f->texture.scale[0] = -1;
if (flags & TEX_FLIPS) if (flags & TEX_FLIPS)
f->texture.scale[1] = -1; f->texture.scale[1] = -1;
} else { } else {
if (flags & TEX_FLIPS) if (flags & TEX_FLIPS)
f->texture.scale[0] = -1; f->texture.scale[0] = -1;
if (flags & TEX_FLIPT) if (flags & TEX_FLIPT)
f->texture.scale[1] = -1; f->texture.scale[1] = -1;
} }
#endif #endif
f++; f++;
numfaces++; numfaces++;
} while (1); } while (1);
numsb++; numsb++;

View file

@ -1,3 +1,4 @@
#include "QF/sys.h"
#include "Things.h" #include "Things.h"
#include "QuakeEd.h" #include "QuakeEd.h"