uncrustify! now the code is only ugly on the *inside*
authorTimothee TTimo Besset <ttimo@idsoftware.com>
Sat, 17 Mar 2012 20:01:54 +0000 (15:01 -0500)
committerTimothee TTimo Besset <ttimo@idsoftware.com>
Sat, 17 Mar 2012 20:01:54 +0000 (15:01 -0500)
667 files changed:
contrib/bkgrnd2d/bkgrnd2d.cpp
contrib/bkgrnd2d/bkgrnd2d.h
contrib/bkgrnd2d/dialog.cpp
contrib/bkgrnd2d/dialog.h
contrib/bkgrnd2d/plugin.cpp
contrib/bkgrnd2d/plugin.h
contrib/bobtoolz/CPortals.h
contrib/bobtoolz/DBobView.cpp
contrib/bobtoolz/DBobView.h
contrib/bobtoolz/DBrush.cpp
contrib/bobtoolz/DBrush.h
contrib/bobtoolz/DEPair.cpp
contrib/bobtoolz/DEPair.h
contrib/bobtoolz/DEntity.cpp
contrib/bobtoolz/DEntity.h
contrib/bobtoolz/DListener.cpp
contrib/bobtoolz/DListener.h
contrib/bobtoolz/DMap.cpp
contrib/bobtoolz/DMap.h
contrib/bobtoolz/DPatch.cpp
contrib/bobtoolz/DPatch.h
contrib/bobtoolz/DPlane.cpp
contrib/bobtoolz/DPlane.h
contrib/bobtoolz/DPoint.cpp
contrib/bobtoolz/DPoint.h
contrib/bobtoolz/DShape.cpp
contrib/bobtoolz/DShape.h
contrib/bobtoolz/DTrainDrawer.cpp
contrib/bobtoolz/DTrainDrawer.h
contrib/bobtoolz/DTreePlanter.cpp
contrib/bobtoolz/DTreePlanter.h
contrib/bobtoolz/DVisDrawer.cpp
contrib/bobtoolz/DVisDrawer.h
contrib/bobtoolz/DWinding.cpp
contrib/bobtoolz/DWinding.h
contrib/bobtoolz/ScriptParser.cpp
contrib/bobtoolz/ScriptParser.h
contrib/bobtoolz/StdAfx.cpp
contrib/bobtoolz/StdAfx.h
contrib/bobtoolz/bobToolz-GTK.cpp
contrib/bobtoolz/bobToolz.h
contrib/bobtoolz/bsploader.cpp
contrib/bobtoolz/bsploader.h
contrib/bobtoolz/cportals.cpp
contrib/bobtoolz/ctfToolz-GTK.cpp
contrib/bobtoolz/ctfresource_gtk.h
contrib/bobtoolz/dialogs/AboutDialog.cpp
contrib/bobtoolz/dialogs/AboutDialog.h
contrib/bobtoolz/dialogs/AutoCaulkDialog.cpp
contrib/bobtoolz/dialogs/AutoCaulkDialog.h
contrib/bobtoolz/dialogs/AutoCaulkStartDialog.cpp
contrib/bobtoolz/dialogs/AutoCaulkStartDialog.h
contrib/bobtoolz/dialogs/BrushCheckDialog.h
contrib/bobtoolz/dialogs/DoorDialog.cpp
contrib/bobtoolz/dialogs/DoorDialog.h
contrib/bobtoolz/dialogs/IntersectDialog.cpp
contrib/bobtoolz/dialogs/IntersectDialog.h
contrib/bobtoolz/dialogs/IntersectInfoDialog.cpp
contrib/bobtoolz/dialogs/IntersectInfoDialog.h
contrib/bobtoolz/dialogs/PolygonDialog.cpp
contrib/bobtoolz/dialogs/PolygonDialog.h
contrib/bobtoolz/dialogs/StairDialog.cpp
contrib/bobtoolz/dialogs/StairDialog.h
contrib/bobtoolz/dialogs/TextureResetDialog.cpp
contrib/bobtoolz/dialogs/TextureResetDialog.h
contrib/bobtoolz/dialogs/brushcheckdialog.cpp
contrib/bobtoolz/dialogs/dialogs-gtk.cpp
contrib/bobtoolz/dialogs/dialogs-gtk.h
contrib/bobtoolz/dialogs/pathplotterdialog.cpp
contrib/bobtoolz/dialogs/pathplotterdialog.h
contrib/bobtoolz/funchandlers-GTK.cpp
contrib/bobtoolz/funchandlers-ctf-GTK.cpp
contrib/bobtoolz/funchandlers.cpp
contrib/bobtoolz/funchandlers.h
contrib/bobtoolz/interfaces/IScriptParser.h
contrib/bobtoolz/lists.cpp
contrib/bobtoolz/lists.h
contrib/bobtoolz/misc.cpp
contrib/bobtoolz/misc.h
contrib/bobtoolz/resource-gtk.h
contrib/bobtoolz/resource.h
contrib/bobtoolz/shapes.cpp
contrib/bobtoolz/shapes.h
contrib/bobtoolz/visfind.cpp
contrib/bobtoolz/visfind.h
contrib/camera/camera.cpp
contrib/camera/camera.h
contrib/camera/dialogs.cpp
contrib/camera/dialogs.h
contrib/camera/dialogs_common.cpp
contrib/camera/funchandlers.cpp
contrib/camera/funchandlers.h
contrib/camera/listener.cpp
contrib/camera/listener.h
contrib/camera/misc.cpp
contrib/camera/misc.h
contrib/camera/renderer.cpp
contrib/camera/renderer.h
contrib/gtkgensurf/bitmap.cpp
contrib/gtkgensurf/dec.cpp
contrib/gtkgensurf/face.cpp
contrib/gtkgensurf/font.cpp
contrib/gtkgensurf/gendlgs.cpp
contrib/gtkgensurf/gendlgs.h
contrib/gtkgensurf/genmap.cpp
contrib/gtkgensurf/gensurf.cpp
contrib/gtkgensurf/gensurf.h
contrib/gtkgensurf/heretic.cpp
contrib/gtkgensurf/plugin.cpp
contrib/gtkgensurf/triangle.c
contrib/gtkgensurf/triangle.h
contrib/gtkgensurf/view.cpp
contrib/hydratoolz/plugin.cpp
contrib/hydratoolz/plugin.h
contrib/prtview/AboutDialog.cpp
contrib/prtview/ConfigDialog.cpp
contrib/prtview/LoadPortalFileDialog.cpp
contrib/prtview/LoadPortalFileDialog.h
contrib/prtview/gtkdlgs.cpp
contrib/prtview/gtkdlgs.h
contrib/prtview/portals.cpp
contrib/prtview/portals.h
contrib/prtview/prtview.cpp
contrib/prtview/prtview.h
contrib/prtview/resource.h
contrib/prtview/stdafx.cpp
contrib/prtview/stdafx.h
contrib/ufoai/plugin.cpp
contrib/ufoai/plugin.h
contrib/ufoai/ufoai_filters.cpp
contrib/ufoai/ufoai_filters.h
docs/manual/quake3/Compile_Manual/cfgq3.c
include/gtkr_list.h
include/gtkr_vector.h
include/ibrush.h
include/ibspfrontend.h
include/icamera.h
include/idata.h
include/idatastream.h
include/ieclass.h
include/ientity.h
include/ifilesystem.h
include/ifilters.h
include/igl.h
include/iimage.h
include/imap.h
include/imodel.h
include/ipatch.h
include/iplugin.h
include/irefcount.h
include/iscriplib.h
include/iselectedface.h
include/ishaders.h
include/ishadersmanager.h
include/isurfaceplugin.h
include/itoolbar.h
include/iui.h
include/iui_gtk.h
include/iundo.h
include/misc_def.h
include/qerplugin.h
include/qertypes.h
include/qsysprintf.h
include/stl_check.h
include/stream_version.h
libs/cmdlib.h
libs/cmdlib/cmdlib.cpp
libs/ddslib.h
libs/ddslib/ddslib.c
libs/igl_to_qgl.h
libs/l_net/l_net.c
libs/l_net/l_net.h
libs/l_net/l_net_berkeley.c
libs/l_net/l_net_wins.c
libs/l_net/l_net_wins.h
libs/mathlib.h
libs/mathlib/bbox.c
libs/mathlib/linear.c
libs/mathlib/m4x4.c
libs/mathlib/mathlib.c
libs/mathlib/ray.c
libs/md4lib.h
libs/md5lib.h
libs/md5lib/md4.c
libs/md5lib/md5lib.c
libs/missing.h
libs/multimon.h
libs/pak/pakstuff.cpp
libs/pak/unzip.cpp
libs/pak/unzip.h
libs/pakstuff.h
libs/picomodel.h
libs/picomodel/lwo/clip.c
libs/picomodel/lwo/envelope.c
libs/picomodel/lwo/list.c
libs/picomodel/lwo/lwio.c
libs/picomodel/lwo/lwo2.c
libs/picomodel/lwo/lwo2.h
libs/picomodel/lwo/lwob.c
libs/picomodel/lwo/pntspols.c
libs/picomodel/lwo/surface.c
libs/picomodel/lwo/vecmath.c
libs/picomodel/lwo/vmap.c
libs/picomodel/picointernal.c
libs/picomodel/picointernal.h
libs/picomodel/picomodel.c
libs/picomodel/picomodules.c
libs/picomodel/pm_3ds.c
libs/picomodel/pm_ase.c
libs/picomodel/pm_fm.c
libs/picomodel/pm_fm.h
libs/picomodel/pm_lwo.c
libs/picomodel/pm_md2.c
libs/picomodel/pm_md3.c
libs/picomodel/pm_mdc.c
libs/picomodel/pm_ms3d.c
libs/picomodel/pm_obj.c
libs/splines/math_angles.cpp
libs/splines/math_angles.h
libs/splines/math_matrix.cpp
libs/splines/math_matrix.h
libs/splines/math_quaternion.cpp
libs/splines/math_quaternion.h
libs/splines/math_vector.cpp
libs/splines/math_vector.h
libs/splines/q_parse.cpp
libs/splines/q_shared.cpp
libs/splines/q_shared.h
libs/splines/splines.cpp
libs/splines/splines.h
libs/splines/util_list.h
libs/splines/util_str.cpp
libs/splines/util_str.h
libs/stdint.msvc.h
libs/str.h
libs/synapse.h
libs/synapse/synapse.cpp
plugins/eclassfgd/plugin.cpp
plugins/eclassfgd/plugin.h
plugins/entity/eclassmodel.cpp
plugins/entity/entity.cpp
plugins/entity/entity.h
plugins/entity/entity_entitymodel.cpp
plugins/entity/entity_entitymodel.h
plugins/entity/light.cpp
plugins/entity/light.h
plugins/entity/miscmodel.cpp
plugins/entity/plugin.cpp
plugins/entity/plugin.h
plugins/image/bmp.cpp
plugins/image/bmp.h
plugins/image/image.cpp
plugins/image/image.h
plugins/image/jpeg.cpp
plugins/image/lbmlib.cpp
plugins/image/lbmlib.h
plugins/imagehl/imagehl.cpp
plugins/imagehl/imagehl.h
plugins/imagehl/lbmlib.cpp
plugins/imagehl/lbmlib.h
plugins/imagem8/imagem8.cpp
plugins/imagem8/imagem8.h
plugins/imagem8/m32.cpp
plugins/imagem8/m32.h
plugins/imagem8/m8.cpp
plugins/imagem8/m8.h
plugins/imagepng/plugin.cpp
plugins/imagepng/plugin.h
plugins/imagewal/imagewal.cpp
plugins/imagewal/imagewal.h
plugins/imagewal/q2_palette.h
plugins/imagewal/wal.cpp
plugins/imagewal/wal.h
plugins/map/parse.cpp
plugins/map/plugin.cpp
plugins/map/plugin.h
plugins/map/write.cpp
plugins/mapxml/plugin.cpp
plugins/mapxml/plugin.h
plugins/mapxml/xmlparse.cpp
plugins/mapxml/xmlwrite.cpp
plugins/model/cpicomodel.cpp
plugins/model/cpicomodel.h
plugins/model/cpicosurface.cpp
plugins/model/cpicosurface.h
plugins/model/miscmodel.cpp
plugins/model/model.cpp
plugins/model/plugin.cpp
plugins/model/plugin.h
plugins/model/remap.cpp
plugins/model/surface.h
plugins/sample/plugin.cpp
plugins/sample/plugin.h
plugins/shaders/plugin.cpp
plugins/shaders/plugin.h
plugins/shaders/shaders.cpp
plugins/shaders/shaders.h
plugins/spritemodel/plugin.cpp
plugins/spritemodel/plugin.h
plugins/spritemodel/spritemodel.cpp
plugins/spritemodel/spritemodel.h
plugins/surface/surfacedialog.cpp
plugins/surface/surfacedialog.h
plugins/surface/surfdlg_plugin.cpp
plugins/surface/surfdlg_plugin.h
plugins/surface_heretic2/surfacedialog.cpp
plugins/surface_heretic2/surfacedialog.h
plugins/surface_heretic2/surfaceflagsdialog_heretic2.cpp
plugins/surface_heretic2/surfaceflagsdialog_heretic2.h
plugins/surface_heretic2/surfdlg_plugin.cpp
plugins/surface_heretic2/surfdlg_plugin.h
plugins/surface_quake2/surfacedialog.cpp
plugins/surface_quake2/surfacedialog.h
plugins/surface_quake2/surfaceflagsdialog_quake2.cpp
plugins/surface_quake2/surfaceflagsdialog_quake2.h
plugins/surface_quake2/surfdlg_plugin.cpp
plugins/surface_quake2/surfdlg_plugin.h
plugins/surface_ufoai/surfacedialog.cpp
plugins/surface_ufoai/surfacedialog.h
plugins/surface_ufoai/surfaceflagsdialog_ufoai.cpp
plugins/surface_ufoai/surfaceflagsdialog_ufoai.h
plugins/surface_ufoai/surfdlg_plugin.cpp
plugins/surface_ufoai/surfdlg_plugin.h
plugins/textool/2DView.cpp
plugins/textool/2DView.h
plugins/textool/ControlPointsManager.cpp
plugins/textool/ControlPointsManager.h
plugins/textool/StdAfx.cpp
plugins/textool/StdAfx.h
plugins/textool/TexTool.cpp
plugins/textool/resource.h
plugins/vfspak/vfs.cpp
plugins/vfspak/vfs.h
plugins/vfspak/vfspak.cpp
plugins/vfspak/vfspak.h
plugins/vfspk3/unzip-vfspk3.h
plugins/vfspk3/unzip.cpp
plugins/vfspk3/vfs.cpp
plugins/vfspk3/vfs.h
plugins/vfspk3/vfspk3.cpp
plugins/vfspk3/vfspk3.h
plugins/vfswad/unwad.cpp
plugins/vfswad/unwad.h
plugins/vfswad/vfs.cpp
plugins/vfswad/vfs.h
plugins/vfswad/vfswad.cpp
plugins/vfswad/vfswad.h
radiant/bp_dlg.cpp
radiant/brush.cpp
radiant/brush.h
radiant/brush_primit.cpp
radiant/brushscript.cpp
radiant/camera.h
radiant/camwindow.cpp
radiant/camwindow.h
radiant/csg.cpp
radiant/dialog.cpp
radiant/dialog.h
radiant/dialoginfo.cpp
radiant/drag.cpp
radiant/eclass.cpp
radiant/eclass_def.cpp
radiant/eclass_def.h
radiant/error.cpp
radiant/feedback.cpp
radiant/feedback.h
radiant/file.cpp
radiant/file.h
radiant/filters.cpp
radiant/filters.h
radiant/findtexturedialog.cpp
radiant/findtexturedialog.h
radiant/glinterface.cpp
radiant/glwidget.cpp
radiant/glwidget.h
radiant/glwindow.cpp
radiant/glwindow.h
radiant/groupdialog.cpp
radiant/groupdialog.h
radiant/gtkdlgs.cpp
radiant/gtkfilesel-darwin.c
radiant/gtkfilesel-darwin.h
radiant/gtkfilesel-linux.c
radiant/gtkfilesel-linux.h
radiant/gtkfilesel.c
radiant/gtkfilesel.h
radiant/gtkmisc.cpp
radiant/gtkmisc.h
radiant/main.cpp
radiant/mainframe.cpp
radiant/mainframe.h
radiant/map.cpp
radiant/map.h
radiant/missing.cpp
radiant/parse.cpp
radiant/parse.h
radiant/patchdialog.cpp
radiant/patchdialog.h
radiant/plugin.h
radiant/pluginentities.cpp
radiant/pluginmanager.cpp
radiant/pluginmanager.h
radiant/pmesh.cpp
radiant/points.cpp
radiant/points.h
radiant/preferences.cpp
radiant/preferences.h
radiant/profile.cpp
radiant/qe3.cpp
radiant/qe3.h
radiant/qedefs.h
radiant/qfiles.h
radiant/qgl-mac.c
radiant/qgl.c
radiant/qgl.h
radiant/qgl_ext.cpp
radiant/queuedraw.cpp
radiant/resource.h
radiant/select.cpp
radiant/select.h
radiant/selectedface.cpp
radiant/stdafx.cpp
radiant/stdafx.h
radiant/surfacedialog.cpp
radiant/surfacedialog.h
radiant/surfaceplugin.cpp
radiant/surfaceplugin.h
radiant/targetname.cpp
radiant/texmanip.cpp
radiant/texmanip.h
radiant/textures.h
radiant/texwindow.cpp
radiant/texwindow.h
radiant/ui.cpp
radiant/ui.h
radiant/undo.cpp
radiant/undo.h
radiant/vertsel.cpp
radiant/watchbsp.cpp
radiant/watchbsp.h
radiant/winding.cpp
radiant/winding.h
radiant/xmlstuff.h
radiant/xywindow.cpp
radiant/xywindow.h
radiant/z.cpp
radiant/z.h
radiant/zwindow.cpp
radiant/zwindow.h
tools/quake2/common/bspfile.c
tools/quake2/common/bspfile.h
tools/quake2/common/cmdlib.c
tools/quake2/common/cmdlib.h
tools/quake2/common/inout.c
tools/quake2/common/inout.h
tools/quake2/common/l3dslib.c
tools/quake2/common/l3dslib.h
tools/quake2/common/lbmlib.c
tools/quake2/common/lbmlib.h
tools/quake2/common/mathlib.c
tools/quake2/common/mathlib.h
tools/quake2/common/path_init.c
tools/quake2/common/polylib.c
tools/quake2/common/polylib.h
tools/quake2/common/q2_threads.h
tools/quake2/common/qfiles.h
tools/quake2/common/scriplib.c
tools/quake2/common/scriplib.h
tools/quake2/common/threads.c
tools/quake2/common/trilib.c
tools/quake2/common/trilib.h
tools/quake2/q2map/brushbsp.c
tools/quake2/q2map/csg.c
tools/quake2/q2map/faces.c
tools/quake2/q2map/flow.c
tools/quake2/q2map/gldraw.c
tools/quake2/q2map/glfile.c
tools/quake2/q2map/leakfile.c
tools/quake2/q2map/lightmap.c
tools/quake2/q2map/main.c
tools/quake2/q2map/map.c
tools/quake2/q2map/nodraw.c
tools/quake2/q2map/patches.c
tools/quake2/q2map/portals.c
tools/quake2/q2map/prtfile.c
tools/quake2/q2map/q2map.h
tools/quake2/q2map/qbsp.c
tools/quake2/q2map/qbsp.h
tools/quake2/q2map/qrad.c
tools/quake2/q2map/qrad.h
tools/quake2/q2map/qvis.c
tools/quake2/q2map/qvis.h
tools/quake2/q2map/textures.c
tools/quake2/q2map/trace.c
tools/quake2/q2map/tree.c
tools/quake2/q2map/writebsp.c
tools/quake2/qdata/anorms.h
tools/quake2/qdata/images.c
tools/quake2/qdata/models.c
tools/quake2/qdata/qdata.c
tools/quake2/qdata/qdata.h
tools/quake2/qdata/sprites.c
tools/quake2/qdata/tables.c
tools/quake2/qdata/video.c
tools/quake2/qdata_heretic2/adpcm.h
tools/quake2/qdata_heretic2/animcomp.c
tools/quake2/qdata_heretic2/animcomp.h
tools/quake2/qdata_heretic2/anorms.h
tools/quake2/qdata_heretic2/book.c
tools/quake2/qdata_heretic2/common/bspfile.c
tools/quake2/qdata_heretic2/common/bspfile.h
tools/quake2/qdata_heretic2/common/cmdlib.c
tools/quake2/qdata_heretic2/common/cmdlib.h
tools/quake2/qdata_heretic2/common/her2_threads.h
tools/quake2/qdata_heretic2/common/inout.c
tools/quake2/qdata_heretic2/common/inout.h
tools/quake2/qdata_heretic2/common/l3dslib.c
tools/quake2/qdata_heretic2/common/l3dslib.h
tools/quake2/qdata_heretic2/common/lbmlib.c
tools/quake2/qdata_heretic2/common/lbmlib.h
tools/quake2/qdata_heretic2/common/mathlib.c
tools/quake2/qdata_heretic2/common/mathlib.h
tools/quake2/qdata_heretic2/common/md4.c
tools/quake2/qdata_heretic2/common/path_init.c
tools/quake2/qdata_heretic2/common/polylib.c
tools/quake2/qdata_heretic2/common/polylib.h
tools/quake2/qdata_heretic2/common/qfiles.c
tools/quake2/qdata_heretic2/common/qfiles.h
tools/quake2/qdata_heretic2/common/scriplib.c
tools/quake2/qdata_heretic2/common/scriplib.h
tools/quake2/qdata_heretic2/common/threads.c
tools/quake2/qdata_heretic2/common/token.c
tools/quake2/qdata_heretic2/common/token.h
tools/quake2/qdata_heretic2/common/trilib.c
tools/quake2/qdata_heretic2/common/trilib.h
tools/quake2/qdata_heretic2/fmodels.c
tools/quake2/qdata_heretic2/images.c
tools/quake2/qdata_heretic2/jointed.c
tools/quake2/qdata_heretic2/jointed.h
tools/quake2/qdata_heretic2/joints.h
tools/quake2/qdata_heretic2/models.c
tools/quake2/qdata_heretic2/pics.c
tools/quake2/qdata_heretic2/qcommon/angles.h
tools/quake2/qdata_heretic2/qcommon/arrayedlist.h
tools/quake2/qdata_heretic2/qcommon/flex.h
tools/quake2/qdata_heretic2/qcommon/fmodel.h
tools/quake2/qdata_heretic2/qcommon/h2common.h
tools/quake2/qdata_heretic2/qcommon/placement.h
tools/quake2/qdata_heretic2/qcommon/q_typedef.h
tools/quake2/qdata_heretic2/qcommon/qfiles.h
tools/quake2/qdata_heretic2/qcommon/reference.c
tools/quake2/qdata_heretic2/qcommon/reference.h
tools/quake2/qdata_heretic2/qcommon/resourcemanager.c
tools/quake2/qdata_heretic2/qcommon/resourcemanager.h
tools/quake2/qdata_heretic2/qcommon/skeletons.c
tools/quake2/qdata_heretic2/qcommon/skeletons.h
tools/quake2/qdata_heretic2/qd_fmodel.h
tools/quake2/qdata_heretic2/qd_skeletons.c
tools/quake2/qdata_heretic2/qd_skeletons.h
tools/quake2/qdata_heretic2/qdata.c
tools/quake2/qdata_heretic2/qdata.h
tools/quake2/qdata_heretic2/resource.h
tools/quake2/qdata_heretic2/sprites.c
tools/quake2/qdata_heretic2/svdcmp.c
tools/quake2/qdata_heretic2/tables.c
tools/quake2/qdata_heretic2/tmix.c
tools/quake2/qdata_heretic2/video.c
tools/quake3/common/aselib.c
tools/quake3/common/aselib.h
tools/quake3/common/bspfile.c
tools/quake3/common/bspfile.h
tools/quake3/common/cmdlib.c
tools/quake3/common/cmdlib.h
tools/quake3/common/imagelib.c
tools/quake3/common/imagelib.h
tools/quake3/common/inout.c
tools/quake3/common/inout.h
tools/quake3/common/jpeg.c
tools/quake3/common/l3dslib.c
tools/quake3/common/l3dslib.h
tools/quake3/common/mutex.c
tools/quake3/common/mutex.h
tools/quake3/common/polylib.c
tools/quake3/common/polylib.h
tools/quake3/common/polyset.h
tools/quake3/common/qfiles.h
tools/quake3/common/qthreads.h
tools/quake3/common/scriplib.c
tools/quake3/common/scriplib.h
tools/quake3/common/surfaceflags.h
tools/quake3/common/threads.c
tools/quake3/common/trilib.c
tools/quake3/common/trilib.h
tools/quake3/common/unzip.c
tools/quake3/common/unzip.h
tools/quake3/common/vfs.c
tools/quake3/common/vfs.h
tools/quake3/q3data/3dslib.c
tools/quake3/q3data/3dslib.h
tools/quake3/q3data/compress.c
tools/quake3/q3data/images.c
tools/quake3/q3data/md3lib.c
tools/quake3/q3data/md3lib.h
tools/quake3/q3data/models.c
tools/quake3/q3data/oldstuff.c
tools/quake3/q3data/p3dlib.c
tools/quake3/q3data/p3dlib.h
tools/quake3/q3data/polyset.c
tools/quake3/q3data/q3data.c
tools/quake3/q3data/q3data.h
tools/quake3/q3data/stripper.c
tools/quake3/q3data/video.c
tools/quake3/q3map2/brush.c
tools/quake3/q3map2/brush_primit.c
tools/quake3/q3map2/bsp.c
tools/quake3/q3map2/bspfile_abstract.c
tools/quake3/q3map2/bspfile_ibsp.c
tools/quake3/q3map2/bspfile_rbsp.c
tools/quake3/q3map2/convert_ase.c
tools/quake3/q3map2/convert_map.c
tools/quake3/q3map2/decals.c
tools/quake3/q3map2/facebsp.c
tools/quake3/q3map2/fog.c
tools/quake3/q3map2/game_ef.h
tools/quake3/q3map2/game_etut.h
tools/quake3/q3map2/game_ja.h
tools/quake3/q3map2/game_jk2.h
tools/quake3/q3map2/game_nexuiz.h
tools/quake3/q3map2/game_qfusion.h
tools/quake3/q3map2/game_quake3.h
tools/quake3/q3map2/game_quakelive.h
tools/quake3/q3map2/game_reaction.h
tools/quake3/q3map2/game_sof2.h
tools/quake3/q3map2/game_t.h
tools/quake3/q3map2/game_tenebrae.h
tools/quake3/q3map2/game_tremulous.h
tools/quake3/q3map2/game_wolf.h
tools/quake3/q3map2/game_wolfet.h
tools/quake3/q3map2/image.c
tools/quake3/q3map2/leakfile.c
tools/quake3/q3map2/light.c
tools/quake3/q3map2/light_bounce.c
tools/quake3/q3map2/light_shadows.c
tools/quake3/q3map2/light_trace.c
tools/quake3/q3map2/light_ydnar.c
tools/quake3/q3map2/lightmaps.c
tools/quake3/q3map2/lightmaps_ydnar.c
tools/quake3/q3map2/main.c
tools/quake3/q3map2/map.c
tools/quake3/q3map2/mesh.c
tools/quake3/q3map2/model.c
tools/quake3/q3map2/patch.c
tools/quake3/q3map2/path_init.c
tools/quake3/q3map2/portals.c
tools/quake3/q3map2/prtfile.c
tools/quake3/q3map2/q3map2.h
tools/quake3/q3map2/shaders.c
tools/quake3/q3map2/surface.c
tools/quake3/q3map2/surface_extra.c
tools/quake3/q3map2/surface_foliage.c
tools/quake3/q3map2/surface_fur.c
tools/quake3/q3map2/surface_meta.c
tools/quake3/q3map2/tjunction.c
tools/quake3/q3map2/tree.c
tools/quake3/q3map2/vis.c
tools/quake3/q3map2/visflow.c
tools/quake3/q3map2/writebsp.c

