Go to QuArK Web Site
Map Saving
Updated 05 Apr 2018
Upper levels:
QuArK Information Base
4. The Source Code
4.4. Specific Topics

 4.4.5. Map Saving

 [ Prev - Up - Next ] 

Map saving is done by the calling TTMapBrush.SaveAsText in QkMapObjects. This is triggered in slightly different ways by the regular build menu (qSaveFile), and the 'File -> SaveAs -> *.map' menu item/dialog (TQForm1.Save), both in QkMapObjects. there is duplication of the code involved in reading the map saving config options; the build menu code does it in Python (quarkpy.mapquakemenu.writemapfile), the file-menu code in Delphi (QMap/QMapFile.SaveFile).

The relevant object hierarchy is:

TTreeMap
  TTreeMapSpec (can have writeable specifics)
     TTreeMapGroup (can have sub-polys/beziers)
        TTreeMapBrush (brush entity)
     TTreeMapEntity
        TDuplicator (hmm, also can have sub-stuff)
  TTexturedTreeMap
     TFace
     TBezier

TTreeMapBrush writes the worldspawn specifics, contained polys, and beziers, and then, at the end, invokes TTMapGroup.SaveAsText to write out the brush and point entities in the map structure (outside of the scope of the worldspawn entities). To keep things confusing, several of the routines pass a Flags parameter, co-named with one of the fields of QObject, which keeps track of some parameters controlling map-writing. Groups are for example perused for beziers to write only if soIgnoreToBuild is set in Flags, and vfIgnoreToBuild is set in ViewFlags, which is the TTreeMapGroup property encoding the view/build flags in groups in the tree-structure.

Originally, the beziers were collected with ListeEntites with the Cat set at [ecBezier], but this caused the ignoretobuild flags to be ignored, so currently a special ListeBeziers function is used. Perhaps ListeEntites should be reinstated with a Flags argument.


Copyright (c) 2022, GNU General Public License by The QuArK (Quake Army Knife) Community - https://quark.sourceforge.io/

 [ Prev - Top - Next ]