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
-initFromText:(const char *)
text source:(const char *) filename
-initFromText:(const char *) text source:(const char *) filename
{
const char *t;
size_t len;

View file

@ -20,6 +20,8 @@
"BSP_entities:",
"BSP_relight:",
"BSP_stop:",
"UIChanged:",
"addPair:",
"appDidInit:",
"appWillTerminate:",
"applyRegion:",
@ -28,13 +30,18 @@
"changeInspector:",
"changeXYLookUp:",
"clear:",
"clearBspOutput:",
"clearTexinfo:",
"clickedOnMap:",
"clickedOnWad:",
"cloneSelection:",
"decRotate:",
"decXScale:",
"decXShift:",
"decYScale:",
"decYShift:",
"delPair:",
"doubleClickEntity:",
"downFloor:",
"drawMode:",
"flip_x:",
@ -49,6 +56,7 @@
"makeEntity:",
"onlyShowMapTextures:",
"openProject:",
"reloadEntityClasses:",
"rotate_x:",
"rotate_y:",
"rotate_z:",
@ -57,9 +65,14 @@
"searchForTexture:",
"selectCompleteEntity:",
"selectCompletelyInside:",
"selectEntity:",
"selectPartiallyInside:",
"setAngle:",
"setBrushRegion:",
"setBspSound:",
"setCurrentEntity:",
"setCurrentProject:",
"setFlags:",
"setModeRadio:",
"setXYRegion:",
"shortBrush:",
@ -96,6 +109,51 @@
);
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 = {
Actions = (
"updateAll:",
@ -168,6 +226,26 @@
);
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 = {
Actions = (
"setModeRadio:",

View file

@ -1,3 +1,5 @@
#include <unistd.h>
#include "QF/sys.h"
#include "Preferences.h"
@ -189,12 +191,14 @@ _atof (const char *c)
path = "";
strcpy (bspSound, path);
if (bspSound_i)
if (bspSound_i) {
[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) {
strcpy (bspSound, "/NextLibrary/Sounds/Funk.snd");
bspSound_i =[[NSSound alloc] initWithContentsOfFile: [NSString stringWithCString:bspSound]];
return self;
}
[bspSoundField_i setStringValue: [NSString stringWithCString:bspSound]];

View file

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

View file

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

View file

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