Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

MAP.H File Reference

Go to the source code of this file.

Functions

void Map_BuildBrushData (void)
void Map_ImportBuffer (char *buf)
qboolean Map_IsBrushFiltered (brush_t *b)
void Map_LoadFile (char *filename)
void Map_New (void)
void Map_RegionBrush (void)
void Map_RegionOff (void)
void Map_RegionSelectedBrushes (void)
void Map_RegionTallBrush (void)
void Map_RegionXY (void)
void Map_SaveFile (char *filename, qboolean use_region)
void Map_SaveSelected (CMemFile *pMemFile, CMemFile *pPatchFile=NULL)

Variables

brush_t active_brushes
char currentmap [1024]
entity_t entities
brush_t filtered_brushes
CPtrArray & g_ptrSelectedFaceBrushes
CPtrArray & g_ptrSelectedFaces
qboolean modified
qboolean region_active
vec3_t region_maxs
vec3_t region_mins
brush_t selected_brushes
entity_tworld_entity


Function Documentation

void Map_BuildBrushData void   ) 
 

Definition at line 177 of file MAP.CPP.

References active_brushes, b, Brush_Build(), brush_s::brush_faces, Brush_Free(), brush_t, CheckForTinyBrush(), g_PrefsDlg, CPrefsDlg::m_bCleanTiny, CPrefsDlg::m_fTinySize, n, next, brush_s::next, NULL, Sys_BeginWait(), Sys_EndWait(), and Sys_Printf().

Referenced by Map_ImportFile(), Map_LoadFile(), CMainFrame::OnConvertcurves(), CMainFrame::OnSelectMouserotate(), CMainFrame::OnViewCubicclipping(), CMainFrame::OnViewShownames(), and Texture_SetMode().

00178 {
00179     brush_t *b, *next;
00180 
00181     if (active_brushes.next == NULL)
00182         return;
00183 
00184     Sys_BeginWait ();   // this could take a while
00185 
00186   int n = 0;
00187     for (b=active_brushes.next ; b != NULL && b != &active_brushes ; b=next)
00188     {
00189         next = b->next;
00190         Brush_Build( b, true, false, false );
00191         if (!b->brush_faces || (g_PrefsDlg.m_bCleanTiny && CheckForTinyBrush(b, n++, g_PrefsDlg.m_fTinySize)))
00192         {
00193             Brush_Free (b);
00194             Sys_Printf ("Removed degenerate brush\n");
00195         }
00196     }
00197     Sys_EndWait();
00198 }

Here is the call graph for this function:

void Map_ImportBuffer char *  buf  ) 
 

Definition at line 834 of file MAP.CPP.

References active_brushes, b, QEGlobals_t::bNeedConvert, QEGlobals_t::bOldBrushes, QEGlobals_t::bPrimitBrushes, Brush_Build(), brush_t, entity_t::brushes, QEGlobals_t::d_num_entities, QEGlobals_t::d_parsed_brushes, entities, Entity_LinkBrush(), Entity_Parse(), Entity_UnlinkBrush(), FindEntity(), g_bScreenUpdates, g_qeglobals, i, modified, brush_s::next, brush_s::onext, Select_Brush(), Select_Deselect(), SetKeyValue(), StartTokenParsing(), strcmp(), Sys_UpdateWindows(), Undo_End(), Undo_EndBrush(), Undo_EndEntity(), Undo_Start(), UniqueTargetName(), ValueForKey(), W_ALL, and world_entity.

Referenced by Map_ImportFile(), and CXYWnd::Paste().