index 130fd2b..2ce978f 100644 (file)
@@ -1,23 +1,23 @@
 /*
-Copyright (C) 1999-2007 id Software, Inc. and contributors.
-For a list of contributors, see the accompanying CONTRIBUTORS file.
+   Copyright (C) 1999-2007 id Software, Inc. and contributors.
+   For a list of contributors, see the accompanying CONTRIBUTORS file.
 
-This file is part of GtkRadiant.
+   This file is part of GtkRadiant.
 
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   GtkRadiant is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GtkRadiant is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
+   You should have received a copy of the GNU General Public License
+   along with GtkRadiant; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 
 //
 // bkgrnd2d Plugin
@@ -31,25 +31,21 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 CBackgroundRender render;
 
-CBackgroundImage backgroundXY(XY),backgroundXZ(XZ),backgroundYZ(YZ);
+CBackgroundImage backgroundXY( XY ),backgroundXZ( XZ ),backgroundYZ( YZ );
 
-CBackgroundRender::CBackgroundRender()
-{
+CBackgroundRender::CBackgroundRender(){
        refCount = 1;
 }
 
-CBackgroundRender::~CBackgroundRender()
-{
+CBackgroundRender::~CBackgroundRender(){
 }
 
-void CBackgroundRender::Register()
-{
+void CBackgroundRender::Register(){
        g_QglTable.m_pfnHookGL2DWindow( this );
 }
 
-void CBackgroundRender::Draw2D( VIEWTYPE vt )
-{
-       switch(vt)
+void CBackgroundRender::Draw2D( VIEWTYPE vt ){
+       switch ( vt )
        {
        case XY:
                backgroundXY.Render();
@@ -64,8 +60,7 @@ void CBackgroundRender::Draw2D( VIEWTYPE vt )
 }
 
 
-CBackgroundImage::CBackgroundImage(VIEWTYPE vt)
-{
+CBackgroundImage::CBackgroundImage( VIEWTYPE vt ){
        m_tex = NULL;
        m_alpha = 0.5;
 
@@ -77,101 +72,99 @@ CBackgroundImage::CBackgroundImage(VIEWTYPE vt)
 
        m_vt = vt;
 
-       switch(m_vt)
+       switch ( m_vt )
        {
-               case XY:
-                       m_ix = 0;
-                       m_iy = 1;
-                       break;
-               case XZ:
-                       m_ix = 0;
-                       m_iy = 2;
-                       break;
-               case YZ:
-                       m_ix = 1;
-                       m_iy = 2;
-                       break;
+       case XY:
+               m_ix = 0;
+               m_iy = 1;
+               break;
+       case XZ:
+               m_ix = 0;
+               m_iy = 2;
+               break;
+       case YZ:
+               m_ix = 1;
+               m_iy = 2;
+               break;
        }
 }
 
 /*
  * should cleanup, but I don't think we can be sure it happens before our
  * interfaces are gone
-CBackgroundImage::~CBackgroundImage()
-{
-}
-*/
-
-void CBackgroundImage::Cleanup()
-{
-       if(m_tex) {
-               g_QglTable.m_pfn_qglDeleteTextures(1,&m_tex->texture_number);
-               g_free(m_tex);
+   CBackgroundImage::~CBackgroundImage()
+   {
+   }
+ */
+
+void CBackgroundImage::Cleanup(){
+       if ( m_tex ) {
+               g_QglTable.m_pfn_qglDeleteTextures( 1,&m_tex->texture_number );
+               g_free( m_tex );
                m_tex = NULL;
        }
 }
 
-void CBackgroundImage::Render()
-{
-       if (!m_bActive || !Valid())
+void CBackgroundImage::Render(){
+       if ( !m_bActive || !Valid() ) {
                return;
-       g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
+       }
+       g_QglTable.m_pfn_qglPushAttrib( GL_ALL_ATTRIB_BITS );
 
-       g_QglTable.m_pfn_qglEnable(GL_TEXTURE_2D);
-       g_QglTable.m_pfn_qglEnable(GL_BLEND);
-       g_QglTable.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-       g_QglTable.m_pfn_qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-       g_QglTable.m_pfn_qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
-       g_QglTable.m_pfn_qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+       g_QglTable.m_pfn_qglEnable( GL_TEXTURE_2D );
+       g_QglTable.m_pfn_qglEnable( GL_BLEND );
+       g_QglTable.m_pfn_qglBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+       g_QglTable.m_pfn_qglTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
+       g_QglTable.m_pfn_qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
+       g_QglTable.m_pfn_qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
 
-       g_QglTable.m_pfn_qglPolygonMode(GL_FRONT,GL_FILL);
+       g_QglTable.m_pfn_qglPolygonMode( GL_FRONT,GL_FILL );
        // TODO, just so we can tell if we end up going the wrong way
        // g_QglTable.m_pfn_qglPolygonMode(GL_BACK,GL_LINE);
        // TODO any other state we should not assume ?
 
-       g_QglTable.m_pfn_qglBindTexture(GL_TEXTURE_2D, m_tex->texture_number);
-       g_QglTable.m_pfn_qglBegin(GL_QUADS);
+       g_QglTable.m_pfn_qglBindTexture( GL_TEXTURE_2D, m_tex->texture_number );
+       g_QglTable.m_pfn_qglBegin( GL_QUADS );
 
-       g_QglTable.m_pfn_qglColor4f(1.0,1.0,1.0,m_alpha);
-       g_QglTable.m_pfn_qglTexCoord2f(0.0,1.0);
-       g_QglTable.m_pfn_qglVertex2f(m_xmin,m_ymin);
+       g_QglTable.m_pfn_qglColor4f( 1.0,1.0,1.0,m_alpha );
+       g_QglTable.m_pfn_qglTexCoord2f( 0.0,1.0 );
+       g_QglTable.m_pfn_qglVertex2f( m_xmin,m_ymin );
 
-       g_QglTable.m_pfn_qglTexCoord2f(1.0,1.0);
-       g_QglTable.m_pfn_qglVertex2f(m_xmax,m_ymin);
+       g_QglTable.m_pfn_qglTexCoord2f( 1.0,1.0 );
+       g_QglTable.m_pfn_qglVertex2f( m_xmax,m_ymin );
 
-       g_QglTable.m_pfn_qglTexCoord2f(1.0,0.0);
-       g_QglTable.m_pfn_qglVertex2f(m_xmax,m_ymax);
+       g_QglTable.m_pfn_qglTexCoord2f( 1.0,0.0 );
+       g_QglTable.m_pfn_qglVertex2f( m_xmax,m_ymax );
 
-       g_QglTable.m_pfn_qglTexCoord2f(0.0,0.0);
-       g_QglTable.m_pfn_qglVertex2f(m_xmin,m_ymax);
+       g_QglTable.m_pfn_qglTexCoord2f( 0.0,0.0 );
+       g_QglTable.m_pfn_qglVertex2f( m_xmin,m_ymax );
 
        g_QglTable.m_pfn_qglEnd();
-       g_QglTable.m_pfn_qglBindTexture(GL_TEXTURE_2D, 0);
+       g_QglTable.m_pfn_qglBindTexture( GL_TEXTURE_2D, 0 );
 
        g_QglTable.m_pfn_qglPopAttrib();
 }
 
-bool CBackgroundImage::Load(const char *filename)
-{
+bool CBackgroundImage::Load( const char *filename ){
        qtexture_t *newtex;
 
        unsigned char *image = NULL; // gets allocated with what ? g_malloc
        int width = 0, height = 0;
 
-       g_FuncTable.m_pfnLoadImage(filename,&image,&width,&height);
+       g_FuncTable.m_pfnLoadImage( filename,&image,&width,&height );
 
-       if(!image) {
-               Syn_Printf(MSG_WARN "load %s failed\n",filename);
+       if ( !image ) {
+               Syn_Printf( MSG_WARN "load %s failed\n",filename );
                return false;
        }
 
 // just in case we want to build for an old version
 #ifdef BKGRND2D_JPG_WORKAROUND
-       if ( strlen(filename) > 4 && !strcmp(".jpg",filename + strlen(filename) - 4)) {
-               Syn_Printf(MSG_PREFIX ".jpg workaround, clearing alpha channel\n");
-               int size = width*height*4;
+       if ( strlen( filename ) > 4 && !strcmp( ".jpg",filename + strlen( filename ) - 4 ) ) {
+               Syn_Printf( MSG_PREFIX ".jpg workaround, clearing alpha channel\n" );
+               int size = width * height * 4;
                int i;
-               for (i = 3; i < size; i+=4) {
+               for ( i = 3; i < size; i += 4 ) {
                        image[i] = 255;
                }
        }
@@ -179,56 +172,53 @@ bool CBackgroundImage::Load(const char *filename)
 
        //TODO bug for stored texture size
        //TODO whose gl context are we in, anyway ?
-       newtex = g_FuncTable.m_pfnLoadTextureRGBA(image,width,height);
+       newtex = g_FuncTable.m_pfnLoadTextureRGBA( image,width,height );
 
-       g_free(image);
+       g_free( image );
 
-       if(!newtex) {
-               Syn_Printf(MSG_WARN "image to texture failed\n");
+       if ( !newtex ) {
+               Syn_Printf( MSG_WARN "image to texture failed\n" );
                return false;
        }
 
        Cleanup();
        m_tex = newtex;
 
-       g_FuncTable.m_pfnSysUpdateWindows(W_XY);
+       g_FuncTable.m_pfnSysUpdateWindows( W_XY );
 
        return true;
 }
 
-bool CBackgroundImage::SetExtentsMM()
-{
+bool CBackgroundImage::SetExtentsMM(){
        entity_s *worldentity;
        const char *val;
        int xmin = 0, ymin = 0, xmax = 0, ymax = 0;
 
-       worldentity = (entity_s *)g_FuncTable.m_pfnGetEntityHandle(0);
-       if(!worldentity) {
-               Syn_Printf(MSG_WARN "SetExtentsMM worldspawn not found\n");
+       worldentity = (entity_s *)g_FuncTable.m_pfnGetEntityHandle( 0 );
+       if ( !worldentity ) {
+               Syn_Printf( MSG_WARN "SetExtentsMM worldspawn not found\n" );
                return false;
        }
        //TODO val is not NULL even if key does not exist
-       val = g_EntityTable.m_pfnValueForKey(worldentity,"mapcoordsmins");
-       if(!val || !val[0]) {
-               Syn_Printf(MSG_WARN "SetExtentsMM mapcoordsmins not found\n");
+       val = g_EntityTable.m_pfnValueForKey( worldentity,"mapcoordsmins" );
+       if ( !val || !val[0] ) {
+               Syn_Printf( MSG_WARN "SetExtentsMM mapcoordsmins not found\n" );
                return false;
        }
 // we could be more robust
 // note contortions due to splashs strange idea of min and max
-       if(sscanf(val, "%d %d",&xmin,&ymax) != 2)
-       {
-               Syn_Printf(MSG_WARN "SetExtentsMM mapcoordsmins malformed\n");
+       if ( sscanf( val, "%d %d",&xmin,&ymax ) != 2 ) {
+               Syn_Printf( MSG_WARN "SetExtentsMM mapcoordsmins malformed\n" );
                return false;
        }
 
-       val = g_EntityTable.m_pfnValueForKey(worldentity,"mapcoordsmaxs");
-       if(!val || !val[0]) {
-               Syn_Printf(MSG_WARN "SetExtentsMM mapcoordsmaxs not found\n");
+       val = g_EntityTable.m_pfnValueForKey( worldentity,"mapcoordsmaxs" );
+       if ( !val || !val[0] ) {
+               Syn_Printf( MSG_WARN "SetExtentsMM mapcoordsmaxs not found\n" );
                return false;
        }
-       if(sscanf(val, "%d %d",&xmax,&ymin) != 2)
-       {
-               Syn_Printf(MSG_WARN "SetExtentsMM mapcoordsmaxs malformed\n");
+       if ( sscanf( val, "%d %d",&xmax,&ymin ) != 2 ) {
+               Syn_Printf( MSG_WARN "SetExtentsMM mapcoordsmaxs malformed\n" );
                return false;
        }
        //might do sanity check before we commit
@@ -237,72 +227,74 @@ bool CBackgroundImage::SetExtentsMM()
        m_xmax = (float)xmax;
        m_ymax = (float)ymax;
 
-       g_FuncTable.m_pfnSysUpdateWindows(W_XY);
+       g_FuncTable.m_pfnSysUpdateWindows( W_XY );
        return true;
 }
 
 // TODO, this should just be exported from core
 // ripped directly from radiant/select.cpp:Select_GetBounds
 //
-static bool get_selection_bounds (vec3_t mins, vec3_t maxs)
-{
-       brush_t *b;
-       int             i;
+static bool get_selection_bounds( vec3_t mins, vec3_t maxs ){
+       brush_t *b;
+       int i;
        brush_t *selected_brushes = g_DataTable.m_pfnSelectedBrushes();
        //TODO should never happen
-       if(!selected_brushes) {
-         Sys_Printf (MSG_PREFIX "selected_brushes = NULL\n");
-         return false;
+       if ( !selected_brushes ) {
+               Sys_Printf( MSG_PREFIX "selected_brushes = NULL\n" );
+               return false;
        }
        // this should mean no selection
-       if(selected_brushes == selected_brushes->next) {
-         Sys_Printf (MSG_PREFIX "nothing selected\n");
+       if ( selected_brushes == selected_brushes->next ) {
+               Sys_Printf( MSG_PREFIX "nothing selected\n" );
 
-         return false;
+               return false;
        }
 
-       for (i=0 ; i<3 ; i++)
+       for ( i = 0 ; i < 3 ; i++ )
        {
                mins[i] = 99999;
                maxs[i] = -99999;
        }
 
-       for (b=selected_brushes->next ; b != selected_brushes ; b=b->next)
+       for ( b = selected_brushes->next ; b != selected_brushes ; b = b->next )
        {
-               if (b->owner->eclass->fixedsize)
-               {
-                       for (i=0 ; i<3 ; i++)
+               if ( b->owner->eclass->fixedsize ) {
+                       for ( i = 0 ; i < 3 ; i++ )
                        {
-                               if (b->owner->origin[i] < mins[i])
+                               if ( b->owner->origin[i] < mins[i] ) {
                                        mins[i] = b->owner->origin[i];
-                               if (b->owner->origin[i] > maxs[i])
+                               }
+                               if ( b->owner->origin[i] > maxs[i] ) {
                                        maxs[i] = b->owner->origin[i];
+                               }
                        }
                }
                else
                {
-                       for (i=0 ; i<3 ; i++)
+                       for ( i = 0 ; i < 3 ; i++ )
                        {
-                               if (b->mins[i] < mins[i])
+                               if ( b->mins[i] < mins[i] ) {
                                        mins[i] = b->mins[i];
-                               if (b->maxs[i] > maxs[i])
+                               }
+                               if ( b->maxs[i] > maxs[i] ) {
                                        maxs[i] = b->maxs[i];
+                               }
                        }
                }
        }
-  return true;
+       return true;
 }
 
-bool CBackgroundImage::SetExtentsSel()
-{
+bool CBackgroundImage::SetExtentsSel(){
        vec3_t mins,maxs;
 
-       if(!get_selection_bounds(mins,maxs))
+       if ( !get_selection_bounds( mins,maxs ) ) {
                return false;
+       }
 
-       if(((int)mins[m_ix] == (int)maxs[m_ix]) ||
-     ((int)mins[m_iy] == (int)maxs[m_iy])) {
-               Syn_Printf(MSG_PREFIX "tiny selection\n");
+       if ( ( (int)mins[m_ix] == (int)maxs[m_ix] ) ||
+                ( (int)mins[m_iy] == (int)maxs[m_iy] ) ) {
+               Syn_Printf( MSG_PREFIX "tiny selection\n" );
                return false;
        }
 
@@ -311,8 +303,7 @@ bool CBackgroundImage::SetExtentsSel()
        m_xmax = maxs[m_ix];
        m_ymax = maxs[m_iy];
 
-       g_FuncTable.m_pfnSysUpdateWindows(W_XY);
+       g_FuncTable.m_pfnSysUpdateWindows( W_XY );
 
-  return true;
+       return true;
 }
-
index bf4771b..59c5973 100644 (file)
@@ -1,23 +1,23 @@
 /*
-Copyright (C) 1999-2007 id Software, Inc. and contributors.
-For a list of contributors, see the accompanying CONTRIBUTORS file.
+   Copyright (C) 1999-2007 id Software, Inc. and contributors.
+   For a list of contributors, see the accompanying CONTRIBUTORS file.
 
-This file is part of GtkRadiant.
+   This file is part of GtkRadiant.
 
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   GtkRadiant is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GtkRadiant is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
+   You should have received a copy of the GNU General Public License
+   along with GtkRadiant; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 
 //
 // bkgrnd2d Plugin
@@ -31,53 +31,56 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 class CBackgroundImage {
 private:
-       qtexture_t *m_tex;
-  VIEWTYPE m_vt;
-  
+qtexture_t *m_tex;
+VIEWTYPE m_vt;
+
 // which components of a vec3_t correspond to x and y in the image
-  unsigned m_ix,m_iy;
+unsigned m_ix,m_iy;
 
 public:
-       CBackgroundImage(VIEWTYPE vt);
+CBackgroundImage( VIEWTYPE vt );
 //  ~CBackgroundImage();
 
-       float m_alpha; // vertex alpha
-       bool m_bActive;
-       
+float m_alpha;     // vertex alpha
+bool m_bActive;
+
 // x and y axis are in relation to the screen, not world, making rendering
-// the same for each view type. Whoever sets them is responsible for 
+// the same for each view type. Whoever sets them is responsible for
 // shuffling.
 // units are world units.
 // TODO should be private
-       float m_xmin,m_ymin,m_xmax,m_ymax;
+float m_xmin,m_ymin,m_xmax,m_ymax;
 
 // load file, create new tex, cleanup old tex, set new tex
-       bool Load(const char *filename); 
-       void Cleanup(); // free texture, free tex, set make tex NULL
-       bool SetExtentsMM(); // set extents by ET mapcoordsmaxs/mapcoordsmins
-       bool SetExtentsSel(); // set extents by selection
-       void Render();
-       bool Valid() { return (m_tex && (m_xmin != m_xmax) && (m_ymin != m_ymax)); }
+bool Load( const char *filename );
+void Cleanup();     // free texture, free tex, set make tex NULL
+bool SetExtentsMM();     // set extents by ET mapcoordsmaxs/mapcoordsmins
+bool SetExtentsSel();     // set extents by selection
+void Render();
+bool Valid() { return ( m_tex && ( m_xmin != m_xmax ) && ( m_ymin != m_ymax ) ); }
 };
 
 class CBackgroundRender : public IGL2DWindow {
 public:
 
-  CBackgroundRender();
-  virtual ~CBackgroundRender();
+CBackgroundRender();
+virtual ~CBackgroundRender();
 
 protected:
-       int refCount;
+int refCount;
 
 public:
 
-  // IGL2DWindow IGL3DWindow interface
-       void IncRef() { refCount++; }
-       void DecRef() { refCount--; if (refCount <= 0) delete this; }
-       void Draw2D( VIEWTYPE vt );
-       void Register();
+// IGL2DWindow IGL3DWindow interface
+void IncRef() { refCount++; }
+void DecRef() {
+       refCount--; if ( refCount <= 0 ) {
+               delete this;
+       }
+}
+void Draw2D( VIEWTYPE vt );
+void Register();
 };
 
 extern CBackgroundImage backgroundXY,backgroundXZ,backgroundYZ;
 extern CBackgroundRender render;
-
index 7b8a213..ae6eef2 100644 (file)
@@ -1,23 +1,23 @@
 /*
-Copyright (C) 1999-2007 id Software, Inc. and contributors.
-For a list of contributors, see the accompanying CONTRIBUTORS file.
+   Copyright (C) 1999-2007 id Software, Inc. and contributors.
+   For a list of contributors, see the accompanying CONTRIBUTORS file.
 
-This file is part of GtkRadiant.
+   This file is part of GtkRadiant.
 
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   GtkRadiant is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GtkRadiant is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
+   You should have received a copy of the GNU General Public License
+   along with GtkRadiant; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 
 //
 // bkgrnd2d Plugin dialog
@@ -37,7 +37,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define NO_FILE_MSG "        (no file loaded)        "
 
 #ifdef _WIN32
-  // TTimo: THIS IS UGLY
+// TTimo: THIS IS UGLY
 #define snprintf _snprintf
 #endif
 
@@ -48,64 +48,60 @@ static GtkTooltips *pTooltips;
 class CBackgroundDialogPage
 {
 private:
-       GtkWidget *m_pWidget;
-       GtkWidget *m_pTabLabel;
-       GtkWidget *m_pFileLabel;
-       GtkWidget *m_pPosLabel;
-       VIEWTYPE m_vt;
-       bool m_bValidFile;
+GtkWidget *m_pWidget;
+GtkWidget *m_pTabLabel;
+GtkWidget *m_pFileLabel;
+GtkWidget *m_pPosLabel;
+VIEWTYPE m_vt;
+bool m_bValidFile;
 
 public:
-       CBackgroundImage *m_pImage;
-       CBackgroundDialogPage( VIEWTYPE vt );
-       void Append(GtkWidget *notebook);
-       void Browse();
-       void Reload();
-       void SetPosLabel();
+CBackgroundImage *m_pImage;
+CBackgroundDialogPage( VIEWTYPE vt );
+void Append( GtkWidget *notebook );
+void Browse();
+void Reload();
+void SetPosLabel();
 //  ~BackgroundDialogPage();
 };
 
 
 // dialog page callbacks
-static void browse_callback( GtkWidget *widget, gpointer data )
-{
-       ((CBackgroundDialogPage *)data)->Browse();
+static void browse_callback( GtkWidget *widget, gpointer data ){
+       ( (CBackgroundDialogPage *)data )->Browse();
 }
 
-static void reload_callback( GtkWidget *widget, gpointer data )
-{
-       ((CBackgroundDialogPage *)data)->Reload();
+static void reload_callback( GtkWidget *widget, gpointer data ){
+       ( (CBackgroundDialogPage *)data )->Reload();
 }
 
-static void size_sel_callback( GtkWidget *widget, gpointer data )
-{
+static void size_sel_callback( GtkWidget *widget, gpointer data ){
        CBackgroundDialogPage *pPage = (CBackgroundDialogPage *)data;
-       if (pPage->m_pImage->SetExtentsSel())
+       if ( pPage->m_pImage->SetExtentsSel() ) {
                pPage->SetPosLabel();
+       }
 }
 
-static void size_mm_callback( GtkWidget *widget, gpointer data )
-{
+static void size_mm_callback( GtkWidget *widget, gpointer data ){
        CBackgroundDialogPage *pPage = (CBackgroundDialogPage *)data;
-       if(pPage->m_pImage->SetExtentsMM())
+       if ( pPage->m_pImage->SetExtentsMM() ) {
                pPage->SetPosLabel();
+       }
 }
 
-static void alpha_adjust_callback( GtkWidget *widget, gpointer data )
-{
+static void alpha_adjust_callback( GtkWidget *widget, gpointer data ){
        CBackgroundDialogPage *pPage = (CBackgroundDialogPage *)data;
-       pPage->m_pImage->m_alpha = (float)gtk_range_get_value (GTK_RANGE(widget));
-       g_FuncTable.m_pfnSysUpdateWindows(W_XY);
+       pPage->m_pImage->m_alpha = (float)gtk_range_get_value( GTK_RANGE( widget ) );
+       g_FuncTable.m_pfnSysUpdateWindows( W_XY );
 }
 
-void CBackgroundDialogPage::Reload()
-{
-       if(m_bValidFile)
-               m_pImage->Load(gtk_label_get_text(GTK_LABEL(m_pFileLabel)));
+void CBackgroundDialogPage::Reload(){
+       if ( m_bValidFile ) {
+               m_pImage->Load( gtk_label_get_text( GTK_LABEL( m_pFileLabel ) ) );
+       }
 }
 
-void CBackgroundDialogPage::Browse()
-{
+void CBackgroundDialogPage::Browse(){
        char browsedir[PATH_MAX];
        const char *ct;
        const char *newfile;
@@ -116,72 +112,71 @@ void CBackgroundDialogPage::Browse()
 //     Syn_Printf(MSG_PREFIX "GetMapName() %s\n",
 //                             g_FuncTable.m_pfnGetMapName());
 
-       ct = g_FuncTable.m_pfnReadProjectKey("basepath");
+       ct = g_FuncTable.m_pfnReadProjectKey( "basepath" );
        // TODO shouldn't need this stuff
-       if(!ct || !strlen(ct)) {
-               Syn_Printf(MSG_PREFIX "basepath = NULL or empty\n");
+       if ( !ct || !strlen( ct ) ) {
+               Syn_Printf( MSG_PREFIX "basepath = NULL or empty\n" );
                return;
        }
-       Syn_Printf(MSG_PREFIX "basepath: %s\n",ct);
-       if(strlen(ct) >= PATH_MAX) {
-               Syn_Printf(MSG_PREFIX "base game dir too long\n");
+       Syn_Printf( MSG_PREFIX "basepath: %s\n",ct );
+       if ( strlen( ct ) >= PATH_MAX ) {
+               Syn_Printf( MSG_PREFIX "base game dir too long\n" );
                return;
        }
 
-       strcpy(browsedir,ct);
+       strcpy( browsedir,ct );
        // make sure we have a trailing /
-       if(browsedir[strlen(browsedir) - 1] != '/')
-               strcat(browsedir,"/");
+       if ( browsedir[strlen( browsedir ) - 1] != '/' ) {
+               strcat( browsedir,"/" );
+       }
 
        //if we dont have a file yet, don't try to use it for default dir
-       if(m_bValidFile) {
-       // filename should always be a nice clean unix style relative path
-               ct = gtk_label_get_text(GTK_LABEL(m_pFileLabel));
-               strcat(browsedir,ct);
-               Syn_Printf(MSG_PREFIX "full path: %s\n",browsedir);
+       if ( m_bValidFile ) {
+               // filename should always be a nice clean unix style relative path
+               ct = gtk_label_get_text( GTK_LABEL( m_pFileLabel ) );
+               strcat( browsedir,ct );
+               Syn_Printf( MSG_PREFIX "full path: %s\n",browsedir );
 
                // lop off the file part
-               t = browsedir + strlen(browsedir) - 1;
-               while (t != browsedir && *t != '/')
+               t = browsedir + strlen( browsedir ) - 1;
+               while ( t != browsedir && *t != '/' )
                        t--;
                *t = 0;
        }
-       Syn_Printf(MSG_PREFIX "browse directory %s\n",browsedir);
+       Syn_Printf( MSG_PREFIX "browse directory %s\n",browsedir );
 
 //does NOT need freeing contrary to include/qerplugin.h comments
 //TODO bug/patch for comments
 //TODO patern gets fucked up sometimes if empty
-       newfile = g_FuncTable.m_pfnFileDialog(pDialogWnd,TRUE,
-                                                                 _("Load Background Image"),browsedir,FILETYPE_KEY, NULL);
-       if(!newfile) {
-               Syn_Printf(MSG_PREFIX "newfile = NULL\n");
+       newfile = g_FuncTable.m_pfnFileDialog( pDialogWnd,TRUE,
+                                                                                  _( "Load Background Image" ),browsedir,FILETYPE_KEY, NULL );
+       if ( !newfile ) {
+               Syn_Printf( MSG_PREFIX "newfile = NULL\n" );
                return;
        }
-       Syn_Printf(MSG_PREFIX "newfile: %s\n",newfile);
-       newfile = g_FileSystemTable.m_pfnExtractRelativePath(newfile);
+       Syn_Printf( MSG_PREFIX "newfile: %s\n",newfile );
+       newfile = g_FileSystemTable.m_pfnExtractRelativePath( newfile );
 
-       if(!newfile) {
-               Syn_Printf(MSG_PREFIX "newfile = NULL\n");
+       if ( !newfile ) {
+               Syn_Printf( MSG_PREFIX "newfile = NULL\n" );
                return;
        }
-       Syn_Printf(MSG_PREFIX "newfile: %s\n",newfile);
+       Syn_Printf( MSG_PREFIX "newfile: %s\n",newfile );
 
-       if(m_pImage->Load(newfile)) {
+       if ( m_pImage->Load( newfile ) ) {
                m_bValidFile = true;
-               gtk_label_set_text(GTK_LABEL(m_pFileLabel),newfile);
+               gtk_label_set_text( GTK_LABEL( m_pFileLabel ),newfile );
        }
 }
 
-void CBackgroundDialogPage::SetPosLabel()
-{
+void CBackgroundDialogPage::SetPosLabel(){
        char s[64];
-       snprintf(s, sizeof(s) - 1, _("Size/Position (%d,%d) (%d,%d)"),(int)(m_pImage->m_xmin),
-                       (int)(m_pImage->m_ymin),(int)(m_pImage->m_xmax),(int)(m_pImage->m_ymax));
-       gtk_label_set_text(GTK_LABEL(m_pPosLabel),s);
+       snprintf( s, sizeof( s ) - 1, _( "Size/Position (%d,%d) (%d,%d)" ),(int)( m_pImage->m_xmin ),
+                         (int)( m_pImage->m_ymin ),(int)( m_pImage->m_xmax ),(int)( m_pImage->m_ymax ) );
+       gtk_label_set_text( GTK_LABEL( m_pPosLabel ),s );
 }
 
-CBackgroundDialogPage::CBackgroundDialogPage(VIEWTYPE vt )
-{
+CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){
        GtkWidget *frame;
        GtkWidget *hbox;
        GtkWidget *w;
@@ -190,180 +185,174 @@ CBackgroundDialogPage::CBackgroundDialogPage(VIEWTYPE vt )
 
        m_bValidFile = false;
 
-       switch(m_vt)
+       switch ( m_vt )
        {
-               case XY:
-                       m_pTabLabel = gtk_label_new(_("X/Y"));
-                       m_pImage = &backgroundXY;
-                       break;
-               case XZ:
-                       m_pTabLabel = gtk_label_new(_("X/Z"));
-                       m_pImage = &backgroundXZ;
-                       break;
-               case YZ:
-                       m_pTabLabel = gtk_label_new(_("Y/Z"));
-                       m_pImage = &backgroundYZ;
-                       break;
+       case XY:
+               m_pTabLabel = gtk_label_new( _( "X/Y" ) );
+               m_pImage = &backgroundXY;
+               break;
+       case XZ:
+               m_pTabLabel = gtk_label_new( _( "X/Z" ) );
+               m_pImage = &backgroundXZ;
+               break;
+       case YZ:
+               m_pTabLabel = gtk_label_new( _( "Y/Z" ) );
+               m_pImage = &backgroundYZ;
+               break;
        }
 // A vbox to hold everything
-       m_pWidget = gtk_vbox_new(FALSE,0);
+       m_pWidget = gtk_vbox_new( FALSE,0 );
 // Frame for file row
-       frame = gtk_frame_new(_("File"));
-       gtk_box_pack_start (GTK_BOX (m_pWidget),frame, FALSE, FALSE, 2);
+       frame = gtk_frame_new( _( "File" ) );
+       gtk_box_pack_start( GTK_BOX( m_pWidget ),frame, FALSE, FALSE, 2 );
 
 // hbox for first row
-       hbox = gtk_hbox_new(FALSE,5);
-       gtk_container_set_border_width(GTK_CONTAINER (hbox),4);
-       gtk_container_add (GTK_CONTAINER (frame), hbox);
+       hbox = gtk_hbox_new( FALSE,5 );
+       gtk_container_set_border_width( GTK_CONTAINER( hbox ),4 );
+       gtk_container_add( GTK_CONTAINER( frame ), hbox );
 
 // label to display filename
-       m_pFileLabel  = gtk_label_new(NO_FILE_MSG);
-       gtk_label_set_selectable(GTK_LABEL(m_pFileLabel),TRUE);
+       m_pFileLabel  = gtk_label_new( NO_FILE_MSG );
+       gtk_label_set_selectable( GTK_LABEL( m_pFileLabel ),TRUE );
 //TODO set min size ? done with spaces right now
-       gtk_box_pack_start (GTK_BOX (hbox),m_pFileLabel, TRUE, TRUE, 5);
+       gtk_box_pack_start( GTK_BOX( hbox ),m_pFileLabel, TRUE, TRUE, 5 );
 
-  gtk_widget_show (m_pFileLabel);
+       gtk_widget_show( m_pFileLabel );
 
-       w = gtk_button_new_with_label ("Browse...");
-       g_signal_connect (G_OBJECT (w), "clicked", G_CALLBACK (browse_callback),
-                                                              (gpointer)this);
-       gtk_box_pack_start (GTK_BOX (hbox),w, FALSE, FALSE, 5);
-       gtk_tooltips_set_tip (pTooltips, w, "Select a file", NULL);
-  gtk_widget_show (w);
+       w = gtk_button_new_with_label( "Browse..." );
+       g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( browse_callback ),
+                                         ( gpointer ) this );
+       gtk_box_pack_start( GTK_BOX( hbox ),w, FALSE, FALSE, 5 );
+       gtk_tooltips_set_tip( pTooltips, w, "Select a file", NULL );
+       gtk_widget_show( w );
 
-       w = gtk_button_new_with_label ("Reload");
-       g_signal_connect (G_OBJECT (w), "clicked", G_CALLBACK (reload_callback),
-                                                              (gpointer)this);
+       w = gtk_button_new_with_label( "Reload" );
+       g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( reload_callback ),
+                                         ( gpointer ) this );
        // TODO disable until we have file
        // gtk_widget_set_sensitive(w,FALSE);
-       gtk_tooltips_set_tip (pTooltips, w, "Reload current file", NULL);
-       gtk_box_pack_start (GTK_BOX (hbox),w, FALSE, FALSE, 5);
-  gtk_widget_show (w);
+       gtk_tooltips_set_tip( pTooltips, w, "Reload current file", NULL );
+       gtk_box_pack_start( GTK_BOX( hbox ),w, FALSE, FALSE, 5 );
+       gtk_widget_show( w );
 
-       gtk_widget_show (hbox);
-       gtk_widget_show (frame);
+       gtk_widget_show( hbox );
+       gtk_widget_show( frame );
 
 // second row (rendering options)
-       frame = gtk_frame_new(_("Rendering"));
-       gtk_box_pack_start (GTK_BOX (m_pWidget),frame, FALSE, FALSE, 2);
-
-       hbox = gtk_hbox_new(FALSE,5);
-       gtk_container_set_border_width(GTK_CONTAINER (hbox),4);
-       gtk_container_add (GTK_CONTAINER (frame), hbox);
-
-       w = gtk_label_new(_("Vertex alpha:"));
-       gtk_box_pack_start (GTK_BOX (hbox),w, FALSE, FALSE, 5);
-  gtk_widget_show (w);
-
-       w = gtk_hscale_new_with_range(0.0,1.0,0.01);
-       gtk_range_set_value(GTK_RANGE(w),0.5);
-       gtk_scale_set_value_pos(GTK_SCALE(w),GTK_POS_LEFT);
-       g_signal_connect (G_OBJECT (w), "value-changed",
-                          G_CALLBACK (alpha_adjust_callback), (gpointer)this);
-       gtk_box_pack_start (GTK_BOX (hbox),w, TRUE, TRUE, 5);
-       gtk_tooltips_set_tip (pTooltips, w, _("Set image transparancy"), NULL);
-  gtk_widget_show (w);
-
-       gtk_widget_show (hbox);
-       gtk_widget_show (frame);
+       frame = gtk_frame_new( _( "Rendering" ) );
+       gtk_box_pack_start( GTK_BOX( m_pWidget ),frame, FALSE, FALSE, 2 );
+
+       hbox = gtk_hbox_new( FALSE,5 );
+       gtk_container_set_border_width( GTK_CONTAINER( hbox ),4 );
+       gtk_container_add( GTK_CONTAINER( frame ), hbox );
+
+       w = gtk_label_new( _( "Vertex alpha:" ) );
+       gtk_box_pack_start( GTK_BOX( hbox ),w, FALSE, FALSE, 5 );
+       gtk_widget_show( w );
+
+       w = gtk_hscale_new_with_range( 0.0,1.0,0.01 );
+       gtk_range_set_value( GTK_RANGE( w ),0.5 );
+       gtk_scale_set_value_pos( GTK_SCALE( w ),GTK_POS_LEFT );
+       g_signal_connect( G_OBJECT( w ), "value-changed",
+                                         G_CALLBACK( alpha_adjust_callback ), ( gpointer ) this );
+       gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, TRUE, 5 );
+       gtk_tooltips_set_tip( pTooltips, w, _( "Set image transparancy" ), NULL );
+       gtk_widget_show( w );
+
+       gtk_widget_show( hbox );
+       gtk_widget_show( frame );
 // Third row (size and position)
-       frame = gtk_frame_new(_("Size/Position (undefined)"));
-       m_pPosLabel = gtk_frame_get_label_widget (GTK_FRAME(frame));
-       gtk_box_pack_start ( GTK_BOX (m_pWidget), frame, FALSE, FALSE, 2);
-
-       hbox = gtk_hbox_new(FALSE,5);
-       gtk_container_add (GTK_CONTAINER (frame), hbox);
-       gtk_container_set_border_width(GTK_CONTAINER (hbox),4);
-
-       w = gtk_button_new_with_label (_("from selection"));
-       gtk_box_pack_start (GTK_BOX (hbox),w, TRUE, FALSE, 5);
-       g_signal_connect (G_OBJECT (w), "clicked", G_CALLBACK (size_sel_callback),
-                                                                (gpointer)this);
-       gtk_tooltips_set_tip (pTooltips, w, _("Set the size of the image to the bounding rectangle of all selected brushes and entities"), NULL);
-  gtk_widget_show (w);
-
-       if(m_vt == XY) {
-               w = gtk_button_new_with_label (_("from map mins/maxs"));
-               gtk_box_pack_start ( GTK_BOX (hbox),w, TRUE, FALSE, 2);
-               g_signal_connect (G_OBJECT (w), "clicked", G_CALLBACK (size_mm_callback),
-                                                                (gpointer)this);
-               gtk_tooltips_set_tip (pTooltips, w, _("Set the size of the image using the mapcoordsmins and mapcoordsmaxs keys of the worldspawn entity"), NULL);
-               gtk_widget_show (w);
+       frame = gtk_frame_new( _( "Size/Position (undefined)" ) );
+       m_pPosLabel = gtk_frame_get_label_widget( GTK_FRAME( frame ) );
+       gtk_box_pack_start( GTK_BOX( m_pWidget ), frame, FALSE, FALSE, 2 );
+
+       hbox = gtk_hbox_new( FALSE,5 );
+       gtk_container_add( GTK_CONTAINER( frame ), hbox );
+       gtk_container_set_border_width( GTK_CONTAINER( hbox ),4 );
+
+       w = gtk_button_new_with_label( _( "from selection" ) );
+       gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, FALSE, 5 );
+       g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( size_sel_callback ),
+                                         ( gpointer ) this );
+       gtk_tooltips_set_tip( pTooltips, w, _( "Set the size of the image to the bounding rectangle of all selected brushes and entities" ), NULL );
+       gtk_widget_show( w );
+
+       if ( m_vt == XY ) {
+               w = gtk_button_new_with_label( _( "from map mins/maxs" ) );
+               gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, FALSE, 2 );
+               g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( size_mm_callback ),
+                                                 ( gpointer ) this );
+               gtk_tooltips_set_tip( pTooltips, w, _( "Set the size of the image using the mapcoordsmins and mapcoordsmaxs keys of the worldspawn entity" ), NULL );
+               gtk_widget_show( w );
        }
 
-       gtk_widget_show (hbox);
-       gtk_widget_show (frame);
+       gtk_widget_show( hbox );
+       gtk_widget_show( frame );
 
-  gtk_widget_show ( m_pWidget );
+       gtk_widget_show( m_pWidget );
 }
 
-void CBackgroundDialogPage::Append(GtkWidget *notebook)
-{
-       gtk_notebook_append_page( GTK_NOTEBOOK(notebook), m_pWidget, m_pTabLabel);
+void CBackgroundDialogPage::Append( GtkWidget *notebook ){
+       gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), m_pWidget, m_pTabLabel );
 }
 
 // dialog global callbacks
 /*
-static gint expose_callback( GtkWidget *widget, gpointer data )
-{
-       return FALSE;
-}
-*/
-
-static void response_callback( GtkWidget *widget, gint response, gpointer data )
-{
-       if( response == GTK_RESPONSE_CLOSE )
-               gtk_widget_hide( pDialogWnd );
+   static gint expose_callback( GtkWidget *widget, gpointer data )
+   {
+    return FALSE;
+   }
+ */
+
+static void response_callback( GtkWidget *widget, gint response, gpointer data ){
+       if ( response == GTK_RESPONSE_CLOSE ) {
+               gtk_widget_hide( pDialogWnd );
+       }
 }
 
-static gint close_callback( GtkWidget *widget, gpointer data )
-{
-       gtk_widget_hide( pDialogWnd );
+static gint close_callback( GtkWidget *widget, gpointer data ){
+       gtk_widget_hide( pDialogWnd );
        return TRUE;
 }
 
-void InitBackgroundDialog()
-{
+void InitBackgroundDialog(){
        CBackgroundDialogPage *pPage;
 
-       pDialogWnd = gtk_dialog_new_with_buttons (_("Background Images"),
-                              GTK_WINDOW(g_pMainWidget),
-                              (GtkDialogFlags)(GTK_DIALOG_DESTROY_WITH_PARENT),
-        // TODO dialog with no buttons
-        //                                                                               GTK_STOCK_CLOSE,
-        //                                                                               GTK_RESPONSE_CLOSE,
-                              NULL);
-       gtk_signal_connect( GTK_OBJECT (pDialogWnd), "delete_event",
-                                    GTK_SIGNAL_FUNC( close_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT (pDialogWnd), "response",
-                                  GTK_SIGNAL_FUNC( response_callback ), NULL );
-//     gtk_signal_connect( GTK_OBJECT (pDialogWnd), "expose_event", GTK_SIGNAL_FUNC( ci_expose ), NULL );
+       pDialogWnd = gtk_dialog_new_with_buttons( _( "Background Images" ),
+                                                                                         GTK_WINDOW( g_pMainWidget ),
+                                                                                         (GtkDialogFlags)( GTK_DIALOG_DESTROY_WITH_PARENT ),
+                                                 // TODO dialog with no buttons
+                                                 //                                                                              GTK_STOCK_CLOSE,
+                                                 //                                                                              GTK_RESPONSE_CLOSE,
+                                                                                         NULL );
+       gtk_signal_connect( GTK_OBJECT( pDialogWnd ), "delete_event",
+                                               GTK_SIGNAL_FUNC( close_callback ), NULL );
+       gtk_signal_connect( GTK_OBJECT( pDialogWnd ), "response",
+                                               GTK_SIGNAL_FUNC( response_callback ), NULL );
+//  gtk_signal_connect( GTK_OBJECT (pDialogWnd), "expose_event", GTK_SIGNAL_FUNC( ci_expose ), NULL );
 
        pTooltips = gtk_tooltips_new();
 
        pNotebook = gtk_notebook_new();
-       pPage = new CBackgroundDialogPage(XY);
-       pPage->Append(pNotebook);
-       pPage = new CBackgroundDialogPage(XZ);
-       pPage->Append(pNotebook);
-       pPage = new CBackgroundDialogPage(YZ);
-       pPage->Append(pNotebook);
+       pPage = new CBackgroundDialogPage( XY );
+       pPage->Append( pNotebook );
+       pPage = new CBackgroundDialogPage( XZ );
+       pPage->Append( pNotebook );
+       pPage = new CBackgroundDialogPage( YZ );
+       pPage->Append( pNotebook );
 
-       gtk_box_pack_start (GTK_BOX (GTK_DIALOG(pDialogWnd)->vbox), pNotebook, TRUE, TRUE, 0);
+       gtk_box_pack_start( GTK_BOX( GTK_DIALOG( pDialogWnd )->vbox ), pNotebook, TRUE, TRUE, 0 );
 
-  gtk_widget_show ( pNotebook );
+       gtk_widget_show( pNotebook );
 
        gtk_widget_realize( pDialogWnd );
 }
 
-void ShowBackgroundDialog()
-{
-       gtk_window_present( GTK_WINDOW(pDialogWnd) );
+void ShowBackgroundDialog(){
+       gtk_window_present( GTK_WINDOW( pDialogWnd ) );
 }
 
-void ShowBackgroundDialogPG(int page)
-{
-       gtk_notebook_set_current_page(GTK_NOTEBOOK(pNotebook),page);
+void ShowBackgroundDialogPG( int page ){
+       gtk_notebook_set_current_page( GTK_NOTEBOOK( pNotebook ),page );
        ShowBackgroundDialog();
 }
-
index b6d8043..1234f6d 100644 (file)
@@ -1,23 +1,23 @@
 /*
-Copyright (C) 1999-2007 id Software, Inc. and contributors.
-For a list of contributors, see the accompanying CONTRIBUTORS file.
+   Copyright (C) 1999-2007 id Software, Inc. and contributors.
+   For a list of contributors, see the accompanying CONTRIBUTORS file.
 
-This file is part of GtkRadiant.
+   This file is part of GtkRadiant.
 
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   GtkRadiant is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GtkRadiant is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
+   You should have received a copy of the GNU General Public License
+   along with GtkRadiant; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 
 //
 // bkgrnd2d Plugin dialog box
@@ -31,6 +31,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 void InitBackgroundDialog();
 void ShowBackgroundDialog();
-void ShowBackgroundDialogPG(int page);
+void ShowBackgroundDialogPG( int page );
 
 #endif // _BKGRND2D_DIALOG_H_
index 3b5cc97..6e92d33 100644 (file)
@@ -1,23 +1,23 @@
 /*
-Copyright (C) 1999-2007 id Software, Inc. and contributors.
-For a list of contributors, see the accompanying CONTRIBUTORS file.
+   Copyright (C) 1999-2007 id Software, Inc. and contributors.
+   For a list of contributors, see the accompanying CONTRIBUTORS file.
 
-This file is part of GtkRadiant.
+   This file is part of GtkRadiant.
 
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   GtkRadiant is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GtkRadiant is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
+   You should have received a copy of the GNU General Public License
+   along with GtkRadiant; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 
 //
 // 2d background Plugin
@@ -30,23 +30,23 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 /*
     Overview
     ========
-       This little plugin allows you to display an image in the background of the
-       gtkradiant XY window.
+    This little plugin allows you to display an image in the background of the
+    gtkradiant XY window.
 
     Version History
     ===============
 
     v0.1
       - Initial version.
-       v0.2
-         - three views, dialog box, toolbar
+    v0.2
+      - three views, dialog box, toolbar
     v0.25
       - tooltips, follow gtkradiant coding conventions
 
     How ?
     -----
      - textures 'n widgets 'n stuff.
-*/
+ */
 
 //#include "plugin.h"
 //TODO we just poke the objects directly
@@ -76,12 +76,12 @@ static const char *PLUGIN_NAME = "2d window background plugin";
 
 //backwards for some reason
 static const char *PLUGIN_COMMANDS = CMD_ABOUT ";"
-                                     CMD_SEP ";"
-                                                                                        CMD_CONFIG
-                                     ;
+                                                                        CMD_SEP ";"
+                                                                        CMD_CONFIG
+;
 
 static const char *PLUGIN_ABOUT = "2d window background v0.25\n\n"
-                                  "By reyalP (hellsownpuppy@yahoo.com)";
+                                                                 "By reyalP (hellsownpuppy@yahoo.com)";
 
 
 
@@ -96,7 +96,7 @@ struct toolbar_button_info_s
        const char *image;
        const char *text;
        const char *tip;
-       void (*func)();
+       void ( *func )();
        IToolbarButton::EType type;
 };
 
@@ -105,28 +105,28 @@ struct toolbar_button_info_s toolbar_buttons[NUM_TOOLBAR_BUTTONS] =
        {
                "bkgrnd2d_xy_toggle.bmp",
                "xy background",
-    "Toggle xy background image",
+               "Toggle xy background image",
                DoBkgrndToggleXY,
                IToolbarButton::eToggleButton
        },
        {
                "bkgrnd2d_xz_toggle.bmp",
                "xz background",
-    "Toggle xz background image",
+               "Toggle xz background image",
                DoBkgrndToggleXZ,
                IToolbarButton::eToggleButton
        },
        {
                "bkgrnd2d_yz_toggle.bmp",
                "yz background",
-    "Toggle yz background image",
+               "Toggle yz background image",
                DoBkgrndToggleYZ,
                IToolbarButton::eToggleButton
        },
        {
                "bkgrnd2d_conf.bmp",
                "Configure",
-    "Configure background images",
+               "Configure background images",
                ShowBackgroundDialog,
                IToolbarButton::eButton
        },
@@ -135,112 +135,104 @@ struct toolbar_button_info_s toolbar_buttons[NUM_TOOLBAR_BUTTONS] =
 class Bkgrnd2dButton : public IToolbarButton
 {
 public:
-  const toolbar_button_info_s *bi;
-  virtual const char* getImage() const
-  {
-    return bi->image;
-  }
-  virtual const char* getText() const
-  {
-    return bi->text;
-  }
-  virtual const char* getTooltip() const
-  {
-    return bi->tip;
-  }
-  virtual void activate() const
-  {
-    bi->func();
-    return ;
-  }
-  virtual EType getType() const
-  {
-    return bi->type;
-  }
+const toolbar_button_info_s *bi;
+virtual const char* getImage() const {
+       return bi->image;
+}
+virtual const char* getText() const {
+       return bi->text;
+}
+virtual const char* getTooltip() const {
+       return bi->tip;
+}
+virtual void activate() const {
+       bi->func();
+       return ;
+}
+virtual EType getType() const {
+       return bi->type;
+}
 };
 
 Bkgrnd2dButton g_bkgrnd2dbuttons[NUM_TOOLBAR_BUTTONS];
 
-unsigned int ToolbarButtonCount()
-{
-  return NUM_TOOLBAR_BUTTONS;
+unsigned int ToolbarButtonCount(){
+       return NUM_TOOLBAR_BUTTONS;
 }
 
-const IToolbarButton* GetToolbarButton(unsigned int index)
-{
-  g_bkgrnd2dbuttons[index].bi = &toolbar_buttons[index];
-  return &g_bkgrnd2dbuttons[index];
+const IToolbarButton* GetToolbarButton( unsigned int index ){
+       g_bkgrnd2dbuttons[index].bi = &toolbar_buttons[index];
+       return &g_bkgrnd2dbuttons[index];
 }
 
-extern "C" const char* QERPlug_Init (void *hApp, void* pMainWidget)
-{
-  g_pMainWidget = pMainWidget;
+extern "C" const char* QERPlug_Init( void *hApp, void* pMainWidget ){
+       g_pMainWidget = pMainWidget;
 
-  InitBackgroundDialog();
-  render.Register();
+       InitBackgroundDialog();
+       render.Register();
 
 //TODO is it right ? is it wrong ? it works
 //TODO figure out supported image types
-  GetFileTypeRegistry()->addType(FILETYPE_KEY, filetype_t("all files", "*.*"));
-  GetFileTypeRegistry()->addType(FILETYPE_KEY, filetype_t("jpeg files", "*.jpg"));
-  GetFileTypeRegistry()->addType(FILETYPE_KEY, filetype_t("targa files", "*.tga"));
-  return (char *) PLUGIN_NAME;
+       GetFileTypeRegistry()->addType( FILETYPE_KEY, filetype_t( "all files", "*.*" ) );
+       GetFileTypeRegistry()->addType( FILETYPE_KEY, filetype_t( "jpeg files", "*.jpg" ) );
+       GetFileTypeRegistry()->addType( FILETYPE_KEY, filetype_t( "targa files", "*.tga" ) );
+       return (char *) PLUGIN_NAME;
 }
 
-extern "C" const char* QERPlug_GetName ()
-{
-  return (char *) PLUGIN_NAME;
+extern "C" const char* QERPlug_GetName(){
+       return (char *) PLUGIN_NAME;
 }
 
-extern "C" const char* QERPlug_GetCommandList ()
-{
-  return (char *) PLUGIN_COMMANDS;
+extern "C" const char* QERPlug_GetCommandList(){
+       return (char *) PLUGIN_COMMANDS;
 }
 
-extern "C" void QERPlug_Dispatch (const char *p, vec3_t vMin, vec3_t vMax, bool bSingleBrush)
-{
-  Sys_Printf (MSG_PREFIX "Command \"%s\"\n",p);
-  if(!strcmp(p, CMD_ABOUT)) {
-       g_FuncTable.m_pfnMessageBox(NULL, PLUGIN_ABOUT, "About", MB_OK, NULL);
-  }
-  else if(!strcmp(p,CMD_CONFIG)) {
-       ShowBackgroundDialog();
-  }
+extern "C" void QERPlug_Dispatch( const char *p, vec3_t vMin, vec3_t vMax, bool bSingleBrush ){
+       Sys_Printf( MSG_PREFIX "Command \"%s\"\n",p );
+       if ( !strcmp( p, CMD_ABOUT ) ) {
+               g_FuncTable.m_pfnMessageBox( NULL, PLUGIN_ABOUT, "About", MB_OK, NULL );
+       }
+       else if ( !strcmp( p,CMD_CONFIG ) ) {
+               ShowBackgroundDialog();
+       }
 }
 
 //TODO these three suck
-void DoBkgrndToggleXY()
-{
-  Sys_Printf (MSG_PREFIX "DoBkgrndToggleXY\n");
-  // always toggle, since the buttons do
-  backgroundXY.m_bActive = (backgroundXY.m_bActive) ? false:true;
-  // if we don't have image or extents, and we activated,
-  // bring up the dialog with the corresponding page
-  // would be better to hide or grey out button, but we can't
-  if(backgroundXY.m_bActive && !backgroundXY.Valid())
-         ShowBackgroundDialogPG(0);
-  else
-         g_FuncTable.m_pfnSysUpdateWindows(W_XY);
+void DoBkgrndToggleXY(){
+       Sys_Printf( MSG_PREFIX "DoBkgrndToggleXY\n" );
+       // always toggle, since the buttons do
+       backgroundXY.m_bActive = ( backgroundXY.m_bActive ) ? false : true;
+       // if we don't have image or extents, and we activated,
+       // bring up the dialog with the corresponding page
+       // would be better to hide or grey out button, but we can't
+       if ( backgroundXY.m_bActive && !backgroundXY.Valid() ) {
+               ShowBackgroundDialogPG( 0 );
+       }
+       else{
+               g_FuncTable.m_pfnSysUpdateWindows( W_XY );
+       }
 }
 
-void DoBkgrndToggleXZ()
-{
-  Sys_Printf (MSG_PREFIX "DoBkgrndToggleXZ\n");
-  backgroundXZ.m_bActive = (backgroundXZ.m_bActive) ? false:true;
-  if(backgroundXZ.m_bActive && !backgroundXZ.Valid())
-         ShowBackgroundDialogPG(1);
-  else
-         g_FuncTable.m_pfnSysUpdateWindows(W_XY);
+void DoBkgrndToggleXZ(){
+       Sys_Printf( MSG_PREFIX "DoBkgrndToggleXZ\n" );
+       backgroundXZ.m_bActive = ( backgroundXZ.m_bActive ) ? false : true;
+       if ( backgroundXZ.m_bActive && !backgroundXZ.Valid() ) {
+               ShowBackgroundDialogPG( 1 );
+       }
+       else{
+               g_FuncTable.m_pfnSysUpdateWindows( W_XY );
+       }
 }
 
-void DoBkgrndToggleYZ()
-{
-  Sys_Printf (MSG_PREFIX "DoBkgrndToggleYZ\n");
-  backgroundYZ.m_bActive = (backgroundYZ.m_bActive) ? false:true;
-  if(backgroundYZ.m_bActive && !backgroundYZ.Valid())
-         ShowBackgroundDialogPG(2);
-  else
-         g_FuncTable.m_pfnSysUpdateWindows(W_XY);
+void DoBkgrndToggleYZ(){
+       Sys_Printf( MSG_PREFIX "DoBkgrndToggleYZ\n" );
+       backgroundYZ.m_bActive = ( backgroundYZ.m_bActive ) ? false : true;
+       if ( backgroundYZ.m_bActive && !backgroundYZ.Valid() ) {
+               ShowBackgroundDialogPG( 2 );
+       }
+       else{
+               g_FuncTable.m_pfnSysUpdateWindows( W_XY );
+       }
 }
 
 // =============================================================================
@@ -252,69 +244,62 @@ CSynapseClientBkgrnd2d g_SynapseClient;
 #if __GNUC__ >= 4
 #pragma GCC visibility push(default)
 #endif
-extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) {
+extern "C" CSynapseClient * SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) {
 #if __GNUC__ >= 4
 #pragma GCC visibility pop
 #endif
-  if (strcmp(version, SYNAPSE_VERSION))
-  {
-    Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version);
-    return NULL;
-  }
-  g_pSynapseServer = pServer;
-  g_pSynapseServer->IncRef();
-  Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf());
-
-  g_SynapseClient.AddAPI(TOOLBAR_MAJOR, BKGRND2D_MINOR, sizeof(_QERPlugToolbarTable));
-  g_SynapseClient.AddAPI(PLUGIN_MAJOR, BKGRND2D_MINOR, sizeof( _QERPluginTable ) );
-
-  g_SynapseClient.AddAPI( RADIANT_MAJOR, NULL, sizeof( g_FuncTable ), SYN_REQUIRE, &g_FuncTable );
-  g_SynapseClient.AddAPI( QGL_MAJOR, NULL, sizeof( g_QglTable ), SYN_REQUIRE, &g_QglTable );
+       if ( strcmp( version, SYNAPSE_VERSION ) ) {
+               Syn_Printf( "ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version );
+               return NULL;
+       }
+       g_pSynapseServer = pServer;
+       g_pSynapseServer->IncRef();
+       Set_Syn_Printf( g_pSynapseServer->Get_Syn_Printf() );
+
+       g_SynapseClient.AddAPI( TOOLBAR_MAJOR, BKGRND2D_MINOR, sizeof( _QERPlugToolbarTable ) );
+       g_SynapseClient.AddAPI( PLUGIN_MAJOR, BKGRND2D_MINOR, sizeof( _QERPluginTable ) );
+
+       g_SynapseClient.AddAPI( RADIANT_MAJOR, NULL, sizeof( g_FuncTable ), SYN_REQUIRE, &g_FuncTable );
+       g_SynapseClient.AddAPI( QGL_MAJOR, NULL, sizeof( g_QglTable ), SYN_REQUIRE, &g_QglTable );
 // TODO is this the right way to ask for 'whichever VFS we have loaded' ? Seems to work
 // for misc filename functions
-  g_SynapseClient.AddAPI( VFS_MAJOR, "*", sizeof( g_FileSystemTable ), SYN_REQUIRE, &g_FileSystemTable );
+       g_SynapseClient.AddAPI( VFS_MAJOR, "*", sizeof( g_FileSystemTable ), SYN_REQUIRE, &g_FileSystemTable );
 // get worldspawn
-  g_SynapseClient.AddAPI( ENTITY_MAJOR, NULL, sizeof( g_EntityTable ), SYN_REQUIRE, &g_EntityTable );
+       g_SynapseClient.AddAPI( ENTITY_MAJOR, NULL, sizeof( g_EntityTable ), SYN_REQUIRE, &g_EntityTable );
 // selected brushes
-  g_SynapseClient.AddAPI( DATA_MAJOR, NULL, sizeof( g_DataTable ), SYN_REQUIRE, &g_DataTable );
+       g_SynapseClient.AddAPI( DATA_MAJOR, NULL, sizeof( g_DataTable ), SYN_REQUIRE, &g_DataTable );
 
-  return &g_SynapseClient;
+       return &g_SynapseClient;
 }
 
-bool CSynapseClientBkgrnd2d::RequestAPI(APIDescriptor_t *pAPI)
-{
-  if (!strcmp(pAPI->major_name, PLUGIN_MAJOR))
-  {
-    _QERPluginTable* pTable= static_cast<_QERPluginTable*>(pAPI->mpTable);
-
-    pTable->m_pfnQERPlug_Init = QERPlug_Init;
-    pTable->m_pfnQERPlug_GetName = QERPlug_GetName;
-    pTable->m_pfnQERPlug_GetCommandList = QERPlug_GetCommandList;
-    pTable->m_pfnQERPlug_Dispatch = QERPlug_Dispatch;
-    return true;
-  }
-  if (!strcmp(pAPI->major_name, TOOLBAR_MAJOR))
-  {
-    _QERPlugToolbarTable* pTable= static_cast<_QERPlugToolbarTable*>(pAPI->mpTable);
-
-    pTable->m_pfnToolbarButtonCount = &ToolbarButtonCount;
-    pTable->m_pfnGetToolbarButton = &GetToolbarButton;
-    return true;
-  }
-
-  Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo());
-  return false;
+bool CSynapseClientBkgrnd2d::RequestAPI( APIDescriptor_t *pAPI ){
+       if ( !strcmp( pAPI->major_name, PLUGIN_MAJOR ) ) {
+               _QERPluginTable* pTable = static_cast<_QERPluginTable*>( pAPI->mpTable );
+
+               pTable->m_pfnQERPlug_Init = QERPlug_Init;
+               pTable->m_pfnQERPlug_GetName = QERPlug_GetName;
+               pTable->m_pfnQERPlug_GetCommandList = QERPlug_GetCommandList;
+               pTable->m_pfnQERPlug_Dispatch = QERPlug_Dispatch;
+               return true;
+       }
+       if ( !strcmp( pAPI->major_name, TOOLBAR_MAJOR ) ) {
+               _QERPlugToolbarTable* pTable = static_cast<_QERPlugToolbarTable*>( pAPI->mpTable );
+
+               pTable->m_pfnToolbarButtonCount = &ToolbarButtonCount;
+               pTable->m_pfnGetToolbarButton = &GetToolbarButton;
+               return true;
+       }
+
+       Syn_Printf( "ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo() );
+       return false;
 }
 
 #include "version.h"
 
-const char* CSynapseClientBkgrnd2d::GetInfo()
-{
-  return "2d Background plugin built " __DATE__ " " RADIANT_VERSION;
+const char* CSynapseClientBkgrnd2d::GetInfo(){
+       return "2d Background plugin built " __DATE__ " " RADIANT_VERSION;
 }
 
-const char* CSynapseClientBkgrnd2d::GetName()
-{
-  return "bkgrnd2d";
+const char* CSynapseClientBkgrnd2d::GetName(){
+       return "bkgrnd2d";
 }
-
index 15fe7d6..d2a18ee 100644 (file)
@@ -1,23 +1,23 @@
 /*
-Copyright (C) 1999-2007 id Software, Inc. and contributors.
-For a list of contributors, see the accompanying CONTRIBUTORS file.
+   Copyright (C) 1999-2007 id Software, Inc. and contributors.
+   For a list of contributors, see the accompanying CONTRIBUTORS file.
 
-This file is part of GtkRadiant.
+   This file is part of GtkRadiant.
 
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   GtkRadiant is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GtkRadiant is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
+   You should have received a copy of the GNU General Public License
+   along with GtkRadiant; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 
 //
 // bkgrnd2d Plugin
@@ -31,9 +31,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define _PLUGIN_H_
 
 /*!
-\todo need general notice about lib purpose etc.
-and the external dependencies (such as GLib, STL, mathlib etc.)
-*/
+   \todo need general notice about lib purpose etc.
+   and the external dependencies (such as GLib, STL, mathlib etc.)
+ */
 
 #include <stdio.h>
 // for CPtrArray for idata.h
@@ -64,13 +64,13 @@ extern CSynapseServer* g_pSynapseServer;
 class CSynapseClientBkgrnd2d : public CSynapseClient
 {
 public:
-  // CSynapseClient API
-  bool RequestAPI(APIDescriptor_t *pAPI);
-  const char* GetInfo();
-  const char* GetName();
+// CSynapseClient API
+bool RequestAPI( APIDescriptor_t *pAPI );
+const char* GetInfo();
+const char* GetName();
 
-  CSynapseClientBkgrnd2d() { }
-  virtual ~CSynapseClientBkgrnd2d() { }
+CSynapseClientBkgrnd2d() { }
+virtual ~CSynapseClientBkgrnd2d() { }
 };
 #define MSG_PREFIX "bkgrnd2d: "
 #define MSG_WARN "bkgrnd2d WARNING: "
index 60506be..bc601f0 100644 (file)
@@ -1,63 +1,63 @@
 /*
-BobToolz plugin for GtkRadiant
-Copyright (C) 2001 Gordon Biggans
+   BobToolz plugin for GtkRadiant
+   Copyright (C) 2001 Gordon Biggans
 
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
-#include "StdAfx.h"    // Added by ClassView
+#include "StdAfx.h" // Added by ClassView
 
 class CBspPoint {
 public:
-       float p[3];
+float p[3];
 };
 
 class CBspPortal {
 public:
-       CBspPortal();
-       ~CBspPortal();
+CBspPortal();
+~CBspPortal();
 
-       unsigned point_count;
-       CBspPoint *point;
-       bool Build(char *def, unsigned int pointCnt, bool bInverse);
+unsigned point_count;
+CBspPoint *point;
+bool Build( char *def, unsigned int pointCnt, bool bInverse );
 };
 
 
 class CBspNode {
 public:
-       CBspPortal *portal;
-       unsigned int portal_count;
+CBspPortal *portal;
+unsigned int portal_count;
 
-       bool AddPortal(char* def, unsigned int pointCnt, bool bInverse);
-       unsigned int portal_next;
-       CBspNode();
-       ~CBspNode();
+bool AddPortal( char* def, unsigned int pointCnt, bool bInverse );
+unsigned int portal_next;
+CBspNode();
+~CBspNode();
 };
 
 
 class CPortals {
 public:
 
-       CPortals();
-       ~CPortals();
+CPortals();
+~CPortals();
 
-       void Load(); // use filename in fn
-       void Purge();
+void Load();     // use filename in fn
+void Purge();
 
-       char fn[PATH_MAX];
-       CBspNode *node;
+char fn[PATH_MAX];
+CBspNode *node;
 
-       unsigned int node_count;
+unsigned int node_count;
 };
index 4721510..f10833e 100644 (file)
@@ -1,21 +1,21 @@
 /*
-BobToolz plugin for GtkRadiant
-Copyright (C) 2001 Gordon Biggans
+   BobToolz plugin for GtkRadiant
+   Copyright (C) 2001 Gordon Biggans
 
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 // BobView.cpp: implementation of the DBobView class.
 //
@@ -31,11 +31,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 // Construction/Destruction
 //////////////////////////////////////////////////////////////////////
 
-DBobView::DBobView()
-{
+DBobView::DBobView(){
        nPathCount = 0;
        refCount = 1;
-       
+
        m_bHooked = FALSE;
 
        path = NULL;
@@ -44,18 +43,20 @@ DBobView::DBobView()
        boundingShow = BOUNDS_APEX;
 }
 
-DBobView::~DBobView()
-{
-       if(path)
+DBobView::~DBobView(){
+       if ( path ) {
                delete[] path;
+       }
 
        // oops forgot to remove our eyes, was causing access violation when it tried
        // to talk to it's parent
-       if(eyes)
+       if ( eyes ) {
                delete eyes;
+       }
 
-       if(m_bHooked)
+       if ( m_bHooked ) {
                UnRegister();
+       }
 
        g_PathView = NULL;
 }
@@ -64,181 +65,179 @@ DBobView::~DBobView()
 // Implementation
 //////////////////////////////////////////////////////////////////////
 
-void DBobView::Draw2D(VIEWTYPE vt)
-{
-       if(!path)
+void DBobView::Draw2D( VIEWTYPE vt ){
+       if ( !path ) {
                return;
+       }
 
-       g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
+       g_QglTable.m_pfn_qglPushAttrib( GL_ALL_ATTRIB_BITS );
 
-       g_QglTable.m_pfn_qglDisable(GL_BLEND);
-       g_QglTable.m_pfn_qglEnable(GL_LINE_SMOOTH);
+       g_QglTable.m_pfn_qglDisable( GL_BLEND );
+       g_QglTable.m_pfn_qglEnable( GL_LINE_SMOOTH );
 
        g_QglTable.m_pfn_qglPushMatrix();
-       
-       switch(vt)
+
+       switch ( vt )
        {
        case XY:
                break;
        case XZ:
-               g_QglTable.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f);
+               g_QglTable.m_pfn_qglRotatef( 270.0f, 1.0f, 0.0f, 0.0f );
                break;
        case YZ:
-               g_QglTable.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f);
-               g_QglTable.m_pfn_qglRotatef(270.0f, 0.0f, 0.0f, 1.0f);
+               g_QglTable.m_pfn_qglRotatef( 270.0f, 1.0f, 0.0f, 0.0f );
+               g_QglTable.m_pfn_qglRotatef( 270.0f, 0.0f, 0.0f, 1.0f );
                break;
        }
 
-       g_QglTable.m_pfn_qglLineWidth(1.0f);
-       g_QglTable.m_pfn_qglColor4f(1.0f, 0.0f, 0.0f, 1.0f);
+       g_QglTable.m_pfn_qglLineWidth( 1.0f );
+       g_QglTable.m_pfn_qglColor4f( 1.0f, 0.0f, 0.0f, 1.0f );
 
        int i;
 
-       g_QglTable.m_pfn_qglBegin(GL_LINE_STRIP);
+       g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP );
 
-       for(i = 0; i < nPathCount; i++)
-               g_QglTable.m_pfn_qglVertex3fv(path[i]);
+       for ( i = 0; i < nPathCount; i++ )
+               g_QglTable.m_pfn_qglVertex3fv( path[i] );
 
        g_QglTable.m_pfn_qglEnd();
 
-       if(m_bShowExtra)
-       {
+       if ( m_bShowExtra ) {
                // +mars
                // for the bounding box stuff
-               g_QglTable.m_pfn_qglColor4f(0.25f, 0.75f, 0.75f, 1.0f);
+               g_QglTable.m_pfn_qglColor4f( 0.25f, 0.75f, 0.75f, 1.0f );
 
                g_QglTable.m_pfn_qglTranslatef( 16.0f, 16.0f, 28.0f );
 
                g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP );
-       
-                       for ( i = 0; i < nPathCount; i++ )
-                               g_QglTable.m_pfn_qglVertex3fv( path[i] );
+
+               for ( i = 0; i < nPathCount; i++ )
+                       g_QglTable.m_pfn_qglVertex3fv( path[i] );
 
                g_QglTable.m_pfn_qglEnd();
-       
-       // ---------------
 
-               g_QglTable.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f );       // back to where we were
-               g_QglTable.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f );         // move to new postion
-       
+               // ---------------
+
+               g_QglTable.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f );   // back to where we were
+               g_QglTable.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f );     // move to new postion
+
                g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP );
 
-                       for ( i = 0; i < nPathCount; i++ )
-                               g_QglTable.m_pfn_qglVertex3fv( path[i] );
+               for ( i = 0; i < nPathCount; i++ )
+                       g_QglTable.m_pfn_qglVertex3fv( path[i] );
 
                g_QglTable.m_pfn_qglEnd();
 
-       // --------------
+               // --------------
 
-               g_QglTable.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f );                // back to where we were
-               g_QglTable.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f );                // new pos
+               g_QglTable.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f );        // back to where we were
+               g_QglTable.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f );        // new pos
 
                g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP );
-               
-                       for ( i = 0; i < nPathCount; i++ )
-                               g_QglTable.m_pfn_qglVertex3fv( path[i] );
+
+               for ( i = 0; i < nPathCount; i++ )
+                       g_QglTable.m_pfn_qglVertex3fv( path[i] );
 
                g_QglTable.m_pfn_qglEnd();
 
-       // ----------------
+               // ----------------
 
-               g_QglTable.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f );         // back to where we were
+               g_QglTable.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f );     // back to where we were
 
 /*             g_QglTable.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f );               // new pos
 
-               g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP );
-               
-               if ( boundingShow == BOUNDS_ALL )
-               {
-                       for ( i = 0; i < nPathCount; i++ )
-                               g_QglTable.m_pfn_qglVertex3fv( path[i] );
-               }
-               else if ( boundingShow == BOUNDS_APEX )
-               {
-                       for ( i = (nPathCount/4); i < (nPathCount/4) * 3; i++ )
-                               g_QglTable.m_pfn_qglVertex3fv( path[i] );
-               }
+        g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP );
 
-               g_QglTable.m_pfn_qglEnd();*/ // djbob: er, um doesn't really seem to do anyhting
+        if ( boundingShow == BOUNDS_ALL )
+        {
+            for ( i = 0; i < nPathCount; i++ )
+                g_QglTable.m_pfn_qglVertex3fv( path[i] );
+        }
+        else if ( boundingShow == BOUNDS_APEX )
+        {
+            for ( i = (nPathCount/4); i < (nPathCount/4) * 3; i++ )
+                g_QglTable.m_pfn_qglVertex3fv( path[i] );
+        }
+
+        g_QglTable.m_pfn_qglEnd();*/                                                                                                                                                                                                                                                                                                                                                                                                                   // djbob: er, um doesn't really seem to do anyhting
        }
 
        // -mars
-       
+
        g_QglTable.m_pfn_qglPopMatrix();
 
        g_QglTable.m_pfn_qglPopAttrib();
 }
 
-void DBobView::Draw3D()
-{
-       if(!path)
+void DBobView::Draw3D(){
+       if ( !path ) {
                return;
+       }
 
-       g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
+       g_QglTable.m_pfn_qglPushAttrib( GL_ALL_ATTRIB_BITS );
 
-       g_QglTable.m_pfn_qglDisable(GL_BLEND);
-       g_QglTable.m_pfn_qglEnable(GL_LINE_SMOOTH);
+       g_QglTable.m_pfn_qglDisable( GL_BLEND );
+       g_QglTable.m_pfn_qglEnable( GL_LINE_SMOOTH );
 
-       g_QglTable.m_pfn_qglLineWidth(1.0f);
-       g_QglTable.m_pfn_qglColor4f(1.0f, 0.0f, 0.0f, 1.0f);
+       g_QglTable.m_pfn_qglLineWidth( 1.0f );
+       g_QglTable.m_pfn_qglColor4f( 1.0f, 0.0f, 0.0f, 1.0f );
 
-       g_QglTable.m_pfn_qglBegin(GL_LINE_STRIP);
+       g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP );
 
-       for(int i = 0; i < nPathCount; i++)
-               g_QglTable.m_pfn_qglVertex3fv(path[i]);
+       for ( int i = 0; i < nPathCount; i++ )
+               g_QglTable.m_pfn_qglVertex3fv( path[i] );
 
        g_QglTable.m_pfn_qglEnd();
 
-       if(m_bShowExtra)
-       {
+       if ( m_bShowExtra ) {
                // +mars
                // ahhh -- a nice C&P job :)
                // for the bounding box stuff
-               g_QglTable.m_pfn_qglColor4f(0.25f, 0.75f, 0.75f, 1.0f);
+               g_QglTable.m_pfn_qglColor4f( 0.25f, 0.75f, 0.75f, 1.0f );
 
                g_QglTable.m_pfn_qglTranslatef( 16.0f, 16.0f, 28.0f );
 
                g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP );
-               
-               int i;  
+
+               int i;
                for ( i = 0; i < nPathCount; i++ )
                        g_QglTable.m_pfn_qglVertex3fv( path[i] );
 
                g_QglTable.m_pfn_qglEnd();
-       
-       // ---------------
 
-               g_QglTable.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f );       // back to where we were
-               g_QglTable.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f );         // move to new postion
-       
+               // ---------------
+
+               g_QglTable.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f );   // back to where we were
+               g_QglTable.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f );     // move to new postion
+
                g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP );
-               
-                       for ( i = 0; i < nPathCount; i++ )
-                               g_QglTable.m_pfn_qglVertex3fv( path[i] );
+
+               for ( i = 0; i < nPathCount; i++ )
+                       g_QglTable.m_pfn_qglVertex3fv( path[i] );
 
                g_QglTable.m_pfn_qglEnd();
 
-       // --------------
+               // --------------
 
-               g_QglTable.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f );                // back to where we were
-               g_QglTable.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f );                // new pos
+               g_QglTable.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f );        // back to where we were
+               g_QglTable.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f );        // new pos
 
                g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP );
-               
-                       for ( i = 0; i < nPathCount; i++ )
-                               g_QglTable.m_pfn_qglVertex3fv( path[i] );
+
+               for ( i = 0; i < nPathCount; i++ )
+                       g_QglTable.m_pfn_qglVertex3fv( path[i] );
 
                g_QglTable.m_pfn_qglEnd();
 
-       // ----------------
+               // ----------------
 
-               g_QglTable.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f );         // back to where we were
-               g_QglTable.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f );               // new pos
+               g_QglTable.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f );     // back to where we were
+               g_QglTable.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f );       // new pos
 
                g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP );
-               
-                       for ( i = 0; i < nPathCount; i++ )
-                               g_QglTable.m_pfn_qglVertex3fv( path[i] );
+
+               for ( i = 0; i < nPathCount; i++ )
+                       g_QglTable.m_pfn_qglVertex3fv( path[i] );
 
                g_QglTable.m_pfn_qglEnd();
        }
@@ -247,61 +246,57 @@ void DBobView::Draw3D()
        g_QglTable.m_pfn_qglPopAttrib();
 }
 
-void DBobView::Register()
-{
+void DBobView::Register(){
        g_QglTable.m_pfnHookGL2DWindow( this );
        g_QglTable.m_pfnHookGL3DWindow( this );
        m_bHooked = TRUE;
 }
 
-void DBobView::UnRegister()
-{
+void DBobView::UnRegister(){
        g_QglTable.m_pfnUnHookGL2DWindow( this );
        g_QglTable.m_pfnUnHookGL3DWindow( this );
        m_bHooked = FALSE;
 }
 
-void DBobView::SetPath(vec3_t *pPath)
-{
-       if(path)
+void DBobView::SetPath( vec3_t *pPath ){
+       if ( path ) {
                delete[] path;
+       }
 
        path = pPath;
 }
 
 #define LOCAL_GRAVITY -800.0f
 
-bool DBobView::CalculateTrajectory(vec3_t start, vec3_t apex, float multiplier, int points, float varGravity)
-{
-       if(apex[2] <= start[2])
-       {
-               SetPath(NULL);
+bool DBobView::CalculateTrajectory( vec3_t start, vec3_t apex, float multiplier, int points, float varGravity ){
+       if ( apex[2] <= start[2] ) {
+               SetPath( NULL );
                return FALSE;
        }
        // ----think q3a actually would allow these
        //scrub that, coz the plugin wont :]
 
        vec3_t dist, speed;
-       VectorSubtract(apex, start, dist);
+       VectorSubtract( apex, start, dist );
 
-       vec_t speed_z = (float)sqrt(-2*LOCAL_GRAVITY*dist[2]);
-       float flight_time = -speed_z/LOCAL_GRAVITY;
+       vec_t speed_z = (float)sqrt( -2 * LOCAL_GRAVITY * dist[2] );
+       float flight_time = -speed_z / LOCAL_GRAVITY;
 
 
-       VectorScale(dist, 1/flight_time, speed);
+       VectorScale( dist, 1 / flight_time, speed );
        speed[2] = speed_z;
 
 //     Sys_Printf("Speed: (%.4f %.4f %.4f)\n", speed[0], speed[1], speed[2]);
 
        vec3_t* pPath = new vec3_t[points];
 
-       float interval = multiplier*flight_time/points;
-       for(int i = 0; i < points; i++)
+       float interval = multiplier * flight_time / points;
+       for ( int i = 0; i < points; i++ )
        {
-               float ltime = interval*i;
+               float ltime = interval * i;
 
-               VectorScale(speed, ltime, pPath[i]);
-               VectorAdd(pPath[i], start, pPath[i]);
+               VectorScale( speed, ltime, pPath[i] );
+               VectorAdd( pPath[i], start, pPath[i] );
 
                // could do this all with vectors
                // vGrav = {0, 0, -800.0f}
@@ -310,17 +305,16 @@ bool DBobView::CalculateTrajectory(vec3_t start, vec3_t apex, float multiplier,
                // _VectorAdd(pPath[i], start, pPath[i])
                // _VectorAdd(pPath[i], vAdd, pPath[i])
 
-               pPath[i][2] = start[2] + (speed_z*ltime) + (varGravity*0.5f*ltime*ltime);
+               pPath[i][2] = start[2] + ( speed_z * ltime ) + ( varGravity * 0.5f * ltime * ltime );
        }
 
-       SetPath(pPath);
+       SetPath( pPath );
        return TRUE;
 }
 
-void DBobView::Begin(const char* trigger, const char *target, float multiplier, int points, float varGravity, bool bNoUpdate, bool bShowExtra)
-{
-       strcpy(entTrigger, trigger);
-       strcpy(entTarget, target);
+void DBobView::Begin( const char* trigger, const char *target, float multiplier, int points, float varGravity, bool bNoUpdate, bool bShowExtra ){
+       strcpy( entTrigger, trigger );
+       strcpy( entTarget, target );
 
        fMultiplier = multiplier;
        fVarGravity = varGravity;
@@ -329,10 +323,8 @@ void DBobView::Begin(const char* trigger, const char *target, float multiplier,
 
        Register();
 
-       if(UpdatePath())
-       {
-               if(!bNoUpdate)
-               {
+       if ( UpdatePath() ) {
+               if ( !bNoUpdate ) {
                        eyes = new DListener;
                        eyes->parent = this;
                        eyes->Register();
@@ -340,20 +332,17 @@ void DBobView::Begin(const char* trigger, const char *target, float multiplier,
        }
        else
        {
-               Sys_ERROR("Initialization Failure in DBobView::Begin");
+               Sys_ERROR( "Initialization Failure in DBobView::Begin" );
                delete this;
        }
 }
 
-bool DBobView::UpdatePath()
-{
+bool DBobView::UpdatePath(){
        vec3_t start, apex;
 
-       if(GetEntityCentre(entTrigger, start))
-       {
-               if(GetEntityCentre(entTarget, apex))
-               {
-                       CalculateTrajectory(start, apex, fMultiplier, nPathCount, fVarGravity);
+       if ( GetEntityCentre( entTrigger, start ) ) {
+               if ( GetEntityCentre( entTarget, apex ) ) {
+                       CalculateTrajectory( start, apex, fMultiplier, nPathCount, fVarGravity );
                        return TRUE;
                }
        }
index 9490260..81f2458 100644 (file)
@@ -1,72 +1,76 @@
 /*
-BobToolz plugin for GtkRadiant
-Copyright (C) 2001 Gordon Biggans
+   BobToolz plugin for GtkRadiant
+   Copyright (C) 2001 Gordon Biggans
 
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 // DBobView.h: interface for the DBobView class.
 //
 //////////////////////////////////////////////////////////////////////
 
-#if !defined(AFX_BOBVIEW_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_)
+#if !defined( AFX_BOBVIEW_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_ )
 #define AFX_BOBVIEW_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_
 
 class DListener;
 
-#define BOUNDS_ALL     0
-#define BOUNDS_APEX    1
+#define BOUNDS_ALL  0
+#define BOUNDS_APEX 1
 
 #if _MSC_VER > 1000
 #pragma once
 #endif // _MSC_VER > 1000
 
-class DBobView : 
-       public IGL2DWindow, 
-       public IGL3DWindow  
+class DBobView :
+       public IGL2DWindow,
+       public IGL3DWindow
 {
 public:
-       DBobView();
-       virtual ~DBobView();
+DBobView();
+virtual ~DBobView();
 
 protected:
-       vec3_t* path;
-       int refCount;
+vec3_t* path;
+int refCount;
 public:
-       bool m_bShowExtra;
-       int boundingShow;
-       DListener* eyes;
-       float fVarGravity;
+bool m_bShowExtra;
+int boundingShow;
+DListener* eyes;
+float fVarGravity;
 
-       bool UpdatePath();
-       char entTarget[256];
-       char entTrigger[256];
-       void Begin(const char*, const char*, float, int, float, bool, bool);
-       bool CalculateTrajectory(vec3_t, vec3_t, float, int, float);
+bool UpdatePath();
+char entTarget[256];
+char entTrigger[256];
+void Begin( const char*, const char*, float, int, float, bool, bool );
+bool CalculateTrajectory( vec3_t, vec3_t, float, int, float );
 
-       void SetPath(vec3_t* pPath);
-       void UnRegister();
-       void Register();
-       void Draw3D();
-       void Draw2D(VIEWTYPE vt);
-       void IncRef() { refCount++; }
-       void DecRef() { refCount--; if (refCount <= 0) delete this; }
+void SetPath( vec3_t* pPath );
+void UnRegister();
+void Register();
+void Draw3D();
+void Draw2D( VIEWTYPE vt );
+void IncRef() { refCount++; }
+void DecRef() {
+       refCount--; if ( refCount <= 0 ) {
+               delete this;
+       }
+}
 
-       float fMultiplier;
-       bool m_bHooked;
-       int nPathCount;
+float fMultiplier;
+bool m_bHooked;
+int nPathCount;
 };
 
 #endif // !defined(AFX_BOBVIEW_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_)
index 73ad40a..34afabf 100644 (file)
@@ -1,21 +1,21 @@
 /*
-BobToolz plugin for GtkRadiant
-Copyright (C) 2001 Gordon Biggans
+   BobToolz plugin for GtkRadiant
+   Copyright (C) 2001 Gordon Biggans
 
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 // DBrush.cpp: implementation of the DBrush class.
 //
@@ -37,15 +37,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 // Construction/Destruction
 //////////////////////////////////////////////////////////////////////
 
-DBrush::DBrush(int ID)
-{
+DBrush::DBrush( int ID ){
        m_nBrushID = ID;
        bBoundsBuilt = FALSE;
        QER_brush = NULL;
 }
 
-DBrush::~DBrush()
-{
+DBrush::~DBrush(){
        ClearFaces();
        ClearPoints();
 }
@@ -54,55 +52,52 @@ DBrush::~DBrush()
 // Implementation
 //////////////////////////////////////////////////////////////////////
 
-DPlane* DBrush::AddFace(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* texData)
-{
+DPlane* DBrush::AddFace( vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* texData ){
 #ifdef _DEBUG
 //     Sys_Printf("(%f %f %f) (%f %f %f) (%f %f %f)\n", va[0], va[1], va[2], vb[0], vb[1], vb[2], vc[0], vc[1], vc[2]);
 #endif
        bBoundsBuilt = FALSE;
-       DPlane* newFace = new DPlane(va, vb, vc, texData);
-       faceList.push_back(newFace);
-       
+       DPlane* newFace = new DPlane( va, vb, vc, texData );
+       faceList.push_back( newFace );
+
        return newFace;
 }
 
-int DBrush::BuildPoints()
-{
+int DBrush::BuildPoints(){
        ClearPoints();
-       
-       if(faceList.size() <= 3)        // if less than 3 faces, there can be no points
-               return 0;                                       // with only 3 faces u can't have a bounded soild
 
-       for(list<DPlane *>::const_iterator p1=faceList.begin(); p1!=faceList.end(); p1++)
+       if ( faceList.size() <= 3 ) {  // if less than 3 faces, there can be no points
+               return 0;                   // with only 3 faces u can't have a bounded soild
+
+       }
+       for ( list<DPlane *>::const_iterator p1 = faceList.begin(); p1 != faceList.end(); p1++ )
        {
-               list<DPlane *>::const_iterator p2=p1;
-               for(p2++; p2!=faceList.end(); p2++)
+               list<DPlane *>::const_iterator p2 = p1;
+               for ( p2++; p2 != faceList.end(); p2++ )
                {
-                       list<DPlane *>::const_iterator p3=p2;
-                       for(p3++; p3!=faceList.end(); p3++)
+                       list<DPlane *>::const_iterator p3 = p2;
+                       for ( p3++; p3 != faceList.end(); p3++ )
                        {
                                vec3_t pnt;
-                               if((*p1)->PlaneIntersection(*p2, *p3, pnt))
-                               {
-                                       int pos = PointPosition(pnt);
+                               if ( ( *p1 )->PlaneIntersection( *p2, *p3, pnt ) ) {
+                                       int pos = PointPosition( pnt );
 
-                                       if(pos == POINT_IN_BRUSH)
-                                       {       // ???? shouldn't happen here
-                                               Sys_Printf("ERROR:: Build Brush Points: Point IN brush!!!\n");
+                                       if ( pos == POINT_IN_BRUSH ) { // ???? shouldn't happen here
+                                               Sys_Printf( "ERROR:: Build Brush Points: Point IN brush!!!\n" );
                                        }
-                                       else if(pos == POINT_ON_BRUSH)
-                                       {       // normal point
-                                               if(!HasPoint(pnt))
-                                                       AddPoint(pnt);
+                                       else if ( pos == POINT_ON_BRUSH ) { // normal point
+                                               if ( !HasPoint( pnt ) ) {
+                                                       AddPoint( pnt );
+                                               }
 /*                                             else
-                                                       Sys_Printf("Duplicate Point Found, pyramids ahoy!!!!!\n");*/
+                            Sys_Printf("Duplicate Point Found, pyramids ahoy!!!!!\n");*/
                                                // point lies on more that 3 planes
                                        }
-                                                       
+
                                        // otherwise point is removed due to another plane..
 
-                                       // Sys_Printf("(%f, %f, %f)\n", pnt[0], pnt[1], pnt[2]);                
-                               }       
+                                       // Sys_Printf("(%f, %f, %f)\n", pnt[0], pnt[1], pnt[2]);
+                               }
                        }
                }
        }
@@ -114,106 +109,103 @@ int DBrush::BuildPoints()
        return pointList.size();
 }
 
-void DBrush::LoadFromBrush_t(brush_t* brush, bool textured)
-{
+void DBrush::LoadFromBrush_t( brush_t* brush, bool textured ){
        ClearFaces();
        ClearPoints();
 
-       for(int i = g_FuncTable.m_pfnGetFaceCount(brush)-1; i >= 0 ; i--)
-       {       // running backwards so i dont have to use the count function each time (OPT)
-               _QERFaceData* faceData = g_FuncTable.m_pfnGetFaceData(brush, i);
+       for ( int i = g_FuncTable.m_pfnGetFaceCount( brush ) - 1; i >= 0 ; i-- )
+       {   // running backwards so i dont have to use the count function each time (OPT)
+               _QERFaceData* faceData = g_FuncTable.m_pfnGetFaceData( brush, i );
 
-               if(faceData == NULL)
-                       DoMessageBox("Null pointer returned", "WARNING!", MB_OK);
+               if ( faceData == NULL ) {
+                       DoMessageBox( "Null pointer returned", "WARNING!", MB_OK );
+               }
 
-               if(textured)
-                       AddFace(faceData->m_v1, faceData->m_v2, faceData->m_v3, faceData);
-               else
-                       AddFace(faceData->m_v1, faceData->m_v2, faceData->m_v3, NULL);
+               if ( textured ) {
+                       AddFace( faceData->m_v1, faceData->m_v2, faceData->m_v3, faceData );
+               }
+               else{
+                       AddFace( faceData->m_v1, faceData->m_v2, faceData->m_v3, NULL );
+               }
        }
 
        QER_brush = brush;
 }
 
-int DBrush::PointPosition(vec3_t pnt)
-{
-       int state = POINT_IN_BRUSH;     // if nothing happens point is inside brush
+int DBrush::PointPosition( vec3_t pnt ){
+       int state = POINT_IN_BRUSH; // if nothing happens point is inside brush
 
-       for(list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
+       for ( list<DPlane *>::const_iterator chkPlane = faceList.begin(); chkPlane != faceList.end(); chkPlane++ )
        {
-               float dist = (*chkPlane)->DistanceToPoint(pnt);
+               float dist = ( *chkPlane )->DistanceToPoint( pnt );
 
-               if(dist > MAX_ROUND_ERROR)
-                       return POINT_OUT_BRUSH;         // if point is in front of plane, it CANT be in the brush
-               else if(fabs(dist) < MAX_ROUND_ERROR)
-                       state = POINT_ON_BRUSH;         // if point is ON plane point is either ON the brush 
-                                                                               // or outside it, it can no longer be in it
+               if ( dist > MAX_ROUND_ERROR ) {
+                       return POINT_OUT_BRUSH;     // if point is in front of plane, it CANT be in the brush
+               }
+               else if ( fabs( dist ) < MAX_ROUND_ERROR ) {
+                       state = POINT_ON_BRUSH;     // if point is ON plane point is either ON the brush
+               }
+               // or outside it, it can no longer be in it
        }
 
        return state;
 }
 
-void DBrush::ClearPoints()
-{
-       for(list<DPoint *>::const_iterator deadPoint=pointList.begin(); deadPoint!=pointList.end(); deadPoint++) {
+void DBrush::ClearPoints(){
+       for ( list<DPoint *>::const_iterator deadPoint = pointList.begin(); deadPoint != pointList.end(); deadPoint++ ) {
                delete *deadPoint;
        }
        pointList.clear();
 }
 
-void DBrush::ClearFaces()
-{
+void DBrush::ClearFaces(){
        bBoundsBuilt = FALSE;
-       for(list<DPlane *>::const_iterator deadPlane=faceList.begin(); deadPlane!=faceList.end(); deadPlane++)
+       for ( list<DPlane *>::const_iterator deadPlane = faceList.begin(); deadPlane != faceList.end(); deadPlane++ )
        {
                delete *deadPlane;
        }
        faceList.clear();
 }
 
-void DBrush::AddPoint(vec3_t pnt)
-{
+void DBrush::AddPoint( vec3_t pnt ){
        DPoint* newPoint = new DPoint;
-       VectorCopy(pnt, newPoint->_pnt);
-       pointList.push_back(newPoint);
+       VectorCopy( pnt, newPoint->_pnt );
+       pointList.push_back( newPoint );
 }
 
-bool DBrush::HasPoint(vec3_t pnt)
-{
-       for(list<DPoint *>::const_iterator chkPoint=pointList.begin(); chkPoint!=pointList.end(); chkPoint++)
+bool DBrush::HasPoint( vec3_t pnt ){
+       for ( list<DPoint *>::const_iterator chkPoint = pointList.begin(); chkPoint != pointList.end(); chkPoint++ )
        {
-               if(**chkPoint == pnt)
+               if ( **chkPoint == pnt ) {
                        return TRUE;
+               }
        }
 
        return FALSE;
 }
 
-int DBrush::RemoveRedundantPlanes()
-{
+int DBrush::RemoveRedundantPlanes(){
        int cnt = 0;
        list<DPlane *>::iterator chkPlane;
 
        // find duplicate planes
-       list<DPlane *>::iterator p1=faceList.begin();
+       list<DPlane *>::iterator p1 = faceList.begin();
 
-       while( p1!=faceList.end() )
+       while ( p1 != faceList.end() )
        {
                list<DPlane *>::iterator p2 = p1;
 
-               for(p2++; p2!=faceList.end(); p2++)
+               for ( p2++; p2 != faceList.end(); p2++ )
                {
-                       if(**p1 == **p2)
-                       {
-                               if(!strcmp((*p1)->texInfo.m_TextureName, "textures/common/caulk"))
-                               {
+                       if ( **p1 == **p2 ) {
+                               if ( !strcmp( ( *p1 )->texInfo.m_TextureName, "textures/common/caulk" ) ) {
                                        delete *p1;
-                                       p1 = faceList.erase(p1);        // duplicate plane
+                                       p1 = faceList.erase( p1 );    // duplicate plane
                                }
                                else
                                {
                                        delete *p2;
-                                       p2 = faceList.erase(p2);        // duplicate plane
+                                       p2 = faceList.erase( p2 );    // duplicate plane
                                }
 
                                cnt++;
@@ -221,186 +213,195 @@ int DBrush::RemoveRedundantPlanes()
                        }
                }
 
-               if( p2 == faceList.end() )
+               if ( p2 == faceList.end() ) {
                        p1++;
+               }
        }
-               
+
        //+djbob kill planes with bad normal, they are more of a nuisance than losing a brush
-       chkPlane=faceList.begin();
-       while( chkPlane!=faceList.end() )
+       chkPlane = faceList.begin();
+       while ( chkPlane != faceList.end() )
        {
-               if(VectorLength((*chkPlane)->normal) == 0) // plane has bad normal
-               {
+               if ( VectorLength( ( *chkPlane )->normal ) == 0 ) { // plane has bad normal
                        delete *chkPlane;
-                       chkPlane = faceList.erase(chkPlane);
+                       chkPlane = faceList.erase( chkPlane );
                        cnt++;
-               } else {
+               }
+               else {
                        chkPlane++;
                }
        }
        //-djbob
-       
-       if(pointList.size() == 0) // if points may not have been built, build them
+
+       if ( pointList.size() == 0 ) { // if points may not have been built, build them
 /*             if(BuildPoints() == 0)  // just let the planes die if they are all bad
-                       return cnt;*/
-                       BuildPoints();
+            return cnt;*/
+               BuildPoints();
+       }
 
-       chkPlane=faceList.begin();
-       while(chkPlane != faceList.end())
+       chkPlane = faceList.begin();
+       while ( chkPlane != faceList.end() )
        {
-               if((*chkPlane)->IsRedundant(pointList)) // checks that plane "0wnz" :), 3 or more points
-               {
+               if ( ( *chkPlane )->IsRedundant( pointList ) ) { // checks that plane "0wnz" :), 3 or more points
                        delete *chkPlane;
-                       chkPlane = faceList.erase(chkPlane);
+                       chkPlane = faceList.erase( chkPlane );
                        cnt++;
-               } 
-               else 
+               }
+               else{
                        chkPlane++;
+               }
        }
 
        return cnt;
 }
 
-bool DBrush::GetBounds(vec3_t min, vec3_t max)
-{
+bool DBrush::GetBounds( vec3_t min, vec3_t max ){
        BuildBounds();
 
-       if(!bBoundsBuilt)
+       if ( !bBoundsBuilt ) {
                return FALSE;
+       }
 
-       VectorCopy(bbox_min, min);
-       VectorCopy(bbox_max, max);
+       VectorCopy( bbox_min, min );
+       VectorCopy( bbox_max, max );
 
        return TRUE;
 }
 
-bool DBrush::BBoxCollision(DBrush* chkBrush)
-{
+bool DBrush::BBoxCollision( DBrush* chkBrush ){
        vec3_t min1, min2;
        vec3_t max1, max2;
 
-       GetBounds(min1, max1);
-       chkBrush->GetBounds(min2, max2);
+       GetBounds( min1, max1 );
+       chkBrush->GetBounds( min2, max2 );
 
-       if(min1[0] >= max2[0])
+       if ( min1[0] >= max2[0] ) {
                return FALSE;
-       if(min1[1] >= max2[1])
+       }
+       if ( min1[1] >= max2[1] ) {
                return FALSE;
-       if(min1[2] >= max2[2])
+       }
+       if ( min1[2] >= max2[2] ) {
                return FALSE;
+       }
 
-       if(max1[0] <= min2[0])
+       if ( max1[0] <= min2[0] ) {
                return FALSE;
-       if(max1[1] <= min2[1])
+       }
+       if ( max1[1] <= min2[1] ) {
                return FALSE;
-       if(max1[2] <= min2[2])
+       }
+       if ( max1[2] <= min2[2] ) {
                return FALSE;
+       }
 
        return TRUE;
 }
 
-DPlane* DBrush::HasPlane(DPlane* chkPlane)
-{
-       for(list<DPlane *>::const_iterator brushPlane=faceList.begin(); brushPlane!=faceList.end(); brushPlane++)
+DPlane* DBrush::HasPlane( DPlane* chkPlane ){
+       for ( list<DPlane *>::const_iterator brushPlane = faceList.begin(); brushPlane != faceList.end(); brushPlane++ )
        {
-               if(**brushPlane == *chkPlane)
+               if ( **brushPlane == *chkPlane ) {
                        return *brushPlane;
+               }
        }
        return NULL;
 }
 
-bool DBrush::IsCutByPlane(DPlane *cuttingPlane)
-{
+bool DBrush::IsCutByPlane( DPlane *cuttingPlane ){
        bool isInFront;
 
-       if(pointList.size() == 0)
-               if(BuildPoints() == 0)
+       if ( pointList.size() == 0 ) {
+               if ( BuildPoints() == 0 ) {
                        return FALSE;
+               }
+       }
 
        list<DPoint *>::const_iterator chkPnt = pointList.begin();
 
-       if(chkPnt == pointList.end())
+       if ( chkPnt == pointList.end() ) {
                return FALSE;
+       }
 
-       float dist = cuttingPlane->DistanceToPoint((*chkPnt)->_pnt);
+       float dist = cuttingPlane->DistanceToPoint( ( *chkPnt )->_pnt );
 
-       if(dist > MAX_ROUND_ERROR)
+       if ( dist > MAX_ROUND_ERROR ) {
                isInFront = FALSE;
-       else if(dist < MAX_ROUND_ERROR)
+       }
+       else if ( dist < MAX_ROUND_ERROR ) {
                isInFront = TRUE;
-       else
+       }
+       else{
                return TRUE;
+       }
 
-       for(chkPnt++=pointList.begin(); chkPnt!=pointList.end(); chkPnt++)
+       for ( chkPnt++ = pointList.begin(); chkPnt != pointList.end(); chkPnt++ )
        {
-               dist = cuttingPlane->DistanceToPoint((*chkPnt)->_pnt);
+               dist = cuttingPlane->DistanceToPoint( ( *chkPnt )->_pnt );
 
-               if(dist > MAX_ROUND_ERROR)
-               {
-                       if(isInFront)
+               if ( dist > MAX_ROUND_ERROR ) {
+                       if ( isInFront ) {
                                return TRUE;
+                       }
                }
-               else if(dist < MAX_ROUND_ERROR)
-               {
-                       if(!isInFront)
+               else if ( dist < MAX_ROUND_ERROR ) {
+                       if ( !isInFront ) {
                                return TRUE;
+                       }
                }
-               else
+               else{
                        return TRUE;
+               }
        }
 
        return FALSE;
 }
 
-brush_t* DBrush::BuildInRadiant(bool allowDestruction, int* changeCnt, entity_t* entity)
-{
-       if(allowDestruction)
-       {
+brush_t* DBrush::BuildInRadiant( bool allowDestruction, int* changeCnt, entity_t* entity ){
+       if ( allowDestruction ) {
                bool kill = TRUE;
-               
-               for(list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
+
+               for ( list<DPlane *>::const_iterator chkPlane = faceList.begin(); chkPlane != faceList.end(); chkPlane++ )
                {
-                       if((*chkPlane)->m_bChkOk)
-                       {
+                       if ( ( *chkPlane )->m_bChkOk ) {
                                kill = FALSE;
                                break;
                        }
                }
-               if(kill)
+               if ( kill ) {
                        return NULL;
+               }
        }
 
        //+djbob: fixed bug when brush had no faces "phantom brush" in radiant.
-       if(faceList.size() < 4)
-       {
-               Sys_Printf("Possible Phantom Brush Found, will not rebuild\n");
+       if ( faceList.size() < 4 ) {
+               Sys_Printf( "Possible Phantom Brush Found, will not rebuild\n" );
                return NULL;
        }
        //-djbob
 
        QER_brush = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle();
 
-       for(list<DPlane *>::const_iterator buildPlane=faceList.begin(); buildPlane!=faceList.end(); buildPlane++) {
-               if((*buildPlane)->AddToBrush_t(QER_brush) && changeCnt) {
-                       (*changeCnt)++;
+       for ( list<DPlane *>::const_iterator buildPlane = faceList.begin(); buildPlane != faceList.end(); buildPlane++ ) {
+               if ( ( *buildPlane )->AddToBrush_t( QER_brush ) && changeCnt ) {
+                       ( *changeCnt )++;
                }
        }
 
-       if(entity) {
-               g_FuncTable.m_pfnCommitBrushHandleToEntity(QER_brush, entity);
-               g_BrushTable.m_pfnBrush_Build(QER_brush, false, false, false, false);
-               g_BrushTable.m_pfnBrush_AddToList(QER_brush, g_AppDataTable.m_pfnSelectedBrushes());
-       } else {
-               g_FuncTable.m_pfnCommitBrushHandle(QER_brush);
+       if ( entity ) {
+               g_FuncTable.m_pfnCommitBrushHandleToEntity( QER_brush, entity );
+               g_BrushTable.m_pfnBrush_Build( QER_brush, false, false, false, false );
+               g_BrushTable.m_pfnBrush_AddToList( QER_brush, g_AppDataTable.m_pfnSelectedBrushes() );
+       }
+       else {
+               g_FuncTable.m_pfnCommitBrushHandle( QER_brush );
        }
 
        return QER_brush;
 }
 
-void DBrush::CutByPlane(DPlane *cutPlane, DBrush **newBrush1, DBrush **newBrush2)
-{
-       if(!IsCutByPlane(cutPlane))
-       {
+void DBrush::CutByPlane( DPlane *cutPlane, DBrush **newBrush1, DBrush **newBrush2 ){
+       if ( !IsCutByPlane( cutPlane ) ) {
                *newBrush1 = NULL;
                *newBrush2 = NULL;
                return;
@@ -408,15 +409,15 @@ void DBrush::CutByPlane(DPlane *cutPlane, DBrush **newBrush1, DBrush **newBrush2
 
        DBrush* b1 = new DBrush;
        DBrush* b2 = new DBrush;
-       
-       for(list<DPlane *>::const_iterator parsePlane=faceList.begin(); parsePlane!=faceList.end(); parsePlane++)
+
+       for ( list<DPlane *>::const_iterator parsePlane = faceList.begin(); parsePlane != faceList.end(); parsePlane++ )
        {
-               b1->AddFace((*parsePlane)->points[0], (*parsePlane)->points[1], (*parsePlane)->points[2], NULL);
-               b2->AddFace((*parsePlane)->points[0], (*parsePlane)->points[1], (*parsePlane)->points[2], NULL);
+               b1->AddFace( ( *parsePlane )->points[0], ( *parsePlane )->points[1], ( *parsePlane )->points[2], NULL );
+               b2->AddFace( ( *parsePlane )->points[0], ( *parsePlane )->points[1], ( *parsePlane )->points[2], NULL );
        }
 
-       b1->AddFace(cutPlane->points[0], cutPlane->points[1], cutPlane->points[2], NULL);
-       b2->AddFace(cutPlane->points[2], cutPlane->points[1], cutPlane->points[0], NULL);
+       b1->AddFace( cutPlane->points[0], cutPlane->points[1], cutPlane->points[2], NULL );
+       b2->AddFace( cutPlane->points[2], cutPlane->points[1], cutPlane->points[0], NULL );
 
        b1->RemoveRedundantPlanes();
        b2->RemoveRedundantPlanes();
@@ -425,68 +426,72 @@ void DBrush::CutByPlane(DPlane *cutPlane, DBrush **newBrush1, DBrush **newBrush2
        *newBrush2 = b2;
 }
 
-bool DBrush::IntersectsWith(DBrush *chkBrush)
-{
-       if(pointList.size() == 0)
-               if(BuildPoints() == 0)
-                       return FALSE;   // invalid brush!!!!
+bool DBrush::IntersectsWith( DBrush *chkBrush ){
+       if ( pointList.size() == 0 ) {
+               if ( BuildPoints() == 0 ) {
+                       return FALSE;   // invalid brush!!!!
+
+               }
+       }
+       if ( chkBrush->pointList.size() == 0 ) {
+               if ( chkBrush->BuildPoints() == 0 ) {
+                       return FALSE;   // invalid brush!!!!
 
-       if(chkBrush->pointList.size() == 0)
-               if(chkBrush->BuildPoints() == 0)
-                       return FALSE;   // invalid brush!!!!
-       
-       if(!BBoxCollision(chkBrush))
+               }
+       }
+       if ( !BBoxCollision( chkBrush ) ) {
                return FALSE;
+       }
 
        list<DPlane *>::const_iterator iplPlane;
 
-       for( iplPlane=faceList.begin(); iplPlane!=faceList.end(); iplPlane++)
+       for ( iplPlane = faceList.begin(); iplPlane != faceList.end(); iplPlane++ )
        {
 
                bool allInFront = TRUE;
-               for(list<DPoint *>::const_iterator iPoint=chkBrush->pointList.begin(); iPoint!=chkBrush->pointList.end(); iPoint++)
+               for ( list<DPoint *>::const_iterator iPoint = chkBrush->pointList.begin(); iPoint != chkBrush->pointList.end(); iPoint++ )
                {
-                       if((*iplPlane)->DistanceToPoint((*iPoint)->_pnt) < -MAX_ROUND_ERROR)
-                       {
+                       if ( ( *iplPlane )->DistanceToPoint( ( *iPoint )->_pnt ) < -MAX_ROUND_ERROR ) {
                                allInFront = FALSE;
                                break;
                        }
                }
-               if(allInFront)
+               if ( allInFront ) {
                        return FALSE;
+               }
        }
 
-       for( iplPlane=chkBrush->faceList.begin(); iplPlane!=chkBrush->faceList.end(); iplPlane++)
+       for ( iplPlane = chkBrush->faceList.begin(); iplPlane != chkBrush->faceList.end(); iplPlane++ )
        {
                bool allInFront = TRUE;
-               for(list<DPoint *>::const_iterator iPoint=pointList.begin(); iPoint!=pointList.end(); iPoint++)
+               for ( list<DPoint *>::const_iterator iPoint = pointList.begin(); iPoint != pointList.end(); iPoint++ )
                {
-                       if((*iplPlane)->DistanceToPoint((*iPoint)->_pnt) < -MAX_ROUND_ERROR)
-                       {
+                       if ( ( *iplPlane )->DistanceToPoint( ( *iPoint )->_pnt ) < -MAX_ROUND_ERROR ) {
                                allInFront = FALSE;
                                break;
                        }
                }
-               if(allInFront)
+               if ( allInFront ) {
                        return FALSE;
+               }
        }
 
        return TRUE;
 }
 
-bool DBrush::IntersectsWith(DPlane* p1, DPlane* p2, vec3_t v) {
+bool DBrush::IntersectsWith( DPlane* p1, DPlane* p2, vec3_t v ) {
        vec3_t vDown = { 0, 0, -1 };
 
        list<DPlane *>::const_iterator iplPlane;
-       for( iplPlane = faceList.begin(); iplPlane != faceList.end(); iplPlane++) {
-               DPlane* p = (*iplPlane);
-               
+       for ( iplPlane = faceList.begin(); iplPlane != faceList.end(); iplPlane++ ) {
+               DPlane* p = ( *iplPlane );
+
                vec_t d = DotProduct( p->normal, vDown );
-               if( d >= 0 ) {
+               if ( d >= 0 ) {
                        continue;
                }
-               if(p->PlaneIntersection(p1, p2, v)) {
-                       if(PointPosition( v ) != POINT_OUT_BRUSH) {
+               if ( p->PlaneIntersection( p1, p2, v ) ) {
+                       if ( PointPosition( v ) != POINT_OUT_BRUSH ) {
                                return TRUE;
                        }
                }
@@ -495,150 +500,162 @@ bool DBrush::IntersectsWith(DPlane* p1, DPlane* p2, vec3_t v) {
        return FALSE;
 }
 
-void DBrush::BuildBounds()
-{
-       if(!bBoundsBuilt)
-       {
-               if(pointList.size() == 0) // if points may not have been built, build them
-                       if(BuildPoints() == 0)
+void DBrush::BuildBounds(){
+       if ( !bBoundsBuilt ) {
+               if ( pointList.size() == 0 ) { // if points may not have been built, build them
+                       if ( BuildPoints() == 0 ) {
                                return;
-       
+                       }
+               }
+
                list<DPoint *>::const_iterator first = pointList.begin();
-               VectorCopy((*first)->_pnt, bbox_min);
-               VectorCopy((*first)->_pnt, bbox_max);
+               VectorCopy( ( *first )->_pnt, bbox_min );
+               VectorCopy( ( *first )->_pnt, bbox_max );
 
-               list<DPoint *>::const_iterator point=pointList.begin();
-               for( point++; point!=pointList.end(); point++)
+               list<DPoint *>::const_iterator point = pointList.begin();
+               for ( point++; point != pointList.end(); point++ )
                {
-                       if((*point)->_pnt[0] > bbox_max[0])
-                               bbox_max[0] = (*point)->_pnt[0];
-                       if((*point)->_pnt[1] > bbox_max[1])
-                               bbox_max[1] = (*point)->_pnt[1];
-                       if((*point)->_pnt[2] > bbox_max[2])
-                               bbox_max[2] = (*point)->_pnt[2];
+                       if ( ( *point )->_pnt[0] > bbox_max[0] ) {
+                               bbox_max[0] = ( *point )->_pnt[0];
+                       }
+                       if ( ( *point )->_pnt[1] > bbox_max[1] ) {
+                               bbox_max[1] = ( *point )->_pnt[1];
+                       }
+                       if ( ( *point )->_pnt[2] > bbox_max[2] ) {
+                               bbox_max[2] = ( *point )->_pnt[2];
+                       }
 
-                       if((*point)->_pnt[0] < bbox_min[0])
-                               bbox_min[0] = (*point)->_pnt[0];
-                       if((*point)->_pnt[1] < bbox_min[1])
-                               bbox_min[1] = (*point)->_pnt[1];
-                       if((*point)->_pnt[2] < bbox_min[2])
-                               bbox_min[2] = (*point)->_pnt[2];
+                       if ( ( *point )->_pnt[0] < bbox_min[0] ) {
+                               bbox_min[0] = ( *point )->_pnt[0];
+                       }
+                       if ( ( *point )->_pnt[1] < bbox_min[1] ) {
+                               bbox_min[1] = ( *point )->_pnt[1];
+                       }
+                       if ( ( *point )->_pnt[2] < bbox_min[2] ) {
+                               bbox_min[2] = ( *point )->_pnt[2];
+                       }
                }
 
                bBoundsBuilt = TRUE;
        }
 }
 
-bool DBrush::BBoxTouch(DBrush *chkBrush)
-{
+bool DBrush::BBoxTouch( DBrush *chkBrush ){
        vec3_t min1, min2;
        vec3_t max1, max2;
 
-       GetBounds(min1, max1);
-       chkBrush->GetBounds(min2, max2);
+       GetBounds( min1, max1 );
+       chkBrush->GetBounds( min2, max2 );
 
-       if((min1[0] - max2[0]) > MAX_ROUND_ERROR)
+       if ( ( min1[0] - max2[0] ) > MAX_ROUND_ERROR ) {
                return FALSE;
-       if((min1[1] - max2[1]) > MAX_ROUND_ERROR)
+       }
+       if ( ( min1[1] - max2[1] ) > MAX_ROUND_ERROR ) {
                return FALSE;
-       if((min1[2] - max2[2]) > MAX_ROUND_ERROR)
+       }
+       if ( ( min1[2] - max2[2] ) > MAX_ROUND_ERROR ) {
                return FALSE;
+       }
 
-       if((min2[0] - max1[0]) > MAX_ROUND_ERROR)
+       if ( ( min2[0] - max1[0] ) > MAX_ROUND_ERROR ) {
                return FALSE;
-       if((min2[1] - max1[1]) > MAX_ROUND_ERROR)
+       }
+       if ( ( min2[1] - max1[1] ) > MAX_ROUND_ERROR ) {
                return FALSE;
-       if((min2[2] - max1[2]) > MAX_ROUND_ERROR)
+       }
+       if ( ( min2[2] - max1[2] ) > MAX_ROUND_ERROR ) {
                return FALSE;
+       }
 
        int cnt = 0;
 
-       if((min2[0] - max1[0]) == 0)
+       if ( ( min2[0] - max1[0] ) == 0 ) {
                cnt++;
+       }
 
-       if((min2[1] - max1[1]) == 0)
+       if ( ( min2[1] - max1[1] ) == 0 ) {
                cnt++;
+       }
 
-       if((min2[2] - max1[2]) == 0)
+       if ( ( min2[2] - max1[2] ) == 0 ) {
                cnt++;
+       }
 
-       if((min1[0] - max2[0]) == 0)
+       if ( ( min1[0] - max2[0] ) == 0 ) {
                cnt++;
+       }
 
-       if((min1[1] - max2[1]) == 0)
+       if ( ( min1[1] - max2[1] ) == 0 ) {
                cnt++;
+       }
 
-       if((min1[2] - max2[2]) == 0)
+       if ( ( min1[2] - max2[2] ) == 0 ) {
                cnt++;
+       }
 
-       if(cnt > 1)
+       if ( cnt > 1 ) {
                return FALSE;
+       }
 
        return TRUE;
 }
 
-void DBrush::ResetChecks(list<Str>* exclusionList)
-{
-       for(list<DPlane *>::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++)
+void DBrush::ResetChecks( list<Str>* exclusionList ){
+       for ( list<DPlane *>::const_iterator resetPlane = faceList.begin(); resetPlane != faceList.end(); resetPlane++ )
        {
                bool set = FALSE;
 
-               if(exclusionList)
-               {
-                       for(list<Str>::iterator eTexture = exclusionList->begin(); eTexture != exclusionList->end(); eTexture++)
+               if ( exclusionList ) {
+                       for ( list<Str>::iterator eTexture = exclusionList->begin(); eTexture != exclusionList->end(); eTexture++ )
                        {
-                               if(strstr((*resetPlane)->texInfo.m_TextureName, eTexture->GetBuffer()))
-                               {
+                               if ( strstr( ( *resetPlane )->texInfo.m_TextureName, eTexture->GetBuffer() ) ) {
                                        set = TRUE;
                                        break;
                                }
                        }
                }
 
-               (*resetPlane)->m_bChkOk = set;
+               ( *resetPlane )->m_bChkOk = set;
        }
 }
 
-DPlane* DBrush::HasPlaneInverted(DPlane *chkPlane)
-{
-       for(list<DPlane *>::const_iterator brushPlane=faceList.begin(); brushPlane!=faceList.end(); brushPlane++)
+DPlane* DBrush::HasPlaneInverted( DPlane *chkPlane ){
+       for ( list<DPlane *>::const_iterator brushPlane = faceList.begin(); brushPlane != faceList.end(); brushPlane++ )
        {
-               if(**brushPlane != *chkPlane)
-               {
-                       if(fabs((*brushPlane)->_d + chkPlane->_d) < 0.1)
-                               return (*brushPlane);
+               if ( **brushPlane != *chkPlane ) {
+                       if ( fabs( ( *brushPlane )->_d + chkPlane->_d ) < 0.1 ) {
+                               return ( *brushPlane );
+                       }
                }
        }
        return NULL;
 }
 
-bool DBrush::HasTexture(const char *textureName)
-{
-       for(list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
+bool DBrush::HasTexture( const char *textureName ){
+       for ( list<DPlane *>::const_iterator chkPlane = faceList.begin(); chkPlane != faceList.end(); chkPlane++ )
        {
-               if(strstr((*chkPlane)->texInfo.m_TextureName, textureName))
+               if ( strstr( ( *chkPlane )->texInfo.m_TextureName, textureName ) ) {
                        return TRUE;
+               }
 
        }
        return FALSE;
 }
 
-bool DBrush::IsDetail()
-{
-       for(list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
+bool DBrush::IsDetail(){
+       for ( list<DPlane *>::const_iterator chkPlane = faceList.begin(); chkPlane != faceList.end(); chkPlane++ )
        {
-               if((*chkPlane)->texInfo.m_nContents & FACE_DETAIL)
+               if ( ( *chkPlane )->texInfo.m_nContents & FACE_DETAIL ) {
                        return TRUE;
+               }
 
        }
        return FALSE;
 }
 
-void DBrush::BuildFromWinding(DWinding *w)
-{
-       if(w->numpoints < 3)
-       {
-               Sys_ERROR("Winding has invalid number of points");
+void DBrush::BuildFromWinding( DWinding *w ){
+       if ( w->numpoints < 3 ) {
+               Sys_ERROR( "Winding has invalid number of points" );
                return;
        }
 
@@ -647,89 +664,89 @@ void DBrush::BuildFromWinding(DWinding *w)
        DWinding* w2;
        w2 = w->CopyWinding();
        int i;
-       for(i = 0; i < w2->numpoints; i++)
-               VectorAdd(w2->p[i], wPlane->normal, w2->p[i]);
+       for ( i = 0; i < w2->numpoints; i++ )
+               VectorAdd( w2->p[i], wPlane->normal, w2->p[i] );
 
-       AddFace(w2->p[0], w2->p[1], w2->p[2], NULL);
-       AddFace(w->p[2], w->p[1], w->p[0], NULL);
+       AddFace( w2->p[0], w2->p[1], w2->p[2], NULL );
+       AddFace( w->p[2], w->p[1], w->p[0], NULL );
 
-       for(i = 0; i < w->numpoints-1; i++)
-               AddFace(w2->p[i], w->p[i], w->p[i+1], NULL);
-       AddFace(w2->p[w->numpoints-1], w->p[w->numpoints-1], w->p[0], NULL);
+       for ( i = 0; i < w->numpoints - 1; i++ )
+               AddFace( w2->p[i], w->p[i], w->p[i + 1], NULL );
+       AddFace( w2->p[w->numpoints - 1], w->p[w->numpoints - 1], w->p[0], NULL );
 
        delete wPlane;
        delete w2;
 }
 
-void DBrush::SaveToFile(FILE *pFile)
-{
-       fprintf(pFile, "{\n");
+void DBrush::SaveToFile( FILE *pFile ){
+       fprintf( pFile, "{\n" );
 
-       for(list<DPlane *>::const_iterator pp=faceList.begin(); pp!=faceList.end(); pp++)
+       for ( list<DPlane *>::const_iterator pp = faceList.begin(); pp != faceList.end(); pp++ )
        {
                char buffer[512];
 
-               sprintf(buffer, "( %.0f %.0f %.0f ) ( %.0f %.0f %.0f ) ( %.0f %.0f %.0f ) %s %.0f %.0f %f %f %.0f 0 0 0\n",
-                       (*pp)->points[0][0], (*pp)->points[0][1], (*pp)->points[0][2], 
-                       (*pp)->points[1][0], (*pp)->points[1][1], (*pp)->points[1][2], 
-                       (*pp)->points[2][0], (*pp)->points[2][1], (*pp)->points[2][2], 
-                       (*pp)->texInfo.m_TextureName,
-                       (*pp)->texInfo.m_fShift[0], (*pp)->texInfo.m_fShift[1], 
-                       (*pp)->texInfo.m_fScale[0], (*pp)->texInfo.m_fScale[0], 
-                       (*pp)->texInfo.m_fRotate);
+               sprintf( buffer, "( %.0f %.0f %.0f ) ( %.0f %.0f %.0f ) ( %.0f %.0f %.0f ) %s %.0f %.0f %f %f %.0f 0 0 0\n",
+                                ( *pp )->points[0][0], ( *pp )->points[0][1], ( *pp )->points[0][2],
+                                ( *pp )->points[1][0], ( *pp )->points[1][1], ( *pp )->points[1][2],
+                                ( *pp )->points[2][0], ( *pp )->points[2][1], ( *pp )->points[2][2],
+                                ( *pp )->texInfo.m_TextureName,
+                                ( *pp )->texInfo.m_fShift[0], ( *pp )->texInfo.m_fShift[1],
+                                ( *pp )->texInfo.m_fScale[0], ( *pp )->texInfo.m_fScale[0],
+                                ( *pp )->texInfo.m_fRotate );
 
-               fprintf(pFile, buffer);
+               fprintf( pFile, buffer );
        }
 
-       fprintf(pFile, "}\n");
+       fprintf( pFile, "}\n" );
 }
 
-void DBrush::Rotate(vec3_t vOrigin, vec3_t vRotation)
-{
-       for(list<DPlane *>::const_iterator rotPlane=faceList.begin(); rotPlane!=faceList.end(); rotPlane++)
+void DBrush::Rotate( vec3_t vOrigin, vec3_t vRotation ){
+       for ( list<DPlane *>::const_iterator rotPlane = faceList.begin(); rotPlane != faceList.end(); rotPlane++ )
        {
-               for(int i = 0; i < 3; i++)
-                       VectorRotate((*rotPlane)->points[i], vRotation, vOrigin);
+               for ( int i = 0; i < 3; i++ )
+                       VectorRotate( ( *rotPlane )->points[i], vRotation, vOrigin );
 
-               (*rotPlane)->Rebuild();
+               ( *rotPlane )->Rebuild();
        }
 }
 
-void DBrush::RotateAboutCentre(vec3_t vRotation)
-{
+void DBrush::RotateAboutCentre( vec3_t vRotation ){
        vec3_t min, max, centre;
-       GetBounds(min, max);
-       VectorAdd(min, max, centre);
-       VectorScale(centre, 0.5f, centre);
+       GetBounds( min, max );
+       VectorAdd( min, max, centre );
+       VectorScale( centre, 0.5f, centre );
 
-       Rotate(centre, vRotation);
+       Rotate( centre, vRotation );
 }
 
-bool DBrush::ResetTextures(const char* textureName, float fScale[2],    float fShift[2],    int rotation, const char* newTextureName, 
-                           int bResetTextureName,   int bResetScale[2], int bResetShift[2], int bResetRotation)
-{
-       if(textureName)
-       {
+bool DBrush::ResetTextures( const char* textureName, float fScale[2],    float fShift[2],    int rotation, const char* newTextureName,
+                                                       int bResetTextureName,   int bResetScale[2], int bResetShift[2], int bResetRotation ){
+       if ( textureName ) {
                bool changed = FALSE;
-               for(list<DPlane *>::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++)
+               for ( list<DPlane *>::const_iterator resetPlane = faceList.begin(); resetPlane != faceList.end(); resetPlane++ )
                {
-                       if(!strcmp((*resetPlane)->texInfo.m_TextureName, textureName))
-                       {
-        if(bResetTextureName)
-                                 strcpy((*resetPlane)->texInfo.m_TextureName, newTextureName);
+                       if ( !strcmp( ( *resetPlane )->texInfo.m_TextureName, textureName ) ) {
+                               if ( bResetTextureName ) {
+                                       strcpy( ( *resetPlane )->texInfo.m_TextureName, newTextureName );
+                               }
 
-                               if(bResetScale[0])
-                                       (*resetPlane)->texInfo.m_fScale[0] = fScale[0];
-                               if(bResetScale[1])
-                                       (*resetPlane)->texInfo.m_fScale[1] = fScale[1];
+                               if ( bResetScale[0] ) {
+                                       ( *resetPlane )->texInfo.m_fScale[0] = fScale[0];
+                               }
+                               if ( bResetScale[1] ) {
+                                       ( *resetPlane )->texInfo.m_fScale[1] = fScale[1];
+                               }
 
-                               if(bResetShift[0])
-                                       (*resetPlane)->texInfo.m_fShift[0] = fShift[0];
-                               if(bResetShift[1])
-                                       (*resetPlane)->texInfo.m_fShift[1] = fShift[1];
+                               if ( bResetShift[0] ) {
+                                       ( *resetPlane )->texInfo.m_fShift[0] = fShift[0];
+                               }
+                               if ( bResetShift[1] ) {
+                                       ( *resetPlane )->texInfo.m_fShift[1] = fShift[1];
+                               }
 
-                               if(bResetRotation)
-                                       (*resetPlane)->texInfo.m_fRotate = (float)rotation;
+                               if ( bResetRotation ) {
+                                       ( *resetPlane )->texInfo.m_fRotate = (float)rotation;
+                               }
 
                                changed = TRUE;
                        }
@@ -738,53 +755,59 @@ bool DBrush::ResetTextures(const char* textureName, float fScale[2],    float fS
        }
        else
        {
-               for(list<DPlane *>::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++)
+               for ( list<DPlane *>::const_iterator resetPlane = faceList.begin(); resetPlane != faceList.end(); resetPlane++ )
                {
-        if(bResetTextureName)
-                                 strcpy((*resetPlane)->texInfo.m_TextureName, newTextureName);
+                       if ( bResetTextureName ) {
+                               strcpy( ( *resetPlane )->texInfo.m_TextureName, newTextureName );
+                       }
 
-                               if(bResetScale[0])
-                                       (*resetPlane)->texInfo.m_fScale[0] = fScale[0];
-                               if(bResetScale[1])
-                                       (*resetPlane)->texInfo.m_fScale[1] = fScale[1];
+                       if ( bResetScale[0] ) {
+                               ( *resetPlane )->texInfo.m_fScale[0] = fScale[0];
+                       }
+                       if ( bResetScale[1] ) {
+                               ( *resetPlane )->texInfo.m_fScale[1] = fScale[1];
+                       }
 
-                               if(bResetShift[0])
-                                       (*resetPlane)->texInfo.m_fShift[0] = fShift[0];
-                               if(bResetShift[1])
-                                       (*resetPlane)->texInfo.m_fShift[1] = fShift[1];
+                       if ( bResetShift[0] ) {
+                               ( *resetPlane )->texInfo.m_fShift[0] = fShift[0];
+                       }
+                       if ( bResetShift[1] ) {
+                               ( *resetPlane )->texInfo.m_fShift[1] = fShift[1];
+                       }
 
-                               if(bResetRotation)
-                                       (*resetPlane)->texInfo.m_fRotate = (float)rotation;
+                       if ( bResetRotation ) {
+                               ( *resetPlane )->texInfo.m_fRotate = (float)rotation;
+                       }
                }
                return TRUE;
        }
 }
 
-bool DBrush::operator ==(DBrush* other)
-{
+bool DBrush::operator ==( DBrush* other ){
        list<DPlane *>::const_iterator chkPlane;
-       
-       for(chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
+
+       for ( chkPlane = faceList.begin(); chkPlane != faceList.end(); chkPlane++ )
        {
-               if(!other->HasPlane((*chkPlane)))
+               if ( !other->HasPlane( ( *chkPlane ) ) ) {
                        return FALSE;
+               }
        }
 
-       for(chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
+       for ( chkPlane = faceList.begin(); chkPlane != faceList.end(); chkPlane++ )
        {
-               if(!HasPlane((*chkPlane)))
+               if ( !HasPlane( ( *chkPlane ) ) ) {
                        return FALSE;
+               }
        }
 
        return TRUE;
 }
 
-DPlane* DBrush::AddFace(vec3_t va, vec3_t vb, vec3_t vc, const char *textureName, bool bDetail)
-{
+DPlane* DBrush::AddFace( vec3_t va, vec3_t vb, vec3_t vc, const char *textureName, bool bDetail ){
        bBoundsBuilt = FALSE;
-       DPlane* newFace = new DPlane(va, vb, vc, textureName, bDetail);
-       faceList.push_back(newFace);
-       
+       DPlane* newFace = new DPlane( va, vb, vc, textureName, bDetail );
+       faceList.push_back( newFace );
+
        return newFace;
 }
 
@@ -792,11 +815,11 @@ DPlane* DBrush::FindPlaneWithClosestNormal( vec_t* normal ) {
        vec_t bestDot = -2;
        DPlane* bestDotPlane = NULL;
        list<DPlane *>::const_iterator chkPlane;
-       for( chkPlane = faceList.begin(); chkPlane != faceList.end(); chkPlane++ ) {
-               DPlane* pPlane = (*chkPlane);
+       for ( chkPlane = faceList.begin(); chkPlane != faceList.end(); chkPlane++ ) {
+               DPlane* pPlane = ( *chkPlane );
 
                vec_t dot = DotProduct( pPlane->normal, normal );
-               if( dot > bestDot ) {
+               if ( dot > bestDot ) {
                        bestDot = dot;
                        bestDotPlane = pPlane;
                }
@@ -808,20 +831,20 @@ DPlane* DBrush::FindPlaneWithClosestNormal( vec_t* normal ) {
 int DBrush::FindPointsForPlane( DPlane* plane, DPoint** pnts, int maxpnts ) {
        int numpnts = 0;
 
-       if(!maxpnts) {
+       if ( !maxpnts ) {
                return 0;
        }
 
        BuildPoints();
 
-       for( list<DPoint *>::const_iterator points = pointList.begin(); points != pointList.end(); points++ ) {
-               DPoint* point = (*points);
+       for ( list<DPoint *>::const_iterator points = pointList.begin(); points != pointList.end(); points++ ) {
+               DPoint* point = ( *points );
 
-               if( fabs(plane->DistanceToPoint( point->_pnt )) < MAX_ROUND_ERROR ) {
+               if ( fabs( plane->DistanceToPoint( point->_pnt ) ) < MAX_ROUND_ERROR ) {
                        pnts[numpnts] = point;
                        numpnts++;
 
-                       if(numpnts >= maxpnts) {
+                       if ( numpnts >= maxpnts ) {
                                return numpnts;
                        }
 
@@ -833,8 +856,8 @@ int DBrush::FindPointsForPlane( DPlane* plane, DPoint** pnts, int maxpnts ) {
 
 void DBrush::RemovePlane( DPlane* plane ) {
        bBoundsBuilt = FALSE;
-       for( list<DPlane *>::const_iterator deadPlane = faceList.begin(); deadPlane != faceList.end(); deadPlane++ ) {          
-               if(*deadPlane == plane) {
+       for ( list<DPlane *>::const_iterator deadPlane = faceList.begin(); deadPlane != faceList.end(); deadPlane++ ) {
+               if ( *deadPlane == plane ) {
                        delete *deadPlane;
                        faceList.remove( plane );
                }
@@ -842,7 +865,7 @@ void DBrush::RemovePlane( DPlane* plane ) {
 }
 
 void DBrush::RemoveFromRadiant( void ) {
-       if(QER_brush) {
-               g_FuncTable.m_pfnDeleteBrushHandle(QER_brush);
+       if ( QER_brush ) {
+               g_FuncTable.m_pfnDeleteBrushHandle( QER_brush );
        }
 }
index 65013dc..be60bfe 100644 (file)
@@ -1,99 +1,99 @@
 /*
-BobToolz plugin for GtkRadiant
-Copyright (C) 2001 Gordon Biggans
+   BobToolz plugin for GtkRadiant
+   Copyright (C) 2001 Gordon Biggans
 
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 // DBrush.h: interface for the DBrush class.
 //
 //////////////////////////////////////////////////////////////////////
 
-#if !defined(AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_)
+#if !defined( AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_ )
 #define AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_
 
 #include "DPlane.h"
 
-#define POINT_IN_BRUSH 0
-#define POINT_ON_BRUSH 1
-#define POINT_OUT_BRUSH        2
+#define POINT_IN_BRUSH  0
+#define POINT_ON_BRUSH  1
+#define POINT_OUT_BRUSH 2
 
 #if _MSC_VER > 1000
 #pragma once
 #endif // _MSC_VER > 1000
 
-class DBrush  
+class DBrush
 {
 public:
-       DPlane* AddFace(vec3_t va, vec3_t vb, vec3_t vc, const char* textureName, bool bDetail);
-       void SaveToFile(FILE* pFile);
+DPlane* AddFace( vec3_t va, vec3_t vb, vec3_t vc, const char* textureName, bool bDetail );
+void SaveToFile( FILE* pFile );
 
-       void Rotate(vec3_t vOrigin, vec3_t vRotation);
-       void RotateAboutCentre(vec3_t vRotation);
+void Rotate( vec3_t vOrigin, vec3_t vRotation );
+void RotateAboutCentre( vec3_t vRotation );
 
-       DPlane* HasPlaneInverted(DPlane* chkPlane);
-       DPlane* HasPlane(DPlane* chkPlane);
-       DPlane* AddFace(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* texData);
+DPlane* HasPlaneInverted( DPlane* chkPlane );
+DPlane* HasPlane( DPlane* chkPlane );
+DPlane* AddFace( vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* texData );
 
-       bool ResetTextures(const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation);
-       bool IsDetail();
-       bool HasTexture(const char* textureName);
-       bool IntersectsWith(DBrush *chkBrush);
-       bool IntersectsWith(DPlane* p1, DPlane* p2, vec3_t v);
-       bool IsCutByPlane(DPlane* cuttingPlane);
-       bool GetBounds(vec3_t min, vec3_t max); 
-       bool HasPoint(vec3_t pnt);
-       bool BBoxCollision(DBrush* chkBrush);
-       bool BBoxTouch(DBrush* chkBrush);
+bool ResetTextures( const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation );
+bool IsDetail();
+bool HasTexture( const char* textureName );
+bool IntersectsWith( DBrush *chkBrush );
+bool IntersectsWith( DPlane* p1, DPlane* p2, vec3_t v );
+bool IsCutByPlane( DPlane* cuttingPlane );
+bool GetBounds( vec3_t min, vec3_t max );
+bool HasPoint( vec3_t pnt );
+bool BBoxCollision( DBrush* chkBrush );
+bool BBoxTouch( DBrush* chkBrush );
 
-       int BuildPoints();
-       void BuildBounds();
-       void BuildFromWinding(DWinding* w);
-       brush_t* BuildInRadiant(bool allowDestruction, int* changeCnt, entity_t* entity = NULL);
+int BuildPoints();
+void BuildBounds();
+void BuildFromWinding( DWinding* w );
+brush_t* BuildInRadiant( bool allowDestruction, int* changeCnt, entity_t* entity = NULL );
 
-       void ResetChecks(list<Str>* exclusionList);
+void ResetChecks( list<Str>* exclusionList );
 
-       void ClearFaces();
-       void ClearPoints();
-       
-       int RemoveRedundantPlanes( void );
-       void RemovePlane( DPlane* plane );
-       int PointPosition(vec3_t pnt);
-       void RemoveFromRadiant( void );
+void ClearFaces();
+void ClearPoints();
 
-       
-       void CutByPlane(DPlane* cutPlane, DBrush** newBrush1, DBrush** newBrush2);
+int RemoveRedundantPlanes( void );
+void RemovePlane( DPlane* plane );
+int PointPosition( vec3_t pnt );
+void RemoveFromRadiant( void );
 
-       void LoadFromBrush_t(brush_t* brush, bool textured);
-       void AddPoint(vec3_t pnt);
 
-       DPlane* FindPlaneWithClosestNormal( vec_t* normal );
-       int FindPointsForPlane( DPlane* plane, DPoint** pnts, int maxpnts );
+void CutByPlane( DPlane* cutPlane, DBrush** newBrush1, DBrush** newBrush2 );
 
-       DBrush(int ID = -1);
-       virtual ~DBrush();
+void LoadFromBrush_t( brush_t* brush, bool textured );
+void AddPoint( vec3_t pnt );
 
-       bool operator== (DBrush* other);
+DPlane* FindPlaneWithClosestNormal( vec_t* normal );
+int FindPointsForPlane( DPlane* plane, DPoint** pnts, int maxpnts );
+
+DBrush( int ID = -1 );
+virtual ~DBrush();
+
+bool operator==( DBrush* other );
 
 //     members
-       brush_t* QER_brush;
-       list<DPlane*> faceList;
-       list<DPoint*> pointList;
-       int m_nBrushID;
-       vec3_t bbox_min, bbox_max;
-       bool bBoundsBuilt;
+brush_t* QER_brush;
+list<DPlane*> faceList;
+list<DPoint*> pointList;
+int m_nBrushID;
+vec3_t bbox_min, bbox_max;
+bool bBoundsBuilt;
 };
 
 //typedef CList<DBrush*, DBrush*> DBrushList;
index 9ef8dc3..dcf11fc 100644 (file)
@@ -1,21 +1,21 @@
 /*
-BobToolz plugin for GtkRadiant
-Copyright (C) 2001 Gordon Biggans
+   BobToolz plugin for GtkRadiant
+   Copyright (C) 2001 Gordon Biggans
 
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 // DEPair.cpp: implementation of the DEPair class.
 //
@@ -28,13 +28,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 // Construction/Destruction
 //////////////////////////////////////////////////////////////////////
 
-DEPair::DEPair()
-{
+DEPair::DEPair(){
 
 }
 
-DEPair::~DEPair()
-{
+DEPair::~DEPair(){
 
 }
 
@@ -42,8 +40,7 @@ DEPair::~DEPair()
 // Implementation
 //////////////////////////////////////////////////////////////////////
 
-void DEPair::Build(const char *pKey, const char *pValue)
-{
-  key = pKey;
-  value = pValue;
+void DEPair::Build( const char *pKey, const char *pValue ){
+       key = pKey;
+       value = pValue;
 }
index 41f86e4..b096ef2 100644 (file)
@@ -1,27 +1,27 @@
 /*
-BobToolz plugin for GtkRadiant
-Copyright (C) 2001 Gordon Biggans
+   BobToolz plugin for GtkRadiant
+   Copyright (C) 2001 Gordon Biggans
 
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 // DEPair.h: interface for the DEPair class.
 //
 //////////////////////////////////////////////////////////////////////
 
-#if !defined(AFX_DEPAIR_H__35B2C521_F0A7_11D4_ACF7_004095A18133__INCLUDED_)
+#if !defined( AFX_DEPAIR_H__35B2C521_F0A7_11D4_ACF7_004095A18133__INCLUDED_ )
 #define AFX_DEPAIR_H__35B2C521_F0A7_11D4_ACF7_004095A18133__INCLUDED_
 
 #if _MSC_VER > 1000
@@ -31,13 +31,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 class DEPair
 {
 public:
-       DEPair();
-       virtual ~DEPair();
+DEPair();
+virtual ~DEPair();
 
-       void Build(const char* pKey, const char* pValue);
+void Build( const char* pKey, const char* pValue );
 
-       Str     key;
-       Str     value;
+Str key;
+Str value;
 };
 
 //typedef CList<DEPair*, DEPair*> DEPairList;
index ca035b8..20a5b26 100644 (file)
@@ -1,21 +1,21 @@
 /*
-BobToolz plugin for GtkRadiant
-Copyright (C) 2001 Gordon Biggans
+   BobToolz plugin for GtkRadiant
+   Copyright (C) 2001 Gordon Biggans
 
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 // DEntity.cpp: implementation of the DEntity class.
 //
@@ -57,15 +57,13 @@ const char* brushEntityList[] = {
 // Construction/Destruction
 //////////////////////////////////////////////////////////////////////
 
-DEntity::DEntity(char *classname, int ID)
-{
-       SetClassname(classname);
+DEntity::DEntity( char *classname, int ID ){
+       SetClassname( classname );
        m_nID = ID;
        QER_Entity = NULL;
 }
 
-DEntity::~DEntity()
-{
+DEntity::~DEntity(){
        ClearPatches();
        ClearBrushes();
        ClearEPairs();
@@ -75,193 +73,186 @@ DEntity::~DEntity()
 // Implementation
 //////////////////////////////////////////////////////////////////////
 
-void DEntity::ClearBrushes()
-{
-       for(list<DBrush *>::const_iterator deadBrush=brushList.begin(); deadBrush!=brushList.end(); deadBrush++)
+void DEntity::ClearBrushes(){
+       for ( list<DBrush *>::const_iterator deadBrush = brushList.begin(); deadBrush != brushList.end(); deadBrush++ )
        {
                delete *deadBrush;
        }
        brushList.clear();
 }
 
-void DEntity::ClearPatches()
-{
-       for(list<DPatch *>::const_iterator deadPatch=patchList.begin(); deadPatch!=patchList.end(); deadPatch++)
+void DEntity::ClearPatches(){
+       for ( list<DPatch *>::const_iterator deadPatch = patchList.begin(); deadPatch != patchList.end(); deadPatch++ )
        {
                delete *deadPatch;
        }
        patchList.clear();
 }
 
-DPatch* DEntity::NewPatch()
-{
+DPatch* DEntity::NewPatch(){
        DPatch* newPatch = new DPatch;
 
-       patchList.push_back(newPatch);
+       patchList.push_back( newPatch );
 
        return newPatch;
 }
 
-DBrush* DEntity::NewBrush(int ID)
-{
-       DBrush* newBrush = new DBrush(ID);
+DBrush* DEntity::NewBrush( int ID ){
+       DBrush* newBrush = new DBrush( ID );
 
-       brushList.push_back(newBrush);
+       brushList.push_back( newBrush );
 
        return newBrush;
 }
 
-char* getNextBracket(char* s)
-{
+char* getNextBracket( char* s ){
        char* p = s;
-       while(*p)
+       while ( *p )
        {
                p++;
-               if(*p == '(')
+               if ( *p == '(' ) {
                        break;
+               }
        }
 
        return p;
 }
 
-bool DEntity::LoadFromPrt(char *filename)
-{
+bool DEntity::LoadFromPrt( char *filename ){
        CPortals portals;
-       strcpy(portals.fn, filename);
+       strcpy( portals.fn, filename );
        portals.Load();
 
-       if(portals.node_count == 0)
+       if ( portals.node_count == 0 ) {
                return FALSE;
+       }
 
        ClearBrushes();
        ClearEPairs();
 
-  bool build = false;
-       for(unsigned int i = 0; i < portals.node_count; i++)
+       bool build = false;
+       for ( unsigned int i = 0; i < portals.node_count; i++ )
        {
-    build = false;
+               build = false;
                DBrush* brush = NewBrush();
 
-               for(unsigned int j = 0; j < portals.node[i].portal_count; j++)
+               for ( unsigned int j = 0; j < portals.node[i].portal_count; j++ )
                {
-      for(unsigned int k = 0; k < portals.node[i].portal[j].point_count-2; k++)
-      {
-             vec3_t v1, v2, normal, n;
-             VectorSubtract(portals.node[i].portal[j].point[k+2].p, portals.node[i].portal[j].point[k+1].p, v1);
-             VectorSubtract(portals.node[i].portal[j].point[k].p, portals.node[i].portal[j].point[k+1].p, v2);
-             CrossProduct(v1, v2, n);
-        VectorNormalize(n, v2);
-
-        if(k == 0)
-        {
-          VectorCopy(v2, normal);
-        }
-        else
-        {
-          VectorSubtract(v2, normal, v1);
-          if(VectorLength(v1) > 0.01)
-          {
-            build = true;
-            break;
-          }
-        }
-      }
-
-      if(!build)
-                         brush->AddFace(portals.node[i].portal[j].point[2].p, portals.node[i].portal[j].point[1].p, portals.node[i].portal[j].point[0].p, "textures/common/caulk", FALSE);
-      else
-                         brush->AddFace(portals.node[i].portal[j].point[0].p, portals.node[i].portal[j].point[1].p, portals.node[i].portal[j].point[2].p, "textures/common/caulk", FALSE);
+                       for ( unsigned int k = 0; k < portals.node[i].portal[j].point_count - 2; k++ )
+                       {
+                               vec3_t v1, v2, normal, n;
+                               VectorSubtract( portals.node[i].portal[j].point[k + 2].p, portals.node[i].portal[j].point[k + 1].p, v1 );
+                               VectorSubtract( portals.node[i].portal[j].point[k].p, portals.node[i].portal[j].point[k + 1].p, v2 );
+                               CrossProduct( v1, v2, n );
+                               VectorNormalize( n, v2 );
+
+                               if ( k == 0 ) {
+                                       VectorCopy( v2, normal );
+                               }
+                               else
+                               {
+                                       VectorSubtract( v2, normal, v1 );
+                                       if ( VectorLength( v1 ) > 0.01 ) {
+                                               build = true;
+                                               break;
+                                       }
+                               }
+                       }
+
+                       if ( !build ) {
+                               brush->AddFace( portals.node[i].portal[j].point[2].p, portals.node[i].portal[j].point[1].p, portals.node[i].portal[j].point[0].p, "textures/common/caulk", FALSE );
+                       }
+                       else{
+                               brush->AddFace( portals.node[i].portal[j].point[0].p, portals.node[i].portal[j].point[1].p, portals.node[i].portal[j].point[2].p, "textures/common/caulk", FALSE );
+                       }
+               }
+               if ( build ) {
+                       brush->BuildInRadiant( FALSE, NULL );
                }
-    if(build)
-      brush->BuildInRadiant(FALSE, NULL);
        }
 
        return TRUE;
 }
 
-DPlane* DEntity::AddFaceToBrush(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* faceData, int ID)
-{
-       DBrush* buildBrush = GetBrushForID(ID);
-       return buildBrush->AddFace(va, vb, vc, faceData);
+DPlane* DEntity::AddFaceToBrush( vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* faceData, int ID ){
+       DBrush* buildBrush = GetBrushForID( ID );
+       return buildBrush->AddFace( va, vb, vc, faceData );
        // slow, dont use much
 }
 
-DBrush* DEntity::GetBrushForID(int ID)
-{
+DBrush* DEntity::GetBrushForID( int ID ){
        DBrush* buildBrush = NULL;
 
-       for(list<DBrush *>::const_iterator chkBrush=brushList.begin(); chkBrush!=brushList.end(); chkBrush++)
+       for ( list<DBrush *>::const_iterator chkBrush = brushList.begin(); chkBrush != brushList.end(); chkBrush++ )
        {
-               if((*chkBrush)->m_nBrushID == ID)
-               {
-                       buildBrush = (*chkBrush);
+               if ( ( *chkBrush )->m_nBrushID == ID ) {
+                       buildBrush = ( *chkBrush );
                        break;
                }
        }
 
-       if(!buildBrush)
-               buildBrush = NewBrush(ID);
+       if ( !buildBrush ) {
+               buildBrush = NewBrush( ID );
+       }
 
        return buildBrush;
 }
 
-void DEntity::LoadSelectedBrushes()
-{
+void DEntity::LoadSelectedBrushes(){
        ClearBrushes();
        ClearEPairs();
 
        int count = g_FuncTable.m_pfnAllocateSelectedBrushHandles();
 
-       for(int i = 0; i < count; i++) {
-               brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(i);
+       for ( int i = 0; i < count; i++ ) {
+               brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle( i );
 
-               if(brush->pPatch)
+               if ( brush->pPatch ) {
                        continue;
+               }
 
-               DBrush* loadBrush = NewBrush(i);
-               loadBrush->LoadFromBrush_t(brush, TRUE);
+               DBrush* loadBrush = NewBrush( i );
+               loadBrush->LoadFromBrush_t( brush, TRUE );
        }
 
        g_FuncTable.m_pfnReleaseSelectedBrushHandles();
 }
 
-void DEntity::LoadSelectedPatches()
-{
+void DEntity::LoadSelectedPatches(){
        ClearPatches();
        ClearEPairs();
 
-  int count = g_FuncTable.m_pfnAllocateSelectedPatchHandles();
+       int count = g_FuncTable.m_pfnAllocateSelectedPatchHandles();
 
-       for(int i = 0; i < count; i++)
+       for ( int i = 0; i < count; i++ )
        {
-    //$ FIXME: m_pfnGetPatchHandle
-               patchMesh_t *pmesh = (patchMesh_t*)g_FuncTable.m_pfnGetPatchData(i);
+               //$ FIXME: m_pfnGetPatchHandle
+               patchMesh_t *pmesh = (patchMesh_t*)g_FuncTable.m_pfnGetPatchData( i );
 
                DPatch* loadPatch = NewPatch();
-               loadPatch->LoadFromBrush_t(pmesh->pSymbiot);
+               loadPatch->LoadFromBrush_t( pmesh->pSymbiot );
        }
 
-  g_FuncTable.m_pfnReleasePatchHandles();
+       g_FuncTable.m_pfnReleasePatchHandles();
 }
 
-bool* DEntity::BuildIntersectList()
-{
+bool* DEntity::BuildIntersectList(){
        int max = GetIDMax();
-       if(max == 0)
+       if ( max == 0 ) {
                return NULL;
+       }
 
        bool* pbIntList = new bool[max];
-      &nb