- // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=503
- // make sure we don't attempt to region compile a map with the camera outside the region
- if (region_active && !Region_cameraValid())
- {
- globalErrorStream() << "The camera must be in the region to start a region compile.\n";
- return;
- }
-
- SaveMap();
-
- if(Map_Unnamed(g_map))
- {
- globalOutputStream() << "build cancelled\n";
- return;
- }
-
- if (g_SnapShots_Enabled && !Map_Unnamed(g_map) && Map_Modified(g_map))
- {
- Map_Snapshot();
- }
-
- if (region_active)
- {
- const char* mapname = Map_Name(g_map);
- StringOutputStream name(256);
- name << StringRange(mapname, path_get_filename_base_end(mapname)) << ".reg";
- Map_SaveRegion(name.c_str());
- }
-
- Pointfile_Delete();
-
- bsp_init();
-
- if (g_WatchBSP_Enabled)
- {
- ArrayCommandListener listener;
- build_run(name, listener);
- // grab the file name for engine running
- const char* fullname = Map_Name(g_map);
- StringOutputStream bspname(64);
- bspname << StringRange(path_get_filename_start(fullname), path_get_filename_base_end(fullname));
- BuildMonitor_Run( listener.array(), bspname.c_str() );
- }
- else
- {
- char junkpath[PATH_MAX];
- strcpy(junkpath, SettingsPath_get());
- strcat(junkpath, "junk.txt");
-
- char batpath[PATH_MAX];
-#if defined(POSIX)
- strcpy(batpath, SettingsPath_get());
- strcat(batpath, "qe3bsp.sh");
-#elif defined(WIN32)
- strcpy(batpath, SettingsPath_get());
- strcat(batpath, "qe3bsp.bat");
+ // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=503
+ // make sure we don't attempt to region compile a map with the camera outside the region
+ if (region_active && !Region_cameraValid()) {
+ globalErrorStream() << "The camera must be in the region to start a region compile.\n";
+ return;
+ }
+
+ SaveMap();
+
+ if (Map_Unnamed(g_map)) {
+ globalOutputStream() << "build cancelled\n";
+ return;
+ }
+
+ if (g_SnapShots_Enabled && !Map_Unnamed(g_map) && Map_Modified(g_map)) {
+ Map_Snapshot();
+ }
+
+ if (region_active) {
+ const char *mapname = Map_Name(g_map);
+ StringOutputStream name(256);
+ name << StringRange(mapname, path_get_filename_base_end(mapname)) << ".reg";
+ Map_SaveRegion(name.c_str());
+ }
+
+ Pointfile_Delete();
+
+ bsp_init();
+
+ if (g_WatchBSP_Enabled) {
+ ArrayCommandListener listener;
+ build_run(name, listener);
+ // grab the file name for engine running
+ const char *fullname = Map_Name(g_map);
+ StringOutputStream bspname(64);
+ bspname << StringRange(path_get_filename_start(fullname), path_get_filename_base_end(fullname));
+ BuildMonitor_Run(listener.array(), bspname.c_str());
+ } else {
+ char junkpath[PATH_MAX];
+ strcpy(junkpath, SettingsPath_get());
+ strcat(junkpath, "junk.txt");
+
+ char batpath[PATH_MAX];
+#if GDEF_OS_POSIX
+ strcpy(batpath, SettingsPath_get());
+ strcat(batpath, "qe3bsp.sh");
+#elif GDEF_OS_WINDOWS
+ strcpy( batpath, SettingsPath_get() );
+ strcat( batpath, "qe3bsp.bat" );