00835 {
00836     entity_t* ent;
00837     brush_t* b = NULL;
00838     CPtrArray ptrs;
00839 
00840     Select_Deselect();
00841 
00842     Undo_Start("import buffer");
00843 
00844     g_qeglobals.d_parsed_brushes = 0;
00845     if (buf)
00846     {
00847         CMapStringToString mapStr;
00848         StartTokenParsing (buf);
00849         g_qeglobals.d_num_entities = 0;
00850 
00851         // Timo
00852         // will be used in Entity_Parse to detect if a conversion between brush formats is needed
00853         g_qeglobals.bNeedConvert = false;
00854         g_qeglobals.bOldBrushes = false;
00855         g_qeglobals.bPrimitBrushes = false;
00856 
00857         while (1)
00858         {
00859 
00860             // use the selected brushes list as it's handy
00861             //ent = Entity_Parse (false, &selected_brushes);
00862             ent = Entity_Parse (false, &active_brushes);
00863             if (!ent)
00864                 break;
00865             //end entity for undo
00866             Undo_EndEntity(ent);
00867             //end brushes for undo
00868             for(b = ent->brushes.onext; b && b != &ent->brushes; b = b->onext)
00869             {
00870                 Undo_EndBrush(b);
00871             }
00872 
00873             if (!strcmp(ValueForKey (ent, "classname"), "worldspawn"))
00874             {
00875                 // world brushes need to be added to the current world entity
00876 
00877                 b=ent->brushes.onext;
00878                 while (b && b != &ent->brushes)
00879                 {
00880                     brush_t* bNext = b->onext;
00881                     Entity_UnlinkBrush(b);
00882                     Entity_LinkBrush(world_entity, b);
00883                     ptrs.Add(b);
00884                     b = bNext;
00885                 }
00886             }
00887             else
00888             {
00889                 // the following bit remaps conflicting target/targetname key/value pairs
00890                 CString str = ValueForKey(ent, "target");
00891                 CString strKey;
00892                 CString strTarget("");
00893                 if (str.GetLength() > 0)
00894                 {
00895                     if (FindEntity("target", str.GetBuffer(0)))
00896                     {
00897                         if (!mapStr.Lookup(str, strKey))
00898                         {
00899                             UniqueTargetName(strKey);
00900                             mapStr.SetAt(str, strKey);
00901                         }
00902                         strTarget = strKey;
00903                         SetKeyValue(ent, "target", strTarget.GetBuffer(0));
00904                     }
00905                 }
00906                 str = ValueForKey(ent, "targetname");
00907                 if (str.GetLength() > 0)
00908                 {
00909                     if (FindEntity("targetname", str.GetBuffer(0)))
00910                     {
00911                         if (!mapStr.Lookup(str, strKey))
00912                         {
00913                             UniqueTargetName(strKey);
00914                             mapStr.SetAt(str, strKey);
00915                         }
00916                         SetKeyValue(ent, "targetname", strKey.GetBuffer(0));
00917                     }
00918                 }
00919                 //if (strTarget.GetLength() > 0)
00920                 //  SetKeyValue(ent, "target", strTarget.GetBuffer(0));
00921 
00922                 // add the entity to the end of the entity list
00923                 ent->next = &entities;
00924                 ent->prev = entities.prev;
00925                 entities.prev->next = ent;
00926                 entities.prev = ent;
00927                 g_qeglobals.d_num_entities++;
00928 
00929                 for (b=ent->brushes.onext ; b != &ent->brushes ; b=b->onext)
00930                 {
00931                     ptrs.Add(b);
00932                 }
00933             }
00934         }
00935     }
00936 
00937     //::ShowWindow(g_qeglobals.d_hwndEntity, FALSE);
00938     //::LockWindowUpdate(g_qeglobals.d_hwndEntity);
00939     g_bScreenUpdates = false; 
00940     for (int i = 0; i < ptrs.GetSize(); i++)
00941     {
00942         Brush_Build(reinterpret_cast<brush_t*>(ptrs[i]), true, false);
00943         Select_Brush(reinterpret_cast<brush_t*>(ptrs[i]), true, false);
00944     }
00945     //::LockWindowUpdate(NULL);
00946     g_bScreenUpdates = true; 
00947 
00948     ptrs.RemoveAll();
00949 
00950     // reset the "need conversion" flag
00951     // conversion to the good format done in Map_BuildBrushData
00952     g_qeglobals.bNeedConvert=false;
00953 
00954     Sys_UpdateWindows (W_ALL);
00955   //Sys_MarkMapModified();
00956     modified = true;
00957 
00958     Undo_End();
00959 
00960 }

Here is the call graph for this function:

qboolean Map_IsBrushFiltered brush_t b  ) 
 

Definition at line 628 of file MAP.CPP.

References b, brush_t, i, brush_s::maxs, brush_s::mins, qboolean, region_maxs, and region_mins.

Referenced by Entity_Write(), Map_ApplyRegion(), and Map_RegionOff().

00629 {
00630     int     i;
00631 
00632     for (i=0 ; i<3 ; i++)
00633     {
00634         if (b->mins[i] > region_maxs[i])
00635             return true;
00636         if (b->maxs[i] < region_mins[i])
00637             return true;
00638     }
00639     return false;
00640 }

void Map_LoadFile char *  filename  ) 
 

Definition at line 297 of file MAP.CPP.

