Merge branch 'fix-fast' into 'master'
authorMario <zacjardine@y7mail.com>
Sun, 29 Apr 2018 13:46:46 +0000 (13:46 +0000)
committerMario <zacjardine@y7mail.com>
Sun, 29 Apr 2018 13:46:46 +0000 (13:46 +0000)
Fix a bug that prevent -fast to behave correctly

See merge request xonotic/netradiant!64

978 files changed:
.drone.yml [new file with mode: 0644]
CMakeLists.txt
Makefile
README.md
cmake/FindGLIB.cmake
cmake/FindGTK2.cmake [new file with mode: 0644]
cmake/FindGTK3.cmake [new file with mode: 0644]
cmake/FindGtkGLExt.cmake
cmake/FindMinizip.cmake
cmake/FindPango.cmake [new file with mode: 0644]
cmake/scripts/package.cmake [new file with mode: 0644]
contrib/CMakeLists.txt
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/CMakeLists.txt
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/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 [deleted file]
contrib/bobtoolz/StdAfx.h [deleted file]
contrib/bobtoolz/bobToolz-GTK.cpp
contrib/bobtoolz/bobToolz.h
contrib/bobtoolz/bobToolz.rc
contrib/bobtoolz/bsploader.cpp
contrib/bobtoolz/bsploader.h
contrib/bobtoolz/cportals.cpp
contrib/bobtoolz/ctfToolz-GTK.cpp
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/lists.cpp
contrib/bobtoolz/lists.h
contrib/bobtoolz/misc.cpp
contrib/bobtoolz/misc.h
contrib/bobtoolz/res/plugin.rc2
contrib/bobtoolz/shapes.cpp
contrib/bobtoolz/shapes.h
contrib/bobtoolz/visfind.cpp
contrib/bobtoolz/visfind.h
contrib/brushexport/callbacks.cpp
contrib/brushexport/callbacks.h
contrib/brushexport/export.cpp
contrib/brushexport/export.h
contrib/brushexport/interface.cpp
contrib/brushexport/plugin.cpp
contrib/brushexport/support.cpp
contrib/brushexport/support.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/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/portals.cpp
contrib/prtview/portals.h
contrib/prtview/prtview.cpp
contrib/prtview/prtview.h
contrib/prtview/res/PrtView.rc2
contrib/shaderplug/shaderplug.cpp
contrib/sunplug/sunplug.cpp
contrib/sunplug/sunplug.h
contrib/ufoaiplug/ufoai.cpp
contrib/ufoaiplug/ufoai_filters.cpp
contrib/ufoaiplug/ufoai_filters.h
contrib/ufoaiplug/ufoai_gtk.cpp
contrib/ufoaiplug/ufoai_gtk.h
contrib/ufoaiplug/ufoai_level.cpp
contrib/ufoaiplug/ufoai_level.h
docs/index.html
download-gamepacks.sh
include/CMakeLists.txt
include/cullable.cpp [deleted file]
include/dpkdeps.h [new file with mode: 0644]
include/editable.cpp [deleted file]
include/iarchive.cpp [deleted file]
include/iarchive.h
include/ibrush.cpp [deleted file]
include/ibrush.h
include/icamera.cpp [deleted file]
include/icamera.h
include/idatastream.cpp [deleted file]
include/ieclass.cpp [deleted file]
include/ientity.cpp [deleted file]
include/ientity.h
include/ifilesystem.cpp [deleted file]
include/ifilesystem.h
include/ifiletypes.cpp [deleted file]
include/ifilter.cpp [deleted file]
include/igl.cpp [deleted file]
include/igl.h
include/iglrender.cpp [deleted file]
include/igtkgl.cpp [deleted file]
include/igtkgl.h
include/iimage.cpp [deleted file]
include/iimage.h
include/imap.cpp [deleted file]
include/imap.h
include/imodel.cpp [deleted file]
include/ipatch.cpp [deleted file]
include/ipatch.h
include/iplugin.cpp [deleted file]
include/ireference.cpp [deleted file]
include/irender.cpp [deleted file]
include/irender.h
include/iscenegraph.cpp [deleted file]
include/iscenegraph.h
include/iscriplib.cpp [deleted file]
include/iscriplib.h
include/iselection.cpp [deleted file]
include/iselection.h
include/ishaders.cpp [deleted file]
include/ishaders.h
include/itexdef.cpp [deleted file]
include/itextstream.cpp [deleted file]
include/itextures.cpp [deleted file]
include/itextures.h
include/itoolbar.cpp [deleted file]
include/itoolbar.h
include/iundo.cpp [deleted file]
include/iundo.h
include/mapfile.cpp [deleted file]
include/mapfile.h
include/modelskin.cpp [deleted file]
include/modelskin.h
include/moduleobserver.cpp [deleted file]
include/moduleobserver.h
include/modulesystem.cpp [deleted file]
include/modulesystem.h
include/nameable.cpp [deleted file]
include/nameable.h
include/namespace.cpp [deleted file]
include/namespace.h
include/preferencesystem.cpp
include/preferencesystem.h
include/qerplugin.cpp [deleted file]
include/qerplugin.h
include/renderable.cpp [deleted file]
include/renderable.h
include/selectable.cpp [deleted file]
include/selectable.h
include/version.h
include/warnings.h
include/windowobserver.cpp [deleted file]
include/windowobserver.h
install-gamepack.sh
install-gamepacks.sh
libs/CMakeLists.txt
libs/_.cpp [new file with mode: 0644]
libs/archivelib.cpp [deleted file]
libs/bytebool.cpp [deleted file]
libs/bytestreamutils.cpp [deleted file]
libs/bytestreamutils.h
libs/character.cpp [deleted file]
libs/cmdlib.h
libs/cmdlib/cmdlib.cpp
libs/container/CMakeLists.txt
libs/container/array.h
libs/container/cache.cpp [deleted file]
libs/container/cache.h
libs/container/container.cpp [deleted file]
libs/container/hashfunc.cpp [deleted file]
libs/container/hashtable.cpp
libs/container/hashtable.h
libs/container/stack.cpp [deleted file]
libs/convert.cpp [deleted file]
libs/ddslib/ddslib.c
libs/debugging/debugging.h
libs/dragplanes.cpp [deleted file]
libs/eclasslib.cpp [deleted file]
libs/eclasslib.h
libs/entitylib.cpp [deleted file]
libs/entitylib.h
libs/entityxml.cpp [deleted file]
libs/fs_filesystem.cpp [deleted file]
libs/fs_path.cpp [deleted file]
libs/generic/CMakeLists.txt
libs/generic/arrayrange.cpp [deleted file]
libs/generic/bitfield.cpp [deleted file]
libs/generic/callback.cpp
libs/generic/callback.h
libs/generic/callbackfwd.cpp [deleted file]
libs/generic/callbackfwd.h [deleted file]
libs/generic/constant.cpp
libs/generic/constant.h
libs/generic/enumeration.cpp [deleted file]
libs/generic/functional.cpp [deleted file]
libs/generic/functional.h
libs/generic/object.h
libs/generic/reference.cpp [deleted file]
libs/generic/referencecounted.cpp [deleted file]
libs/generic/static.cpp
libs/generic/vector.cpp [deleted file]
libs/globaldefs.h [new file with mode: 0644]
libs/gtkutil/CMakeLists.txt
libs/gtkutil/accelerator.cpp
libs/gtkutil/accelerator.h
libs/gtkutil/button.cpp
libs/gtkutil/button.h
libs/gtkutil/clipboard.cpp
libs/gtkutil/clipboard.h
libs/gtkutil/closure.cpp [deleted file]
libs/gtkutil/closure.h
libs/gtkutil/container.cpp [deleted file]
libs/gtkutil/container.h
libs/gtkutil/cursor.cpp
libs/gtkutil/cursor.h
libs/gtkutil/dialog.cpp
libs/gtkutil/dialog.h
libs/gtkutil/entry.cpp
libs/gtkutil/entry.h
libs/gtkutil/filechooser.cpp
libs/gtkutil/filechooser.h
libs/gtkutil/frame.cpp
libs/gtkutil/frame.h
libs/gtkutil/glfont.cpp
libs/gtkutil/glfont.h
libs/gtkutil/glwidget.cpp
libs/gtkutil/glwidget.h
libs/gtkutil/idledraw.cpp [deleted file]
libs/gtkutil/idledraw.h
libs/gtkutil/image.cpp
libs/gtkutil/image.h
libs/gtkutil/menu.cpp
libs/gtkutil/menu.h
libs/gtkutil/messagebox.cpp
libs/gtkutil/messagebox.h
libs/gtkutil/nonmodal.cpp
libs/gtkutil/nonmodal.h
libs/gtkutil/paned.cpp
libs/gtkutil/paned.h
libs/gtkutil/pointer.cpp [deleted file]
libs/gtkutil/pointer.h
libs/gtkutil/toolbar.cpp
libs/gtkutil/toolbar.h
libs/gtkutil/widget.cpp
libs/gtkutil/widget.h
libs/gtkutil/window.cpp
libs/gtkutil/window.h
libs/gtkutil/xorrectangle.cpp
libs/gtkutil/xorrectangle.h
libs/imagelib.cpp [deleted file]
libs/instancelib.cpp [deleted file]
libs/instancelib.h
libs/l_net/l_net.c
libs/l_net/l_net.h
libs/l_net/l_net_berkley.c
libs/l_net/l_net_wins.c
libs/l_net/l_net_wins.h
libs/maplib.cpp [deleted file]
libs/maplib.h
libs/math/CMakeLists.txt
libs/math/_.cpp [new file with mode: 0644]
libs/math/aabb.cpp [deleted file]
libs/math/aabb.h
libs/math/curve.cpp [deleted file]
libs/math/frustum.cpp [deleted file]
libs/math/line.cpp [deleted file]
libs/math/matrix.cpp [deleted file]
libs/math/pi.cpp [deleted file]
libs/math/plane.cpp [deleted file]
libs/math/quaternion.cpp [deleted file]
libs/math/vector.cpp [deleted file]
libs/math/vector.h
libs/mathlib/bbox.c
libs/mathlib/m4x4.c
libs/mathlib/mathlib.c
libs/mathlib/ray.c
libs/md5lib.h
libs/md5lib/md5lib.c
libs/memory/allocator.h
libs/moduleobservers.cpp [deleted file]
libs/modulesystem/CMakeLists.txt
libs/modulesystem/moduleregistry.cpp [deleted file]
libs/modulesystem/moduleregistry.h
libs/modulesystem/modulesmap.cpp [deleted file]
libs/modulesystem/singletonmodule.h
libs/os/CMakeLists.txt
libs/os/_.cpp [new file with mode: 0644]
libs/os/dir.cpp [deleted file]
libs/os/file.cpp [deleted file]
libs/os/file.h
libs/os/path.cpp [deleted file]
libs/os/path.h
libs/picomodel/lwo/clip.c
libs/picomodel/lwo/envelope.c
libs/picomodel/lwo/lwio.c
libs/picomodel/lwo/lwo2.c
libs/picomodel/lwo/lwo2.h
libs/picomodel/lwo/lwob.c
libs/picomodel/lwo/surface.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_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/picomodel/pm_terrain.c
libs/pivot.cpp [deleted file]
libs/profile/file.cpp
libs/profile/profile.cpp
libs/property.h [new file with mode: 0644]
libs/render.cpp [deleted file]
libs/render.h
libs/scenelib.cpp [deleted file]
libs/scenelib.h
libs/script/CMakeLists.txt
libs/script/_.cpp [new file with mode: 0644]
libs/script/scripttokeniser.cpp [deleted file]
libs/script/scripttokenwriter.cpp [deleted file]
libs/selectionlib.cpp [deleted file]
libs/selectionlib.h
libs/shaderlib.cpp [deleted file]
libs/signal/CMakeLists.txt
libs/signal/isignal.cpp [deleted file]
libs/signal/isignal.h
libs/signal/signal.cpp
libs/signal/signal.h
libs/signal/signalfwd.cpp [deleted file]
libs/splines/math_matrix.h
libs/splines/math_quaternion.h
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/util_str.cpp
libs/splines/util_str.h
libs/str.cpp [deleted file]
libs/str.h
libs/stream/CMakeLists.txt
libs/stream/_.cpp [new file with mode: 0644]
libs/stream/filestream.cpp [deleted file]
libs/stream/memstream.cpp [deleted file]
libs/stream/stringstream.cpp [deleted file]
libs/stream/stringstream.h
libs/stream/textfilestream.cpp [deleted file]
libs/stream/textstream.cpp [deleted file]
libs/stream/textstream.h
libs/string/CMakeLists.txt
libs/string/pooledstring.cpp
libs/string/string.cpp [deleted file]
libs/string/string.h
libs/string/stringfwd.cpp [deleted file]
libs/stringio.cpp [deleted file]
libs/stringio.h
libs/texturelib.cpp [deleted file]
libs/transformlib.cpp [deleted file]
libs/transformlib.h
libs/traverselib.cpp [deleted file]
libs/traverselib.h
libs/typesystem.cpp [deleted file]
libs/typesystem.h
libs/uilib/CMakeLists.txt
libs/uilib/uilib.cpp
libs/uilib/uilib.h [new file with mode: 0644]
libs/undolib.cpp [deleted file]
libs/undolib.h
libs/uniquenames.cpp [deleted file]
libs/versionlib.cpp [deleted file]
libs/xml/CMakeLists.txt
libs/xml/ixml.cpp [deleted file]
libs/xml/xmlelement.cpp [deleted file]
libs/xml/xmlparser.cpp [deleted file]
libs/xml/xmlparser.h
libs/xml/xmltextags.cpp
libs/xml/xmlwriter.cpp [deleted file]
plugins/CMakeLists.txt
plugins/archivepak/CMakeLists.txt
plugins/archivepak/archive.cpp
plugins/archivepak/archive.h
plugins/archivepak/pak.cpp [deleted file]
plugins/archivepak/pak.h
plugins/archivepak/plugin.cpp
plugins/archivepak/plugin.h [deleted file]
plugins/archivewad/CMakeLists.txt
plugins/archivewad/archive.cpp
plugins/archivewad/archive.h
plugins/archivewad/plugin.cpp
plugins/archivewad/plugin.h [deleted file]
plugins/archivewad/wad.cpp [deleted file]
plugins/archivewad/wad.h
plugins/archivezip/CMakeLists.txt
plugins/archivezip/archive.cpp
plugins/archivezip/archive.h
plugins/archivezip/pkzip.cpp [deleted file]
plugins/archivezip/pkzip.h
plugins/archivezip/plugin.cpp
plugins/archivezip/plugin.h [deleted file]
plugins/archivezip/zlibstream.cpp [deleted file]
plugins/archivezip/zlibstream.h
plugins/entity/CMakeLists.txt
plugins/entity/angle.cpp [deleted file]
plugins/entity/angle.h
plugins/entity/angles.cpp [deleted file]
plugins/entity/angles.h
plugins/entity/colour.cpp [deleted file]
plugins/entity/colour.h
plugins/entity/curve.cpp [deleted file]
plugins/entity/curve.h
plugins/entity/doom3group.cpp
plugins/entity/doom3group.h
plugins/entity/eclassmodel.cpp
plugins/entity/eclassmodel.h
plugins/entity/entity.cpp
plugins/entity/entity.h
plugins/entity/filters.cpp
plugins/entity/filters.h
plugins/entity/generic.cpp
plugins/entity/generic.h
plugins/entity/group.cpp
plugins/entity/group.h
plugins/entity/keyobservers.cpp [deleted file]
plugins/entity/keyobservers.h
plugins/entity/light.cpp
plugins/entity/light.h
plugins/entity/miscmodel.cpp
plugins/entity/miscmodel.h
plugins/entity/model.cpp [deleted file]
plugins/entity/model.h
plugins/entity/modelskinkey.cpp [deleted file]
plugins/entity/modelskinkey.h
plugins/entity/namedentity.cpp [deleted file]
plugins/entity/namedentity.h
plugins/entity/namekeys.cpp [deleted file]
plugins/entity/namekeys.h
plugins/entity/origin.cpp [deleted file]
plugins/entity/origin.h
plugins/entity/plugin.cpp
plugins/entity/plugin.h [deleted file]
plugins/entity/rotation.cpp [deleted file]
plugins/entity/rotation.h
plugins/entity/scale.cpp [deleted file]
plugins/entity/scale.h
plugins/entity/skincache.cpp
plugins/entity/skincache.h
plugins/entity/targetable.cpp
plugins/entity/targetable.h
plugins/image/CMakeLists.txt
plugins/image/bmp.cpp
plugins/image/bmp.h
plugins/image/dds.cpp
plugins/image/dds.h
plugins/image/image.cpp
plugins/image/image.h [deleted file]
plugins/image/jpeg.cpp
plugins/image/jpeg.h
plugins/image/ktx.cpp
plugins/image/ktx.h
plugins/image/pcx.cpp
plugins/image/pcx.h
plugins/image/tga.cpp
plugins/image/tga.h
plugins/imagehl/CMakeLists.txt
plugins/imagehl/hlw.cpp
plugins/imagehl/hlw.h
plugins/imagehl/imagehl.cpp
plugins/imagehl/imagehl.h [deleted file]
plugins/imagehl/mip.cpp
plugins/imagehl/mip.h
plugins/imagehl/sprite.cpp
plugins/imagehl/sprite.h
plugins/imagepng/CMakeLists.txt
plugins/imagepng/plugin.cpp
plugins/imagepng/plugin.h [deleted file]
plugins/imageq2/CMakeLists.txt
plugins/imageq2/imageq2.cpp
plugins/imageq2/imageq2.h [deleted file]
plugins/imageq2/wal.cpp
plugins/imageq2/wal.h
plugins/imageq2/wal32.cpp
plugins/imageq2/wal32.h
plugins/iqmmodel/CMakeLists.txt [new file with mode: 0644]
plugins/iqmmodel/iqm.cpp [new file with mode: 0644]
plugins/iqmmodel/iqm.h [new file with mode: 0644]
plugins/iqmmodel/modeliqm.def [new file with mode: 0644]
plugins/iqmmodel/plugin.cpp [new file with mode: 0644]
plugins/iqmmodel/plugin.h [new file with mode: 0644]
plugins/mapq3/CMakeLists.txt
plugins/mapq3/parse.cpp
plugins/mapq3/parse.h
plugins/mapq3/plugin.cpp
plugins/mapq3/plugin.h [deleted file]
plugins/mapq3/write.cpp
plugins/mapq3/write.h
plugins/mapxml/CMakeLists.txt
plugins/mapxml/plugin.cpp
plugins/mapxml/plugin.h [deleted file]
plugins/mapxml/xmlparse.cpp
plugins/mapxml/xmlparse.h
plugins/mapxml/xmlwrite.cpp
plugins/mapxml/xmlwrite.h
plugins/md3model/CMakeLists.txt
plugins/md3model/ident.h
plugins/md3model/md2.cpp
plugins/md3model/md2.h
plugins/md3model/md3.cpp
plugins/md3model/md3.h
plugins/md3model/md3normals.cpp [deleted file]
plugins/md3model/md3normals.h
plugins/md3model/md5.cpp
plugins/md3model/md5.h
plugins/md3model/mdc.cpp
plugins/md3model/mdc.h
plugins/md3model/mdl.cpp
plugins/md3model/mdl.h
plugins/md3model/mdlformat.cpp [deleted file]
plugins/md3model/mdlformat.h
plugins/md3model/mdlimage.cpp
plugins/md3model/mdlimage.h
plugins/md3model/mdlnormals.cpp [deleted file]
plugins/md3model/mdlnormals.h
plugins/md3model/model.cpp [deleted file]
plugins/md3model/model.h
plugins/md3model/plugin.cpp
plugins/md3model/plugin.h [deleted file]
plugins/model/CMakeLists.txt
plugins/model/model.cpp
plugins/model/model.h
plugins/model/plugin.cpp
plugins/model/plugin.h [deleted file]
plugins/sample/sample.cpp
plugins/sample/sample.h [deleted file]
plugins/shaders/CMakeLists.txt
plugins/shaders/plugin.cpp
plugins/shaders/plugin.h [deleted file]
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/textool/2DView.cpp
plugins/textool/2DView.h
plugins/textool/ControlPointsManager.cpp
plugins/textool/ControlPointsManager.h
plugins/textool/Doc/TexTool.html
plugins/textool/StdAfx.cpp [deleted file]
plugins/textool/StdAfx.h
plugins/textool/TexTool.cpp
plugins/textool/TexTool.rc
plugins/vfspk3/CMakeLists.txt
plugins/vfspk3/archive.cpp
plugins/vfspk3/archive.h
plugins/vfspk3/vfs.cpp
plugins/vfspk3/vfs.h
plugins/vfspk3/vfspk3.cpp
plugins/vfspk3/vfspk3.h [deleted file]
radiant/CMakeLists.txt
radiant/autosave.cpp
radiant/autosave.h
radiant/brush.cpp
radiant/brush.h
radiant/brush_primit.cpp
radiant/brush_primit.h
radiant/brushmanip.cpp
radiant/brushmanip.h
radiant/brushmodule.cpp
radiant/brushmodule.h
radiant/brushnode.h
radiant/brushtokens.h
radiant/brushxml.h
radiant/build.cpp
radiant/build.h
radiant/camwindow.cpp
radiant/camwindow.h
radiant/commands.cpp
radiant/commands.h
radiant/console.cpp
radiant/console.h
radiant/csg.cpp
radiant/csg.h
radiant/dialog.cpp
radiant/dialog.h
radiant/eclass.cpp
radiant/eclass_def.cpp
radiant/eclass_doom3.cpp
radiant/eclass_fgd.cpp
radiant/eclass_xml.cpp
radiant/entity.cpp
radiant/entity.h
radiant/entityinspector.cpp
radiant/entityinspector.h
radiant/entitylist.cpp
radiant/entitylist.h
radiant/environment.cpp
radiant/environment.h
radiant/error.cpp
radiant/error.h
radiant/feedback.cpp
radiant/feedback.h
radiant/filetypes.cpp
radiant/filetypes.h
radiant/filters.cpp
radiant/filters.h
radiant/findtexturedialog.cpp
radiant/findtexturedialog.h
radiant/glwidget.cpp
radiant/grid.cpp
radiant/grid.h
radiant/groupdialog.cpp
radiant/groupdialog.h
radiant/gtkdlgs.cpp
radiant/gtkdlgs.h
radiant/gtkmisc.cpp
radiant/gtkmisc.h
radiant/help.cpp
radiant/help.h
radiant/image.cpp
radiant/image.h
radiant/main.cpp
radiant/mainframe.cpp
radiant/mainframe.h
radiant/map.cpp
radiant/map.h
radiant/mru.cpp
radiant/mru.h
radiant/multimon.cpp
radiant/multimon.h
radiant/nullmodel.cpp
radiant/nullmodel.h
radiant/parse.cpp
radiant/patch.cpp
radiant/patch.h
radiant/patchdialog.cpp
radiant/patchdialog.h
radiant/patchmanip.cpp
radiant/patchmanip.h
radiant/patchmodule.cpp
radiant/plugin.cpp
radiant/plugin.h
radiant/pluginapi.cpp
radiant/pluginapi.h
radiant/pluginmanager.cpp
radiant/pluginmanager.h
radiant/pluginmenu.cpp
radiant/pluginmenu.h
radiant/plugintoolbar.cpp
radiant/plugintoolbar.h
radiant/points.cpp
radiant/points.h
radiant/preferencedictionary.h
radiant/preferences.cpp
radiant/preferences.h
radiant/qe3.cpp
radiant/qe3.h
radiant/qgl.cpp
radiant/qgl.h
radiant/radiant.rc
radiant/referencecache.cpp
radiant/referencecache.h
radiant/renderer.h
radiant/renderstate.cpp
radiant/renderstate.h
radiant/scenegraph.cpp
radiant/select.cpp
radiant/select.h
radiant/selection.cpp
radiant/selection.h
radiant/server.cpp
radiant/server.h
radiant/shaders.cpp
radiant/shaders.h
radiant/sockets.cpp
radiant/sockets.h
radiant/stacktrace.cpp
radiant/stacktrace.h
radiant/surfacedialog.cpp
radiant/surfacedialog.h
radiant/texmanip.cpp
radiant/texmanip.h
radiant/textureentry.cpp
radiant/textureentry.h
radiant/textures.cpp
radiant/textures.h
radiant/texwindow.cpp
radiant/texwindow.h
radiant/timer.cpp
radiant/timer.h
radiant/treemodel.cpp
radiant/treemodel.h
radiant/undo.cpp
radiant/url.cpp
radiant/url.h
radiant/view.cpp
radiant/view.h
radiant/watchbsp.cpp
radiant/watchbsp.h
radiant/winding.cpp
radiant/winding.h
radiant/windowobservers.cpp
radiant/windowobservers.h
radiant/xmlstuff.h
radiant/xywindow.cpp
radiant/xywindow.h
tools/CMakeLists.txt
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/extra/bsp/qrad3/qrad.h
tools/quake2/extra/common/cmdlib.c
tools/quake2/extra/common/cmdlib.h
tools/quake2/extra/common/threads.c
tools/quake2/extra/qdata/qdata.c
tools/quake2/extra/qe4/cmdlib.c
tools/quake2/extra/qe4/mru.c
tools/quake2/extra/qe4/mru.h
tools/quake2/extra/qe4/qe3.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/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/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/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/CMakeLists.txt
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/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/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/bsp.c
tools/quake3/q3map2/bspfile_abstract.c
tools/quake3/q3map2/facebsp.c
tools/quake3/q3map2/game__null.h
tools/quake3/q3map2/game_etut.h
tools/quake3/q3map2/game_quakelive.h
tools/quake3/q3map2/game_unvanquished.h
tools/quake3/q3map2/game_wolf.h
tools/quake3/q3map2/game_wolfet.h
tools/quake3/q3map2/help.c
tools/quake3/q3map2/image.c
tools/quake3/q3map2/light.c
tools/quake3/q3map2/light_bounce.c
tools/quake3/q3map2/light_trace.c
tools/quake3/q3map2/light_ydnar.c
tools/quake3/q3map2/lightmaps_ydnar.c
tools/quake3/q3map2/main.c
tools/quake3/q3map2/model.c
tools/quake3/q3map2/path_init.c
tools/quake3/q3map2/portals.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_meta.c
tools/quake3/q3map2/tjunction.c
tools/quake3/q3map2/vis.c
tools/quake3/q3map2/writebsp.c

