diff --git a/tools/Forge/Bundles/MapEdit/EntityClass.m b/tools/Forge/Bundles/MapEdit/EntityClass.m index 8a20a39ca..7924e841a 100644 --- a/tools/Forge/Bundles/MapEdit/EntityClass.m +++ b/tools/Forge/Bundles/MapEdit/EntityClass.m @@ -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; diff --git a/tools/Forge/Bundles/MapEdit/MapEdit.gorm/data.classes b/tools/Forge/Bundles/MapEdit/MapEdit.gorm/data.classes index 1c3f7aab6..5b141bab6 100644 --- a/tools/Forge/Bundles/MapEdit/MapEdit.gorm/data.classes +++ b/tools/Forge/Bundles/MapEdit/MapEdit.gorm/data.classes @@ -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:", diff --git a/tools/Forge/Bundles/MapEdit/MapEdit.gorm/objects.gorm b/tools/Forge/Bundles/MapEdit/MapEdit.gorm/objects.gorm index aade3fc21..730715d71 100644 Binary files a/tools/Forge/Bundles/MapEdit/MapEdit.gorm/objects.gorm and b/tools/Forge/Bundles/MapEdit/MapEdit.gorm/objects.gorm differ diff --git a/tools/Forge/Bundles/MapEdit/Preferences.m b/tools/Forge/Bundles/MapEdit/Preferences.m index d0181286e..9f0d15768 100644 --- a/tools/Forge/Bundles/MapEdit/Preferences.m +++ b/tools/Forge/Bundles/MapEdit/Preferences.m @@ -1,3 +1,5 @@ +#include + #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]]; diff --git a/tools/Forge/Bundles/MapEdit/Project.m b/tools/Forge/Bundles/MapEdit/Project.m index d01520ba5..18570a5e3 100644 --- a/tools/Forge/Bundles/MapEdit/Project.m +++ b/tools/Forge/Bundles/MapEdit/Project.m @@ -6,6 +6,7 @@ #include +#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]; diff --git a/tools/Forge/Bundles/MapEdit/SetBrush.m b/tools/Forge/Bundles/MapEdit/SetBrush.m index be78ac854..99fe3801e 100644 --- a/tools/Forge/Bundles/MapEdit/SetBrush.m +++ b/tools/Forge/Bundles/MapEdit/SetBrush.m @@ -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++; diff --git a/tools/Forge/Bundles/MapEdit/Things.m b/tools/Forge/Bundles/MapEdit/Things.m index 85703160f..076bb321e 100644 --- a/tools/Forge/Bundles/MapEdit/Things.m +++ b/tools/Forge/Bundles/MapEdit/Things.m @@ -1,3 +1,4 @@ +#include "QF/sys.h" #include "Things.h" #include "QuakeEd.h"