References active_brushes, AngledEntity(), camera_t::angles, QEGlobals_t::bNeedConvert, QEGlobals_t::bOldBrushes, QEGlobals_t::bPrimitBrushes, CCamWnd::Camera(), currentmap, QEGlobals_t::d_num_entities, QEGlobals_t::d_parsed_brushes, entities, Entity_Free(), Entity_Parse(), FloatForKey(), free(), g_pParentWnd, g_qeglobals, CMainFrame::GetCamera(), CXYWnd::GetOrigin(), GetVectorForKey(), CMainFrame::GetXYWnd(), Group_Add(), Group_Init(), LoadFile(), Map_BuildBrushData(), Map_Free(), Map_New(), Map_RegionOff(), Map_RestoreBetween(), modified, camera_t::origin, QE_ConvertDOSToUnixName(), Select_Deselect(), StartTokenParsing(), strcmp(), strcpy(), Sys_BeginWait(), Sys_EndWait(), Sys_Printf(), Sys_SetTitle(), Sys_UpdateWindows(), Texture_ShowInuse(), ValueForKey(), vec3_origin, VectorCopy, W_ALL, and world_entity.

Referenced by CMainFrame::OnCreate(), CMainFrame::OnFileNewproject(), and OpenDialog().

00298 {
00299     char        *buf;
00300     entity_t    *ent;
00301     char         temp[1024];
00302 
00303     Sys_BeginWait ();
00304     Select_Deselect();
00305     //SetInspectorMode(W_CONSOLE);
00306 
00307     QE_ConvertDOSToUnixName( temp, filename );
00308     Sys_Printf ("Map_LoadFile: %s\n", temp );
00309 
00310     Map_Free ();
00311     //++timo FIXME: maybe even easier to have Group_Init called from Map_Free?
00312     Group_Init();
00313 
00314     g_qeglobals.d_parsed_brushes = 0;
00315     strcpy (currentmap, filename);
00316 
00317     if (LoadFile (filename, (void **)&buf) != -1)
00318     {
00319 
00320         StartTokenParsing (buf);
00321         g_qeglobals.d_num_entities = 0;
00322 
00323         // Timo
00324         // will be used in Entity_Parse to detect if a conversion between brush formats is needed
00325         g_qeglobals.bNeedConvert = false;
00326         g_qeglobals.bOldBrushes = false;
00327         g_qeglobals.bPrimitBrushes = false;
00328 
00329         while (1)
00330         {
00331             ent = Entity_Parse (false, &active_brushes);
00332             if (!ent)
00333                 break;
00334             if (!strcmp(ValueForKey (ent, "classname"), "worldspawn"))
00335             {
00336                 if (world_entity)
00337                     Sys_Printf ("WARNING: multiple worldspawn\n");
00338                 world_entity = ent;
00339             }
00340             else if (!strcmp(ValueForKey (ent, "classname"), "group_info"))
00341       {
00342         // it's a group thing!
00343         Group_Add(ent);
00344         Entity_Free(ent);
00345       }
00346       else
00347             {
00348                 // add the entity to the end of the entity list
00349                 ent->next = &entities;
00350                 ent->prev = entities.prev;
00351                 entities.prev->next = ent;
00352                 entities.prev = ent;
00353                 g_qeglobals.d_num_entities++;
00354             }
00355         }
00356     }
00357 
00358   free (buf);
00359 
00360     if (!world_entity)
00361     {
00362         Sys_Printf ("No worldspawn in map.\n");
00363         Map_New ();
00364         return;
00365     }
00366 
00367     Sys_Printf ("--- LoadMapFile ---\n");
00368     Sys_Printf ("%s\n", temp );
00369 
00370     Sys_Printf ("%5i brushes\n",  g_qeglobals.d_parsed_brushes );
00371     Sys_Printf ("%5i entities\n", g_qeglobals.d_num_entities);
00372 
00373     Map_RestoreBetween ();
00374 
00375     Sys_Printf ("Map_BuildAllDisplayLists\n");
00376     Map_BuildBrushData();
00377 
00378     // reset the "need conversion" flag
00379     // conversion to the good format done in Map_BuildBrushData
00380     g_qeglobals.bNeedConvert=false;
00381 
00382     //
00383     // move the view to a start position
00384     //
00385   ent = AngledEntity();
00386 
00387   g_pParentWnd->GetCamera()->Camera().angles[PITCH] = 0;
00388     if (ent)
00389     {
00390         GetVectorForKey (ent, "origin", g_pParentWnd->GetCamera()->Camera().origin);
00391         GetVectorForKey (ent, "origin", g_pParentWnd->GetXYWnd()->GetOrigin());
00392         g_pParentWnd->GetCamera()->Camera().angles[YAW] = FloatForKey (ent, "angle");
00393     }
00394     else
00395     {
00396         g_pParentWnd->GetCamera()->Camera().angles[YAW] = 0;
00397         VectorCopy (vec3_origin, g_pParentWnd->GetCamera()->Camera().origin);
00398         VectorCopy (vec3_origin, g_pParentWnd->GetXYWnd()->GetOrigin());
00399     }
00400 
00401     Map_RegionOff ();
00402 
00403 
00404     modified = false;
00405     Sys_SetTitle (temp);
00406 
00407     Texture_ShowInuse ();
00408 
00409     Sys_EndWait();
00410     Sys_UpdateWindows (W_ALL);
00411 
00412 }