diff --git a/.drone.yml b/.drone.yml
new file mode 100644 (file)
index 0000000..d40dd2e
--- /dev/null
@@ -0,0 +1,8 @@
+build:
+  image: teaci/msys32
+  shell: mingw32
+  pull: true
+  commands:
+    - pacman -S --needed --noconfirm --noprogressbar mingw-w64-i686-{toolchain,cmake,gtk2,gtkglext}
+    - cmake -G "MSYS Makefiles" .
+    - make
index 78efba947a1ca4b171924105d550179342932979..aa1028d64d869b1efb61341377dbf72a37e96cd9 100644 (file)
@@ -1,12 +1,12 @@
-cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
-# Enable Debug by default, can be changed with -DCMAKE_BUILD_TYPE=Release
-if (NOT CMAKE_BUILD_TYPE)
-    set(CMAKE_BUILD_TYPE Debug)
-endif ()
-
 project(NetRadiant C CXX)
-option(BUILD_RADIANT "Build the gui" ON)
+
+option(BUILD_RADIANT "Build the GUI" ON)
+
+if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+    set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/install" CACHE PATH "..." FORCE)
+endif ()
 
 #-----------------------------------------------------------------------
 # Version
@@ -20,6 +20,7 @@ set(NetRadiant_VERSION "${NetRadiant_VERSION_MAJOR}.${NetRadiant_VERSION_MINOR}.
 
 file(WRITE "${PROJECT_BINARY_DIR}/RADIANT_MAJOR" ${NetRadiant_VERSION_MAJOR})
 file(WRITE "${PROJECT_BINARY_DIR}/RADIANT_MINOR" ${NetRadiant_VERSION_MINOR})
+file(WRITE "${PROJECT_BINARY_DIR}/RADIANT_PATCH" ${NetRadiant_VERSION_PATCH})
 
 set(RADIANT_ABOUTMSG "Custom build" CACHE STRING "About message")
 
@@ -43,27 +44,59 @@ message(STATUS "Building ${PROJECT_NAME} ${RADIANT_VERSION_STRING} ${RADIANT_ABO
 
 set(CMAKE_CXX_STANDARD 11)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
-# For some reason the above flags don't really work...
-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX)
-    include(CheckCXXCompilerFlag)
-    check_cxx_compiler_flag(--std=c++${CMAKE_CXX_STANDARD} STD_CXX)
-    if (STD_CXX)
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++${CMAKE_CXX_STANDARD}")
+set(CMAKE_CXX_EXTENSIONS OFF)
+if (CMAKE_VERSION VERSION_LESS "3.1")
+    if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX)
+        include(CheckCXXCompilerFlag)
+        check_cxx_compiler_flag(--std=c++${CMAKE_CXX_STANDARD} STD_CXX)
+        if (STD_CXX)
+            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++${CMAKE_CXX_STANDARD}")
+        else ()
+            message(SEND_ERROR "Requires C++${CMAKE_CXX_STANDARD} or better")
+        endif ()
     else ()
