2003-03-18 19:48:24 +00:00
|
|
|
//======================================
|
|
|
|
//
|
|
|
|
// QuakeEd Project Management
|
|
|
|
//
|
|
|
|
//======================================
|
|
|
|
|
2010-09-11 08:35:25 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
|
2010-09-12 09:12:02 +00:00
|
|
|
#include "QF/quakefs.h"
|
2010-09-11 08:35:25 +00:00
|
|
|
#include "QF/sys.h"
|
|
|
|
|
|
|
|
#include "Project.h"
|
|
|
|
#include "Map.h"
|
|
|
|
#include "QuakeEd.h"
|
|
|
|
#include "Preferences.h"
|
|
|
|
#include "Dict.h"
|
|
|
|
#include "Things.h"
|
|
|
|
#include "TexturePalette.h"
|
2003-03-18 19:48:24 +00:00
|
|
|
|
|
|
|
|
2010-09-11 10:03:41 +00:00
|
|
|
id project_i;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
|
|
|
@implementation Project
|
|
|
|
|
2010-09-11 10:03:41 +00:00
|
|
|
-init
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
project_i = self;
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Project code
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
|
|
|
//===========================================================
|
2010-09-11 10:03:41 +00:00
|
|
|
-initVars
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-28 09:41:38 +00:00
|
|
|
const char *s;
|
2010-09-12 09:12:02 +00:00
|
|
|
const char *pe;
|
2010-09-28 09:41:38 +00:00
|
|
|
char *ts;
|
2010-09-11 10:03:41 +00:00
|
|
|
|
2010-09-28 09:41:38 +00:00
|
|
|
ts = strdup ([preferences_i getProjectPath]);
|
|
|
|
pe = QFS_SkipPath (ts);
|
|
|
|
ts[pe - ts] = 0;
|
|
|
|
strcpy (path_basepath, ts);
|
2010-09-11 10:03:41 +00:00
|
|
|
|
2010-09-28 09:41:38 +00:00
|
|
|
strcpy (path_progdir, ts);
|
2010-09-12 09:12:02 +00:00
|
|
|
strcat (path_progdir, SUBDIR_ENT);
|
2010-09-11 10:03:41 +00:00
|
|
|
|
2010-09-28 09:41:38 +00:00
|
|
|
strcpy (path_mapdirectory, ts);
|
2010-09-12 09:12:02 +00:00
|
|
|
strcat (path_mapdirectory, SUBDIR_MAPS); // source dir
|
2010-09-11 10:03:41 +00:00
|
|
|
|
2010-09-28 09:41:38 +00:00
|
|
|
strcpy (path_finalmapdir, ts);
|
2010-09-12 09:12:02 +00:00
|
|
|
strcat (path_finalmapdir, SUBDIR_MAPS); // dest dir
|
2010-09-11 10:03:41 +00:00
|
|
|
|
2010-09-28 09:41:38 +00:00
|
|
|
[basepathinfo_i setStringValue: [NSString stringWithCString:ts]];
|
2010-09-11 10:03:41 +00:00
|
|
|
// in Project Inspector
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
if ((s =[projectInfo getStringFor:BASEPATHKEY])) {
|
|
|
|
strcpy (path_basepath, s);
|
|
|
|
|
|
|
|
strcpy (path_progdir, s);
|
|
|
|
strcat (path_progdir, "/" SUBDIR_ENT);
|
|
|
|
|
|
|
|
strcpy (path_mapdirectory, s);
|
|
|
|
strcat (path_mapdirectory, "/" SUBDIR_MAPS); // source dir
|
|
|
|
|
|
|
|
strcpy (path_finalmapdir, s);
|
|
|
|
strcat (path_finalmapdir, "/" SUBDIR_MAPS); // dest dir
|
|
|
|
|
|
|
|
[basepathinfo_i setStringValue:s];
|
|
|
|
// in Project Inspector
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
2010-09-11 10:03:41 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
if ((s =[projectInfo getStringFor:BSPFULLVIS])) {
|
|
|
|
strcpy (string_fullvis, s);
|
|
|
|
changeString ('@', '\"', string_fullvis);
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
2010-09-11 10:03:41 +00:00
|
|
|
|
|
|
|
if ((s =[projectInfo getStringFor:BSPFASTVIS])) {
|
|
|
|
strcpy (string_fastvis, s);
|
|
|
|
changeString ('@', '\"', string_fastvis);
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
2010-09-11 10:03:41 +00:00
|
|
|
|
|
|
|
if ((s =[projectInfo getStringFor:BSPNOVIS])) {
|
|
|
|
strcpy (string_novis, s);
|
|
|
|
changeString ('@', '\"', string_novis);
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
2010-09-11 10:03:41 +00:00
|
|
|
|
|
|
|
if ((s =[projectInfo getStringFor:BSPRELIGHT])) {
|
|
|
|
strcpy (string_relight, s);
|
|
|
|
changeString ('@', '\"', string_relight);
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
2010-09-11 10:03:41 +00:00
|
|
|
|
|
|
|
if ((s =[projectInfo getStringFor:BSPLEAKTEST])) {
|
|
|
|
strcpy (string_leaktest, s);
|
|
|
|
changeString ('@', '\"', string_leaktest);
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
|
|
|
|
2010-09-11 10:03:41 +00:00
|
|
|
if ((s =[projectInfo getStringFor:BSPENTITIES])) {
|
|
|
|
strcpy (string_entities, s);
|
|
|
|
changeString ('@', '\"', string_entities);
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
2010-09-11 10:03:41 +00:00
|
|
|
// Build list of wads
|
|
|
|
wadList =[projectInfo parseMultipleFrom:WADSKEY];
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:03:41 +00:00
|
|
|
// Build list of maps & descriptions
|
|
|
|
mapList =[projectInfo parseMultipleFrom:MAPNAMESKEY];
|
|
|
|
descList =[projectInfo parseMultipleFrom:DESCKEY];
|
|
|
|
[self changeChar: '_' to: ' ' in:descList];
|
2003-03-18 19:48:24 +00:00
|
|
|
|
|
|
|
[self initProjSettings];
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Init Project Settings fields
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
-initProjSettings
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-11 10:03:41 +00:00
|
|
|
[pis_basepath_i setStringValue: [NSString stringWithCString:path_basepath]];
|
|
|
|
[pis_fullvis_i setStringValue: [NSString stringWithCString:string_fullvis]];
|
|
|
|
[pis_fastvis_i setStringValue: [NSString stringWithCString:string_fastvis]];
|
|
|
|
[pis_novis_i setStringValue: [NSString stringWithCString:string_novis]];
|
|
|
|
[pis_relight_i setStringValue: [NSString stringWithCString:string_relight]];
|
|
|
|
[pis_leaktest_i setStringValue: [NSString stringWithCString:string_leaktest]];
|
|
|
|
|
2003-03-18 19:48:24 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Add text to the BSP Output window
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-28 09:41:38 +00:00
|
|
|
-addToOutput:(const char *) string
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-11 10:03:41 +00:00
|
|
|
int end;
|
|
|
|
|
|
|
|
end =[BSPoutput_i textLength];
|
|
|
|
[BSPoutput_i replaceCharactersInRange: NSMakeRange (end, 0) withString: [NSString stringWithCString:string]];
|
|
|
|
|
|
|
|
end =[BSPoutput_i textLength];
|
2010-09-11 08:35:25 +00:00
|
|
|
[BSPoutput_i setSelectedRange:NSMakeRange (end, 0)];
|
2010-09-11 10:03:41 +00:00
|
|
|
// XXX [BSPoutput_i scrollSelToVisible];
|
|
|
|
|
2003-03-18 19:48:24 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2010-09-11 10:03:41 +00:00
|
|
|
-clearBspOutput:sender
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-11 10:03:41 +00:00
|
|
|
int end;
|
|
|
|
|
|
|
|
end =[BSPoutput_i textLength];
|
|
|
|
[BSPoutput_i replaceCharactersInRange: NSMakeRange (0, end) withString:@""];
|
|
|
|
|
2003-03-18 19:48:24 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2010-09-11 10:03:41 +00:00
|
|
|
-print
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-11 10:03:41 +00:00
|
|
|
// XXX [BSPoutput_i printPSCode:self];
|
2003-03-18 19:48:24 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-09-11 10:03:41 +00:00
|
|
|
-initProject
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
[self parseProjectFile];
|
|
|
|
if (projectInfo == NULL)
|
|
|
|
return self;
|
|
|
|
[self initVars];
|
2010-09-11 08:35:25 +00:00
|
|
|
[mapbrowse_i setReusesColumns:YES];
|
2003-03-18 19:48:24 +00:00
|
|
|
[mapbrowse_i loadColumnZero];
|
2010-09-11 08:35:25 +00:00
|
|
|
[pis_wads_i setReusesColumns:YES];
|
2003-03-18 19:48:24 +00:00
|
|
|
[pis_wads_i loadColumnZero];
|
|
|
|
|
2010-09-11 10:03:41 +00:00
|
|
|
[things_i initEntities];
|
|
|
|
|
2003-03-18 19:48:24 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Change a character to another in a Storage list of strings
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-28 09:41:38 +00:00
|
|
|
-changeChar:(char) f to:(char) t in:(id) obj
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-11 10:03:41 +00:00
|
|
|
int i;
|
|
|
|
int max;
|
|
|
|
char *string;
|
|
|
|
|
|
|
|
max =[obj count];
|
|
|
|
for (i = 0; i < max; i++) {
|
|
|
|
string =[obj elementAt:i];
|
|
|
|
changeString (f, t, string);
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Fill the QuakeEd Maps or wads browser
|
|
|
|
// (Delegate method - delegated in Interface Builder)
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-14 13:17:35 +00:00
|
|
|
-(void) browser: sender createRowsForColumn:(int) column inMatrix: matrix
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-11 10:03:41 +00:00
|
|
|
id cell, list;
|
|
|
|
int max;
|
|
|
|
char *name;
|
|
|
|
int i;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
|
|
|
if (sender == mapbrowse_i)
|
|
|
|
list = mapList;
|
|
|
|
else if (sender == pis_wads_i)
|
|
|
|
list = wadList;
|
2010-09-11 10:03:41 +00:00
|
|
|
else {
|
2003-03-18 19:48:24 +00:00
|
|
|
list = nil;
|
2010-09-11 08:35:25 +00:00
|
|
|
Sys_Error ("Project: unknown browser to fill");
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
2010-09-11 10:03:41 +00:00
|
|
|
|
|
|
|
max =[list count];
|
|
|
|
for (i = 0; i < max; i++) {
|
|
|
|
name =[list elementAt:i];
|
2003-03-18 19:48:24 +00:00
|
|
|
[matrix addRow];
|
2010-09-11 10:03:41 +00:00
|
|
|
cell =[matrix cellAtRow: i column:0];
|
|
|
|
[cell setStringValue: [NSString stringWithCString:name]];
|
2003-03-18 19:48:24 +00:00
|
|
|
[cell setLeaf:YES];
|
|
|
|
[cell setLoaded:YES];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Clicked on a map name or description!
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
-clickedOnMap:sender
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-11 10:03:41 +00:00
|
|
|
id matrix;
|
|
|
|
int row;
|
|
|
|
char fname[1024];
|
|
|
|
id panel;
|
2010-09-19 08:05:34 +00:00
|
|
|
NSModalSession session;
|
2010-09-11 10:03:41 +00:00
|
|
|
|
|
|
|
matrix =[sender matrixInColumn:0];
|
|
|
|
row =[matrix selectedRow];
|
|
|
|
sprintf (fname, "%s/%s.map", path_mapdirectory, (char *)[mapList elementAt:row]);
|
|
|
|
|
|
|
|
panel = NSGetAlertPanel (@"Loading...",
|
|
|
|
@"Loading map. Please wait.", NULL, NULL, NULL);
|
2010-09-19 08:05:34 +00:00
|
|
|
|
|
|
|
session = [NSApp beginModalSessionForWindow: panel];
|
|
|
|
[NSApp runModalSession: session];
|
2003-03-18 19:48:24 +00:00
|
|
|
|
|
|
|
[quakeed_i doOpen:fname];
|
|
|
|
|
2010-09-19 08:05:34 +00:00
|
|
|
[NSApp endModalSession: session];
|
|
|
|
[panel close];
|
|
|
|
NSReleaseAlertPanel (panel);
|
2003-03-18 19:48:24 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-09-27 15:29:16 +00:00
|
|
|
-setTextureWad:(const char *) wf
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-11 10:03:41 +00:00
|
|
|
int i, c;
|
|
|
|
char *name;
|
|
|
|
|
2010-09-12 02:13:35 +00:00
|
|
|
Sys_Printf ("loading %s\n", wf);
|
2003-03-18 19:48:24 +00:00
|
|
|
|
|
|
|
// set the row in the settings inspector wad browser
|
2010-09-11 10:03:41 +00:00
|
|
|
c =[wadList count];
|
|
|
|
for (i = 0; i < c; i++) {
|
2003-03-18 19:48:24 +00:00
|
|
|
name = (char *)[wadList elementAt:i];
|
2010-09-11 10:03:41 +00:00
|
|
|
if (!strcmp (name, wf)) {
|
|
|
|
[[pis_wads_i matrixInColumn: 0] selectCellAtRow: i column:0];
|
2003-03-18 19:48:24 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// update the texture inspector
|
2010-09-11 10:03:41 +00:00
|
|
|
[texturepalette_i initPaletteFromWadfile:wf];
|
|
|
|
[[map_i objectAtIndex: 0] setKey: "wad" toValue:wf];
|
|
|
|
// [inspcontrol_i changeInspectorTo:i_textures];
|
2003-03-18 19:48:24 +00:00
|
|
|
|
|
|
|
[quakeed_i updateAll];
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Clicked on a wad name
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
-clickedOnWad:sender
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-11 10:03:41 +00:00
|
|
|
id matrix;
|
|
|
|
int row;
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
matrix =[sender matrixInColumn:0];
|
|
|
|
row =[matrix selectedRow];
|
2003-03-18 19:48:24 +00:00
|
|
|
|
|
|
|
name = (char *)[wadList elementAt:row];
|
2010-09-11 10:03:41 +00:00
|
|
|
[self setTextureWad:name];
|
|
|
|
|
2003-03-18 19:48:24 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Read in the <name>.QE_Project file
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
-parseProjectFile
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-28 09:41:38 +00:00
|
|
|
const char *path;
|
2010-09-11 10:03:41 +00:00
|
|
|
int rtn;
|
|
|
|
|
|
|
|
path =[preferences_i getProjectPath];
|
|
|
|
if (!path || !path[0] || access (path, 0)) {
|
|
|
|
rtn = NSRunAlertPanel (@"Project Error!",
|
|
|
|
@"A default project has not been found.\n",
|
|
|
|
@"Open Project", NULL, NULL);
|
2003-03-18 19:48:24 +00:00
|
|
|
if ([self openProject] == nil)
|
2010-09-11 10:03:41 +00:00
|
|
|
while (1) // can't run without a project
|
|
|
|
[NSApp terminate:self];
|
|
|
|
return self;
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[self openProjectFile:path];
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Loads and parses a project file
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-28 09:41:38 +00:00
|
|
|
-openProjectFile:(const char *) path
|
2010-09-11 10:03:41 +00:00
|
|
|
{
|
|
|
|
FILE *fp;
|
|
|
|
struct stat s;
|
2010-09-12 09:12:02 +00:00
|
|
|
Sys_Printf ("openProjectFile: %s\n", path);
|
2010-09-11 10:03:41 +00:00
|
|
|
strcpy (path_projectinfo, path);
|
2003-03-18 19:48:24 +00:00
|
|
|
|
|
|
|
projectInfo = NULL;
|
2010-09-11 10:03:41 +00:00
|
|
|
fp = fopen (path, "r+t");
|
2003-03-18 19:48:24 +00:00
|
|
|
if (fp == NULL)
|
|
|
|
return self;
|
|
|
|
|
2010-09-11 10:03:41 +00:00
|
|
|
stat (path, &s);
|
2003-03-18 19:48:24 +00:00
|
|
|
lastModified = s.st_mtime;
|
|
|
|
|
2010-09-11 10:03:41 +00:00
|
|
|
projectInfo =[(Dict *)[Dict alloc] initFromFile:fp];
|
|
|
|
fclose (fp);
|
|
|
|
|
2003-03-18 19:48:24 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2010-09-28 09:41:38 +00:00
|
|
|
-(const char *) currentProjectFile
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
return path_projectinfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Open a project file
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
-openProject
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-11 10:03:41 +00:00
|
|
|
char path[128];
|
|
|
|
id openpanel;
|
|
|
|
int rtn;
|
|
|
|
NSString *projtypes[] = { @"qpr" };
|
2010-09-11 08:35:25 +00:00
|
|
|
NSArray *filenames;
|
|
|
|
const char *dir;
|
2010-09-11 10:03:41 +00:00
|
|
|
|
|
|
|
openpanel =[NSOpenPanel new];
|
|
|
|
// [openpanel allowMultipleFiles:NO];
|
|
|
|
// [openpanel chooseDirectories:NO];
|
|
|
|
rtn =[openpanel runModalForTypes: [NSArray arrayWithObjects: projtypes count:1]];
|
|
|
|
if (rtn == NSOKButton) {
|
|
|
|
filenames =[openpanel filenames];
|
|
|
|
dir =[[openpanel directory] cString];
|
2010-09-12 09:12:02 +00:00
|
|
|
dir = "";
|
2010-09-11 10:03:41 +00:00
|
|
|
sprintf (path, "%s/%s", dir,[[filenames objectAtIndex:0] cString]);
|
|
|
|
strcpy (path_projectinfo, path);
|
|
|
|
[self openProjectFile:path];
|
|
|
|
return self;
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
2010-09-11 10:03:41 +00:00
|
|
|
|
2003-03-18 19:48:24 +00:00
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Search for a string in a List of strings
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-28 09:41:38 +00:00
|
|
|
-(int) searchForString:(const char *) str in:(id) obj
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-11 10:03:41 +00:00
|
|
|
int i;
|
|
|
|
int max;
|
|
|
|
char *s;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:03:41 +00:00
|
|
|
max =[obj count];
|
|
|
|
for (i = 0; i < max; i++) {
|
2003-03-18 19:48:24 +00:00
|
|
|
s = (char *)[obj elementAt:i];
|
2010-09-11 10:03:41 +00:00
|
|
|
if (!strcmp (s, str))
|
2003-03-18 19:48:24 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-09-28 09:41:38 +00:00
|
|
|
-(const char *) getMapDirectory
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
return path_mapdirectory;
|
|
|
|
}
|
|
|
|
|
2010-09-28 09:41:38 +00:00
|
|
|
-(const char *) getFinalMapDirectory
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
return path_finalmapdir;
|
|
|
|
}
|
|
|
|
|
2010-09-28 09:41:38 +00:00
|
|
|
-(const char *) getProgDirectory
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
return path_progdir;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Return the WAD name for cmd-8
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-28 09:41:38 +00:00
|
|
|
-(const char *) getWAD8
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
if (!path_wad8[0])
|
|
|
|
return NULL;
|
|
|
|
return path_wad8;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Return the WAD name for cmd-9
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-28 09:41:38 +00:00
|
|
|
-(const char *) getWAD9
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
if (!path_wad9[0])
|
|
|
|
return NULL;
|
|
|
|
return path_wad9;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Return the WAD name for cmd-0
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-28 09:41:38 +00:00
|
|
|
-(const char *) getWAD0
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
if (!path_wad0[0])
|
|
|
|
return NULL;
|
|
|
|
return path_wad0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Return the FULLVIS cmd string
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-28 09:41:38 +00:00
|
|
|
-(const char *) getFullVisCmd
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
if (!string_fullvis[0])
|
|
|
|
return NULL;
|
|
|
|
return string_fullvis;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Return the FASTVIS cmd string
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-28 09:41:38 +00:00
|
|
|
-(const char *) getFastVisCmd
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
if (!string_fastvis[0])
|
|
|
|
return NULL;
|
|
|
|
return string_fastvis;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Return the NOVIS cmd string
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-28 09:41:38 +00:00
|
|
|
-(const char *) getNoVisCmd
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
if (!string_novis[0])
|
|
|
|
return NULL;
|
|
|
|
return string_novis;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Return the RELIGHT cmd string
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-28 09:41:38 +00:00
|
|
|
-(const char *) getRelightCmd
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
if (!string_relight[0])
|
|
|
|
return NULL;
|
|
|
|
return string_relight;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
// Return the LEAKTEST cmd string
|
2003-03-18 19:48:24 +00:00
|
|
|
//
|
2010-09-28 09:41:38 +00:00
|
|
|
-(const char *) getLeaktestCmd
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
if (!string_leaktest[0])
|
|
|
|
return NULL;
|
|
|
|
return string_leaktest;
|
|
|
|
}
|
|
|
|
|
2010-09-28 09:41:38 +00:00
|
|
|
-(const char *) getEntitiesCmd
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
|
|
|
if (!string_entities[0])
|
|
|
|
return NULL;
|
|
|
|
return string_entities;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
//====================================================
|
|
|
|
// C Functions
|
|
|
|
//====================================================
|
|
|
|
//
|
|
|
|
// Change a character to a different char in a string
|
|
|
|
//
|
2010-09-11 10:03:41 +00:00
|
|
|
void
|
|
|
|
changeString (char cf, char ct, char *string)
|
2003-03-18 19:48:24 +00:00
|
|
|
{
|
2010-09-11 10:03:41 +00:00
|
|
|
int j;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:03:41 +00:00
|
|
|
for (j = 0; j < strlen (string); j++)
|
2003-03-18 19:48:24 +00:00
|
|
|
if (string[j] == cf)
|
|
|
|
string[j] = ct;
|
|
|
|
}
|