Here is the call graph for this function:

void Map_New void   ) 
 

Definition at line 527 of file MAP.CPP.

References camera_t::angles, entity_t::brushes, CCamWnd::Camera(), Eclass_ForName(), g_pParentWnd, CMainFrame::GetCamera(), CXYWnd::GetOrigin(), CMainFrame::GetXYWnd(), Group_Init(), Map_Free(), Map_RestoreBetween(), modified, camera_t::origin, Patch_Cleanup(), qmalloc(), SetKeyValue(), Sys_Printf(), Sys_UpdateWindows(), vec3_origin, VectorCopy, W_ALL, and world_entity.

Referenced by Map_LoadFile(), CMainFrame::OnFileNew(), QE_LoadProject(), and Texture_Flush().

00528 {
00529     Sys_Printf ("Map_New\n");
00530     Map_Free ();
00531 
00532   Patch_Cleanup();
00533 
00534     world_entity = (entity_s*)qmalloc(sizeof(*world_entity));
00535     world_entity->brushes.onext = 
00536         world_entity->brushes.oprev = &world_entity->brushes;
00537     SetKeyValue (world_entity, "classname", "worldspawn");
00538     world_entity->eclass = Eclass_ForName ("worldspawn", true);
00539 
00540     g_pParentWnd->GetCamera()->Camera().angles[YAW] = 0;
00541     g_pParentWnd->GetCamera()->Camera().angles[PITCH] = 0;
00542     VectorCopy (vec3_origin, g_pParentWnd->GetCamera()->Camera().origin);
00543     g_pParentWnd->GetCamera()->Camera().origin[2] = 48;
00544     VectorCopy (vec3_origin, g_pParentWnd->GetXYWnd()->GetOrigin());
00545 
00546     Map_RestoreBetween ();
00547 
00548   Group_Init();
00549 
00550     Sys_UpdateWindows (W_ALL);
00551     modified = false;
00552 }

Here is the call graph for this function:

void Map_RegionBrush void   ) 
 

Definition at line 780 of file MAP.CPP.

References b, brush_t, Map_ApplyRegion(), Map_RegionOff(), brush_s::maxs, brush_s::mins, brush_s::next, QE_SingleBrush(), region_maxs, region_mins, Select_Delete(), selected_brushes, and VectorCopy.

Referenced by CMainFrame::OnRegionSetbrush().

00781 {
00782     brush_t *b;
00783 
00784     if (!QE_SingleBrush ())
00785         return;
00786 
00787     b = selected_brushes.next;
00788 
00789     Map_RegionOff ();
00790 
00791     VectorCopy (b->mins, region_mins);
00792     VectorCopy (b->maxs, region_maxs);
00793 
00794     Select_Delete ();
00795     Map_ApplyRegion ();
00796 }

Here is the call graph for this function:

void Map_RegionOff void   ) 
 

Definition at line 649 of file MAP.CPP.

References active_brushes, b, Brush_AddToList(), Brush_RemoveFromList(), brush_t, filtered_brushes, i, Map_IsBrushFiltered(), next, brush_s::next, NULL, brush_s::prev, region_active, region_maxs, region_mins, Sys_UpdateWindows(), and W_ALL.

Referenced by Map_LoadFile(), Map_RegionBrush(), Map_RegionSelectedBrushes(), Map_RegionTallBrush(), Map_RegionXY(), and CMainFrame::OnRegionOff().

00650 {
00651     brush_t *b, *next;
00652     int         i;
00653 
00654     region_active = false;
00655     for (i=0 ; i<3 ; i++)
00656     {
00657         region_maxs[i] = MAX_WORLD_COORD;//4096;
00658         region_mins[i] = MIN_WORLD_COORD;//-4096;
00659     }
00660     
00661     for (b=filtered_brushes.next ; b != &filtered_brushes ; b=next)
00662     {
00663         next = b->next;
00664         if (Map_IsBrushFiltered (b))
00665             continue;       // still filtered
00666         Brush_RemoveFromList (b);
00667     if (active_brushes.next == NULL || active_brushes.prev == NULL)
00668     {
00669       active_brushes.next = &active_brushes;
00670       active_brushes.prev = &active_brushes;
00671     }
00672         Brush_AddToList (b, &active_brushes);
00673     }
00674 
00675     Sys_UpdateWindows (W_ALL);
00676 }