-        message(SEND_ERROR "Requires C++${CMAKE_CXX_STANDARD} or better")
+        message(WARNING "Unrecognized compiler: ${CMAKE_CXX_COMPILER_ID}, make sure it supports C++${CMAKE_CXX_STANDARD}")
     endif ()
-else ()
-    message(WARNING "Unrecognized compiler: ${CMAKE_CXX_COMPILER_ID}, make sure it supports C++${CMAKE_CXX_STANDARD}")
 endif ()
 
 #-----------------------------------------------------------------------
 # Flags
 #-----------------------------------------------------------------------
 
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}   -fno-strict-aliasing")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fno-exceptions -fno-rtti")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
+macro(addflags_c args)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${args}")
+endmacro()
+macro(addflags_cxx args)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${args}")
+endmacro()
+macro(addflags args)
+    addflags_c("${args}")
+    addflags_cxx("${args}")
+endmacro()
+addflags("-fno-strict-aliasing")
+if (NOT WIN32)
+    addflags("-fvisibility=hidden")
+endif ()
+
+if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+    addflags("-Werror")
+    addflags("-pedantic-errors")
+endif ()
+
+addflags("-Wall")
+addflags("-Wextra")
+addflags("-pedantic")
+
+addflags_c("-Wno-deprecated-declarations") # vfs.c: g_strdown
+
+addflags("-Wno-unused-function")
+addflags("-Wno-unused-variable")
+addflags("-Wno-unused-parameter")
+
 set(CMAKE_POSITION_INDEPENDENT_CODE 1)
-set(GTK_NS "GTK2" CACHE STRING "GTK variable prefix")
+set(GTK_TARGET 2 CACHE STRING "GTK target")
+add_definitions(-DGTK_TARGET=${GTK_TARGET})
 
 #-----------------------------------------------------------------------
 # Defs
@@ -72,13 +105,28 @@ set(GTK_NS "GTK2" CACHE STRING "GTK variable prefix")
 add_definitions(-DRADIANT_VERSION="${NetRadiant_VERSION}")
 add_definitions(-DRADIANT_MAJOR_VERSION="${NetRadiant_VERSION_MAJOR}")
 add_definitions(-DRADIANT_MINOR_VERSION="${NetRadiant_VERSION_MINOR}")
+add_definitions(-DRADIANT_PATCH_VERSION="${NetRadiant_VERSION_PATCH}")
 
 add_definitions(-DRADIANT_ABOUTMSG="${NetRadiant_ABOUT}")
 
-if (CMAKE_BUILD_TYPE MATCHES Debug)
+if (NOT CMAKE_BUILD_TYPE MATCHES Release)
     add_definitions(-D_DEBUG=1)
 endif ()
 
+macro(disable_deprecated name gtk2only)
+    add_definitions(-D${name}_DISABLE_SINGLE_INCLUDES)
+    if ((${gtk2only} EQUAL 0) OR (GTK_TARGET EQUAL 2))
+        add_definitions(-D${name}_DISABLE_DEPRECATED)
+    endif ()
+endmacro()
+
+disable_deprecated(ATK 0)
+disable_deprecated(G 0)
+disable_deprecated(GDK 0)
+disable_deprecated(GDK_PIXBUF 0)
+disable_deprecated(GTK 1)
+disable_deprecated(PANGO 0)
+
 if (APPLE)
     option(XWINDOWS "Build against X11" ON)
     add_definitions(
@@ -105,6 +153,23 @@ endif ()
 include_directories("${PROJECT_SOURCE_DIR}/include")
 include_directories("${PROJECT_SOURCE_DIR}/libs")
 
+if (WIN32 AND NOT CMAKE_CROSSCOMPILING)
+    set(BUNDLE_LIBRARIES_DEFAULT ON)
+else ()
+    set(BUNDLE_LIBRARIES_DEFAULT OFF)
+endif ()
+option(BUNDLE_LIBRARIES "Bundle libraries" ${BUNDLE_LIBRARIES_DEFAULT})
+
+macro(copy_dlls target)
+    if (BUNDLE_LIBRARIES)
+        add_custom_command(TARGET ${target} POST_BUILD
+                COMMAND bash
+                ARGS -c "ldd '$<TARGET_FILE:${target}>' | grep -v /c/Windows | awk '{ print $1 }' | while read dll; do cp \"$(which $dll)\" '${PROJECT_BINARY_DIR}'; done"
+                VERBATIM
+                )
+    endif ()
+endmacro()
+
 #-----------------------------------------------------------------------
 # Libraries
 #-----------------------------------------------------------------------
@@ -132,12 +197,8 @@ endif ()
 # Radiant
 #-----------------------------------------------------------------------
 
-if (BUILD_RADIANT)
-    add_subdirectory(radiant build)
-endif ()
-
 if (CMAKE_EXECUTABLE_SUFFIX)
-    set(RADIANT_EXECUTABLE ${CMAKE_EXECUTABLE_SUFFIX})
+    string(REGEX REPLACE "^[.]" "" RADIANT_EXECUTABLE ${CMAKE_EXECUTABLE_SUFFIX})
 else ()
     execute_process(
             COMMAND uname -m
@@ -146,7 +207,25 @@ else ()
     )
 endif ()
 
+macro(radiant_tool name)
+    add_executable(${name} ${ARGN})
+    install(
+            TARGETS ${name}
+            RUNTIME DESTINATION .
+    )
+    if (NOT (CMAKE_EXECUTABLE_SUFFIX STREQUAL ".${RADIANT_EXECUTABLE}"))
+        add_custom_command(TARGET ${name} POST_BUILD
+                COMMAND ln -f -s "$<TARGET_FILE_NAME:${name}>" "${PROJECT_BINARY_DIR}/${name}.${RADIANT_EXECUTABLE}"
+                VERBATIM
+                )
+        install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
+                ${name}${CMAKE_EXECUTABLE_SUFFIX} ${CMAKE_INSTALL_PREFIX}/${name}.${RADIANT_EXECUTABLE})
+                ")
+    endif ()
+endmacro()
+
 if (BUILD_RADIANT)
+    add_subdirectory(radiant _radiant)
     set_target_properties(radiant PROPERTIES
             COMPILE_DEFINITIONS RADIANT_EXECUTABLE="${RADIANT_EXECUTABLE}"
             )
@@ -158,13 +237,12 @@ endif ()
 
 add_subdirectory(tools)
 
+file(GLOB DATA_FILES "${PROJECT_SOURCE_DIR}/setup/data/tools/*")
+
 if (NOT (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR))
     # Copy data files from sources to the build directory
     message(STATUS "Copying data files")
-    file(GLOB DATA_FILES "${PROJECT_SOURCE_DIR}/setup/data/tools/*")
     file(COPY ${DATA_FILES} DESTINATION "${PROJECT_BINARY_DIR}")
-    file(GLOB DATA_FILES "${PROJECT_SOURCE_DIR}/docs/*")
-    file(COPY ${DATA_FILES} DESTINATION "${PROJECT_BINARY_DIR}/docs")
 endif ()
 
 #-----------------------------------------------------------------------
@@ -172,11 +250,74 @@ endif ()
 #-----------------------------------------------------------------------
 
 option(DOWNLOAD_GAMEPACKS "Download game packs" ON)
