| Map Saving Updated 10 May 2002 | Upper levels: - QuArK Information Base - 4. The Source Code - 4.5. Specific Topics

4.5.4. 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.

GNU General Public License by The QuArK (Quake Army Knife) Community - http://www.planetquake.com/quark | [ Prev - Top - Next ]