Here is the call graph for this function:

void Map_RegionSelectedBrushes void   ) 
 

Definition at line 701 of file MAP.CPP.

References active_brushes, filtered_brushes, Map_RegionOff(), brush_s::next, brush_s::prev, region_active, region_maxs, region_mins, Select_GetBounds(), selected_brushes, Sys_Printf(), Sys_UpdateWindows(), and W_ALL.

Referenced by CMainFrame::OnRegionSetselection().

00702 {
00703     Map_RegionOff ();
00704 
00705     if (selected_brushes.next == &selected_brushes)  // nothing selected
00706   {
00707     Sys_Printf("Tried to region with no selection...\n");
00708     return;
00709   }
00710     region_active = true;
00711     Select_GetBounds (region_mins, region_maxs);
00712 
00713     // move the entire active_brushes list to filtered_brushes
00714     filtered_brushes.next = active_brushes.next;
00715     filtered_brushes.prev = active_brushes.prev;
00716     filtered_brushes.next->prev = &filtered_brushes;
00717     filtered_brushes.prev->next = &filtered_brushes;
00718 
00719     // move the entire selected_brushes list to active_brushes
00720     active_brushes.next = selected_brushes.next;
00721     active_brushes.prev = selected_brushes.prev;
00722     active_brushes.next->prev = &active_brushes;
00723     active_brushes.prev->next = &active_brushes;
00724 
00725     // clear selected_brushes
00726     selected_brushes.next = selected_brushes.prev = &selected_brushes;
00727 
00728     Sys_UpdateWindows (W_ALL);
00729 }

Here is the call graph for this function:

void Map_RegionTallBrush void   ) 
 

Definition at line 755 of file MAP.CPP.

References b, brush_t, Map_ApplyRegion(), Map_RegionOff(), brush_s::maxs, brush_s::mins, brush_s::next, QE_SingleBrush(), region_maxs, region_mins, Select_Delete(), selected_brushes, and VectorCopy.

Referenced by CMainFrame::OnRegionSettallbrush().

00756 {
00757     brush_t *b;
00758 
00759     if (!QE_SingleBrush ())
00760         return;
00761 
00762     b = selected_brushes.next;
00763 
00764     Map_RegionOff ();
00765 
00766     VectorCopy (b->mins, region_mins);
00767     VectorCopy (b->maxs, region_maxs);
00768     region_mins[2] = MIN_WORLD_COORD;
00769     region_maxs[2] = MAX_WORLD_COORD;
00770 
00771 
00772     Select_Delete ();
00773     Map_ApplyRegion ();
00774 }

Here is the call graph for this function:

void Map_RegionXY void   ) 
 

Definition at line 737 of file MAP.CPP.

References g_pParentWnd, CXYWnd::GetOrigin(), CMainFrame::GetXYWnd(), CXYWnd::Height(), Map_ApplyRegion(), Map_RegionOff(), region_maxs, region_mins, CXYWnd::Scale(), and CXYWnd::Width().

Referenced by CMainFrame::OnRegionSetxy().

00738 {
00739     Map_RegionOff ();
00740 
00741     region_mins[0] = g_pParentWnd->GetXYWnd()->GetOrigin()[0] - 0.5 * g_pParentWnd->GetXYWnd()->Width() / g_pParentWnd->GetXYWnd()->Scale();
00742     region_maxs[0] = g_pParentWnd->GetXYWnd()->GetOrigin()[0] + 0.5 * g_pParentWnd->GetXYWnd()->Width() / g_pParentWnd->GetXYWnd()->Scale();
00743     region_mins[1] = g_pParentWnd->GetXYWnd()->GetOrigin()[1] - 0.5 * g_pParentWnd->GetXYWnd()->Height() / g_pParentWnd->GetXYWnd()->Scale();
00744     region_maxs[1] = g_pParentWnd->GetXYWnd()->GetOrigin()[1] + 0.5 * g_pParentWnd->GetXYWnd()->Height() / g_pParentWnd->GetXYWnd()->Scale();
00745     region_mins[2] = -MIN_WORLD_COORD;
00746     region_maxs[2] = MAX_WORLD_COORD;
00747     Map_ApplyRegion ();
00748 }

Here is the call graph for this function:

void Map_SaveFile char *  filename,
qboolean  use_region
 

Definition at line 419 of file MAP.CPP.