-add_custom_target(game_packs
+add_custom_target(game_packs_free
         COMMAND ${CMAKE_COMMAND} -E make_directory games
         COMMAND DOWNLOAD_GAMEPACKS=yes SOURCE_DIR="${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/install-gamepacks.sh" "${PROJECT_BINARY_DIR}"
-        COMMENT "Downloading game packs"
+        COMMENT "Downloading free game packs"
+        )
+add_custom_target(game_packs_all
+        COMMAND ${CMAKE_COMMAND} -E make_directory games
+        COMMAND DOWNLOAD_GAMEPACKS=all SOURCE_DIR="${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/install-gamepacks.sh" "${PROJECT_BINARY_DIR}"
+        COMMENT "Downloading all game packs"
         )
+
 if (DOWNLOAD_GAMEPACKS)
-    add_custom_target(game_packs_all ALL DEPENDS game_packs)
+    set(DOWNLOAD_GAMEPACKS "all")
+endif()
+if ("${DOWNLOAD_GAMEPACKS}" STREQUAL "free")
+    add_custom_target(game_packs_go ALL DEPENDS game_packs_free)
+elseif ("${DOWNLOAD_GAMEPACKS}" STREQUAL "all")
+    add_custom_target(game_packs_go ALL DEPENDS game_packs_all)
 endif ()
+
+#-----------------------------------------------------------------------
+# Install
+#-----------------------------------------------------------------------
+
+install(
+        FILES
+        "${PROJECT_BINARY_DIR}/RADIANT_MAJOR"
+        "${PROJECT_BINARY_DIR}/RADIANT_MINOR"
+        "${PROJECT_BINARY_DIR}/RADIANT_PATCH"
+        DESTINATION .
+)
+
+install(
+        DIRECTORY
+        setup/data/tools/
+        docs
+        DESTINATION .
+)
+
+set(GAME_FILES
+        DarkPlaces
+        Nexuiz
+        OpenArena
+        Osirion
+        Q3
+        Quake2
+        Quake
+        Quetoo
+        Tremulous
+        UFOAI
+        Unvanquished
+        Warsow
+        Xonotic
+        )
+unset(_tmp)
+foreach (it ${GAME_FILES})
+    set(dir "${PROJECT_BINARY_DIR}/games/${it}Pack")
+    string(TOLOWER "${it}" it)
+    list(APPEND _tmp "${dir}/games")
+    list(APPEND _tmp "${dir}/${it}.game")
+endforeach ()
+set(GAME_FILES ${_tmp})
+
+install(
+        DIRECTORY
+        ${GAME_FILES}
+        DESTINATION .
+        OPTIONAL
+)
+
+include(cmake/scripts/package.cmake)
index 1ead72574e3fa4ada627e9afa9f32005f376bc18..0a2d4b9711e82c0c466da40e1af62455567c7c5e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -113,7 +113,7 @@ CFLAGS_COMMON = -MMD -W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter -fn
 CPPFLAGS_COMMON =
 LDFLAGS_COMMON =
 LIBS_COMMON =
-CXXFLAGS_COMMON = -Wno-non-virtual-dtor -Wreorder -fno-exceptions -fno-rtti
+CXXFLAGS_COMMON = -std=c++11 -Wno-non-virtual-dtor -Wreorder -fno-exceptions -fno-rtti
 
 ifeq ($(BUILD),debug)
 ifeq ($(findstring $(CFLAGS),-g),)
@@ -241,10 +241,11 @@ endif
 endif
 
 # VERSION!
-RADIANT_VERSION_NUMBER = 1.5.0
+RADIANT_MAJOR_VERSION = 1
+RADIANT_MINOR_VERSION = 5
+RADIANT_PATCH_VERSION = 0
+RADIANT_VERSION_NUMBER = $(RADIANT_MAJOR_VERSION).$(RADIANT_MINOR_VERSION).$(RADIANT_PATCH_VERSION)
 RADIANT_VERSION = $(RADIANT_VERSION_NUMBER)n
-RADIANT_MAJOR_VERSION = 5
-RADIANT_MINOR_VERSION = 0
 Q3MAP_VERSION = 2.5.17n
 
 # Executable extension
@@ -256,7 +257,8 @@ ifneq ($(GIT_VERSION),)
        Q3MAP_VERSION := $(Q3MAP_VERSION)-git-$(GIT_VERSION)
 endif
 
-CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_MAJOR_VERSION="\"$(RADIANT_MAJOR_VERSION)\"" -DRADIANT_MINOR_VERSION="\"$(RADIANT_MINOR_VERSION)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\"" -DQ3MAP_VERSION="\"$(Q3MAP_VERSION)\"" -DRADIANT_EXECUTABLE="\"$(RADIANT_EXECUTABLE)\""
+CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_MAJOR_VERSION="\"$(RADIANT_MAJOR_VERSION)\"" -DRADIANT_MINOR_VERSION="\"$(RADIANT_MINOR_VERSION)\"" -DRADIANT_PATCH_VERSION="\"$(RADIANT_PATCH_VERSION)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\"" -DQ3MAP_VERSION="\"$(Q3MAP_VERSION)\"" -DRADIANT_EXECUTABLE="\"$(RADIANT_EXECUTABLE)\""
+CPPFLAGS += -DGTK_TARGET=2
 
 .PHONY: all
 all: \
@@ -696,6 +698,7 @@ $(INSTALLDIR)/radiant.$(EXE): \
        radiant/stacktrace.o \
        radiant/surfacedialog.o \
        radiant/texmanip.o \
+       radiant/textureentry.o \
        radiant/textures.o \
        radiant/texwindow.o \
        radiant/timer.o \
@@ -710,6 +713,7 @@ $(INSTALLDIR)/radiant.$(EXE): \
        radiant/xywindow.o \
        libcmdlib.$(A) \
        libgtkutil.$(A) \
+       libuilib.$(A) \
        libl_net.$(A) \
        libmathlib.$(A) \
        libprofile.$(A) \
@@ -734,8 +738,6 @@ libgtkutil.$(A): \
        libs/gtkutil/accelerator.o \
        libs/gtkutil/button.o \
        libs/gtkutil/clipboard.o \
-       libs/gtkutil/closure.o \
-       libs/gtkutil/container.o \
        libs/gtkutil/cursor.o \
        libs/gtkutil/dialog.o \
        libs/gtkutil/entry.o \
@@ -743,51 +745,42 @@ libgtkutil.$(A): \
        libs/gtkutil/frame.o \
        libs/gtkutil/glfont.o \
        libs/gtkutil/glwidget.o \
-       libs/gtkutil/idledraw.o \
        libs/gtkutil/image.o \
        libs/gtkutil/menu.o \
        libs/gtkutil/messagebox.o \
        libs/gtkutil/nonmodal.o \
        libs/gtkutil/paned.o \
-       libs/gtkutil/pointer.o \
        libs/gtkutil/toolbar.o \
        libs/gtkutil/widget.o \
        libs/gtkutil/window.o \
        libs/gtkutil/xorrectangle.o \
 
+libuilib.$(A): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_GTKGLEXT) -Ilibs -Iinclude
+libuilib.$(A): \
+       libs/uilib/uilib.o \
+
 libxmllib.$(A): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Ilibs -Iinclude
 libxmllib.$(A): \
-       libs/xml/ixml.o \
-       libs/xml/xmlelement.o \
-       libs/xml/xmlparser.o \
        libs/xml/xmltextags.o \
-       libs/xml/xmlwriter.o \
 
 $(INSTALLDIR)/modules/archivezip.$(DLL): LIBS_EXTRA := $(LIBS_ZLIB)
 $(INSTALLDIR)/modules/archivezip.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_ZLIB) -Ilibs -Iinclude
 $(INSTALLDIR)/modules/archivezip.$(DLL): \
        plugins/archivezip/archive.o \
-       plugins/archivezip/pkzip.o \
        plugins/archivezip/plugin.o \
-       plugins/archivezip/zlibstream.o \
 
 $(INSTALLDIR)/modules/archivewad.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
 $(INSTALLDIR)/modules/archivewad.$(DLL): \
        plugins/archivewad/archive.o \
        plugins/archivewad/plugin.o \
-       plugins/archivewad/wad.o \
 
 $(INSTALLDIR)/modules/archivepak.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
 $(INSTALLDIR)/modules/archivepak.$(DLL): \
        plugins/archivepak/archive.o \
-       plugins/archivepak/pak.o \
        plugins/archivepak/plugin.o \
 
-$(INSTALLDIR)/modules/entity.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
+$(INSTALLDIR)/modules/entity.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
 $(INSTALLDIR)/modules/entity.$(DLL): \
-       plugins/entity/angle.o \
-       plugins/entity/angles.o \
-       plugins/entity/colour.o \
        plugins/entity/doom3group.o \
        plugins/entity/eclassmodel.o \
        plugins/entity/entity.o \
@@ -796,13 +789,7 @@ $(INSTALLDIR)/modules/entity.$(DLL): \
        plugins/entity/group.o \
        plugins/entity/light.o \
        plugins/entity/miscmodel.o \
-       plugins/entity/model.o \
-       plugins/entity/modelskinkey.o \
-       plugins/entity/namedentity.o \
-       plugins/entity/origin.o \
        plugins/entity/plugin.o \
-       plugins/entity/rotation.o \
-       plugins/entity/scale.o \
        plugins/entity/skincache.o \
        plugins/entity/targetable.o \
 
@@ -837,7 +824,7 @@ $(INSTALLDIR)/modules/imagepng.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_PNG) -Ilibs
 $(INSTALLDIR)/modules/imagepng.$(DLL): \
        plugins/imagepng/plugin.o \
 
-$(INSTALLDIR)/modules/mapq3.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
+$(INSTALLDIR)/modules/mapq3.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
 $(INSTALLDIR)/modules/mapq3.$(DLL): \
        plugins/mapq3/parse.o \
        plugins/mapq3/plugin.o \
@@ -1058,8 +1045,9 @@ install-data: binaries
        $(MKDIR) $(INSTALLDIR)/games
        $(FIND) $(INSTALLDIR_BASE)/ -name .svn -exec $(RM_R) {} \; -prune
        DOWNLOAD_GAMEPACKS="$(DOWNLOAD_GAMEPACKS)" GIT="$(GIT)" SVN="$(SVN)" WGET="$(WGET)" RM_R="$(RM_R)" MV="$(MV)" UNZIPPER="$(UNZIPPER)" ECHO="$(ECHO)" SH="$(SH)" CP="$(CP)" CP_R="$(CP_R)" $(SH) install-gamepacks.sh "$(INSTALLDIR)"
-       $(ECHO) $(RADIANT_MINOR_VERSION) > $(INSTALLDIR)/RADIANT_MINOR
        $(ECHO) $(RADIANT_MAJOR_VERSION) > $(INSTALLDIR)/RADIANT_MAJOR
+       $(ECHO) $(RADIANT_MINOR_VERSION) > $(INSTALLDIR)/RADIANT_MINOR
+       $(ECHO) $(RADIANT_PATCH_VERSION) > $(INSTALLDIR)/RADIANT_PATCH
        $(CP_R) setup/data/tools/* $(INSTALLDIR)/
        $(MKDIR) $(INSTALLDIR)/docs
        $(CP_R) docs/* $(INSTALLDIR)/docs/
index f43a8b260ef8c6aa32ec07359339ac73efdb53d8..59e356fa8f13a94bc1f435ed2353e2b76376a3fe 100644 (file)
--- a/README.md
+++ b/README.md
@@ -27,36 +27,23 @@ See also https://gitlab.com/xonotic/netradiant/ for a source browser, issues and
  * GtkGLExt
  * LibJpeg
  * LibPng
+ * Minizip
  * ZLib
 
-# Compiling
-
-This project uses the usual CMake workflow:
-
-`cmake -H. -Bbuild && cmake --build build -- -j$(nproc)`
-
-## linux
-
-```
-cmake -H. -Bbuild -G "Unix Makefiles"
-```
-
 ## msys2
 
-`pacman -S --needed base-devel`
+Under MSYS2, the mingw shell must be used
 
 ### 32 bit:
 
 ```
-pacman -S --needed mingw-w64-i686-{toolchain,cmake,gtk2,gtkglext}
-cmake -H. -Bbuild -G "MSYS Makefiles" -DGTK2_GLIBCONFIG_INCLUDE_DIR=/mingw32/lib/glib-2.0/include -DGTK2_GDKCONFIG_INCLUDE_DIR=/mingw32/lib/gtk-2.0/include
+pacman -S --needed base-devel mingw-w64-i686-{toolchain,cmake,make,gtk2,gtkglext}
 ```
 
 ### 64 bit:
 
 ```
-pacman -S mingw-w64-x86_64-{toolchain,cmake,gtk2,gtkglext}
-cmake -H. -Bbuild -G "MSYS Makefiles" -DGTK2_GLIBCONFIG_INCLUDE_DIR=/mingw64/lib/glib-2.0/include -DGTK2_GDKCONFIG_INCLUDE_DIR=/mingw64/lib/gtk-2.0/include
+pacman -S --needed base-devel mingw-w64-x86_64-{toolchain,cmake,make,gtk2,gtkglext}
 ```
 
 ## OS X:
@@ -67,8 +54,23 @@ brew install Caskroom/cask/xquartz
 brew link --force gettext
 ```
 
-More Compilation Details
-------------------------
+# Compiling
+
+This project uses the usual CMake workflow:
+
+## Debug
+
+```
+cmake -G "Unix Makefiles" -H. -Bbuild && cmake --build build -- -j$(nproc)
+```
+
+## Release
+
+```
+cmake -G "Unix Makefiles" -H. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build -- -j$(nproc)
+```
+
+## More Compilation Details
 
 options:
  * `DOWNLOAD_GAMEPACKS=ON`
index 092bdc863abb4f19fa0699674d91b0a8aef35f0f..4b1b26504b27c0ee2beb6b1aea50f2a1619a22f2 100644 (file)
@@ -1,9 +1,21 @@
-include(FindPkgConfig)
+find_package(PkgConfig)
 if (PKG_CONFIG_FOUND)
     if (GLIB_FIND_REQUIRED)
-        set(_PACKAGE_ARGS REQUIRED)
-    else ()
-        set(_PACKAGE_ARGS "")
+        set(_pkgconfig_REQUIRED REQUIRED)
+    endif ()
+    pkg_check_modules(GLIB ${_pkgconfig_REQUIRED} glib-2.0)
+else ()
+    find_path(GLIB_INCLUDE_DIRS glib.h)
+    find_library(GLIB_LIBRARIES glib-2.0)
+    if (GLIB_INCLUDE_DIRS AND GLIB_LIBRARIES)
+        set(GLIB_FOUND 1)
+        if (NOT GLIB_FIND_QUIETLY)
+            message(STATUS "Found GLIB: ${GLIB_LIBRARIES}")
+        endif ()
+    elseif (GLIB_FIND_REQUIRED)
+        message(SEND_ERROR "Could not find GLIB")
+    elseif (NOT GLIB_FIND_QUIETLY)
+        message(STATUS "Could not find GLIB")
     endif ()
-    pkg_check_modules(GLIB glib-2.0 ${_PACKAGE_ARGS})
 endif ()
+mark_as_advanced(GLIB_INCLUDE_DIRS GLIB_LIBRARIES)
diff --git a/cmake/FindGTK2.cmake b/cmake/FindGTK2.cmake
new file mode 100644 (file)
index 0000000..ff20526
--- /dev/null
@@ -0,0 +1,21 @@
+find_package(PkgConfig)
+if (PKG_CONFIG_FOUND)
+    if (GTK2_FIND_REQUIRED)
+        set(_pkgconfig_REQUIRED REQUIRED)
+    endif ()
+    pkg_check_modules(GTK2 ${_pkgconfig_REQUIRED} gtk+-2.0)
+else ()
+    find_path(GTK2_INCLUDE_DIRS gtk.h)
+    # find_library(GTK2_LIBRARIES)
+    if (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES)
+        set(GTK2_FOUND 1)
+        if (NOT GTK2_FIND_QUIETLY)
+            message(STATUS "Found GTK2: ${GTK2_LIBRARIES}")
+        endif ()
+    elseif (GTK2_FIND_REQUIRED)
+        message(SEND_ERROR "Could not find GTK2")
+    elseif (NOT GTK2_FIND_QUIETLY)
+        message(STATUS "Could not find GTK2")
+    endif ()
+endif ()
+mark_as_advanced(GTK2_INCLUDE_DIRS GTK2_LIBRARIES)
diff --git a/cmake/FindGTK3.cmake b/cmake/FindGTK3.cmake
new file mode 100644 (file)
index 0000000..7bef3b0
--- /dev/null
@@ -0,0 +1,21 @@
+find_package(PkgConfig)
+if (PKG_CONFIG_FOUND)
+    if (GTK3_FIND_REQUIRED)
+        set(_pkgconfig_REQUIRED REQUIRED)
+    endif ()
+    pkg_check_modules(GTK3 ${_pkgconfig_REQUIRED} gtk+-3.0)
+else ()
+    find_path(GTK3_INCLUDE_DIRS gtk.h)
+    # find_library(GTK3_LIBRARIES)
+    if (GTK3_INCLUDE_DIRS AND GTK3_LIBRARIES)
+        set(GTK3_FOUND 1)
+        if (NOT GTK3_FIND_QUIETLY)
+            message(STATUS "Found GTK3: ${GTK3_LIBRARIES}")
+        endif ()
+    elseif (GTK3_FIND_REQUIRED)
+        message(SEND_ERROR "Could not find GTK3")
+    elseif (NOT GTK3_FIND_QUIETLY)
+        message(STATUS "Could not find GTK3")
+    endif ()
+endif ()
+mark_as_advanced(GTK3_INCLUDE_DIRS GTK3_LIBRARIES)
index 7fb3e9d1bfef83e502aa4769e12522e76326d012..b30a1e1185fe57a11b891f277bccba0df94f0bfb 100644 (file)
@@ -1,16 +1,27 @@
-include(FindPkgConfig)
+find_package(PkgConfig)
 if (PKG_CONFIG_FOUND)
     if (GtkGLExt_FIND_REQUIRED)
-        set(_PACKAGE_ARGS REQUIRED)
-    else ()
-        set(_PACKAGE_ARGS "")
+        set(_pkgconfig_REQUIRED REQUIRED)
     endif ()
-    pkg_check_modules(GTK gtk+-2.0 ${_PACKAGE_ARGS})
     if (XWINDOWS)
-        pkg_check_modules(GTKGL gtkglext-x11-1.0 ${_PACKAGE_ARGS})
+        pkg_check_modules(GtkGLExt ${_pkgconfig_REQUIRED} gtkglext-x11-1.0)
     elseif (WIN32)
-        pkg_check_modules(GTKGL gtkglext-win32-1.0 ${_PACKAGE_ARGS})
+        pkg_check_modules(GtkGLExt ${_pkgconfig_REQUIRED} gtkglext-win32-1.0)
     else ()
-        pkg_check_modules(GTKGL gtkglext-quartz-1.0 ${_PACKAGE_ARGS})
+        pkg_check_modules(GtkGLExt ${_pkgconfig_REQUIRED} gtkglext-quartz-1.0)
+    endif ()
+else ()
+    find_path(GtkGLExt_INCLUDE_DIRS gtkglwidget.h)
+    # find_library(GtkGLExt_LIBRARIES)
+    if (GtkGLExt_INCLUDE_DIRS AND GtkGLExt_LIBRARIES)
+        set(GtkGLExt_FOUND 1)
+        if (NOT GtkGLExt_FIND_QUIETLY)
+            message(STATUS "Found GtkGLExt: ${GtkGLExt_LIBRARIES}")
+        endif ()
+    elseif (GtkGLExt_FIND_REQUIRED)
+        message(SEND_ERROR "Could not find GtkGLExt")
+    elseif (NOT GtkGLExt_FIND_QUIETLY)
+        message(STATUS "Could not find GtkGLExt")
     endif ()
 endif ()
+mark_as_advanced(GtkGLExt_INCLUDE_DIRS GtkGLExt_LIBRARIES)
index b874c391dd3152eda822e5cba48bb8aadf2eedc0..0de098f438fb258aba1d66bf397cb802e660db09 100644 (file)
@@ -1,9 +1,21 @@
-include(FindPkgConfig)
+find_package(PkgConfig)
 if (PKG_CONFIG_FOUND)
     if (Minizip_FIND_REQUIRED)
-        set(_PACKAGE_ARGS REQUIRED)
-    else ()
-        set(_PACKAGE_ARGS "")
+        set(_pkgconfig_REQUIRED REQUIRED)
+    endif ()
+    pkg_check_modules(Minizip ${_pkgconfig_REQUIRED} minizip)
+else ()
+    find_path(Minizip_INCLUDE_DIRS unzip.h)
+    # find_library(Minizip_LIBRARIES)
+    if (Minizip_INCLUDE_DIRS AND Minizip_LIBRARIES)
+        set(Minizip_FOUND 1)
+        if (NOT Minizip_FIND_QUIETLY)
+            message(STATUS "Found Minizip: ${Minizip_LIBRARIES}")
+        endif ()
+    elseif (Minizip_FIND_REQUIRED)
+        message(SEND_ERROR "Could not find Minizip")
+    elseif (NOT Minizip_FIND_QUIETLY)
+        message(STATUS "Could not find Minizip")
     endif ()
-    pkg_check_modules(MINIZIP minizip ${_PACKAGE_ARGS})
 endif ()
+mark_as_advanced(Minizip_INCLUDE_DIRS Minizip_LIBRARIES)
diff --git a/cmake/FindPango.cmake b/cmake/FindPango.cmake
new file mode 100644 (file)
index 0000000..67359ef
--- /dev/null
@@ -0,0 +1,23 @@
+find_package(PkgConfig)
+if (PKG_CONFIG_FOUND)
+    if (Pango_FIND_REQUIRED)
+        set(_pkgconfig_REQUIRED REQUIRED)
+    endif ()
+    pkg_search_module(Pango ${_pkgconfig_REQUIRED} pango pangocairo)
+    pkg_search_module(PangoFT2 ${_pkgconfig_REQUIRED} pangoft2)
+else ()
+    # find_path(Pango_INCLUDE_DIRS)
+    # find_library(Pango_LIBRARIES)
+    if (Pango_INCLUDE_DIRS AND Pango_LIBRARIES)
+        set(Pango_FOUND 1)
+        if (NOT Pango_FIND_QUIETLY)
+            message(STATUS "Found Pango: ${Pango_LIBRARIES}")
+        endif ()
+    elseif (Pango_FIND_REQUIRED)
+        message(SEND_ERROR "Could not find Pango")
+    elseif (NOT Pango_FIND_QUIETLY)
+        message(STATUS "Could not find Pango")
+    endif ()
+endif ()
+mark_as_advanced(Pango_INCLUDE_DIRS Pango_LIBRARIES)
+mark_as_advanced(PangoFT2_INCLUDE_DIRS PangoFT2_LIBRARIES)
diff --git a/cmake/scripts/package.cmake b/cmake/scripts/package.cmake
new file mode 100644 (file)
index 0000000..be530ec
--- /dev/null
@@ -0,0 +1,16 @@
+set(CPACK_PACKAGE_NAME "NetRadiant")
+set(CPACK_PACKAGE_VERSION_MAJOR "${NetRadiant_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${NetRadiant_VERSION_MINOR}")
+set(CPACK_PACKAGE_VERSION_PATCH "${NetRadiant_VERSION_PATCH}")
+
+# binary: --target package
+set(CPACK_GENERATOR "ZIP")
+set(CPACK_STRIP_FILES 1)
+
+# source: --target package_source
+set(CPACK_SOURCE_GENERATOR "ZIP")
+set(CPACK_SOURCE_IGNORE_FILES "/\\\\.git/;/build/;/install/")
+
+# configure
+include(InstallRequiredSystemLibraries)
+include(CPack)
index 7899526fd03405306101ef6a3e41f869beba4d47..8233ea1e672581e7c4febfff5b58fde1b4c5f3df 100644 (file)
@@ -5,6 +5,11 @@ macro(radiant_plugin name)
     message(STATUS "Found Plugin ${name}")
     add_library(${name} MODULE ${ARGN})
     add_dependencies(plugins ${name})
+    copy_dlls(${name})
+    install(
+            TARGETS ${name}
+            LIBRARY DESTINATION plugins
+    )
 endmacro()
 
 add_subdirectory(bobtoolz)
index b115952550b48e9de09ae19f18477fa0eb6dd7ca..7ed6315dc5365775e46acbc189882a3067debb3f 100644 (file)
 
 CBackgroundRender render;
 
-CBackgroundImage backgroundXY( XY ),backgroundXZ( XZ ),backgroundYZ( YZ );
+CBackgroundImage backgroundXY(XY), backgroundXZ(XZ), backgroundYZ(YZ);
 
-CBackgroundRender::CBackgroundRender(){
-       refCount = 1;
+CBackgroundRender::CBackgroundRender()
+{
+    refCount = 1;
 }
 
-CBackgroundRender::~CBackgroundRender(){
+CBackgroundRender::~CBackgroundRender()
+{
 }
 
-void CBackgroundRender::Register(){
-       g_QglTable.m_pfnHookGL2DWindow( this );
+void CBackgroundRender::Register()
+{
+    g_QglTable.m_pfnHookGL2DWindow(this);
 }
 
-void CBackgroundRender::Draw2D( VIEWTYPE vt ){
-       switch ( vt )
-       {
-       case XY:
-               backgroundXY.Render();
-               break;
-       case XZ:
-               backgroundXZ.Render();
-               break;
-       case YZ:
-               backgroundYZ.Render();
-               break;
-       }
+void CBackgroundRender::Draw2D(VIEWTYPE vt)
+{
+    switch (vt) {
+        case XY:
+            backgroundXY.Render();
+            break;
+        case XZ:
+            backgroundXZ.Render();
+            break;
+        case YZ:
+            backgroundYZ.Render();
+            break;
+    }
 }
 
 
-CBackgroundImage::CBackgroundImage( VIEWTYPE vt ){
-       m_tex = NULL;
-       m_alpha = 0.5;
-
-       // TODO, sensible defaults ? Or not show until we have extents ?
-       m_xmin = m_ymin = 0.0f;
-       m_xmax = m_ymax = 0.0f;
-
-       m_bActive = false;
-
-       m_vt = 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;
-       }
+CBackgroundImage::CBackgroundImage(VIEWTYPE vt)
+{
+    m_tex = NULL;
+    m_alpha = 0.5;
+
+    // TODO, sensible defaults ? Or not show until we have extents ?
+    m_xmin = m_ymin = 0.0f;
+    m_xmax = m_ymax = 0.0f;
+
+    m_bActive = false;
+
+    m_vt = 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;
+    }
 }
 
 /*
@@ -96,214 +99,214 @@ CBackgroundImage::CBackgroundImage( VIEWTYPE vt ){
    }
  */
 