References AddRegionBrushes(), entity_t::brushes, count, QEGlobals_t::d_workcount, e, entities, Entity_Free(), Entity_Write(), f, FALSE, fclose(), fopen(), fprintf(), g_qeglobals, Group_Save(), modified, next, NULL, Pointfile_Clear(), QE_ConvertDOSToUnixName(), RemoveRegionBrushes(), rename(), strcat(), strcpy(), StripExtension(), strlen(), strstr(), Sys_Printf(), Sys_SetTitle(), Sys_Status(), time(), time_t, and world_entity.

Referenced by Map_Snapshot(), CMainFrame::OnFileSave(), QE_CheckAutoSave(), QE_CheckOpenGLForErrors(), RunBsp(), and SaveAsDialog().

00420 {
00421     entity_t    *e, *next;
00422     FILE        *f;
00423     char         temp[1024];
00424     int         count;
00425 
00426   if (filename == NULL || strlen(filename) == 0)
00427   {
00428     CFileDialog dlgSave(FALSE, "map", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "Map Files (*.map)|*.map||", AfxGetMainWnd());
00429     if (dlgSave.DoModal() == IDOK)
00430       filename = strdup(dlgSave.m_ofn.lpstrFile);
00431     else 
00432       return;
00433   }
00434 
00435     Pointfile_Clear ();
00436     QE_ConvertDOSToUnixName( temp, filename );
00437 
00438     if (!use_region)
00439     {
00440         char    backup[1024];
00441 
00442         // rename current to .bak
00443         strcpy (backup, filename);
00444         StripExtension (backup);
00445         strcat (backup, ".bak");
00446         _unlink (backup);
00447         rename (filename, backup);
00448     }
00449 
00450     Sys_Printf ("Map_SaveFile: %s\n", filename);
00451 
00452     f = fopen(filename, "w");
00453 
00454     if (!f)
00455     {
00456         Sys_Printf ("ERROR!!!! Couldn't open %s\n", filename);
00457         return;
00458     }
00459 
00460     if (use_region)
00461   {
00462         AddRegionBrushes ();
00463   }
00464 
00465     // write world entity first
00466     Entity_Write (world_entity, f, use_region);
00467 
00468     // then write all other ents
00469     count = 1;
00470     for (e=entities.next ; e != &entities ; e=next)
00471     {
00472         next = e->next;
00473         if (e->brushes.onext == &e->brushes)
00474     {
00475             Entity_Free (e);    // no brushes left, so remove it
00476     }
00477         else
00478     {
00479         fprintf (f, "// entity %i\n", count);
00480         count++;
00481             Entity_Write (e, f, use_region);
00482     }
00483     }
00484 
00485     // save the group info stuff
00486     Group_Save(f);
00487 
00488     fclose (f);
00489 
00490     if (use_region)
00491         RemoveRegionBrushes ();
00492 
00493     Sys_Printf ("Saved.\n");
00494     modified = false;
00495 
00496     if ( !strstr( temp, "autosave" ) )
00497         Sys_SetTitle (temp);
00498 
00499     if (!use_region)
00500     {
00501         time_t  timer;
00502         FILE    *f;
00503 
00504         time (&timer);
00505         MessageBeep (MB_ICONEXCLAMATION);
00506         f = fopen ("c:/tstamps.log", "a");
00507         if (f)
00508         {
00509             fprintf (f, "%s", filename);
00510             //fprintf (f, "%4i : %35s : %s", g_qeglobals.d_workcount, filename, ctime(&timer));
00511             fclose (f);
00512             g_qeglobals.d_workcount = 0;
00513         }
00514         fclose (f);
00515         Sys_Status ("Saved.\n", 0);
00516     }
00517     
00518   //Curve_WriteFile (filename);     //.trinity
00519   //Patch_WriteFile (filename);
00520 }

Here is the call graph for this function:

void Map_SaveSelected CMemFile *  pMemFile,
CMemFile *  pPatchFile = NULL
 

Definition at line 1031 of file MAP.CPP.

References count, e, entities, Entity_WriteSelected(), MemFile_fprintf(), next, and world_entity.

01032 {
01033     entity_t    *e, *next;
01034     int count;
01035     CString strTemp;
01036   
01037     // write world entity first
01038     Entity_WriteSelected(world_entity, pMemFile);
01039 
01040     // then write all other ents
01041     count = 1;
01042     for (e=entities.next ; e != &entities ; e=next)
01043     {
01044         MemFile_fprintf(pMemFile, "// entity %i\n", count);
01045         count++;
01046         Entity_WriteSelected(e, pMemFile);
01047         next = e->next;
01048     }
01049 
01050   //if (pPatchFile)
01051   //  Patch_WriteFile(pPatchFile);
01052 }

Here is the call graph for this function:


Variable Documentation

brush_t active_brushes
 

Definition at line 34 of file MAP.CPP.