-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::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() ) {
-               return;
-       }
-       g_QglTable.m_pfn_qglPushAttrib( GL_ALL_ATTRIB_BITS );
+void CBackgroundImage::Render()
+{
+    if (!m_bActive || !Valid()) {
+        return;
+    }
+    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 );
-       // 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_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_qglEnd();
+    g_QglTable.m_pfn_qglBindTexture(GL_TEXTURE_2D, 0);
 
-       g_QglTable.m_pfn_qglPopAttrib();
+    g_QglTable.m_pfn_qglPopAttrib();
 }
 
-bool CBackgroundImage::Load( const char *filename ){
-       qtexture_t *newtex;
+bool CBackgroundImage::Load(const char *filename)
+{
+    qtexture_t *newtex;
 
-       unsigned char *image = NULL; // gets allocated with what ? g_malloc
-       int width = 0, height = 0;
+    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 );
-               return false;
-       }
+    if (!image) {
+        Syn_Printf(MSG_WARN "load %s failed\n", filename);
+        return false;
+    }
 
 // just in case we want to build for an old version
 // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=900
 #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;
-               int i;
-               for ( i = 3; i < size; i += 4 ) {
-                       image[i] = 255;
-               }
-       }
+    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 ) {
+            image[i] = 255;
+        }
+    }
 #endif
 
-       //TODO bug for stored texture size
-       //TODO whose gl context are we in, anyway ?
-       newtex = g_FuncTable.m_pfnLoadTextureRGBA( image,width,height );
+    //TODO bug for stored texture size
+    //TODO whose gl context are we in, anyway ?
+    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" );
-               return false;
-       }
+    if (!newtex) {
+        Syn_Printf(MSG_WARN "image to texture failed\n");
+        return false;
+    }
 
-       Cleanup();
-       m_tex = newtex;
+    Cleanup();
+    m_tex = newtex;
 
-       g_FuncTable.m_pfnSysUpdateWindows( W_XY );
+    g_FuncTable.m_pfnSysUpdateWindows(W_XY);
 
-       return true;
+    return true;
 }
 
-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" );
-               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" );
-               return false;
-       }
+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");
+        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");
+        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" );
-               return false;
-       }
-
-       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" );
-               return false;
-       }
-       //might do sanity check before we commit
-       m_xmin = (float)xmin;
-       m_ymin = (float)ymin;
-       m_xmax = (float)xmax;
-       m_ymax = (float)ymax;
-
-       g_FuncTable.m_pfnSysUpdateWindows( W_XY );
-       return true;
+    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");
+        return false;
+    }
+    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
+    m_xmin = (float) xmin;
+    m_ymin = (float) ymin;
+    m_xmax = (float) xmax;
+    m_ymax = (float) ymax;
+
+    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;
-       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;
-       }
-       // this should mean no selection
-       if ( selected_brushes == selected_brushes->next ) {
-               Sys_Printf( MSG_PREFIX "nothing selected\n" );
-
-               return false;
-       }
-
-       for ( i = 0 ; i < 3 ; i++ )
-       {
-               mins[i] = 99999;
-               maxs[i] = -99999;
-       }
-
-       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->origin[i] < mins[i] ) {
-                                       mins[i] = b->owner->origin[i];
-                               }
-                               if ( b->owner->origin[i] > maxs[i] ) {
-                                       maxs[i] = b->owner->origin[i];
-                               }
-                       }
-               }
-               else
-               {
-                       for ( i = 0 ; i < 3 ; i++ )
-                       {
-                               if ( b->mins[i] < mins[i] ) {
-                                       mins[i] = b->mins[i];
-                               }
-                               if ( b->maxs[i] > maxs[i] ) {
-                                       maxs[i] = b->maxs[i];
-                               }
-                       }
-               }
-       }
-       return true;
+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;
+    }
+    // this should mean no selection
+    if (selected_brushes == selected_brushes->next) {
+        Sys_Printf(MSG_PREFIX "nothing selected\n");
+
+        return false;
+    }
+
+    for (i = 0; i < 3; i++) {
+        mins[i] = 99999;
+        maxs[i] = -99999;
+    }
+
+    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->origin[i] < mins[i]) {
+                    mins[i] = b->owner->origin[i];
+                }
+                if (b->owner->origin[i] > maxs[i]) {
+                    maxs[i] = b->owner->origin[i];
+                }
+            }
+        } else {
+            for (i = 0; i < 3; i++) {
+                if (b->mins[i] < mins[i]) {
+                    mins[i] = b->mins[i];
+                }
+                if (b->maxs[i] > maxs[i]) {
+                    maxs[i] = b->maxs[i];
+                }
+            }
+        }
+    }
+    return true;
 }
 
-bool CBackgroundImage::SetExtentsSel(){
-       vec3_t mins,maxs;
+bool CBackgroundImage::SetExtentsSel()
+{
+    vec3_t mins, maxs;
 
-       if ( !get_selection_bounds( mins,maxs ) ) {
-               return false;
-       }
+    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" );
-               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");
+        return false;
+    }
 
-       m_xmin = mins[m_ix];
-       m_ymin = mins[m_iy];
-       m_xmax = maxs[m_ix];
-       m_ymax = maxs[m_iy];
+    m_xmin = mins[m_ix];
+    m_ymin = mins[m_iy];
+    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 41ee2713f08384c70ae8e511d56d2b2caa95322e..5c3bf3ee24db7745a0f29953c7f58a5d1adcb473 100644 (file)
 
 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
 // 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();
+    void IncRef()
+    { refCount++; }
+
+    void DecRef()
+    {
+        refCount--;
+        if (refCount <= 0) {
+            delete this;
+        }
+    }
+
+    void Draw2D(VIEWTYPE vt);
+
+    void Register();
 };
 
-extern CBackgroundImage backgroundXY,backgroundXZ,backgroundYZ;
+extern CBackgroundImage backgroundXY, backgroundXZ, backgroundYZ;
 extern CBackgroundRender render;
index 6d63bc3fd80e8cba0bb60ddd484088da45f470bb..7bdf466aad9e0dbe4c2cf5c7c4840968b87dbf76 100644 (file)
 // spaces to make label nice and big
 #define NO_FILE_MSG "        (no file loaded)        "
 
-static GtkWidget *pDialogWnd;
+static ui::Window pDialogWnd{ui::null};
 static GtkWidget *pNotebook;
 static GtkTooltips *pTooltips;
 
-class CBackgroundDialogPage
-{
+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;
+    ui::Label 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 ){
-       CBackgroundDialogPage *pPage = (CBackgroundDialogPage *)data;
-       if ( pPage->m_pImage->SetExtentsSel() ) {
-               pPage->SetPosLabel();
-       }
+static void size_sel_callback(GtkWidget *widget, gpointer data)
+{
+    CBackgroundDialogPage *pPage = (CBackgroundDialogPage *) data;
+    if (pPage->m_pImage->SetExtentsSel()) {
+        pPage->SetPosLabel();
+    }
 }
 
-static void size_mm_callback( GtkWidget *widget, gpointer data ){
-       CBackgroundDialogPage *pPage = (CBackgroundDialogPage *)data;
-       if ( pPage->m_pImage->SetExtentsMM() ) {
-               pPage->SetPosLabel();
-       }
+static void size_mm_callback(GtkWidget *widget, gpointer data)
+{
+    CBackgroundDialogPage *pPage = (CBackgroundDialogPage *) data;
+    if (pPage->m_pImage->SetExtentsMM()) {
+        pPage->SetPosLabel();
+    }
 }
 
-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 );
+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);
 }
 
-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(){
-       char browsedir[PATH_MAX];
-       const char *ct;
-       const char *newfile;
-       char *t;
+void CBackgroundDialogPage::Browse()
+{
+    char browsedir[PATH_MAX];
+    const char *ct;
+    const char *newfile;
+    char *t;
 
-       //TODO GetMapName saves the map. eeep!
-       //also with no map, returns unnamed.map, otherwise returns full path
+    //TODO GetMapName saves the map. eeep!
+    //also with no map, returns unnamed.map, otherwise returns full path
 //     Syn_Printf(MSG_PREFIX "GetMapName() %s\n",
 //                             g_FuncTable.m_pfnGetMapName());
 
-       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" );
-               return;
-       }
-       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 );
-       // make sure we have a trailing /
-       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 );
-
-               // lop off the file part
-               t = browsedir + strlen( browsedir ) - 1;
-               while ( t != browsedir && *t != '/' )
-                       t--;
-               *t = 0;
-       }
-       Syn_Printf( MSG_PREFIX "browse directory %s\n",browsedir );
+    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");
+        return;
+    }
+    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);
+    // make sure we have a trailing /
+    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);
+
+        // lop off the file part
+        t = browsedir + strlen(browsedir) - 1;
+        while (t != browsedir && *t != '/') {
+            t--;
+        }
+        *t = 0;
+    }
+    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
 //http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=915
-       newfile = g_FuncTable.m_pfnFileDialog( pDialogWnd,TRUE,
-                                                                                  "Load Background Image",browsedir,FILETYPE_KEY );
-       if ( !newfile ) {
-               Syn_Printf( MSG_PREFIX "newfile = NULL\n" );
-               return;
-       }
-       Syn_Printf( MSG_PREFIX "newfile: %s\n",newfile );
-       newfile = g_FileSystemTable.m_pfnExtractRelativePath( newfile );
-
-       if ( !newfile ) {
-               Syn_Printf( MSG_PREFIX "newfile = NULL\n" );
-               return;
-       }
-       Syn_Printf( MSG_PREFIX "newfile: %s\n",newfile );
-
-       if ( m_pImage->Load( newfile ) ) {
-               m_bValidFile = true;
-               gtk_label_set_text( GTK_LABEL( m_pFileLabel ),newfile );
-       }
+    newfile = g_FuncTable.m_pfnFileDialog(pDialogWnd, TRUE,
+                                          "Load Background Image", browsedir, FILETYPE_KEY);
+    if (!newfile) {
+        Syn_Printf(MSG_PREFIX "newfile = NULL\n");
+        return;
+    }
+    Syn_Printf(MSG_PREFIX "newfile: %s\n", newfile);
+    newfile = g_FileSystemTable.m_pfnExtractRelativePath(newfile);
+
+    if (!newfile) {
+        Syn_Printf(MSG_PREFIX "newfile = NULL\n");
+        return;
+    }
+    Syn_Printf(MSG_PREFIX "newfile: %s\n", newfile);
+
+    if (m_pImage->Load(newfile)) {
+        m_bValidFile = true;
+        m_pFileLabel.text(newfile);
+    }
 }
 
-void CBackgroundDialogPage::SetPosLabel(){
-       char s[64];
-       // TODO no snprintf ?
-       sprintf( s, "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 );
+void CBackgroundDialogPage::SetPosLabel()
+{
+    char s[64];
+    // TODO no snprintf ?
+    sprintf(s, "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));
+    m_pPosLabel.text(s);
 }
 
-CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){
-       GtkWidget *frame;
-       GtkWidget *hbox;
-       GtkWidget *w;
-
-       m_vt = vt;
-
-       m_bValidFile = false;
-
-       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;
-       }
+CBackgroundDialogPage::CBackgroundDialogPage(VIEWTYPE vt)
+{
+    GtkWidget *w;
+
+    m_vt = vt;
+
+    m_bValidFile = false;
+
+    switch (m_vt) {
+        case XY:
+            m_pTabLabel = ui::Label("X/Y");
+            m_pImage = &backgroundXY;
+            break;
+        case XZ:
+            m_pTabLabel = ui::Label("X/Z");
+            m_pImage = &backgroundXZ;
+            break;
+        case YZ:
+            m_pTabLabel = ui::Label("Y/Z");
+            m_pImage = &backgroundYZ;
+            break;
+    }
 // A vbox to hold everything
-       m_pWidget = gtk_vbox_new( FALSE,0 );
+    m_pWidget = ui::VBox(FALSE, 0);
 // Frame for file row
-       frame = gtk_frame_new( "File" );
-       gtk_box_pack_start( GTK_BOX( m_pWidget ),frame, FALSE, FALSE, 2 );
+    auto frame = ui::Frame("File");
+    m_pWidget.pack_start(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 );
+    auto hbox = ui::HBox(FALSE, 5);
+    gtk_container_set_border_width(GTK_CONTAINER(hbox), 4);
+    frame.add(hbox);
 
 // label to display filename
-       m_pFileLabel  = gtk_label_new( NO_FILE_MSG );
-       gtk_label_set_selectable( GTK_LABEL( m_pFileLabel ),TRUE );
+    m_pFileLabel = ui::Label(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 );
+    hbox.pack_start(m_pFileLabel, TRUE, TRUE, 5);
 
-       gtk_widget_show( m_pFileLabel );
+    m_pFileLabel.show();
 
-       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 = ui::Button("Browse...");
+    w.connect("clicked", G_CALLBACK(browse_callback), (gpointer) this );
+    hbox.pack_start(w, FALSE, FALSE, 5);
+    gtk_tooltips_set_tip(pTooltips, w, "Select a file", NULL);
+    w.show();
 
-       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 );
+    w = ui::Button("Reload");
+    w.connect("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);
+    hbox.pack_start(w, FALSE, FALSE, 5);
+    w.show();
 
-       gtk_widget_show( hbox );
-       gtk_widget_show( frame );
+    hbox.show();
+    frame.show();
 
 // 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 = ui::Frame("Rendering");
+    m_pWidget.pack_start(frame, FALSE, FALSE, 2);
+
+    hbox = ui::HBox(FALSE, 5);
+    gtk_container_set_border_width(GTK_CONTAINER(hbox), 4);
+    frame.add(hbox);
+
+    w = ui::Label("Vertex alpha:");
+    hbox.pack_start(w, FALSE, FALSE, 5);
+    w.show();
+
+    w = ui::HScale(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);
+    w.connect("value-changed", G_CALLBACK(alpha_adjust_callback), (gpointer) this );
+    hbox.pack_start(w, TRUE, TRUE, 5);
+    gtk_tooltips_set_tip(pTooltips, w, "Set image transparancy", NULL);
+    w.show();
+
+    hbox.show();
+    frame.show();
 // 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 );
-       }
-
-       gtk_widget_show( hbox );
-       gtk_widget_show( frame );
-
-       gtk_widget_show( m_pWidget );
+    frame = ui::Frame("Size/Position (undefined)");
+    m_pPosLabel = gtk_frame_get_label_widget(GTK_FRAME(frame));
+    m_pWidget.pack_start(frame, FALSE, FALSE, 2);
+
+    hbox = ui::HBox(FALSE, 5);
+    frame.add(hbox);
+    gtk_container_set_border_width(GTK_CONTAINER(hbox), 4);
+
+    w = ui::Button("from selection");
+    hbox.pack_start(w, TRUE, FALSE, 5);
+    w.connect("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);
+    w.show();
+
+    if (m_vt == XY) {
+        w = ui::Button("from map mins/maxs");
+        hbox.pack_start(w, TRUE, FALSE, 2);
+        w.connect("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);
+        w.show();
+    }
+
+    hbox.show();
+    frame.show();
+
+    m_pWidget.show();
 }
 
-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
@@ -299,55 +310,58 @@ void CBackgroundDialogPage::Append( GtkWidget *notebook ){
    }
  */
 
-static void response_callback( GtkWidget *widget, gint response, gpointer data ){
-       if ( response == GTK_RESPONSE_CLOSE ) {
-               gtk_widget_hide( pDialogWnd );
-       }
+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 );
-       return TRUE;
+static gint close_callback(GtkWidget *widget, gpointer data)
+{
+    gtk_widget_hide(pDialogWnd);
+    return TRUE;
 }
 
-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 );
-
-       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 );
-
-       gtk_box_pack_start( GTK_BOX( GTK_DIALOG( pDialogWnd )->vbox ), pNotebook, TRUE, TRUE, 0 );
-
-       gtk_widget_show( pNotebook );
-
-       gtk_widget_realize( pDialogWnd );
+void InitBackgroundDialog()
+{
+    CBackgroundDialogPage *pPage;
+
+    pDialogWnd = gtk_dialog_new_with_buttons("Background Images",
+                                             g_pMainWidget,
+                                             (GtkDialogFlags)(GTK_DIALOG_DESTROY_WITH_PARENT),
+            // TODO dialog with no buttons
+            //                                                                           GTK_STOCK_CLOSE,
+            //                                                                           GTK_RESPONSE_CLOSE,
+                                             NULL);
+    pDialogWnd.connect("delete_event", G_CALLBACK(close_callback), NULL);
+    pDialogWnd.connect("response", G_CALLBACK(response_callback), NULL);
+//  pDialogWnd.connect( "expose_event", G_CALLBACK( 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);
+
+    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(pDialogWnd)->vbox), pNotebook, TRUE, TRUE, 0);
+
+    pNotebook.show();
+
+    gtk_widget_realize(pDialogWnd);
 }
 
-void ShowBackgroundDialog(){
-       gtk_window_present( GTK_WINDOW( pDialogWnd ) );
+void ShowBackgroundDialog()
+{
+    gtk_window_present(pDialogWnd);
 }
 
-void ShowBackgroundDialogPG( int page ){
-       gtk_notebook_set_current_page( GTK_NOTEBOOK( pNotebook ),page );
-       ShowBackgroundDialog();
+void ShowBackgroundDialogPG(int page)
+{
+    gtk_notebook_set_current_page(GTK_NOTEBOOK(pNotebook), page);
+    ShowBackgroundDialog();
 }
index 29a511d6ef5a4753d1f96e6d517699a9abb530e6..e442dda441a1eff2377ffde301563d6f32cd9ddd 100644 (file)
@@ -29,7 +29,9 @@
 #define _BKGRND2D_DIALOG_H_
 
 void InitBackgroundDialog();
+
 void ShowBackgroundDialog();
-void ShowBackgroundDialogPG( int page );
+
+void ShowBackgroundDialogPG(int page);
 
 #endif // _BKGRND2D_DIALOG_H_
index 35fb072071286131eff680f1ea983cd2e79c63b2..261b5412afb759c2d1e4e22355abfd2d728c8251 100644 (file)
@@ -80,224 +80,248 @@ 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)";
 
 
 void DoBkgrndToggleXY();
+
 void DoBkgrndToggleXZ();
+
 void DoBkgrndToggleYZ();
 
 #define NUM_TOOLBAR_BUTTONS 4
-struct toolbar_button_info_s
-{
-       const char *image;
-       const char *text;
-       const char *tip;
-       void ( *func )();
-       IToolbarButton::EType type;
-};
 
-struct toolbar_button_info_s toolbar_buttons[NUM_TOOLBAR_BUTTONS] =
-{
-       {
-               "bkgrnd2d_xy_toggle.png",
-               "xy background",
-               "Toggle xy background image",
-               DoBkgrndToggleXY,
-               IToolbarButton::eToggleButton
-       },
-       {
-               "bkgrnd2d_xz_toggle.png",
-               "xz background",
-               "Toggle xz background image",
-               DoBkgrndToggleXZ,
-               IToolbarButton::eToggleButton
-       },
-       {
-               "bkgrnd2d_yz_toggle.png",
-               "yz background",
-               "Toggle yz background image",
-               DoBkgrndToggleYZ,
-               IToolbarButton::eToggleButton
-       },
-       {
-               "bkgrnd2d_conf.png",
-               "Configure",
-               "Configure background images",
-               ShowBackgroundDialog,
-               IToolbarButton::eButton
-       },
+struct toolbar_button_info_s {
+    const char *image;
+    const char *text;
+    const char *tip;
+
+    void ( *func )();
+
+    IToolbarButton::EType type;
 };
 
-class Bkgrnd2dButton : public IToolbarButton
-{
+struct toolbar_button_info_s toolbar_buttons[NUM_TOOLBAR_BUTTONS] =
+        {
+                {
+                        "bkgrnd2d_xy_toggle.png",
+                        "xy background",
+                        "Toggle xy background image",
+                        DoBkgrndToggleXY,
+                        IToolbarButton::eToggleButton
+                },
+                {
+                        "bkgrnd2d_xz_toggle.png",
+                        "xz background",
+                        "Toggle xz background image",
+                        DoBkgrndToggleXZ,
+                        IToolbarButton::eToggleButton
+                },
+                {
+                        "bkgrnd2d_yz_toggle.png",
+                        "yz background",
+                        "Toggle yz background image",
+                        DoBkgrndToggleYZ,
+                        IToolbarButton::eToggleButton
+                },
+                {
+                        "bkgrnd2d_conf.png",
+                        "Configure",
+                        "Configure background images",
+                        ShowBackgroundDialog,
+                        IToolbarButton::eButton
+                },
+        };
+
+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);
+    }
 }
 
 // =============================================================================
 // SYNAPSE
 
-CSynapseServerg_pSynapseServer = NULL;
+CSynapseServer *g_pSynapseServer = NULL;
 CSynapseClientBkgrnd2d g_SynapseClient;
 
-extern "C" CSynapseClient * SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ){
-       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() );
+extern "C" CSynapseClient *SYNAPSE_DLL_EXPORT
 
-       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 );
+Synapse_EnumerateInterfaces(const char *version, CSynapseServer *pServer)
+{
+    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 13ca737884e29ca048f98a0d9d6b222f81d1d483..361bf833c2b4fb56ff33845e002c836efb2fb367 100644 (file)
@@ -41,7 +41,9 @@
 #include "synapse.h"
 #include "iplugin.h"
 #include "itoolbar.h"
+
 #define USE_QERTABLE_DEFINE
+
 #include "qerplugin.h"
 #include "igl.h"
 #include "ifilesystem.h"
@@ -58,19 +60,24 @@ extern _QEREntityTable g_EntityTable;
 extern _QERAppDataTable g_DataTable;
 extern void *g_pMainWidget;
 
-extern CSynapseServerg_pSynapseServer;
+extern CSynapseServer *g_pSynapseServer;
 
-class CSynapseClientBkgrnd2d : public CSynapseClient
-{
+class CSynapseClientBkgrnd2d : public CSynapseClient {
 public:
 // CSynapseClient API
-bool RequestAPI( APIDescriptor_t *pAPI );
-const char* GetInfo();
-const char* GetName();
+    bool RequestAPI(APIDescriptor_t *pAPI);
+
+    const char *GetInfo();
 
-CSynapseClientBkgrnd2d() { }
-virtual ~CSynapseClientBkgrnd2d() { }
+    const char *GetName();
+
+    CSynapseClientBkgrnd2d()
+    {}
+
+    virtual ~CSynapseClientBkgrnd2d()
+    {}
 };
+
 #define MSG_PREFIX "bkgrnd2d: "
 #define MSG_WARN "bkgrnd2d WARNING: "
 #define BKGRND2D_MINOR "bkgrnd2d"
index fb6f7fb0ad4379d0bddef9acf046b3d4e2d37f06..c9b83cb74e68326dfc7863cb13f4943435f6be2b 100644 (file)
@@ -26,7 +26,6 @@ radiant_plugin(bobtoolz
         resource-gtk.h
         ScriptParser.cpp ScriptParser.h
         shapes.cpp shapes.h
-        StdAfx.cpp StdAfx.h
         visfind.cpp visfind.h
         )
 
index fc55553130eb2b6f6a0daa4c3496430bc63e51b4..eea867cc607ee3249e9f3c46e4b945cbb85eed9d 100644 (file)
 
 class CBspPoint {
 public:
-float p[3];
+    float p[3];
 };
 
 class CBspPortal {
 public:
-CBspPortal();
-~CBspPortal();
+    CBspPortal();
 
-unsigned point_count;
-CBspPoint *point;
-bool Build( char *def, unsigned int pointCnt, bool bInverse );
+    ~CBspPortal();
+
+    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);
 
-bool AddPortal( char* def, unsigned int pointCnt, bool bInverse );
-unsigned int portal_next;
-CBspNode();
-~CBspNode();
+    unsigned int portal_next;
+
+    CBspNode();
+
+    ~CBspNode();
 };
 
 
@@ -50,14 +55,15 @@ 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[NAME_MAX];
-CBspNode *node;
+    char fn[NAME_MAX];
+    CBspNode *node;
 
-unsigned int node_count;
+    unsigned int node_count;
 };