Referenced by AddBrushForPatch(), AddBrushForTerrain(), CPlugInManager::AllocateActivePatchHandles(), BEGIN_MESSAGE_MAP(), CCamWnd::Cam_ChangeFloor(), CCamWnd::Cam_Draw(), CPlugInManager::CommitBrushHandleToMap(), CPlugInManager::CommitEntityHandleToMap(), CopyAndSelect(), CopyToMap(), CreateEntityFromName(), CSG_Subtract(), DrawTerrain(), Group_Init(), Map_ApplyRegion(), Map_BuildBrushData(), Map_Free(), Map_ImportBuffer(), Map_LoadFile(), Map_RegionOff(), Map_RegionSelectedBrushes(), CMainFrame::OnConvertcurves(), CMainFrame::OnCreate(), CMainFrame::OnDestroy(), Patch_ClearOverlays(), Patch_Freeze(), CXYWnd::ProduceSplitLists(), QE_CountBrushesAndUpdateStatusBar(), QERApp_ActiveBrushCount(), QERApp_AllocateActiveBrushHandles(), QERApp_CreateBrush(), Select_AllOfType(), Select_Clone(), Select_CompleteTall(), Select_Deselect(), Select_Inside(), Select_Invert(), Select_PartialTall(), Select_Ray(), Select_ShowAllHidden(), Select_Touching(), Terrain_AddMovePoint(), Terrain_SelectPointByRay(), Terrain_UpdateSelected(), Test_Ray(), Texture_ForName(), Texture_ShowInuse(), Undo_GeneralStart(), Undo_Redo(), Undo_Undo(), CXYWnd::XY_Draw(), and Z_Draw().

char currentmap[1024]
 

Definition at line 31 of file MAP.CPP.

Referenced by CheckBspProcess(), DLLBuildDone(), Map_Free(), Map_LoadFile(), Map_Snapshot(), CMainFrame::OnBspCommand(), CMainFrame::OnDestroy(), CMainFrame::OnFileSave(), Pointfile_Check(), Pointfile_Delete(), QE_CheckAutoSave(), RunBsp(), SaveAsDialog(), and Sys_MarkMapModified().

entity_t entities
 

Definition at line 34 of file l_bsp_ent.c.

brush_t filtered_brushes
 

Definition at line 40 of file MAP.CPP.

Referenced by Map_ApplyRegion(), Map_Free(), Map_RegionOff(), Map_RegionSelectedBrushes(), CMainFrame::OnDestroy(), and Texture_ForName().

CPtrArray& g_ptrSelectedFaceBrushes
 

Definition at line 31 of file SELECT.CPP.

Referenced by CSurfaceDlg::OnBtnFacefit(), QERApp_SetFaceInfo(), Select_Brush(), Select_Delete(), Select_Deselect(), Select_FitTexture(), Select_RotateTexture(), Select_ScaleTexture(), Select_SetTexture(), and Select_ShiftTexture().

CPtrArray& g_ptrSelectedFaces
 

Definition at line 30 of file SELECT.CPP.

Referenced by AnyPatchesSelected(), CCamWnd::Cam_Draw(), CTextureBar::GetSurfaceAttributes(), CSurfaceDlg::GetTexMods(), CSurfaceDlg::OnBtnFacefit(), OnlyPatchesSelected(), QERApp_GetFaceInfo(), QERApp_GetTextureSize(), QERApp_ISelectedFace_GetTextureNumber(), QERApp_SetFaceInfo(), Select_AllOfType(), Select_Brush(), Select_Delete(), Select_Deselect(), Select_FitTexture(), Select_RotateTexture(), Select_ScaleTexture(), Select_SetTexture(), Select_ShiftTexture(), CTextureBar::SetSurfaceAttributes(), CSurfaceDlg::SetTexMods(), and CSurfaceDlg::UpdateSpinners().

qboolean modified
 

Definition at line 28 of file MAP.CPP.

Referenced by Map_ImportBuffer(), Map_ImportFile(), Map_LoadFile(), Map_New(), Map_SaveFile(), MapKey(), NET_Config(), NET_GetCvars(), QE_CheckAutoSave(), Sys_MarkMapModified(), and Team_SetFlagStatus().

qboolean region_active
 

Definition at line 562 of file MAP.CPP.

vec3_t region_maxs
 

Definition at line 564 of file MAP.CPP.

Referenced by AddRegionBrushes(), Map_IsBrushFiltered(), Map_RegionBrush(), Map_RegionOff(), Map_RegionSelectedBrushes(), Map_RegionTallBrush(), Map_RegionXY(), CXYWnd::XY_DrawBlockGrid(), CXYWnd::XY_DrawGrid(), and Z_DrawGrid().

vec3_t region_mins
 

Definition at line 563 of file MAP.CPP.

Referenced by AddRegionBrushes(), Map_IsBrushFiltered(), Map_RegionBrush(), Map_RegionOff(), Map_RegionSelectedBrushes(), Map_RegionTallBrush(), Map_RegionXY(), CXYWnd::XY_DrawBlockGrid(), CXYWnd::XY_DrawGrid(), and Z_DrawGrid().

brush_t selected_brushes
 

Definition at line 35 of file MAP.CPP.

Referenced by AddPatchMovePoint(), AddProp(), AddRegionBrushes(), CPlugInManager::AllocateSelectedPatchHandles(), AnyPatchesSelected(), AnyTerrainSelected(), Brush_AddToList(), Brush_MakeSided(), Brush_MakeSidedCone(), Brush_MakeSidedSphere(), Brush_SelectFaceForDragging(), CXYWnd::Clip(), CXYWnd::Copy(), CopySelected(), CreateEntity(), CreateEntityBrush(), CreateEntityFromName(), CreateRightClickEntity(), CreateSmartBrush(), CreateSmartEntity(), CSG_MakeHollow(), CSG_Merge(), CSG_Subtract(), DelProp(), CPlugInManager::Dispatch(), Drag_MouseUp(), Drag_Setup(), Entity_Create(), FindReplaceTextures(), FinishSmartCreation(), GetSelectionIndex(), GetSpawnFlags(), Group_Init(), IsBrushSelected(), MakeFace(), Map_Free(), Map_RegionBrush(), Map_RegionSelectedBrushes(), Map_RegionTallBrush(), Map_RestoreBetween(), Map_SaveBetween(), MoveSelection(), CXYWnd::NewBrushDrag(), CMainFrame::OnBrush3sided(), CMainFrame::OnBrush4sided(), CMainFrame::OnBrush5sided(), CMainFrame::OnBrush6sided(), CMainFrame::OnBrush7sided(), CMainFrame::OnBrush8sided(), CMainFrame::OnBrush9sided(), CMainFrame::OnBrushArbitrarysided(), CMainFrame::OnBrushFlipx(), CMainFrame::OnBrushFlipy(), CMainFrame::OnBrushFlipz(), CMainFrame::OnBrushMakecone(), CMainFrame::OnBrushPrimitivesSphere(), CMainFrame::OnBrushRotatex(), CMainFrame::OnBrushRotatey(), CMainFrame::OnBrushRotatez(), CSurfaceDlg::OnBtnFacefit(), CMainFrame::OnClipSelected(), CMainFrame::OnCurveDeletecolumn(), CMainFrame::OnCurveDeleteFirstcolumn(), CMainFrame::OnCurveDeleteFirstrow(), CMainFrame::OnCurveDeleteLastcolumn(), CMainFrame::OnCurveDeleteLastrow(), CMainFrame::OnCurveDeleterow(), CMainFrame::OnCurveInsertAddcolumn(), CMainFrame::OnCurveInsertAddrow(), CMainFrame::OnCurveInsertcolumn(), CMainFrame::OnCurveInsertInsertcolumn(), CMainFrame::OnCurveInsertInsertrow(), CMainFrame::OnCurveInsertrow(), CMainFrame::OnCurveMoreendcapsbevelsSquarebevel(), CMainFrame::OnCurveMoreendcapsbevelsSquareendcap(), CMainFrame::OnCurvePatchbevel(), CMainFrame::OnCurvePatchcone(), CMainFrame::OnCurvePatchdensetube(), CMainFrame::OnCurvePatchendcap(), CMainFrame::OnCurvePatchsquare(), CMainFrame::OnCurvePatchtube(), CMainFrame::OnCurvePatchverydensetube(), CMainFrame::OnCurveSimplepatchmesh(), CMainFrame::OnCurveThicken(), CMainFrame::OnDestroy(), CXYWnd::OnEntityCreate(), OnlyPatchesSelected(), OnlyTerrainSelected(), CMainFrame::OnPatchTab(), CMainFrame::OnSelectionArbitraryrotation(), CMainFrame::OnSelectionCsgmerge(), CMainFrame::OnSelectionDelete(), CMainFrame::OnSelectionMakeDetail(), CMainFrame::OnSelectionMakehollow(), CMainFrame::OnSelectionMakeStructural(), CMainFrame::OnSelectionMovedown(), CMainFrame::OnSelectionPrint(), CMainFrame::OnSelectScale(), CMainFrame::OnSplitSelected(), CXYWnd::Paste(), Patch_AdjustSelected(), Patch_AdjustSelectedRowCols()<