index 55dd8e4dd58d083435c2e79be5fd901c77fbbcaa..940d1918d755f56a04259411f7648f45d12ed5bb 100644 (file)
 // Construction/Destruction
 //////////////////////////////////////////////////////////////////////
 
-DBobView::DBobView(){
-       nPathCount = 0;
+DBobView::DBobView()
+{
+    nPathCount = 0;
 
-       path = NULL;
+    path = NULL;
 
-       boundingShow = BOUNDS_APEX;
+    boundingShow = BOUNDS_APEX;
 
-       constructShaders();
-       GlobalShaderCache().attachRenderable( *this );
+    constructShaders();
+    GlobalShaderCache().attachRenderable(*this);
 }
 
-DBobView::~DBobView(){
-       GlobalShaderCache().detachRenderable( *this );
-       destroyShaders();
+DBobView::~DBobView()
+{
+    GlobalShaderCache().detachRenderable(*this);
+    destroyShaders();
 
-       if ( path ) {
-               delete[] path;
-       }
+    if (path) {
+        delete[] path;
+    }
 
-       g_PathView = NULL;
+    g_PathView = NULL;
 }
 
 //////////////////////////////////////////////////////////////////////
 // Implementation
 //////////////////////////////////////////////////////////////////////
 
-void DBobView::render( RenderStateFlags state ) const {
-       glBegin( GL_LINE_STRIP );
+void DBobView::render(RenderStateFlags state) const
+{
+    glBegin(GL_LINE_STRIP);
 
-       for ( int i = 0; i < nPathCount; i++ )
-               glVertex3fv( path[i] );
+    for (int i = 0; i < nPathCount; i++)
+        glVertex3fv(path[i]);
 
-       glEnd();
+    glEnd();
 }
 
-const char* DBobView_state_line = "$bobtoolz/bobview/line";
-const char* DBobView_state_box = "$bobtoolz/bobview/box";
-
-void DBobView::constructShaders(){
-       OpenGLState state;
-       GlobalOpenGLStateLibrary().getDefaultState( state );
-       state.m_state = RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_BLEND | RENDER_LINESMOOTH;
-       state.m_sort = OpenGLState::eSortOpaque;
-       state.m_linewidth = 1;
-       state.m_colour[0] = 1;
-       state.m_colour[1] = 0;
-       state.m_colour[2] = 0;
-       state.m_colour[3] = 1;
-       GlobalOpenGLStateLibrary().insert( DBobView_state_line, state );
-
-       state.m_colour[0] = 0.25f;
-       state.m_colour[1] = 0.75f;
-       state.m_colour[2] = 0.75f;
-       state.m_colour[3] = 1;
-       GlobalOpenGLStateLibrary().insert( DBobView_state_box, state );
-
-       m_shader_line = GlobalShaderCache().capture( DBobView_state_line );
-       m_shader_box = GlobalShaderCache().capture( DBobView_state_box );
+const char *DBobView_state_line = "$bobtoolz/bobview/line";
+const char *DBobView_state_box = "$bobtoolz/bobview/box";
+
+void DBobView::constructShaders()
+{
+    OpenGLState state;
+    GlobalOpenGLStateLibrary().getDefaultState(state);
+    state.m_state = RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_BLEND | RENDER_LINESMOOTH;
+    state.m_sort = OpenGLState::eSortOpaque;
+    state.m_linewidth = 1;
+    state.m_colour[0] = 1;
+    state.m_colour[1] = 0;
+    state.m_colour[2] = 0;
+    state.m_colour[3] = 1;
+    GlobalOpenGLStateLibrary().insert(DBobView_state_line, state);
+
+    state.m_colour[0] = 0.25f;
+    state.m_colour[1] = 0.75f;
+    state.m_colour[2] = 0.75f;
+    state.m_colour[3] = 1;
+    GlobalOpenGLStateLibrary().insert(DBobView_state_box, state);
+
+    m_shader_line = GlobalShaderCache().capture(DBobView_state_line);
+    m_shader_box = GlobalShaderCache().capture(DBobView_state_box);
 }
 
-void DBobView::destroyShaders(){
-       GlobalOpenGLStateLibrary().erase( DBobView_state_line );
-       GlobalOpenGLStateLibrary().erase( DBobView_state_box );
-       GlobalShaderCache().release( DBobView_state_line );
-       GlobalShaderCache().release( DBobView_state_box );
+void DBobView::destroyShaders()
+{
+    GlobalOpenGLStateLibrary().erase(DBobView_state_line);
+    GlobalOpenGLStateLibrary().erase(DBobView_state_box);
+    GlobalShaderCache().release(DBobView_state_line);
+    GlobalShaderCache().release(DBobView_state_box);
 }
 
-Matrix4 g_transform_box1 = matrix4_translation_for_vec3( Vector3( 16.0f, 16.0f, 28.0f ) );
-Matrix4 g_transform_box2 = matrix4_translation_for_vec3( Vector3( -16.0f, 16.0f, 28.0f ) );
-Matrix4 g_transform_box3 = matrix4_translation_for_vec3( Vector3( 16.0f, -16.0f, -28.0f ) );
-Matrix4 g_transform_box4 = matrix4_translation_for_vec3( Vector3( -16.0f, -16.0f, -28.0f ) );
-
-void DBobView::renderSolid( Renderer& renderer, const VolumeTest& volume ) const {
-       if ( !path ) {
-               return;
-       }
-
-       renderer.SetState( m_shader_line, Renderer::eWireframeOnly );
-       renderer.SetState( m_shader_line, Renderer::eFullMaterials );
-       renderer.addRenderable( *this, g_matrix4_identity );
-
-       if ( m_bShowExtra ) {
-               renderer.SetState( m_shader_box, Renderer::eWireframeOnly );
-               renderer.SetState( m_shader_box, Renderer::eFullMaterials );
-               renderer.addRenderable( *this, g_transform_box1 );
-               renderer.addRenderable( *this, g_transform_box2 );
-               renderer.addRenderable( *this, g_transform_box3 );
-               renderer.addRenderable( *this, g_transform_box4 );
-       }
+Matrix4 g_transform_box1 = matrix4_translation_for_vec3(Vector3(16.0f, 16.0f, 28.0f));
+Matrix4 g_transform_box2 = matrix4_translation_for_vec3(Vector3(-16.0f, 16.0f, 28.0f));
+Matrix4 g_transform_box3 = matrix4_translation_for_vec3(Vector3(16.0f, -16.0f, -28.0f));
+Matrix4 g_transform_box4 = matrix4_translation_for_vec3(Vector3(-16.0f, -16.0f, -28.0f));
+
+void DBobView::renderSolid(Renderer &renderer, const VolumeTest &volume) const
+{
+    if (!path) {
+        return;
+    }
+
+    renderer.SetState(m_shader_line, Renderer::eWireframeOnly);
+    renderer.SetState(m_shader_line, Renderer::eFullMaterials);
+    renderer.addRenderable(*this, g_matrix4_identity);
+
+    if (m_bShowExtra) {
+        renderer.SetState(m_shader_box, Renderer::eWireframeOnly);
+        renderer.SetState(m_shader_box, Renderer::eFullMaterials);
+        renderer.addRenderable(*this, g_transform_box1);
+        renderer.addRenderable(*this, g_transform_box2);
+        renderer.addRenderable(*this, g_transform_box3);
+        renderer.addRenderable(*this, g_transform_box4);
+    }
 }
-void DBobView::renderWireframe( Renderer& renderer, const VolumeTest& volume ) const {
-       renderSolid( renderer, volume );
+
+void DBobView::renderWireframe(Renderer &renderer, const VolumeTest &volume) const
+{
+    renderSolid(renderer, volume);
 }
 
-void DBobView::SetPath( vec3_t *pPath ){
-       if ( path ) {
-               delete[] path;
-       }
+void DBobView::SetPath(vec3_t *pPath)
+{
+    if (path) {
+        delete[] path;
+    }
 
-       path = pPath;
+    path = pPath;
 }
 
-#define LOCAL_GRAVITY -800.0f
+const float 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 );
-               return false;
-       }
-       // ----think q3a actually would allow these
-       //scrub that, coz the plugin wont :]
+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 );
+    vec3_t dist, speed;
+    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 );
-       speed[2] = speed_z;
+    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];
+    vec3_t *pPath = new vec3_t[points];
 
-       float interval = multiplier * flight_time / points;
-       for ( int i = 0; i < points; i++ )
-       {
-               float ltime = interval * i;
+    float interval = multiplier * flight_time / points;
+    for (int i = 0; i < points; 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}
-               // VectorScale(vGrav, 0.5f*ltime*ltime, vAdd);
-               // VectorScale(speed, ltime, pPath[i]);
-               // _VectorAdd(pPath[i], start, pPath[i])
-               // _VectorAdd(pPath[i], vAdd, pPath[i])
+        // could do this all with vectors
+        // vGrav = {0, 0, -800.0f}
+        // VectorScale(vGrav, 0.5f*ltime*ltime, vAdd);
+        // VectorScale(speed, ltime, pPath[i]);
+        // _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 );
-       return true;
+    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 );
-
-       fMultiplier = multiplier;
-       fVarGravity = varGravity;
-       nPathCount = points;
-       m_bShowExtra = bShowExtra;
-
-       if ( !UpdatePath() ) {
-               globalErrorStream() << "Initialization Failure in DBobView::Begin";
-               delete this;
-       }
-       globalOutputStream() << "Initialization of Path Plotter succeeded.";
+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;
+    nPathCount = points;
+    m_bShowExtra = bShowExtra;
+
+    if (!UpdatePath()) {
+        globalErrorStream() << "Initialization Failure in DBobView::Begin";
+        delete this;
+    }
+    globalOutputStream() << "Initialization of Path Plotter succeeded.";
 }
 
-bool DBobView::UpdatePath(){
-       vec3_t start, apex;
-
-       if ( GetEntityCentre( entTrigger, start ) ) {
-               if ( GetEntityCentre( entTarget, apex ) ) {
-                       CalculateTrajectory( start, apex, fMultiplier, nPathCount, fVarGravity );
-                       return true;
-               }
-       }
-       return false;
+bool DBobView::UpdatePath()
+{
+    vec3_t start, apex;
+
+    if (GetEntityCentre(entTrigger, start)) {
+        if (GetEntityCentre(entTarget, apex)) {
+            CalculateTrajectory(start, apex, fMultiplier, nPathCount, fVarGravity);
+            return true;
+        }
+    }
+    return false;
 }
 
-void DBobView_setEntity( Entity& entity, float multiplier, int points, float varGravity, bool bNoUpdate, bool bShowExtra ){
-       DEntity trigger;
-       trigger.LoadEPairList( &entity );
-
-       DEPair* trigger_ep = trigger.FindEPairByKey( "targetname" );
-
-       if ( trigger_ep ) {
-               if ( !strcmp( trigger.m_Classname, "trigger_push" ) ) {
-                       DEPair* target_ep = trigger.FindEPairByKey( "target" );
-                       if ( target_ep ) {
-                               const scene::Path* entTarget = FindEntityFromTargetname( target_ep->value );
-                               if ( entTarget ) {
-&nb